about summary refs log tree commit diff stats
path: root/src/packet.c
diff options
context:
space:
mode:
authorRen Kararou <[email protected]>2024-12-26 01:50:22 -0600
committerRen Kararou <[email protected]>2024-12-26 01:50:22 -0600
commit746cd14f273a96c0348f4e64f9b347ce49a93f45 (patch)
tree813aee86d27bd8ec0b4416ea6cd5f22603666a89 /src/packet.c
parent6b0cf95d75935308e142232fe646d56d0f9d418c (diff)
downloadnbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.tar.gz
nbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.tar.bz2
nbtpd-746cd14f273a96c0348f4e64f9b347ce49a93f45.zip
add ci; update packet structs; add makefile
Diffstat (limited to 'src/packet.c')
-rw-r--r--src/packet.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/packet.c b/src/packet.c
new file mode 100644
index 0000000..8f7a7e6
--- /dev/null
+++ b/src/packet.c
@@ -0,0 +1,24 @@
+#include "packet.h"
+
+char* nbt_tftp_error_to_message(nbt_tftp_ecode error) {
+	switch (error) {
+		case 0:
+			return "ERROR";
+		case 1:
+			return "File not Found";
+		case 2:
+			return "Access violation";
+		case 3:
+			return "Disk full or allocation exceeded";
+		case 4:
+			return "Illegal TFTP operation";
+		case 5:
+			return "Unknown Transfer ID";
+		case 6:
+			return "File already exists";
+		case 7:
+			return "No such user";
+	}
+	return "UNKNOWN ERROR";
+}
+