about summary refs log tree commit diff stats
path: root/src/packet.c
diff options
context:
space:
mode:
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";
+}
+