iPXE
Data Structures | Macros | Functions | Variables
cachedhcp.c File Reference

Cached DHCP packet. More...

#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <ipxe/dhcppkt.h>
#include <ipxe/init.h>
#include <ipxe/netdevice.h>
#include <ipxe/vlan.h>
#include <ipxe/cachedhcp.h>

Go to the source code of this file.

Data Structures

struct  cached_dhcp_packet
 A cached DHCP packet. More...
 

Macros

#define CACHEDHCP_RETAIN   0x0001
 Cached DHCP packet should be retained. More...
 
#define CACHEDHCP_USED   0x0002
 Cached DHCP packet has been used. More...
 
#define colour   &cached_dhcpack
 Colour for debug messages. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static void cachedhcp_free (struct cached_dhcp_packet *cache)
 Free cached DHCP packet. More...
 
static int cachedhcp_apply (struct cached_dhcp_packet *cache, struct net_device *netdev)
 Apply cached DHCP packet settings. More...
 
int cachedhcp_record (struct cached_dhcp_packet *cache, unsigned int vlan, userptr_t data, size_t max_len)
 Record cached DHCP packet. More...
 
static void cachedhcp_startup_early (void)
 Cached DHCP packet early startup function. More...
 
static void cachedhcp_startup_late (void)
 Cache DHCP packet late startup function. More...
 
static void cachedhcp_shutdown (int booting __unused)
 Cached DHCP packet shutdown function. More...
 
struct startup_fn cachedhcp_early_fn __startup_fn (STARTUP_EARLY)
 Cached DHCP packet early startup function. More...
 
struct startup_fn cachedhcp_late_fn __startup_fn (STARTUP_LATE)
 Cached DHCP packet late startup function. More...
 
static int cachedhcp_probe (struct net_device *netdev, void *priv __unused)
 Apply cached DHCPACK to network device, if applicable. More...
 
void cachedhcp_recycle (struct net_device *netdev)
 Recycle cached DHCPACK. More...
 

Variables

struct cached_dhcp_packet cached_dhcpack
 Cached DHCPACK. More...
 
struct cached_dhcp_packet cached_proxydhcp
 Cached ProxyDHCPOFFER. More...
 
struct cached_dhcp_packet cached_pxebs
 Cached PXEBSACK. More...
 
static struct cached_dhcp_packetcached_packets []
 List of cached DHCP packets. More...
 
struct net_driver cachedhcp_driver __net_driver
 Cached DHCP packet network device driver. More...
 

Detailed Description

Cached DHCP packet.

Definition in file cachedhcp.c.

Macro Definition Documentation

◆ CACHEDHCP_RETAIN

#define CACHEDHCP_RETAIN   0x0001

Cached DHCP packet should be retained.

Definition at line 54 of file cachedhcp.c.

◆ CACHEDHCP_USED

#define CACHEDHCP_USED   0x0002

Cached DHCP packet has been used.

Definition at line 57 of file cachedhcp.c.

◆ colour

#define colour   &cached_dhcpack

Colour for debug messages.

Definition at line 83 of file cachedhcp.c.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ cachedhcp_free()

static void cachedhcp_free ( struct cached_dhcp_packet cache)
static

Free cached DHCP packet.

Parameters
cacheCached DHCP packet

Definition at line 90 of file cachedhcp.c.

90  {
91 
92  dhcppkt_put ( cache->dhcppkt );
93  cache->dhcppkt = NULL;
94 }
struct dhcp_packet * dhcppkt
DHCP packet (if any)
Definition: cachedhcp.c:46
static void dhcppkt_put(struct dhcp_packet *dhcppkt)
Decrement reference count on DHCP packet.
Definition: dhcppkt.h:49
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References cached_dhcp_packet::dhcppkt, dhcppkt_put(), and NULL.

Referenced by cachedhcp_apply(), cachedhcp_record(), cachedhcp_shutdown(), cachedhcp_startup_early(), and cachedhcp_startup_late().

◆ cachedhcp_apply()

static int cachedhcp_apply ( struct cached_dhcp_packet cache,
struct net_device netdev 
)
static

Apply cached DHCP packet settings.

Parameters
cacheCached DHCP packet
netdevNetwork device, or NULL
Return values
rcReturn status code

Definition at line 103 of file cachedhcp.c.

104  {
105  struct settings *settings = NULL;
106  struct ll_protocol *ll_protocol;
107  const uint8_t *chaddr;
108  uint8_t *hw_addr;
109  uint8_t *ll_addr;
110  size_t ll_addr_len;
111  int rc;
112 
113  /* Do nothing if cache is empty or already in use */
114  if ( ( ! cache->dhcppkt ) || ( cache->flags & CACHEDHCP_USED ) )
115  return 0;
116  chaddr = cache->dhcppkt->dhcphdr->chaddr;
117 
118  /* Handle association with network device, if specified */
119  if ( netdev ) {
120  hw_addr = netdev->hw_addr;
121  ll_addr = netdev->ll_addr;
124 
125  /* If cached packet's MAC address matches the network
126  * device's permanent MAC address, then assume that
127  * the permanent MAC address ought to be the network
128  * device's current link-layer address.
129  *
130  * This situation can arise when the PXE ROM does not
131  * understand the system-specific mechanism for
132  * overriding the MAC address, and so uses the
133  * permanent MAC address instead. We choose to match
134  * this behaviour in order to minimise surprise.
135  */
136  if ( memcmp ( hw_addr, chaddr, ll_addr_len ) == 0 ) {
137  if ( memcmp ( hw_addr, ll_addr, ll_addr_len ) != 0 ) {
138  DBGC ( colour, "CACHEDHCP %s resetting %s MAC "
139  "%s ", cache->name, netdev->name,
140  ll_protocol->ntoa ( ll_addr ) );
141  DBGC ( colour, "-> %s\n",
142  ll_protocol->ntoa ( hw_addr ) );
143  }
144  memcpy ( ll_addr, hw_addr, ll_addr_len );
145  }
146 
147  /* Do nothing unless cached packet's MAC address
148  * matches this network device.
149  */
150  if ( memcmp ( ll_addr, chaddr, ll_addr_len ) != 0 ) {
151  DBGC ( colour, "CACHEDHCP %s %s does not match %s\n",
152  cache->name, ll_protocol->ntoa ( chaddr ),
153  netdev->name );
154  return 0;
155  }
156 
157  /* Do nothing unless cached packet's VLAN tag matches
158  * this network device.
159  */
160  if ( vlan_tag ( netdev ) != cache->vlan ) {
161  DBGC ( colour, "CACHEDHCP %s VLAN %d does not match "
162  "%s\n", cache->name, cache->vlan,
163  netdev->name );
164  return 0;
165  }
166 
167  /* Use network device's settings block */
169  DBGC ( colour, "CACHEDHCP %s is for %s\n",
170  cache->name, netdev->name );
171  }
172 
173  /* Register settings */
174  if ( ( rc = register_settings ( &cache->dhcppkt->settings, settings,
175  cache->name ) ) != 0 ) {
176  DBGC ( colour, "CACHEDHCP %s could not register settings: %s\n",
177  cache->name, strerror ( rc ) );
178  return rc;
179  }
180 
181  /* Mark as used */
182  cache->flags |= CACHEDHCP_USED;
183 
184  /* Free cached DHCP packet, if applicable */
185  if ( ! ( cache->flags & CACHEDHCP_RETAIN ) )
186  cachedhcp_free ( cache );
187 
188  return 0;
189 }
#define colour
Colour for debug messages.
Definition: cachedhcp.c:83
struct arbelprm_rc_send_wqe rc
Definition: arbel.h:14
uint8_t ll_addr_len
Link-layer address length.
Definition: netdevice.h:198
unsigned int vlan
VLAN tag (if applicable)
Definition: cachedhcp.c:48
#define DBGC(...)
Definition: compiler.h:505
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
Definition: netdevice.h:583
A link-layer protocol.
Definition: netdevice.h:114
struct dhcp_packet * dhcppkt
DHCP packet (if any)
Definition: cachedhcp.c:46
static void cachedhcp_free(struct cached_dhcp_packet *cache)
Free cached DHCP packet.
Definition: cachedhcp.c:90
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static struct net_device * netdev
Definition: gdbudp.c:52
#define CACHEDHCP_RETAIN
Cached DHCP packet should be retained.
Definition: cachedhcp.c:54
char * strerror(int errno)
Retrieve string representation of error number.
Definition: strerror.c:78
uint8_t chaddr[16]
Client hardware address.
Definition: dhcp.h:659
A settings block.
Definition: settings.h:132
unsigned char uint8_t
Definition: stdint.h:10
unsigned int flags
Flags.
Definition: cachedhcp.c:50
struct settings settings
Settings interface.
Definition: dhcppkt.h:28
char name[NETDEV_NAME_LEN]
Name of this network device.
Definition: netdevice.h:362
struct dhcphdr * dhcphdr
The DHCP packet contents.
Definition: dhcppkt.h:24
const char * name
Settings block name.
Definition: cachedhcp.c:44
const char *(* ntoa)(const void *ll_addr)
Transcribe link-layer address.
Definition: netdevice.h:163
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
Definition: settings.c:475
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
Definition: netdevice.h:387
static unsigned int vlan_tag(struct net_device *netdev)
Get the VLAN tag.
Definition: vlan.h:73
#define CACHEDHCP_USED
Cached DHCP packet has been used.
Definition: cachedhcp.c:57
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition: string.c:114
uint8_t hw_addr[MAX_HW_ADDR_LEN]
Hardware address.
Definition: netdevice.h:381
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321
struct ll_protocol * ll_protocol
Link-layer protocol.
Definition: netdevice.h:372

References cachedhcp_free(), CACHEDHCP_RETAIN, CACHEDHCP_USED, dhcphdr::chaddr, colour, DBGC, dhcp_packet::dhcphdr, cached_dhcp_packet::dhcppkt, cached_dhcp_packet::flags, net_device::hw_addr, net_device::ll_addr, ll_protocol::ll_addr_len, net_device::ll_protocol, memcmp(), memcpy(), cached_dhcp_packet::name, net_device::name, netdev, netdev_settings(), ll_protocol::ntoa, NULL, rc, register_settings(), dhcp_packet::settings, strerror(), cached_dhcp_packet::vlan, and vlan_tag().

Referenced by cachedhcp_probe(), and cachedhcp_startup_early().

◆ cachedhcp_record()

int cachedhcp_record ( struct cached_dhcp_packet cache,
unsigned int  vlan,
userptr_t  data,
size_t  max_len 
)

Record cached DHCP packet.

Parameters
cacheCached DHCP packet
vlanVLAN tag, if any
dataDHCPACK packet buffer
max_lenMaximum possible length
Return values
rcReturn status code

Definition at line 200 of file cachedhcp.c.

201  {
202  struct dhcp_packet *dhcppkt;
203  struct dhcp_packet *tmp;
204  struct dhcphdr *dhcphdr;
205  unsigned int i;
206  size_t len;
207 
208  /* Free any existing cached packet */
209  cachedhcp_free ( cache );
210 
211  /* Allocate and populate DHCP packet */
212  dhcppkt = zalloc ( sizeof ( *dhcppkt ) + max_len );
213  if ( ! dhcppkt ) {
214  DBGC ( colour, "CACHEDHCP %s could not allocate copy\n",
215  cache->name );
216  return -ENOMEM;
217  }
218  dhcphdr = ( ( ( void * ) dhcppkt ) + sizeof ( *dhcppkt ) );
219  copy_from_user ( dhcphdr, data, 0, max_len );
220  dhcppkt_init ( dhcppkt, dhcphdr, max_len );
221 
222  /* Shrink packet to required length. If reallocation fails,
223  * just continue to use the original packet and waste the
224  * unused space.
225  */
226  len = dhcppkt_len ( dhcppkt );
227  assert ( len <= max_len );
228  tmp = realloc ( dhcppkt, ( sizeof ( *dhcppkt ) + len ) );
229  if ( tmp )
230  dhcppkt = tmp;
231 
232  /* Reinitialise packet at new address */
233  dhcphdr = ( ( ( void * ) dhcppkt ) + sizeof ( *dhcppkt ) );
234  dhcppkt_init ( dhcppkt, dhcphdr, len );
235 
236  /* Discard duplicate packets, since some PXE stacks (including
237  * iPXE itself) will report the DHCPACK packet as the PXEBSACK
238  * if no separate PXEBSACK exists.
239  */
240  for ( i = 0 ; i < ( sizeof ( cached_packets ) /
241  sizeof ( cached_packets[0] ) ) ; i++ ) {
242  tmp = cached_packets[i]->dhcppkt;
243  if ( tmp && ( dhcppkt_len ( tmp ) == len ) &&
244  ( memcmp ( tmp->dhcphdr, dhcppkt->dhcphdr, len ) == 0 ) ) {
245  DBGC ( colour, "CACHEDHCP %s duplicates %s\n",
246  cache->name, cached_packets[i]->name );
247  dhcppkt_put ( dhcppkt );
248  return -EEXIST;
249  }
250  }
251 
252  /* Store as cached packet */
253  DBGC ( colour, "CACHEDHCP %s at %#08lx+%#zx/%#zx\n", cache->name,
254  user_to_phys ( data, 0 ), len, max_len );
255  cache->dhcppkt = dhcppkt;
256  cache->vlan = vlan;
257 
258  return 0;
259 }
#define colour
Colour for debug messages.
Definition: cachedhcp.c:83
A DHCP packet.
Definition: dhcppkt.h:20
unsigned int vlan
VLAN tag (if applicable)
Definition: cachedhcp.c:48
#define EEXIST
File exists.
Definition: errno.h:388
static __always_inline void copy_from_user(void *dest, userptr_t src, off_t src_off, size_t len)
Copy data from user buffer.
Definition: uaccess.h:411
unsigned long user_to_phys(userptr_t userptr, off_t offset)
Convert user pointer to physical address.
#define DBGC(...)
Definition: compiler.h:505
static struct cached_dhcp_packet * cached_packets[]
List of cached DHCP packets.
Definition: cachedhcp.c:76
struct dhcp_packet * dhcppkt
DHCP packet (if any)
Definition: cachedhcp.c:46
static void cachedhcp_free(struct cached_dhcp_packet *cache)
Free cached DHCP packet.
Definition: cachedhcp.c:90
unsigned long tmp
Definition: linux_pci.h:63
#define ENOMEM
Not enough space.
Definition: errno.h:534
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
void * zalloc(size_t size)
Allocate cleared memory.
Definition: malloc.c:624
A DHCP header.
Definition: dhcp.h:613
void dhcppkt_init(struct dhcp_packet *dhcppkt, struct dhcphdr *data, size_t len)
Initialise DHCP packet.
Definition: dhcppkt.c:300
struct dhcphdr * dhcphdr
The DHCP packet contents.
Definition: dhcppkt.h:24
static void dhcppkt_put(struct dhcp_packet *dhcppkt)
Decrement reference count on DHCP packet.
Definition: dhcppkt.h:49
static size_t dhcppkt_len(struct dhcp_packet *dhcppkt)
Get used length of DHCP packet.
Definition: dhcppkt.h:59
const char * name
Settings block name.
Definition: cachedhcp.c:44
uint8_t data[48]
Additional event data.
Definition: ena.h:22
void * realloc(void *old_ptr, size_t new_size)
Reallocate memory.
Definition: malloc.c:521
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
Definition: string.c:114
uint32_t len
Length.
Definition: ena.h:14

References assert(), cached_packets, cachedhcp_free(), colour, copy_from_user(), data, DBGC, dhcp_packet::dhcphdr, cached_dhcp_packet::dhcppkt, dhcppkt_init(), dhcppkt_len(), dhcppkt_put(), EEXIST, ENOMEM, len, memcmp(), cached_dhcp_packet::name, realloc(), tmp, user_to_phys(), cached_dhcp_packet::vlan, and zalloc().

Referenced by cachedhcp_init(), and efi_cachedhcp_record().

◆ cachedhcp_startup_early()

static void cachedhcp_startup_early ( void  )
static

Cached DHCP packet early startup function.

Definition at line 265 of file cachedhcp.c.

265  {
266 
267  /* Apply cached ProxyDHCPOFFER, if any */
270 
271  /* Apply cached PXEBSACK, if any */
274 }
struct cached_dhcp_packet cached_proxydhcp
Cached ProxyDHCPOFFER.
Definition: cachedhcp.c:66
static void cachedhcp_free(struct cached_dhcp_packet *cache)
Free cached DHCP packet.
Definition: cachedhcp.c:90
static int cachedhcp_apply(struct cached_dhcp_packet *cache, struct net_device *netdev)
Apply cached DHCP packet settings.
Definition: cachedhcp.c:103
struct cached_dhcp_packet cached_pxebs
Cached PXEBSACK.
Definition: cachedhcp.c:71
#define NULL
NULL pointer (VOID *)
Definition: Base.h:321

References cached_proxydhcp, cached_pxebs, cachedhcp_apply(), cachedhcp_free(), and NULL.

◆ cachedhcp_startup_late()

static void cachedhcp_startup_late ( void  )
static

Cache DHCP packet late startup function.

Definition at line 280 of file cachedhcp.c.

280  {
281 
282  /* Clear retention flag */
284 
285  /* Free cached DHCPACK, if used by a network device */
288 
289  /* Report unclaimed DHCPACK, if any. Do not free yet, since
290  * it may still be claimed by a dynamically created device
291  * such as a VLAN device.
292  */
293  if ( cached_dhcpack.dhcppkt ) {
294  DBGC ( colour, "CACHEDHCP %s unclaimed\n",
296  }
297 }
#define colour
Colour for debug messages.
Definition: cachedhcp.c:83
#define DBGC(...)
Definition: compiler.h:505
struct dhcp_packet * dhcppkt
DHCP packet (if any)
Definition: cachedhcp.c:46
static void cachedhcp_free(struct cached_dhcp_packet *cache)
Free cached DHCP packet.
Definition: cachedhcp.c:90
#define CACHEDHCP_RETAIN
Cached DHCP packet should be retained.
Definition: cachedhcp.c:54
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
Definition: cachedhcp.c:60
unsigned int flags
Flags.
Definition: cachedhcp.c:50
const char * name
Settings block name.
Definition: cachedhcp.c:44
#define CACHEDHCP_USED
Cached DHCP packet has been used.
Definition: cachedhcp.c:57

References cached_dhcpack, cachedhcp_free(), CACHEDHCP_RETAIN, CACHEDHCP_USED, colour, DBGC, cached_dhcp_packet::dhcppkt, cached_dhcp_packet::flags, and cached_dhcp_packet::name.

◆ cachedhcp_shutdown()

static void cachedhcp_shutdown ( int booting  __unused)
static

Cached DHCP packet shutdown function.

Parameters
bootingSystem is shutting down for OS boot

Definition at line 304 of file cachedhcp.c.

304  {
305 
306  /* Free cached DHCPACK, if any */
307  if ( cached_dhcpack.dhcppkt ) {
308  DBGC ( colour, "CACHEDHCP %s never claimed\n",
310  }
312 }
#define colour
Colour for debug messages.
Definition: cachedhcp.c:83
#define DBGC(...)
Definition: compiler.h:505
struct dhcp_packet * dhcppkt
DHCP packet (if any)
Definition: cachedhcp.c:46
static void cachedhcp_free(struct cached_dhcp_packet *cache)
Free cached DHCP packet.
Definition: cachedhcp.c:90
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
Definition: cachedhcp.c:60
const char * name
Settings block name.
Definition: cachedhcp.c:44

References cached_dhcpack, cachedhcp_free(), colour, DBGC, cached_dhcp_packet::dhcppkt, and cached_dhcp_packet::name.

◆ __startup_fn() [1/2]

struct startup_fn cachedhcp_early_fn __startup_fn ( STARTUP_EARLY  )

Cached DHCP packet early startup function.

◆ __startup_fn() [2/2]

struct startup_fn cachedhcp_late_fn __startup_fn ( STARTUP_LATE  )

Cached DHCP packet late startup function.

◆ cachedhcp_probe()

static int cachedhcp_probe ( struct net_device netdev,
void *priv  __unused 
)
static

Apply cached DHCPACK to network device, if applicable.

Parameters
netdevNetwork device
privPrivate data
Return values
rcReturn status code

Definition at line 334 of file cachedhcp.c.

334  {
335 
336  /* Apply cached DHCPACK to network device, if applicable */
338 }
static int cachedhcp_apply(struct cached_dhcp_packet *cache, struct net_device *netdev)
Apply cached DHCP packet settings.
Definition: cachedhcp.c:103
static struct net_device * netdev
Definition: gdbudp.c:52
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
Definition: cachedhcp.c:60

References cached_dhcpack, cachedhcp_apply(), and netdev.

◆ cachedhcp_recycle()

void cachedhcp_recycle ( struct net_device netdev)

Recycle cached DHCPACK.

Parameters
netdevNetwork device
privPrivate data

Definition at line 352 of file cachedhcp.c.

352  {
353  struct cached_dhcp_packet *cache = &cached_dhcpack;
354  struct settings *settings;
355 
356  /* Return DHCPACK to cache, if applicable */
358  cache->name );
359  if ( cache->dhcppkt && ( settings == &cache->dhcppkt->settings ) ) {
360  DBGC ( colour, "CACHEDHCP %s recycled from %s\n",
361  cache->name, netdev->name );
362  assert ( cache->flags & CACHEDHCP_USED );
364  cache->flags &= ~CACHEDHCP_USED;
365  }
366 }
#define colour
Colour for debug messages.
Definition: cachedhcp.c:83
void unregister_settings(struct settings *settings)
Unregister settings block.
Definition: settings.c:514
#define DBGC(...)
Definition: compiler.h:505
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
Definition: netdevice.h:583
struct dhcp_packet * dhcppkt
DHCP packet (if any)
Definition: cachedhcp.c:46
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static struct net_device * netdev
Definition: gdbudp.c:52
A cached DHCP packet.
Definition: cachedhcp.c:42
A settings block.
Definition: settings.h:132
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
Definition: cachedhcp.c:60
unsigned int flags
Flags.
Definition: cachedhcp.c:50
struct settings settings
Settings interface.
Definition: dhcppkt.h:28
char name[NETDEV_NAME_LEN]
Name of this network device.
Definition: netdevice.h:362
const char * name
Settings block name.
Definition: cachedhcp.c:44
struct settings * find_child_settings(struct settings *parent, const char *name)
Find child settings block.
Definition: settings.c:279
#define CACHEDHCP_USED
Cached DHCP packet has been used.
Definition: cachedhcp.c:57

References assert(), cached_dhcpack, CACHEDHCP_USED, colour, DBGC, cached_dhcp_packet::dhcppkt, find_child_settings(), cached_dhcp_packet::flags, cached_dhcp_packet::name, net_device::name, netdev, netdev_settings(), dhcp_packet::settings, and unregister_settings().

Referenced by mnptemp_destroy().

Variable Documentation

◆ cached_dhcpack

struct cached_dhcp_packet cached_dhcpack
Initial value:
= {
.flags = CACHEDHCP_RETAIN,
}
#define DHCP_SETTINGS_NAME
Settings block name used for DHCP responses.
Definition: dhcp.h:708
#define CACHEDHCP_RETAIN
Cached DHCP packet should be retained.
Definition: cachedhcp.c:54

Cached DHCPACK.

Definition at line 60 of file cachedhcp.c.

Referenced by cachedhcp_init(), cachedhcp_probe(), cachedhcp_recycle(), cachedhcp_shutdown(), cachedhcp_startup_late(), and efi_cachedhcp_record().

◆ cached_proxydhcp

struct cached_dhcp_packet cached_proxydhcp
Initial value:
= {
}
#define PROXYDHCP_SETTINGS_NAME
Settings block name used for ProxyDHCP responses.
Definition: dhcp.h:711

Cached ProxyDHCPOFFER.

Definition at line 66 of file cachedhcp.c.

Referenced by cachedhcp_startup_early(), and efi_cachedhcp_record().

◆ cached_pxebs

struct cached_dhcp_packet cached_pxebs
Initial value:
= {
}
#define PXEBS_SETTINGS_NAME
Setting block name used for BootServerDHCP responses.
Definition: dhcp.h:714

Cached PXEBSACK.

Definition at line 71 of file cachedhcp.c.

Referenced by cachedhcp_startup_early(), and efi_cachedhcp_record().

◆ cached_packets

struct cached_dhcp_packet* cached_packets[]
static
Initial value:
= {
}
struct cached_dhcp_packet cached_proxydhcp
Cached ProxyDHCPOFFER.
Definition: cachedhcp.c:66
struct cached_dhcp_packet cached_dhcpack
Cached DHCPACK.
Definition: cachedhcp.c:60
struct cached_dhcp_packet cached_pxebs
Cached PXEBSACK.
Definition: cachedhcp.c:71

List of cached DHCP packets.

Definition at line 76 of file cachedhcp.c.

Referenced by cachedhcp_record().

◆ __net_driver

struct net_driver cachedhcp_driver __net_driver
Initial value:
= {
.name = "cachedhcp",
.probe = cachedhcp_probe,
}
static int cachedhcp_probe(struct net_device *netdev, void *priv __unused)
Apply cached DHCPACK to network device, if applicable.
Definition: cachedhcp.c:334

Cached DHCP packet network device driver.

Definition at line 341 of file cachedhcp.c.