diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/handlers.h | 10 | ||||
-rw-r--r-- | inc/netascii.h | 4 | ||||
-rw-r--r-- | inc/packet.h | 26 |
3 files changed, 22 insertions, 18 deletions
diff --git a/inc/handlers.h b/inc/handlers.h index 9f1988f..5aa0733 100644 --- a/inc/handlers.h +++ b/inc/handlers.h @@ -7,11 +7,15 @@ typedef struct { char path[768]; char mode[32]; + int err; struct sockaddr_in client; } nbd_nbtpd_args; -void read_req_resp(nbd_nbtpd_args args); -void write_req_resp(nbd_nbtpd_args args); -void nbd_nbtpd_resp_error(nbd_nbtpd_args args); +/// WARNING: use this only if you know what you are doing +void *read_req_resp(void *args); +/// WARNING: use this only if you know what you are doing +void *write_req_resp(void *args); +/// WARNING: use this only if you know what you are doing +void *nbd_nbtpd_resp_error(void *args); #endif diff --git a/inc/netascii.h b/inc/netascii.h index 096b1c3..ada2051 100644 --- a/inc/netascii.h +++ b/inc/netascii.h @@ -3,7 +3,7 @@ #include <stdint.h> uint8_t is_netascii_char(char c); -uint8_t is_netascii_str(char* str); -uint8_t is_netascii_buf(char* buf, uint64_t len); +uint8_t is_netascii_str(char *str); +uint8_t is_netascii_buf(char *buf, uint64_t len); #endif diff --git a/inc/packet.h b/inc/packet.h index a236f74..abd6d3e 100644 --- a/inc/packet.h +++ b/inc/packet.h @@ -1,5 +1,5 @@ -#ifndef NBT_TFTP_PACKET_H -#define NBT_TFTP_PACKET_H +#ifndef NBD_TFTP_PACKET_H +#define NBD_TFTP_PACKET_H #include <stdint.h> @@ -9,7 +9,7 @@ typedef enum { DAT = 3, ACK = 4, ERR = 5, -} nbt_tftp_opcode; +} nbd_tftp_opcode; typedef enum { ERROR = 0, @@ -20,32 +20,32 @@ typedef enum { ETRANS = 5, EEXISTS = 6, EUSER = 7, -} nbt_tftp_ecode; +} nbd_tftp_ecode; typedef struct { uint16_t opcode; - char* filename; - char* mode; -} nbt_tftp_packet_rq; + char *filename; + char *mode; +} nbd_tftp_packet_rq; typedef struct { uint16_t opcode; uint16_t block_num; - char* data; -} nbt_tftp_packet_data; + char *data; +} nbd_tftp_packet_data; typedef struct { uint16_t opcode; uint16_t block_num; -} nbt_tftp_packet_ack; +} nbd_tftp_packet_ack; typedef struct { uint16_t opcode; uint16_t err; - char* emsg; -} nbt_tftp_packet_error; + char *emsg; +} nbd_tftp_packet_error; -char* nbt_tftp_error_to_message(nbt_tftp_ecode error); +char *nbd_tftp_error_to_message(nbd_tftp_ecode error); #endif |