From 51d62d1a3cd965f23af48a20886cf0c916e3977e Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 28 Jun 2006 18:59:54 +0000 Subject: Provide a mechanism for returning the encapsulator as well as the encapsulated option; this will be needed for modifications to the options block. --- src/include/gpxe/dhcp.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/include') diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 26016cf81..cc9b94eb9 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 ) ); -- cgit v1.2.3-55-g7522