From e40ebb67de88082e9f7a14a1a5c68d10b5c100e7 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 19 Jul 2006 11:05:38 +0000 Subject: Allow for calling find_dhcp_option() with "options" set to NULL, in order to search through all registered option blocks. Move some static inlines that are likely to be used frequently into dhcpopts.c as normal functions, to save space. --- src/include/gpxe/dhcp.h | 55 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 49 deletions(-) (limited to 'src/include') diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 71c6c14a0..57d632697 100644 --- a/src/include/gpxe/dhcp.h +++ b/src/include/gpxe/dhcp.h @@ -287,7 +287,6 @@ struct dhcp_session { extern unsigned long dhcp_num_option ( struct dhcp_option *option ); extern struct dhcp_option * find_dhcp_option ( struct dhcp_option_block *options, unsigned int tag ); -extern struct dhcp_option * find_global_dhcp_option ( unsigned int tag ); extern void register_dhcp_options ( struct dhcp_option_block *options ); extern void unregister_dhcp_options ( struct dhcp_option_block *options ); extern void init_dhcp_options ( struct dhcp_option_block *options, @@ -297,53 +296,11 @@ extern void free_dhcp_options ( struct dhcp_option_block *options ); extern struct dhcp_option * set_dhcp_option ( struct dhcp_option_block *options, unsigned int tag, const void *data, size_t len ); - -/** - * Find DHCP numerical option, and return its value - * - * @v options DHCP options block - * @v tag DHCP option tag to search for - * @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 ( struct dhcp_option_block *options, unsigned int tag ) { - return dhcp_num_option ( find_dhcp_option ( options, tag ) ); -} - -/** - * Find DHCP numerical option, and return its value - * - * @v tag DHCP option tag to search for - * @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_global_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_global_dhcp_option() returns a non-NULL value. - */ -static inline unsigned long -find_global_dhcp_num_option ( unsigned int tag ) { - return dhcp_num_option ( find_global_dhcp_option ( tag ) ); -} - -/** - * Delete DHCP option - * - * @v options DHCP options block - * @v tag DHCP option tag - */ -static inline void delete_dhcp_option ( struct dhcp_option_block *options, - unsigned int tag ) { - set_dhcp_option ( options, tag, NULL, 0 ); -} +extern struct dhcp_option * find_global_dhcp_option ( unsigned int tag ); +extern unsigned long find_dhcp_num_option ( struct dhcp_option_block *options, + unsigned int tag ); +extern unsigned long find_global_dhcp_num_option ( unsigned int tag ); +extern void delete_dhcp_option ( struct dhcp_option_block *options, + unsigned int tag ); #endif /* _GPXE_DHCP_H */ -- cgit v1.2.3-55-g7522