VirtualBox

source: vbox/trunk/src/VBox/Devices/Network/slirp/bootp.h@ 26837

Last change on this file since 26837 was 26037, checked in by vboxsync, 15 years ago

NAT: xtracker 4630 (respect the bootp BROADCAST flags)

  • Property svn:eol-style set to native
File size: 4.6 KB
Line 
1/* bootp/dhcp defines */
2
3#define BOOTP_SERVER 67
4#define BOOTP_CLIENT 68
5
6#define BOOTP_REQUEST 1
7#define BOOTP_REPLY 2
8
9#define RFC1533_COOKIE 99, 130, 83, 99
10#define RFC1533_PAD 0
11#define RFC1533_NETMASK 1
12#define RFC1533_TIMEOFFSET 2
13#define RFC1533_GATEWAY 3
14#define RFC1533_TIMESERVER 4
15#define RFC1533_IEN116NS 5
16#define RFC1533_DNS 6
17#define RFC1533_LOGSERVER 7
18#define RFC1533_COOKIESERVER 8
19#define RFC1533_LPRSERVER 9
20#define RFC1533_IMPRESSSERVER 10
21#define RFC1533_RESOURCESERVER 11
22#define RFC1533_HOSTNAME 12
23#define RFC1533_BOOTFILESIZE 13
24#define RFC1533_MERITDUMPFILE 14
25#define RFC1533_DOMAINNAME 15
26#define RFC1533_SWAPSERVER 16
27#define RFC1533_ROOTPATH 17
28#define RFC1533_EXTENSIONPATH 18
29#define RFC1533_IPFORWARDING 19
30#define RFC1533_IPSOURCEROUTING 20
31#define RFC1533_IPPOLICYFILTER 21
32#define RFC1533_IPMAXREASSEMBLY 22
33#define RFC1533_IPTTL 23
34#define RFC1533_IPMTU 24
35#define RFC1533_IPMTUPLATEAU 25
36#define RFC1533_INTMTU 26
37#define RFC1533_INTLOCALSUBNETS 27
38#define RFC1533_INTBROADCAST 28
39#define RFC1533_INTICMPDISCOVER 29
40#define RFC1533_INTICMPRESPOND 30
41#define RFC1533_INTROUTEDISCOVER 31
42#define RFC1533_INTROUTESOLICIT 32
43#define RFC1533_INTSTATICROUTES 33
44#define RFC1533_LLTRAILERENCAP 34
45#define RFC1533_LLARPCACHETMO 35
46#define RFC1533_LLETHERNETENCAP 36
47#define RFC1533_TCPTTL 37
48#define RFC1533_TCPKEEPALIVETMO 38
49#define RFC1533_TCPKEEPALIVEGB 39
50#define RFC1533_NISDOMAIN 40
51#define RFC1533_NISSERVER 41
52#define RFC1533_NTPSERVER 42
53#define RFC1533_VENDOR 43
54#define RFC1533_NBNS 44
55#define RFC1533_NBDD 45
56#define RFC1533_NBNT 46
57#define RFC1533_NBSCOPE 47
58#define RFC1533_XFS 48
59#define RFC1533_XDM 49
60
61#define RFC2132_REQ_ADDR 50
62#define RFC2132_LEASE_TIME 51
63#define RFC2132_MSG_TYPE 53
64#define RFC2132_SRV_ID 54
65#define RFC2132_PARAM_LIST 55
66#define RFC2132_MAX_SIZE 57
67#define RFC2132_RENEWAL_TIME 58
68#define RFC2132_REBIND_TIME 59
69
70#define DHCPDISCOVER 1
71#define DHCPOFFER 2
72#define DHCPREQUEST 3
73#define DHCPDECLINE 4
74#define DHCPACK 5
75#define DHCPNAK 6
76#define DHCPRELEASE 7
77#define DHCPINFORM 8
78
79#define RFC1533_VENDOR_MAJOR 0
80#define RFC1533_VENDOR_MINOR 0
81
82#define RFC1533_VENDOR_MAGIC 128
83#define RFC1533_VENDOR_ADDPARM 129
84#define RFC1533_VENDOR_ETHDEV 130
85#define RFC1533_VENDOR_HOWTO 132
86#define RFC1533_VENDOR_MNUOPTS 160
87#define RFC1533_VENDOR_SELECTION 176
88#define RFC1533_VENDOR_MOTD 184
89#define RFC1533_VENDOR_NUMOFMOTD 8
90#define RFC1533_VENDOR_IMG 192
91#define RFC1533_VENDOR_NUMOFIMG 16
92
93#define RFC1533_END 255
94#define BOOTP_VENDOR_LEN 64
95#define DHCP_OPT_LEN 312
96
97/* RFC 2131 */
98struct bootp_t
99{
100 struct ip ip; /**< header: IP header */
101 struct udphdr udp; /**< header: UDP header */
102 uint8_t bp_op; /**< opcode (BOOTP_REQUEST, BOOTP_REPLY) */
103 uint8_t bp_htype; /**< hardware type */
104 uint8_t bp_hlen; /**< hardware address length */
105 uint8_t bp_hops; /**< hop count */
106 uint32_t bp_xid; /**< transaction ID */
107 uint16_t bp_secs; /**< numnber of seconds */
108 uint16_t bp_flags; /**< flags (DHCP_FLAGS_B) */
109 struct in_addr bp_ciaddr; /**< client IP address */
110 struct in_addr bp_yiaddr; /**< your IP address */
111 struct in_addr bp_siaddr; /**< server IP address */
112 struct in_addr bp_giaddr; /**< gateway IP address */
113 uint8_t bp_hwaddr[16]; /** client hardware address */
114 uint8_t bp_sname[64]; /** server host name */
115 uint8_t bp_file[128]; /** boot filename */
116 uint8_t bp_vend[DHCP_OPT_LEN]; /**< vendor specific info */
117};
118
119
120#define DHCP_FLAGS_B (1<<15) /**< B, broadcast */
121struct bootp_ext
122{
123 uint8_t bpe_tag;
124 uint8_t bpe_len;
125};
126
127void bootp_input(PNATState, struct mbuf *m);
128int bootp_cache_lookup_ip_by_ether(PNATState, const uint8_t *, uint32_t *);
129int bootp_cache_lookup_ether_by_ip(PNATState, uint32_t, uint8_t *);
130int bootp_dhcp_init(PNATState);
131int bootp_dhcp_fini(PNATState);
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette