diff options
author | Michael Brown | 2006-06-28 20:59:54 +0200 |
---|---|---|
committer | Michael Brown | 2006-06-28 20:59:54 +0200 |
commit | 51d62d1a3cd965f23af48a20886cf0c916e3977e (patch) | |
tree | 07a1e0d9d210848190ec2fa1987255c1920b58df /src/include/gpxe/dhcp.h | |
parent | Renamed net/interface.c and include/gpxe/interface.h to net/tcpip_if.c and in... (diff) | |
download | ipxe-51d62d1a3cd965f23af48a20886cf0c916e3977e.tar.gz ipxe-51d62d1a3cd965f23af48a20886cf0c916e3977e.tar.xz ipxe-51d62d1a3cd965f23af48a20886cf0c916e3977e.zip |
Provide a mechanism for returning the encapsulator as well as the
encapsulated option; this will be needed for modifications to the options
block.
Diffstat (limited to 'src/include/gpxe/dhcp.h')
-rw-r--r-- | src/include/gpxe/dhcp.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 26016cf8..cc9b94eb 100644 --- a/src/include/gpxe/dhcp.h +++ b/src/include/gpxe/dhcp.h @@ -88,6 +88,20 @@ extern unsigned long dhcp_num_option ( struct dhcp_option *option ); extern struct dhcp_option * find_dhcp_option ( unsigned int tag, struct dhcp_option_block *options ); +/** + * Find DHCP numerical option, and return its value + * + * @v tag DHCP option tag to search for + * @v options DHCP options block + * @ret value Numerical value of the option, or 0 if not found + * + * This function exists merely as a notational shorthand for a call to + * find_dhcp_option() followed by a call to dhcp_num_option(). It is + * not possible to distinguish between the cases "option not found" + * and "option has a value of zero" using this function; if this + * matters to you then issue the two constituent calls directly and + * check that find_dhcp_option() returns a non-NULL value. + */ static inline unsigned long find_dhcp_num_option ( unsigned int tag, struct dhcp_option_block *options ) { return dhcp_num_option ( find_dhcp_option ( tag, options ) ); |