summaryrefslogtreecommitdiffstats
path: root/src/net/dhcpopts.c
diff options
context:
space:
mode:
authorMichael Brown2008-03-21 01:50:12 +0100
committerMichael Brown2008-03-21 01:50:12 +0100
commitbb32b8999cf76e5dab057a058d465468afc7e4ce (patch)
treefb63f6ce21bc7f0dda58aff90d761db2a4f1582b /src/net/dhcpopts.c
parent[Settings] Use a settings applicator in ibft.c (diff)
downloadipxe-bb32b8999cf76e5dab057a058d465468afc7e4ce.tar.gz
ipxe-bb32b8999cf76e5dab057a058d465468afc7e4ce.tar.xz
ipxe-bb32b8999cf76e5dab057a058d465468afc7e4ce.zip
[DHCP] Kill off some no-longer-used DHCP functions
Diffstat (limited to 'src/net/dhcpopts.c')
-rw-r--r--src/net/dhcpopts.c118
1 files changed, 0 insertions, 118 deletions
diff --git a/src/net/dhcpopts.c b/src/net/dhcpopts.c
index 25b517d3..8788d13e 100644
--- a/src/net/dhcpopts.c
+++ b/src/net/dhcpopts.c
@@ -88,55 +88,6 @@ unsigned long dhcp_num_option ( struct dhcp_option *option ) {
}
/**
- * Obtain value of an IPv4-address DHCP option
- *
- * @v option DHCP option, or NULL
- * @v inp IPv4 address to fill in
- *
- * Parses the IPv4 address value from a DHCP option, if present. It
- * is permitted to call dhcp_ipv4_option() with @c option set to NULL;
- * in this case the address will be set to 0.0.0.0.
- */
-void dhcp_ipv4_option ( struct dhcp_option *option, struct in_addr *inp ) {
- if ( option )
- *inp = option->data.in;
-}
-
-/**
- * Print DHCP string option value into buffer
- *
- * @v buf Buffer into which to write the string
- * @v size Size of buffer
- * @v option DHCP option, or NULL
- * @ret len Length of formatted string
- *
- * DHCP option strings are stored without a NUL terminator. This
- * function provides a convenient way to extract these DHCP strings
- * into standard C strings. It is permitted to call dhcp_snprintf()
- * with @c option set to NULL; in this case the buffer will be filled
- * with an empty string.
- *
- * The usual snprintf() semantics apply with regard to buffer size,
- * return value when the buffer is too small, etc.
- */
-int dhcp_snprintf ( char *buf, size_t size, struct dhcp_option *option ) {
- size_t len;
- char *content = "";
-
- if ( option ) {
- /* Shrink buffer size so that it is only just large
- * enough to contain the option data. snprintf() will
- * take care of everything else (inserting the NUL etc.)
- */
- len = ( option->len + 1 );
- if ( len < size )
- size = len;
- content = option->data.string;
- }
- return snprintf ( buf, size, "%s", content );
-}
-
-/**
* Calculate length of a normal DHCP option
*
* @v option DHCP option
@@ -462,19 +413,6 @@ struct dhcp_option * set_dhcp_option ( struct dhcp_option_block *options,
}
/**
- * Find DHCP option within all registered DHCP options blocks
- *
- * @v tag DHCP option tag to search for
- * @ret option DHCP option, or NULL if not found
- *
- * This function exists merely as a notational shorthand for
- * find_dhcp_option() with @c options set to NULL.
- */
-struct dhcp_option * find_global_dhcp_option ( unsigned int tag ) {
- return find_dhcp_option ( NULL, tag );
-}
-
-/**
* Find DHCP numerical option, and return its value
*
* @v options DHCP options block
@@ -494,62 +432,6 @@ unsigned long find_dhcp_num_option ( struct dhcp_option_block *options,
}
/**
- * 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.
- */
-unsigned long find_global_dhcp_num_option ( unsigned int tag ) {
- return dhcp_num_option ( find_global_dhcp_option ( tag ) );
-}
-
-/**
- * Find DHCP IPv4-address option, and return its value
- *
- * @v options DHCP options block
- * @v tag DHCP option tag to search for
- * @v inp IPv4 address to fill in
- * @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_ipv4_option(). It is
- * not possible to distinguish between the cases "option not found"
- * and "option has a value of 0.0.0.0" 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.
- */
-void find_dhcp_ipv4_option ( struct dhcp_option_block *options,
- unsigned int tag, struct in_addr *inp ) {
- dhcp_ipv4_option ( find_dhcp_option ( options, tag ), inp );
-}
-
-/**
- * Find DHCP IPv4-address option, and return its value
- *
- * @v options DHCP options block
- * @v tag DHCP option tag to search for
- * @v inp IPv4 address to fill in
- * @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_ipv4_option(). It is
- * not possible to distinguish between the cases "option not found"
- * and "option has a value of 0.0.0.0" 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.
- */
-void find_global_dhcp_ipv4_option ( unsigned int tag, struct in_addr *inp ) {
- dhcp_ipv4_option ( find_global_dhcp_option ( tag ), inp );
-}
-
-/**
* Delete DHCP option
*
* @v options DHCP options block