From 1567b698958cccde4c32e554ef56df7add3a06f6 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 5 Jul 2007 18:38:14 +0100 Subject: Add concept of DHCP option applicators. --- src/include/gpxe/dhcp.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/include') diff --git a/src/include/gpxe/dhcp.h b/src/include/gpxe/dhcp.h index 3183a3a9d..caac91443 100644 --- a/src/include/gpxe/dhcp.h +++ b/src/include/gpxe/dhcp.h @@ -11,6 +11,7 @@ #include #include #include +#include struct net_device; struct job_interface; @@ -438,6 +439,23 @@ struct dhcp_packet { struct dhcp_option_block options; }; +/** A DHCP option applicator */ +struct dhcp_option_applicator { + /** DHCP option tag */ + unsigned int tag; + /** Applicator + * + * @v tag DHCP option tag + * @v option DHCP option + * @ret rc Return status code + */ + int ( * apply ) ( unsigned int tag, struct dhcp_option *option ); +}; + +/** Declare a DHCP option applicator */ +#define __dhcp_applicator \ + __table ( struct dhcp_option_applicator, dhcp_appicators, 01 ) + /** * Get reference to DHCP options block * @@ -485,6 +503,7 @@ extern void find_global_dhcp_ipv4_option ( unsigned int tag, struct in_addr *inp ); extern void delete_dhcp_option ( struct dhcp_option_block *options, unsigned int tag ); +extern int apply_dhcp_options ( struct dhcp_option_block *options ); extern struct dhcp_option_block dhcp_request_options; extern int create_dhcp_packet ( struct net_device *netdev, uint8_t msgtype, -- cgit v1.2.3-55-g7522