iPXE
dhcpopts.h
Go to the documentation of this file.
00001 #ifndef _IPXE_DHCPOPTS_H
00002 #define _IPXE_DHCPOPTS_H
00003 
00004 /** @file
00005  *
00006  * DHCP options
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <stdint.h>
00013 
00014 /** A DHCP options block */
00015 struct dhcp_options {
00016         /** Option block raw data */
00017         void *data;
00018         /** Option block used length */
00019         size_t used_len;
00020         /** Option block allocated length */
00021         size_t alloc_len;
00022         /** Reallocate option block raw data
00023          *
00024          * @v options           DHCP option block
00025          * @v len               New length
00026          * @ret rc              Return status code
00027          */
00028         int ( * realloc ) ( struct dhcp_options *options, size_t len );
00029 };
00030 
00031 extern int dhcpopt_applies ( unsigned int tag );
00032 extern int dhcpopt_store ( struct dhcp_options *options, unsigned int tag,
00033                            const void *data, size_t len );
00034 extern int dhcpopt_fetch ( struct dhcp_options *options, unsigned int tag,
00035                            void *data, size_t len );
00036 extern void dhcpopt_init ( struct dhcp_options *options,
00037                            void *data, size_t alloc_len,
00038                            int ( * realloc ) ( struct dhcp_options *options,
00039                                                size_t len ) );
00040 extern void dhcpopt_update_used_len ( struct dhcp_options *options );
00041 extern int dhcpopt_no_realloc ( struct dhcp_options *options, size_t len );
00042 
00043 #endif /* _IPXE_DHCPOPTS_H */