mirror of
https://github.com/xcat2/xNBA.git
synced 2026-01-28 17:23:30 +00:00
Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
65 lines
1.4 KiB
C
65 lines
1.4 KiB
C
#ifndef _IPXE_DHCPPKT_H
|
|
#define _IPXE_DHCPPKT_H
|
|
|
|
/** @file
|
|
*
|
|
* DHCP packets
|
|
*
|
|
*/
|
|
|
|
FILE_LICENCE ( GPL2_OR_LATER );
|
|
|
|
#include <ipxe/dhcp.h>
|
|
#include <ipxe/dhcpopts.h>
|
|
#include <ipxe/refcnt.h>
|
|
|
|
/**
|
|
* A DHCP packet
|
|
*
|
|
*/
|
|
struct dhcp_packet {
|
|
/** Reference counter */
|
|
struct refcnt refcnt;
|
|
/** The DHCP packet contents */
|
|
struct dhcphdr *dhcphdr;
|
|
/** Maximum length of the DHCP packet buffer */
|
|
size_t max_len;
|
|
/** Used length of the DHCP packet buffer */
|
|
size_t len;
|
|
/** DHCP options */
|
|
struct dhcp_options options;
|
|
/** Settings interface */
|
|
struct settings settings;
|
|
};
|
|
|
|
/**
|
|
* Increment reference count on DHCP packet
|
|
*
|
|
* @v dhcppkt DHCP packet
|
|
* @ret dhcppkt DHCP packet
|
|
*/
|
|
static inline __attribute__ (( always_inline )) struct dhcp_packet *
|
|
dhcppkt_get ( struct dhcp_packet *dhcppkt ) {
|
|
ref_get ( &dhcppkt->refcnt );
|
|
return dhcppkt;
|
|
}
|
|
|
|
/**
|
|
* Decrement reference count on DHCP packet
|
|
*
|
|
* @v dhcppkt DHCP packet
|
|
*/
|
|
static inline __attribute__ (( always_inline )) void
|
|
dhcppkt_put ( struct dhcp_packet *dhcppkt ) {
|
|
ref_put ( &dhcppkt->refcnt );
|
|
}
|
|
|
|
extern int dhcppkt_store ( struct dhcp_packet *dhcppkt, unsigned int tag,
|
|
const void *data, size_t len );
|
|
extern int dhcppkt_fetch ( struct dhcp_packet *dhcppkt, unsigned int tag,
|
|
void *data, size_t len );
|
|
extern void dhcppkt_init ( struct dhcp_packet *dhcppkt,
|
|
struct dhcphdr *data, size_t len );
|
|
|
|
#endif /* _IPXE_DHCPPKT_H */
|