about summary refs log tree commit diff stats
path: root/inc
diff options
context:
space:
mode:
authorRen Kararou <[email protected]>2025-01-05 02:29:15 -0600
committerRen Kararou <[email protected]>2025-01-05 02:29:15 -0600
commit5605a5ddf3c77232b04c002a82b91e227c0f27da (patch)
tree30d5cf75759aa4bd2e8e75d5a7c852931e114066 /inc
parent70a46fab050c3fdf38b9c72453f6e678cc8341be (diff)
downloadnbtpd-5605a5ddf3c77232b04c002a82b91e227c0f27da.tar.gz
nbtpd-5605a5ddf3c77232b04c002a82b91e227c0f27da.tar.bz2
nbtpd-5605a5ddf3c77232b04c002a82b91e227c0f27da.zip
builds on illumos, freebsd, and linux
Diffstat (limited to 'inc')
-rw-r--r--inc/handlers.h7
-rw-r--r--inc/netascii.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/inc/handlers.h b/inc/handlers.h
index c174b6a..6be05da 100644
--- a/inc/handlers.h
+++ b/inc/handlers.h
@@ -4,9 +4,12 @@
 #include <netinet/in.h>
 #include "packet.h"
 
+#define NBD_NBTPD_ARGS_PATH_MAX 768
+#define NBD_NBTPD_ARGS_MODE_MAX 32
+
 typedef struct {
-	char path[768];
-	char mode[32];
+	char path[NBD_NBTPD_ARGS_PATH_MAX];
+	char mode[NBD_NBTPD_ARGS_MODE_MAX];
 	nbd_tftp_ecode err;
 	struct sockaddr_in client;
 } nbd_nbtpd_args;
diff --git a/inc/netascii.h b/inc/netascii.h
index ada2051..ae80bae 100644
--- a/inc/netascii.h
+++ b/inc/netascii.h
@@ -1,9 +1,10 @@
 #ifndef NBD_NETASCII_H
 #define NBD_NETASCII_H
 #include <stdint.h>
+#include <stdlib.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_buf(char *buf, size_t len);
 
 #endif