57#define CACHEDHCP_RETAIN 0x0001
60#define CACHEDHCP_USED 0x0002
86#define colour &cached_dhcpack
123 hw_addr =
netdev->hw_addr;
124 ll_addr =
netdev->ll_addr;
141 DBGC (
colour,
"CACHEDHCP %s resetting %s MAC "
154 DBGC (
colour,
"CACHEDHCP %s %s does not match %s\n",
164 DBGC (
colour,
"CACHEDHCP %s VLAN %d does not match "
178 cache->
name ) ) != 0 ) {
179 DBGC (
colour,
"CACHEDHCP %s could not register settings: %s\n",
204 const void *
data,
size_t max_len ) {
215 dhcppkt =
zalloc (
sizeof ( *dhcppkt ) + max_len );
217 DBGC (
colour,
"CACHEDHCP %s could not allocate copy\n",
221 dhcphdr = ( ( (
void * ) dhcppkt ) +
sizeof ( *dhcppkt ) );
236 dhcphdr = ( ( (
void * ) dhcppkt ) +
sizeof ( *dhcppkt ) );
248 DBGC (
colour,
"CACHEDHCP %s duplicates %s\n",
257 virt_to_phys (
data ),
len, max_len );
311 DBGC (
colour,
"CACHEDHCP %s never claimed\n",
319 .name =
"cachedhcp1",
325 .name =
"cachedhcp2",
363 DBGC (
colour,
"CACHEDHCP %s recycled from %s\n",
#define NULL
NULL pointer (VOID *)
#define colour
Colour for debug messages.
struct arbelprm_rc_send_wqe rc
#define assert(condition)
Assert a condition at run-time.
struct cached_dhcp_packet cached_proxydhcp
Cached ProxyDHCPOFFER.
struct cached_dhcp_packet cached_pxebs
Cached PXEBSACK.
#define CACHEDHCP_RETAIN
Cached DHCP packet should be retained.
static int cachedhcp_probe(struct net_device *netdev, void *priv __unused)
Apply cached DHCPACK to network device, if applicable.
static void cachedhcp_startup_early(void)
Cached DHCP packet early startup function.
static void cachedhcp_startup_late(void)
Cache DHCP packet late startup function.
#define CACHEDHCP_USED
Cached DHCP packet has been used.
void cachedhcp_recycle(struct net_device *netdev)
Recycle cached DHCPACK.
static struct cached_dhcp_packet * cached_packets[]
List of cached DHCP packets.
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
int cachedhcp_record(struct cached_dhcp_packet *cache, unsigned int vlan, const void *data, size_t max_len)
Record cached DHCP packet.
static void cachedhcp_free(struct cached_dhcp_packet *cache)
Free cached DHCP packet.
static int cachedhcp_apply(struct cached_dhcp_packet *cache, struct net_device *netdev)
Apply cached DHCP packet settings.
static void cachedhcp_shutdown(int booting __unused)
Cached DHCP packet shutdown function.
void dhcppkt_init(struct dhcp_packet *dhcppkt, struct dhcphdr *data, size_t len)
Initialise DHCP packet.
static void dhcppkt_put(struct dhcp_packet *dhcppkt)
Decrement reference count on DHCP packet.
static size_t dhcppkt_len(struct dhcp_packet *dhcppkt)
Get used length of DHCP packet.
uint8_t data[48]
Additional event data.
static struct net_device * netdev
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EEXIST
File exists.
#define ENOMEM
Not enough space.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
#define STARTUP_EARLY
Early startup.
#define STARTUP_LATE
Late startup.
#define PXEBS_SETTINGS_NAME
Setting block name used for BootServerDHCP responses.
#define PROXYDHCP_SETTINGS_NAME
Settings block name used for ProxyDHCP responses.
#define DHCP_SETTINGS_NAME
Settings block name used for DHCP responses.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define __startup_fn(startup_order)
Declare a startup/shutdown function.
Access to external ("user") memory.
void * realloc(void *old_ptr, size_t new_size)
Reallocate memory.
void * zalloc(size_t size)
Allocate cleared memory.
Network device management.
#define __net_driver
Declare a network driver.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
void unregister_settings(struct settings *settings)
Unregister settings block.
struct settings * find_child_settings(struct settings *parent, const char *name)
Find child settings block.
char * strerror(int errno)
Retrieve string representation of error number.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
struct dhcp_packet * dhcppkt
DHCP packet (if any)
unsigned int vlan
VLAN tag (if applicable)
const char * name
Settings block name.
struct settings settings
Settings interface.
struct dhcphdr * dhcphdr
The DHCP packet contents.
uint8_t chaddr[16]
Client hardware address.
const char *(* ntoa)(const void *ll_addr)
Transcribe link-layer address.
uint8_t ll_addr_len
Link-layer address length.
A network upper-layer driver.
A startup/shutdown function.
static struct tlan_private * priv
static unsigned int vlan_tag(struct net_device *netdev)
Get the VLAN tag.