From 660da53647cdcdc5ce07054f74e5c420a15702fe Mon Sep 17 00:00:00 2001 From: Ren Kararou Date: Tue, 7 Jan 2025 20:52:27 -0600 Subject: first RRQ processed --- inc/handlers.h | 2 +- inc/packet.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/handlers.h b/inc/handlers.h index aecd964..acf994e 100644 --- a/inc/handlers.h +++ b/inc/handlers.h @@ -10,7 +10,7 @@ typedef enum opmode { NOT_FOUND, NETASCII, - OCTAL, + OCTET, MAIL // any additional modes } nbd_opmode; 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 +#include 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 -- cgit 1.4.1-2-gfad0