aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNigel Hathaway <Nigel.Hathaway@ubiquisys.com>2011-04-26 02:50:00 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-04-26 02:50:00 +0200
commitfb6b173ff786648f5f43d23ff3c4f7721e9cb8b5 (patch)
treeba67ed5f064e5380304682418be401ec08bc1521
parentc37d4c67e85782001953a8bae8a9c65ccdcb2f88 (diff)
downloadbusybox-w32-fb6b173ff786648f5f43d23ff3c4f7721e9cb8b5.tar.gz
busybox-w32-fb6b173ff786648f5f43d23ff3c4f7721e9cb8b5.tar.bz2
busybox-w32-fb6b173ff786648f5f43d23ff3c4f7721e9cb8b5.zip
udhcp: add FEATURE_UDHCP_8021Q option
function old new delta dhcp_option_strings 217 237 +20 dhcp_optflags 64 68 +4 Signed-off-by: Nigel Hathaway <Nigel.Hathaway@ubiquisys.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--examples/udhcp/udhcpd.conf9
-rw-r--r--networking/udhcp/Config.src8
-rw-r--r--networking/udhcp/common.c8
-rw-r--r--networking/udhcp/common.h2
4 files changed, 27 insertions, 0 deletions
diff --git a/examples/udhcp/udhcpd.conf b/examples/udhcp/udhcpd.conf
index 23fc834b7..43b49df89 100644
--- a/examples/udhcp/udhcpd.conf
+++ b/examples/udhcp/udhcpd.conf
@@ -90,6 +90,8 @@ option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
90#opt wpad STRING 90#opt wpad STRING
91#opt serverid IP # default: server's IP 91#opt serverid IP # default: server's IP
92#opt message STRING # error message (udhcpd sends it on success too) 92#opt message STRING # error message (udhcpd sends it on success too)
93#opt vlanid NUM # 802.1P VLAN ID
94#opt vlanpriority NUM # 802.1Q VLAN priority
93# Options specifying server(s) 95# Options specifying server(s)
94#opt dns IP_LIST 96#opt dns IP_LIST
95#opt wins IP_LIST 97#opt wins IP_LIST
@@ -97,8 +99,15 @@ option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
97#opt ntpsrv IP_LIST 99#opt ntpsrv IP_LIST
98#opt lprsrv IP_LIST 100#opt lprsrv IP_LIST
99#opt swapsrv IP 101#opt swapsrv IP
102# Options specifying routes
103#opt routes IP_PAIR_LIST
100# Obsolete options, no longer supported 104# Obsolete options, no longer supported
101#opt logsrv IP_LIST # 704/UDP log server (not syslog!) 105#opt logsrv IP_LIST # 704/UDP log server (not syslog!)
102#opt namesrv IP_LIST # IEN 116 name server, obsolete (August 1979!!!) 106#opt namesrv IP_LIST # IEN 116 name server, obsolete (August 1979!!!)
103#opt cookiesrv IP_LIST # RFC 865 "quote of the day" server, rarely (never?) used 107#opt cookiesrv IP_LIST # RFC 865 "quote of the day" server, rarely (never?) used
104#opt timesrv IP_LIST # RFC 868 time server, rarely (never?) used 108#opt timesrv IP_LIST # RFC 868 time server, rarely (never?) used
109# TODO: in development
110#opt userclass STRING # RFC 3004. set of LASCII strings. "I am a printer" etc
111#opt sipserv STRING LIST # RFC 3361. flag byte, then: 0: domain names, 1: IP addrs
112#opt staticroutes STATIC_ROUTES
113#opt msstaticroutes STATIC_ROUTES
diff --git a/networking/udhcp/Config.src b/networking/udhcp/Config.src
index 9cd8cbbae..6bfa398ea 100644
--- a/networking/udhcp/Config.src
+++ b/networking/udhcp/Config.src
@@ -113,6 +113,14 @@ config FEATURE_UDHCP_RFC3397
113 search lists via option 119, specified in RFC 3397, 113 search lists via option 119, specified in RFC 3397,
114 and SIP servers option 120, specified in RFC 3361. 114 and SIP servers option 120, specified in RFC 3361.
115 115
116config FEATURE_UDHCP_8021Q
117 bool "Support for 802.1Q VLAN parameters"
118 default y
119 depends on UDHCPD || UDHCPC
120 help
121 If selected, both client and server will support passing of VLAN
122 ID and priority via options 132 and 133 as per 802.1Q.
123
116config UDHCPC_DEFAULT_SCRIPT 124config UDHCPC_DEFAULT_SCRIPT
117 string "Absolute path to config script" 125 string "Absolute path to config script"
118 default "/usr/share/udhcpc/default.script" 126 default "/usr/share/udhcpc/default.script"
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 0a60261ab..70e34614c 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -55,6 +55,10 @@ const struct dhcp_optflag dhcp_optflags[] = {
55 { OPTION_SIP_SERVERS , 0x78 }, /* DHCP_SIP_SERVERS */ 55 { OPTION_SIP_SERVERS , 0x78 }, /* DHCP_SIP_SERVERS */
56#endif 56#endif
57 { OPTION_STATIC_ROUTES , 0x79 }, /* DHCP_STATIC_ROUTES */ 57 { OPTION_STATIC_ROUTES , 0x79 }, /* DHCP_STATIC_ROUTES */
58#if ENABLE_FEATURE_UDHCP_8021Q
59 { OPTION_U16 , 0x84 }, /* DHCP_VLAN_ID */
60 { OPTION_U8 , 0x85 }, /* DHCP_VLAN_PRIORITY */
61#endif
58 { OPTION_STATIC_ROUTES , 0xf9 }, /* DHCP_MS_STATIC_ROUTES */ 62 { OPTION_STATIC_ROUTES , 0xf9 }, /* DHCP_MS_STATIC_ROUTES */
59 { OPTION_STRING , 0xfc }, /* DHCP_WPAD */ 63 { OPTION_STRING , 0xfc }, /* DHCP_WPAD */
60 64
@@ -118,6 +122,10 @@ const char dhcp_option_strings[] ALIGN1 =
118// doesn't work in udhcpd.conf since OPTION_STATIC_ROUTES 122// doesn't work in udhcpd.conf since OPTION_STATIC_ROUTES
119// is not handled yet by "string->option" conversion code: 123// is not handled yet by "string->option" conversion code:
120 "staticroutes" "\0"/* DHCP_STATIC_ROUTES */ 124 "staticroutes" "\0"/* DHCP_STATIC_ROUTES */
125#if ENABLE_FEATURE_UDHCP_8021Q
126 "vlanid" "\0" /* DHCP_VLAN_ID */
127 "vlanpriority" "\0"/* DHCP_VLAN_PRIORITY */
128#endif
121 "msstaticroutes""\0"/* DHCP_MS_STATIC_ROUTES */ 129 "msstaticroutes""\0"/* DHCP_MS_STATIC_ROUTES */
122 "wpad" "\0" /* DHCP_WPAD */ 130 "wpad" "\0" /* DHCP_WPAD */
123 ; 131 ;
diff --git a/networking/udhcp/common.h b/networking/udhcp/common.h
index f8f18ff01..ad6991c94 100644
--- a/networking/udhcp/common.h
+++ b/networking/udhcp/common.h
@@ -145,6 +145,8 @@ enum {
145//#define DHCP_DOMAIN_SEARCH 0x77 /* RFC 3397. set of ASCIZ string, DNS-style compressed */ 145//#define DHCP_DOMAIN_SEARCH 0x77 /* RFC 3397. set of ASCIZ string, DNS-style compressed */
146//#define DHCP_SIP_SERVERS 0x78 /* RFC 3361. flag byte, then: 0: domain names, 1: IP addrs */ 146//#define DHCP_SIP_SERVERS 0x78 /* RFC 3361. flag byte, then: 0: domain names, 1: IP addrs */
147//#define DHCP_STATIC_ROUTES 0x79 /* RFC 3442. (mask,ip,router) tuples */ 147//#define DHCP_STATIC_ROUTES 0x79 /* RFC 3442. (mask,ip,router) tuples */
148#define DHCP_VLAN_ID 0x84 /* 802.1P VLAN ID */
149#define DHCP_VLAN_PRIORITY 0x85 /* 802.1Q VLAN priority */
148//#define DHCP_MS_STATIC_ROUTES 0xf9 /* Microsoft's pre-RFC 3442 code for 0x79? */ 150//#define DHCP_MS_STATIC_ROUTES 0xf9 /* Microsoft's pre-RFC 3442 code for 0x79? */
149//#define DHCP_WPAD 0xfc /* MSIE's Web Proxy Autodiscovery Protocol */ 151//#define DHCP_WPAD 0xfc /* MSIE's Web Proxy Autodiscovery Protocol */
150#define DHCP_END 0xff 152#define DHCP_END 0xff