-
Notifications
You must be signed in to change notification settings - Fork 1
/
tftp.c
42 lines (35 loc) · 952 Bytes
/
tftp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
tftp - common code between server and client
*/
#if (0)
#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <arpa/inet.h>
#endif
#include "tftp.h"
char server_port_default[] = SERVER_PORT;
char *tftp_opcode_name[] =
{
"UNDEFINED",
"RRQ",
"WRQ",
"DATA",
"ACK",
"ERROR",
"OACK" /* RFC 2347 Addition */
};
char *tftp_error_string[] =
{
"Not defined, see error message (if any).", /* ErrorCode Value = 0 */
"File not found.", /* ErrorCode Value = 1 */
"Access violation.", /* ErrorCode Value = 2 */
"Disk full or allocation exceeded.", /* ErrorCode Value = 3 */
"Illegal TFTP operation.", /* ErrorCode Value = 4 */
"Unknown transfer ID.", /* ErrorCode Value = 5 */
"File already exists.", /* ErrorCode Value = 6 */
"No such user.", /* ErrorCode Value = 7 */
"Terminate transfer." /* ErrorCode Value = 8 */ /* RFC 2347 Addition */
};