1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 #define BP_CHADDR_LEN 16
25 #define BP_SNAME_LEN 64
26 #define BP_FILE_LEN 128
27 #define BP_VEND_LEN 64
28 #define BP_MINPKTSZ 300
29
30
31 struct bootp {
32 u_char bp_op;
33 u_char bp_htype;
34 u_char bp_hlen;
35 u_char bp_hops;
36 u_int bp_xid;
37 u_short bp_secs;
38 u_short bp_flags;
39 struct in_addr bp_ciaddr;
40 struct in_addr bp_yiaddr;
41 struct in_addr bp_siaddr;
42 struct in_addr bp_giaddr;
43 u_char bp_chaddr[BP_CHADDR_LEN];
44 u_char bp_sname[BP_SNAME_LEN];
45 u_char bp_file[BP_FILE_LEN];
46 u_char bp_vend[BP_VEND_LEN];
47 };
48
49
50
51
52 #define IPPORT_BOOTPS 67
53 #define IPPORT_BOOTPC 68
54
55 #define BOOTREPLY 2
56 #define BOOTREQUEST 1
57
58
59
60
61 #define HTYPE_ETHERNET 1
62 #define HTYPE_EXP_ETHERNET 2
63 #define HTYPE_AX25 3
64 #define HTYPE_PRONET 4
65 #define HTYPE_CHAOS 5
66 #define HTYPE_IEEE802 6
67 #define HTYPE_ARCNET 7
68
69
70
71
72 #define VM_CMU "CMU"
73
74
75
76
77 #define VM_RFC1048 { 99, 130, 83, 99 }
78
79
80
81
82
83
84
85
86 #define TAG_PAD ((unsigned char) 0)
87 #define TAG_SUBNET_MASK ((unsigned char) 1)
88 #define TAG_TIME_OFFSET ((unsigned char) 2)
89 #define TAG_GATEWAY ((unsigned char) 3)
90 #define TAG_TIME_SERVER ((unsigned char) 4)
91 #define TAG_NAME_SERVER ((unsigned char) 5)
92 #define TAG_DOMAIN_SERVER ((unsigned char) 6)
93 #define TAG_LOG_SERVER ((unsigned char) 7)
94 #define TAG_COOKIE_SERVER ((unsigned char) 8)
95 #define TAG_LPR_SERVER ((unsigned char) 9)
96 #define TAG_IMPRESS_SERVER ((unsigned char) 10)
97 #define TAG_RLP_SERVER ((unsigned char) 11)
98 #define TAG_HOSTNAME ((unsigned char) 12)
99 #define TAG_BOOTSIZE ((unsigned char) 13)
100 #define TAG_DUMPFILE ((unsigned char) 14)
101 #define TAG_DOMAINNAME ((unsigned char) 15)
102 #define TAG_SWAPSERVER ((unsigned char) 16)
103 #define TAG_ROOTPATH ((unsigned char) 17)
104 #define TAG_EXTEN_FILE ((unsigned char) 18)
105 #define TAG_NIS_DOMAIN ((unsigned char) 40)
106 #define TAG_NIS_SERVER ((unsigned char) 41)
107 #define TAG_NTP_SERVER ((unsigned char) 42)
108 #define TAG_MAX_MSGSZ ((unsigned char) 57)
109 #define TAG_END ((unsigned char) 255)
110
111
112
113
114
115
116
117 struct cmu_vend {
118 unsigned char v_magic[4];
119 unsigned int v_flags;
120 struct in_addr v_smask;
121 struct in_addr v_dgate;
122 struct in_addr v_dns1, v_dns2;
123 struct in_addr v_ins1, v_ins2;
124 struct in_addr v_ts1, v_ts2;
125 unsigned char v_unused[25];
126 };
127
128
129 #define VF_SMASK 1
130
131 void bootp(int);