iPXE
|
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 | 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 (void) |
Cached DHCP packet startup function. More... | |
static void | cachedhcp_shutdown (int booting __unused) |
Cached DHCP packet shutdown function. More... | |
struct startup_fn cachedhcp_startup_fn | __startup_fn (STARTUP_LATE) |
Cached DHCPACK startup function. More... | |
static int | cachedhcp_probe (struct net_device *netdev, void *priv __unused) |
Apply cached DHCPACK to network device, if applicable. 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_packet * | cached_packets [] |
List of cached DHCP packets. More... | |
struct net_driver cachedhcp_driver | __net_driver |
Cached DHCP packet network device driver. More... | |
Cached DHCP packet.
Definition in file cachedhcp.c.
#define colour &cached_dhcpack |
Colour for debug messages.
Definition at line 74 of file cachedhcp.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Free cached DHCP packet.
cache | Cached DHCP packet |
Definition at line 81 of file cachedhcp.c.
References cached_dhcp_packet::dhcppkt, dhcppkt_put(), and NULL.
Referenced by cachedhcp_apply(), cachedhcp_record(), cachedhcp_shutdown(), and cachedhcp_startup().
|
static |
Apply cached DHCP packet settings.
cache | Cached DHCP packet |
netdev | Network device, or NULL |
rc | Return status code |
Definition at line 94 of file cachedhcp.c.
References cachedhcp_free(), dhcphdr::chaddr, colour, DBGC, dhcp_packet::dhcphdr, cached_dhcp_packet::dhcppkt, 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().
int cachedhcp_record | ( | struct cached_dhcp_packet * | cache, |
unsigned int | vlan, | ||
userptr_t | data, | ||
size_t | max_len | ||
) |
Record cached DHCP packet.
cache | Cached DHCP packet |
vlan | VLAN tag, if any |
data | DHCPACK packet buffer |
max_len | Maximum possible length |
rc | Return status code |
Definition at line 187 of file cachedhcp.c.
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, max_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().
|
static |
Cached DHCP packet startup function.
Definition at line 252 of file cachedhcp.c.
References cached_dhcpack, cached_proxydhcp, cached_pxebs, cachedhcp_apply(), cachedhcp_free(), colour, DBGC, cached_dhcp_packet::dhcppkt, cached_dhcp_packet::name, and NULL.
|
static |
Cached DHCP packet shutdown function.
booting | System is shutting down for OS boot |
Definition at line 277 of file cachedhcp.c.
References cached_dhcpack, cachedhcp_free(), colour, DBGC, cached_dhcp_packet::dhcppkt, and cached_dhcp_packet::name.
struct startup_fn cachedhcp_startup_fn __startup_fn | ( | STARTUP_LATE | ) |
Cached DHCPACK startup function.
|
static |
Apply cached DHCPACK to network device, if applicable.
netdev | Network device |
priv | Private data |
rc | Return status code |
Definition at line 301 of file cachedhcp.c.
References cached_dhcpack, cachedhcp_apply(), and netdev.
struct cached_dhcp_packet cached_dhcpack |
Cached DHCPACK.
Definition at line 52 of file cachedhcp.c.
Referenced by cachedhcp_init(), cachedhcp_probe(), cachedhcp_shutdown(), cachedhcp_startup(), and efi_cachedhcp_record().
struct cached_dhcp_packet cached_proxydhcp |
Cached ProxyDHCPOFFER.
Definition at line 57 of file cachedhcp.c.
Referenced by cachedhcp_startup(), and efi_cachedhcp_record().
struct cached_dhcp_packet cached_pxebs |
Cached PXEBSACK.
Definition at line 62 of file cachedhcp.c.
Referenced by cachedhcp_startup(), and efi_cachedhcp_record().
|
static |
List of cached DHCP packets.
Definition at line 67 of file cachedhcp.c.
Referenced by cachedhcp_record().
struct net_driver cachedhcp_driver __net_driver |
Cached DHCP packet network device driver.
Definition at line 308 of file cachedhcp.c.