about summary refs log tree commit diff stats
path: root/inc/packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/packet.h')
-rw-r--r--inc/packet.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/inc/packet.h b/inc/packet.h
index abd6d3e..a404d49 100644
--- a/inc/packet.h
+++ b/inc/packet.h
@@ -2,6 +2,7 @@
 #define NBD_TFTP_PACKET_H
 
 #include <stdint.h>
+#include <unistd.h>
 
 typedef enum {
 	RRQ	= 1,
@@ -32,6 +33,7 @@ typedef struct {
 	uint16_t opcode;
 	uint16_t block_num;
 	char *data;
+	size_t datalen;
 } nbd_tftp_packet_data;
 
 typedef struct {
@@ -46,6 +48,9 @@ typedef struct {
 } nbd_tftp_packet_error;
 
 char *nbd_tftp_error_to_message(nbd_tftp_ecode error);
+char *nbd_tftp_ser_data(nbd_tftp_packet_data d);
+char *nbd_tftp_ser_data_from_parts(uint16_t blocknum, char *data, size_t datalen);
+nbd_tftp_packet_ack nbd_tftp_de_ack(char *buf, ssize_t buflen);
 
 #endif