diff options
author | Ren Kararou <[email protected]> | 2025-01-07 20:52:27 -0600 |
---|---|---|
committer | Ren Kararou <[email protected]> | 2025-01-07 20:52:27 -0600 |
commit | 660da53647cdcdc5ce07054f74e5c420a15702fe (patch) | |
tree | 796f00487c00a16a958467860354ad9f4bcc0276 /inc | |
parent | b9635ce3b4ca30b14128c131bb9fe9be08740d6d (diff) | |
download | nbtpd-660da53647cdcdc5ce07054f74e5c420a15702fe.tar.gz nbtpd-660da53647cdcdc5ce07054f74e5c420a15702fe.tar.bz2 nbtpd-660da53647cdcdc5ce07054f74e5c420a15702fe.zip |
first RRQ processed
Diffstat (limited to 'inc')
-rw-r--r-- | inc/handlers.h | 2 | ||||
-rw-r--r-- | inc/packet.h | 5 |
2 files changed, 6 insertions, 1 deletions
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 <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 |