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>
This commit is contained in:
Nigel Hathaway 2011-04-26 02:50:00 +02:00 committed by Denys Vlasenko
parent c37d4c67e8
commit fb6b173ff7
4 changed files with 27 additions and 0 deletions

View File

@ -90,6 +90,8 @@ option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
#opt wpad STRING #opt wpad STRING
#opt serverid IP # default: server's IP #opt serverid IP # default: server's IP
#opt message STRING # error message (udhcpd sends it on success too) #opt message STRING # error message (udhcpd sends it on success too)
#opt vlanid NUM # 802.1P VLAN ID
#opt vlanpriority NUM # 802.1Q VLAN priority
# Options specifying server(s) # Options specifying server(s)
#opt dns IP_LIST #opt dns IP_LIST
#opt wins IP_LIST #opt wins IP_LIST
@ -97,8 +99,15 @@ option 0x08 01020304 # option 8: "cookie server IP addr: 1.2.3.4"
#opt ntpsrv IP_LIST #opt ntpsrv IP_LIST
#opt lprsrv IP_LIST #opt lprsrv IP_LIST
#opt swapsrv IP #opt swapsrv IP
# Options specifying routes
#opt routes IP_PAIR_LIST
# Obsolete options, no longer supported # Obsolete options, no longer supported
#opt logsrv IP_LIST # 704/UDP log server (not syslog!) #opt logsrv IP_LIST # 704/UDP log server (not syslog!)
#opt namesrv IP_LIST # IEN 116 name server, obsolete (August 1979!!!) #opt namesrv IP_LIST # IEN 116 name server, obsolete (August 1979!!!)
#opt cookiesrv IP_LIST # RFC 865 "quote of the day" server, rarely (never?) used #opt cookiesrv IP_LIST # RFC 865 "quote of the day" server, rarely (never?) used
#opt timesrv IP_LIST # RFC 868 time server, rarely (never?) used #opt timesrv IP_LIST # RFC 868 time server, rarely (never?) used
# TODO: in development
#opt userclass STRING # RFC 3004. set of LASCII strings. "I am a printer" etc
#opt sipserv STRING LIST # RFC 3361. flag byte, then: 0: domain names, 1: IP addrs
#opt staticroutes STATIC_ROUTES
#opt msstaticroutes STATIC_ROUTES

View File

@ -113,6 +113,14 @@ config FEATURE_UDHCP_RFC3397
search lists via option 119, specified in RFC 3397, search lists via option 119, specified in RFC 3397,
and SIP servers option 120, specified in RFC 3361. and SIP servers option 120, specified in RFC 3361.
config FEATURE_UDHCP_8021Q
bool "Support for 802.1Q VLAN parameters"
default y
depends on UDHCPD || UDHCPC
help
If selected, both client and server will support passing of VLAN
ID and priority via options 132 and 133 as per 802.1Q.
config UDHCPC_DEFAULT_SCRIPT config UDHCPC_DEFAULT_SCRIPT
string "Absolute path to config script" string "Absolute path to config script"
default "/usr/share/udhcpc/default.script" default "/usr/share/udhcpc/default.script"

View File

@ -55,6 +55,10 @@ const struct dhcp_optflag dhcp_optflags[] = {
{ OPTION_SIP_SERVERS , 0x78 }, /* DHCP_SIP_SERVERS */ { OPTION_SIP_SERVERS , 0x78 }, /* DHCP_SIP_SERVERS */
#endif #endif
{ OPTION_STATIC_ROUTES , 0x79 }, /* DHCP_STATIC_ROUTES */ { OPTION_STATIC_ROUTES , 0x79 }, /* DHCP_STATIC_ROUTES */
#if ENABLE_FEATURE_UDHCP_8021Q
{ OPTION_U16 , 0x84 }, /* DHCP_VLAN_ID */
{ OPTION_U8 , 0x85 }, /* DHCP_VLAN_PRIORITY */
#endif
{ OPTION_STATIC_ROUTES , 0xf9 }, /* DHCP_MS_STATIC_ROUTES */ { OPTION_STATIC_ROUTES , 0xf9 }, /* DHCP_MS_STATIC_ROUTES */
{ OPTION_STRING , 0xfc }, /* DHCP_WPAD */ { OPTION_STRING , 0xfc }, /* DHCP_WPAD */
@ -118,6 +122,10 @@ const char dhcp_option_strings[] ALIGN1 =
// doesn't work in udhcpd.conf since OPTION_STATIC_ROUTES // doesn't work in udhcpd.conf since OPTION_STATIC_ROUTES
// is not handled yet by "string->option" conversion code: // is not handled yet by "string->option" conversion code:
"staticroutes" "\0"/* DHCP_STATIC_ROUTES */ "staticroutes" "\0"/* DHCP_STATIC_ROUTES */
#if ENABLE_FEATURE_UDHCP_8021Q
"vlanid" "\0" /* DHCP_VLAN_ID */
"vlanpriority" "\0"/* DHCP_VLAN_PRIORITY */
#endif
"msstaticroutes""\0"/* DHCP_MS_STATIC_ROUTES */ "msstaticroutes""\0"/* DHCP_MS_STATIC_ROUTES */
"wpad" "\0" /* DHCP_WPAD */ "wpad" "\0" /* DHCP_WPAD */
; ;

View File

@ -145,6 +145,8 @@ enum {
//#define DHCP_DOMAIN_SEARCH 0x77 /* RFC 3397. set of ASCIZ string, DNS-style compressed */ //#define DHCP_DOMAIN_SEARCH 0x77 /* RFC 3397. set of ASCIZ string, DNS-style compressed */
//#define DHCP_SIP_SERVERS 0x78 /* RFC 3361. flag byte, then: 0: domain names, 1: IP addrs */ //#define DHCP_SIP_SERVERS 0x78 /* RFC 3361. flag byte, then: 0: domain names, 1: IP addrs */
//#define DHCP_STATIC_ROUTES 0x79 /* RFC 3442. (mask,ip,router) tuples */ //#define DHCP_STATIC_ROUTES 0x79 /* RFC 3442. (mask,ip,router) tuples */
#define DHCP_VLAN_ID 0x84 /* 802.1P VLAN ID */
#define DHCP_VLAN_PRIORITY 0x85 /* 802.1Q VLAN priority */
//#define DHCP_MS_STATIC_ROUTES 0xf9 /* Microsoft's pre-RFC 3442 code for 0x79? */ //#define DHCP_MS_STATIC_ROUTES 0xf9 /* Microsoft's pre-RFC 3442 code for 0x79? */
//#define DHCP_WPAD 0xfc /* MSIE's Web Proxy Autodiscovery Protocol */ //#define DHCP_WPAD 0xfc /* MSIE's Web Proxy Autodiscovery Protocol */
#define DHCP_END 0xff #define DHCP_END 0xff