VirtualBox

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

Last change on this file since 28739 was 28449, checked in by vboxsync, 15 years ago

NAT: slirp file headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.4 KB
Line 
1/* $Id: bootp.h 28449 2010-04-19 09:52:59Z vboxsync $ */
2/** @file
3 * NAT - BOOTP/DHCP server emulation (declarations/defines).
4 */
5
6/*
7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22/* bootp/dhcp defines */
23
24#define BOOTP_SERVER 67
25#define BOOTP_CLIENT 68
26
27#define BOOTP_REQUEST 1
28#define BOOTP_REPLY 2
29
30#define RFC1533_COOKIE 99, 130, 83, 99
31#define RFC1533_PAD 0
32#define RFC1533_NETMASK 1
33#define RFC1533_TIMEOFFSET 2
34#define RFC1533_GATEWAY 3
35#define RFC1533_TIMESERVER 4
36#define RFC1533_IEN116NS 5
37#define RFC1533_DNS 6
38#define RFC1533_LOGSERVER 7
39#define RFC1533_COOKIESERVER 8
40#define RFC1533_LPRSERVER 9
41#define RFC1533_IMPRESSSERVER 10
42#define RFC1533_RESOURCESERVER 11
43#define RFC1533_HOSTNAME 12
44#define RFC1533_BOOTFILESIZE 13
45#define RFC1533_MERITDUMPFILE 14
46#define RFC1533_DOMAINNAME 15
47#define RFC1533_SWAPSERVER 16
48#define RFC1533_ROOTPATH 17
49#define RFC1533_EXTENSIONPATH 18
50#define RFC1533_IPFORWARDING 19
51#define RFC1533_IPSOURCEROUTING 20
52#define RFC1533_IPPOLICYFILTER 21
53#define RFC1533_IPMAXREASSEMBLY 22
54#define RFC1533_IPTTL 23
55#define RFC1533_IPMTU 24
56#define RFC1533_IPMTUPLATEAU 25
57#define RFC1533_INTMTU 26
58#define RFC1533_INTLOCALSUBNETS 27
59#define RFC1533_INTBROADCAST 28
60#define RFC1533_INTICMPDISCOVER 29
61#define RFC1533_INTICMPRESPOND 30
62#define RFC1533_INTROUTEDISCOVER 31
63#define RFC1533_INTROUTESOLICIT 32
64#define RFC1533_INTSTATICROUTES 33
65#define RFC1533_LLTRAILERENCAP 34
66#define RFC1533_LLARPCACHETMO 35
67#define RFC1533_LLETHERNETENCAP 36
68#define RFC1533_TCPTTL 37
69#define RFC1533_TCPKEEPALIVETMO 38
70#define RFC1533_TCPKEEPALIVEGB 39
71#define RFC1533_NISDOMAIN 40
72#define RFC1533_NISSERVER 41
73#define RFC1533_NTPSERVER 42
74#define RFC1533_VENDOR 43
75#define RFC1533_NBNS 44
76#define RFC1533_NBDD 45
77#define RFC1533_NBNT 46
78#define RFC1533_NBSCOPE 47
79#define RFC1533_XFS 48
80#define RFC1533_XDM 49
81
82#define RFC2132_REQ_ADDR 50
83#define RFC2132_LEASE_TIME 51
84#define RFC2132_MSG_TYPE 53
85#define RFC2132_SRV_ID 54
86#define RFC2132_PARAM_LIST 55
87#define RFC2132_MAX_SIZE 57
88#define RFC2132_RENEWAL_TIME 58
89#define RFC2132_REBIND_TIME 59
90
91#define DHCPDISCOVER 1
92#define DHCPOFFER 2
93#define DHCPREQUEST 3
94#define DHCPDECLINE 4
95#define DHCPACK 5
96#define DHCPNAK 6
97#define DHCPRELEASE 7
98#define DHCPINFORM 8
99
100#define RFC1533_VENDOR_MAJOR 0
101#define RFC1533_VENDOR_MINOR 0
102
103#define RFC1533_VENDOR_MAGIC 128
104#define RFC1533_VENDOR_ADDPARM 129
105#define RFC1533_VENDOR_ETHDEV 130
106#define RFC1533_VENDOR_HOWTO 132
107#define RFC1533_VENDOR_MNUOPTS 160
108#define RFC1533_VENDOR_SELECTION 176
109#define RFC1533_VENDOR_MOTD 184
110#define RFC1533_VENDOR_NUMOFMOTD 8
111#define RFC1533_VENDOR_IMG 192
112#define RFC1533_VENDOR_NUMOFIMG 16
113
114#define RFC1533_END 255
115#define BOOTP_VENDOR_LEN 64
116#define DHCP_OPT_LEN 312
117
118/* RFC 2131 */
119struct bootp_t
120{
121 struct ip ip; /**< header: IP header */
122 struct udphdr udp; /**< header: UDP header */
123 uint8_t bp_op; /**< opcode (BOOTP_REQUEST, BOOTP_REPLY) */
124 uint8_t bp_htype; /**< hardware type */
125 uint8_t bp_hlen; /**< hardware address length */
126 uint8_t bp_hops; /**< hop count */
127 uint32_t bp_xid; /**< transaction ID */
128 uint16_t bp_secs; /**< numnber of seconds */
129 uint16_t bp_flags; /**< flags (DHCP_FLAGS_B) */
130 struct in_addr bp_ciaddr; /**< client IP address */
131 struct in_addr bp_yiaddr; /**< your IP address */
132 struct in_addr bp_siaddr; /**< server IP address */
133 struct in_addr bp_giaddr; /**< gateway IP address */
134 uint8_t bp_hwaddr[16]; /** client hardware address */
135 uint8_t bp_sname[64]; /** server host name */
136 uint8_t bp_file[128]; /** boot filename */
137 uint8_t bp_vend[DHCP_OPT_LEN]; /**< vendor specific info */
138};
139
140
141#define DHCP_FLAGS_B (1<<15) /**< B, broadcast */
142struct bootp_ext
143{
144 uint8_t bpe_tag;
145 uint8_t bpe_len;
146};
147
148void bootp_input(PNATState, struct mbuf *m);
149int bootp_cache_lookup_ip_by_ether(PNATState, const uint8_t *, uint32_t *);
150int bootp_cache_lookup_ether_by_ip(PNATState, uint32_t, uint8_t *);
151int bootp_dhcp_init(PNATState);
152int 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