-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootp.h
76 lines (62 loc) · 2.38 KB
/
bootp.h
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*************************************************/
/* Center for Information Technology Integration */
/* The University of Michigan */
/* Ann Arbor */
/* */
/* Dedicated to the public domain. */
/* Send questions to [email protected] */
/* */
/* BOOTP is documented in RFC 951 and RFC 1048 */
/*************************************************/
#ifndef BOOTREQUEST
#include "socket.h"
struct bootp {
char op; /* packet opcode type */
char htype; /* hardware addr type */
char hlen; /* hardware addr length */
char hops; /* gateway hops */
int32 xid; /* transaction ID */
int16 secs; /* seconds since boot began */
int16 unused;
struct in_addr ciaddr; /* client IP address */
struct in_addr yiaddr; /* 'your' IP address */
struct in_addr siaddr; /* server IP address */
struct in_addr giaddr; /* gateway IP address */
char chaddr[16]; /* client hardware address */
char sname[64]; /* server host name */
char file[128]; /* boot file name */
char vend[64]; /* vendor-specific area */
};
/*
* UDP port numbers, server and client.
*/
#define IPPORT_BOOTPS 67
#define IPPORT_BOOTPC 68
#define BOOTREQUEST 1
#define BOOTREPLY 2
#define BOOTP_PAD 0
#define BOOTP_SUBNET 1
#define BOOTP_GATEWAY 3
#define BOOTP_DNS 6
#define BOOTP_HOSTNAME 12
#define BOOTP_END 0xff
/*
* "vendor" data permitted for Stanford boot clients.
*/
struct vend {
unsigned char v_magic[4]; /* magic number */
unsigned long v_flags; /* flags/opcodes, etc. */
unsigned char v_unused[56]; /* currently unused */
};
#define VM_STANFORD "STAN" /* v_magic for Stanford */
/* v_flags values */
#define VF_PCBOOT 1 /* an IBMPC or Mac wants environment info */
#define VF_HELP 2 /* help me, I'm not registered */
extern int WantBootp;
extern char bp_ascii[];
#ifdef __GNUC__
struct ip; /* forward declaration */
#endif
void bootp_print_packet __ARGS((struct bootp *bp));
int bootp_validPacket __ARGS((struct ip *ip,struct mbuf **bpp));
#endif