98 128, 129, 130, 131, 132, 133, 134, 135,
106 &vendor_class_setting,
112 .
name =
"dhcp-server",
113 .description =
"DHCP server",
115 .type = &setting_type_ipv4,
139 case DHCPACK:
return "DHCPACK";
140 case DHCPNAK:
return "DHCPNAK";
143 default:
return "DHCP<invalid>";
287 DBGC ( dhcp,
"DHCP %p entering %s state\n", dhcp,
state->name );
291 set_timer_limits ( &dhcp->
timer,
337 DBGC ( dhcp,
"DHCP %p DHCPDISCOVER\n", dhcp );
367 unsigned long elapsed;
369 DBGC ( dhcp,
"DHCP %p %s from %s:%d", dhcp,
372 if ( ( server_id.
s_addr !=
peer->sin_addr.s_addr ) ||
373 ( pseudo_id.
s_addr !=
peer->sin_addr.s_addr ) ) {
385 vci,
sizeof ( vci ) );
386 has_pxeclient = ( ( vci_len >= ( int )
sizeof ( vci ) ) &&
387 (
strncmp (
"PXEClient", vci,
sizeof (vci) ) == 0 ));
388 if ( has_pxeclient ) {
401 sizeof ( no_pxedhcp ) );
403 DBGC ( dhcp,
" nopxe" );
408 ( ( msgtype ==
DHCPOFFER ) || ( ! msgtype ) ) &&
417 if ( pseudo_id.
s_addr && has_pxeclient &&
459 DBGC ( dhcp,
"DHCP %p deferring discovery\n", dhcp );
513 DBGC ( dhcp,
"DHCP %p DHCPREQUEST to %s:%d",
520 sizeof ( dhcp->
server ) ) ) != 0 )
526 sizeof ( dhcp->
offer ) ) ) != 0 )
556 DBGC ( dhcp,
"DHCP %p %s from %s:%d", dhcp,
559 if ( ( server_id.
s_addr !=
peer->sin_addr.s_addr ) ||
560 ( pseudo_id.
s_addr !=
peer->sin_addr.s_addr ) ) {
586 if ( msgtype && ( msgtype !=
DHCPACK ) )
599 DBGC ( dhcp,
"DHCP %p could not register settings: %s\n",
621 DBGC ( dhcp,
"DHCP %p could not register " 622 "proxy settings: %s\n",
672 DBGC ( dhcp,
"DHCP %p ProxyDHCP REQUEST to %s\n", dhcp,
706 DBGC ( dhcp,
"DHCP %p %s from %s:%d", dhcp,
709 if ( ( server_id.
s_addr !=
peer->sin_addr.s_addr ) ||
710 ( pseudo_id.
s_addr !=
peer->sin_addr.s_addr ) ) {
715 DBGC ( dhcp,
" pxe" );
731 DBGC ( dhcp,
"DHCP %p could not register proxy settings: %s\n",
788 DBGC ( dhcp,
"DHCP %p PXEBS REQUEST to %s:%d for type %d\n",
795 &menu_item,
sizeof ( menu_item ) ) ) != 0 )
822 DBGC ( dhcp,
"DHCP %p rejecting server %s\n",
845 DBGC ( dhcp,
"DHCP %p %s from %s:%d", dhcp,
848 if ( ( server_id.
s_addr !=
peer->sin_addr.s_addr ) ||
849 ( pseudo_id.
s_addr !=
peer->sin_addr.s_addr ) ) {
856 &menu_item,
sizeof ( menu_item ) );
857 if ( menu_item.
type )
875 DBGC ( dhcp,
"DHCP %p could not register settings: %s\n",
947 void *
data,
size_t max_len ) {
952 if ( max_len < (
sizeof ( *
dhcphdr ) + options_len ) )
981 memset ( dhcppkt, 0,
sizeof ( *dhcppkt ) );
986 &msgtype,
sizeof ( msgtype ) ) ) != 0 )
1010 void *
data,
size_t max_len ) {
1016 size_t dhcp_features_len;
1027 data, max_len ) ) != 0 ) {
1028 DBG (
"DHCP could not create DHCP packet: %s\n",
1030 goto err_create_packet;
1040 dhcp_features_len ) ) != 0 ) {
1041 DBG (
"DHCP could not set features list option: %s\n",
1043 goto err_store_features;
1048 &dhcp_desc,
sizeof ( dhcp_desc ) );
1050 sizeof ( dhcp_desc ) ) ) != 0 ) {
1051 DBG (
"DHCP could not set bus ID option: %s\n",
1053 goto err_store_busid;
1064 ( ll_addr_len + 1 ) ) ) != 0 ) {
1065 DBG (
"DHCP could not set client ID: %s\n",
1067 goto err_store_client_id;
1077 &client_uuid.
uuid ) ) >= 0 ) {
1081 sizeof ( client_uuid ) ) ) != 0 ) {
1082 DBG (
"DHCP could not set client UUID: %s\n",
1084 goto err_store_client_uuid;
1097 DBG (
"DHCP could not set %s: %s\n",
1105 err_store_client_uuid:
1106 err_store_client_id:
1154 DBGC ( dhcp,
"DHCP %p could not construct DHCP request: %s\n",
1168 if ( (
rc = dhcp->
state->
tx ( dhcp, &dhcppkt, &
peer ) ) != 0 ) {
1169 DBGC ( dhcp,
"DHCP %p could not fill DHCP request: %s\n",
1178 DBGC ( dhcp,
"DHCP %p could not transmit UDP packet: %s\n",
1206 struct in_addr server_id = { 0 };
1211 if ( !
meta->src ) {
1212 DBGC ( dhcp,
"DHCP %p received packet without source port\n",
1228 goto err_alloc_dhcppkt;
1230 dhcphdr = ( ( (
void * ) dhcppkt ) +
sizeof ( *dhcppkt ) );
1236 sizeof ( msgtype ) );
1240 &server_id,
sizeof ( server_id ) );
1243 pseudo_id = server_id;
1244 if ( ! pseudo_id.
s_addr )
1246 if ( ! pseudo_id.
s_addr )
1247 pseudo_id =
peer->sin_addr;
1251 DBGC ( dhcp,
"DHCP %p %s from %s:%d has bad transaction " 1262 DBGC ( dhcp,
"DHCP %p %s from %s:%d has bad chaddr %s\n",
1271 dhcp->
state->
rx ( dhcp, dhcppkt,
peer, msgtype, server_id, pseudo_id );
1362 dhcp =
zalloc (
sizeof ( *dhcp ) );
1414 if (
raw_len <
sizeof ( *server ) ) {
1415 DBGC ( dhcp,
"DHCP %p malformed PXE server list\n",
1422 DBGC ( dhcp,
"DHCP %p malformed PXE server list\n",
1427 for ( i = 0 ; i < server->
num_ip ; i++ )
1428 *(
ip++) = server->
ip[i];
1430 server = ( ( (
void * ) server ) + server_len );
1448 unsigned int pxe_type ) {
1449 struct setting pxe_discovery_control_setting =
1451 struct setting pxe_boot_servers_setting =
1453 struct setting pxe_boot_server_mcast_setting =
1458 unsigned int pxe_discovery_control;
1464 if ( pxebs_list_len < 0 )
1468 dhcp =
zalloc (
sizeof ( *dhcp ) +
sizeof ( *
ip ) +
1469 sizeof ( *
ip ) + pxebs_list_len +
1485 pxe_discovery_control =
1487 ip = ( ( (
void * ) dhcp ) +
sizeof ( *dhcp ) );
1498 if ( pxebs_list_len ) {
1502 buf,
sizeof ( buf ) );
1506 DBGC ( dhcp,
"DHCP %p has no PXE boot servers for type %04x\n",
1513 DBGC ( dhcp,
"DHCP %p attempting", dhcp );
1516 DBGC ( dhcp,
"\n" );
1518 DBGC ( dhcp,
"DHCP %p accepting", dhcp );
1521 DBGC ( dhcp,
"\n" );
#define DHCP_FEATURES
DHCP feature table.
#define DHCP_REQUESTED_ADDRESS
Requested IP address.
#define EINVAL
Invalid argument.
#define DHCP_CLIENT_UUID
UUID client identifier.
An object interface operation.
#define DHCP_NTP_SERVERS
NTP servers.
#define PXE_PORT
PXE server port.
static void dhcp_set_state(struct dhcp_session *dhcp, struct dhcp_session_state *state)
Transition to new DHCP session state.
static void dhcp_free(struct refcnt *refcnt)
Free DHCP session.
struct arbelprm_rc_send_wqe rc
struct dhcp_packet * proxy_offer
ProxyDHCP offer.
void(* rx)(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer, uint8_t msgtype, struct in_addr server_id, struct in_addr pseudo_id)
Handle received packet.
void intf_close(struct interface *intf, int rc)
Close an object interface.
int proxy_priority
ProxyDHCP offer priority.
Dynamic Host Configuration Protocol.
#define iob_put(iobuf, len)
static struct interface_operation dhcp_xfer_operations[]
DHCP data transfer interface operations.
#define TICKS_PER_SEC
Number of ticks per second.
void intf_shutdown(struct interface *intf, int rc)
Shut down an object interface.
#define DHCP_HOST_NAME
Host name.
static int dhcp_deliver(struct dhcp_session *dhcp, struct io_buffer *iobuf, struct xfer_metadata *meta)
Receive new data.
static void dhcp_timer_expired(struct retry_timer *timer, int fail)
Handle DHCP retry timer expiry.
uint8_t num_ip
Number of IPv4 addresses.
static void dhcp_discovery_expired(struct dhcp_session *dhcp)
Handle timer expiry during DHCP discovery.
struct in_addr offer
Offered IP address.
#define DHCP_LOG_SERVERS
Syslog servers.
static void start_timer_nodelay(struct retry_timer *timer)
Start timer with no delay.
uint8_t ll_addr_len
Link-layer address length.
static void dhcp_finished(struct dhcp_session *dhcp, int rc)
Mark DHCP session as complete.
static int dhcp_has_pxeopts(struct dhcp_packet *dhcppkt)
Check if DHCP packet contains PXE options.
#define table_start(table)
Get start of linker table.
void unregister_settings(struct settings *settings)
Unregister settings block.
struct retry_timer timer
Retransmission timer.
#define DHCP_EB_ENCAP
Etherboot-specific encapsulated options.
static const struct setting * dhcp_request_settings[]
Settings copied in to all DHCP requests.
static struct interface_descriptor dhcp_job_desc
DHCP job control interface descriptor.
uint8_t tx_msgtype
Transmitted message type.
int fetch_raw_setting_copy(struct settings *settings, const struct setting *setting, void **data)
Fetch value of setting.
#define ref_init(refcnt, free)
Initialise a reference counter.
int xfer_open_socket(struct interface *intf, int semantics, struct sockaddr *peer, struct sockaddr *local)
Open socket.
struct settings * parent
Parent settings block.
#define DHCP_ROUTERS
Routers.
int fetch_ipv4_setting(struct settings *settings, const struct setting *setting, struct in_addr *inp)
Fetch value of IPv4 address setting.
#define DHCP_ISCSI_INITIATOR_IQN
iSCSI initiator IQN
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define DHCP_DOMAIN_NAME
Domain name.
#define BOOTP_REPLY
Opcode for a reply from server to client.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
unsigned int count
Transmission counter.
uint8_t htype
Hardware address type.
sa_family_t sa_family
Socket address family.
#define DHCP_DISC_MAX_DEFERRALS
#define LL_NAME_ONLY
Local link-layer address functions only as a name.
#define BOOTP_FL_BROADCAST
BOOTP reply must be broadcast.
static struct sockaddr dhcp_peer
DHCP peer address for socket opening.
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
#define DHCP_MESSAGE_TYPE
DHCP message type.
unsigned long start
Start time of the current state (in ticks)
void(* expired)(struct dhcp_session *dhcp)
Handle timer expiry.
static int dhcp_pxebs_accept(struct dhcp_session *dhcp, struct in_addr bs)
Check to see if PXE Boot Server address is acceptable.
int start_dhcp(struct interface *job, struct net_device *netdev)
Start DHCP state machine on a network device.
struct io_buffer * xfer_alloc_iob(struct interface *intf, size_t len)
Allocate I/O buffer.
int fetch_raw_setting(struct settings *settings, const struct setting *setting, void *data, size_t len)
Fetch value of setting.
uint8_t options[0]
DHCP options.
uint32_t xid
Transaction ID.
#define DHCP_PROXY_END_TIMEOUT_SEC
int dhcp_create_request(struct dhcp_packet *dhcppkt, struct net_device *netdev, unsigned int msgtype, uint32_t xid, struct in_addr ciaddr, void *data, size_t max_len)
Create DHCP request packet.
uint32_t data_len
Microcode data size (or 0 to indicate 2000 bytes)
static void dhcp_discovery_rx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer, uint8_t msgtype, struct in_addr server_id, struct in_addr pseudo_id)
Handle received packet during DHCP discovery.
struct refcnt refcnt
Reference counter.
#define SETTING_MISC
Miscellaneous settings.
static uint8_t dhcp_request_options_data[]
Raw option data for options common to all DHCP requests.
struct interface job
Job control interface.
#define BOOTPS_PORT
BOOTP/DHCP server port.
DHCP session state operations.
#define offsetof(type, field)
Get offset of a field within a structure.
uint16_t secs
Seconds since start of acquisition.
#define DHCP_EB_NO_PXEDHCP
Skip PXE DHCP protocol extensions such as ProxyDHCP.
static int netdev_link_blocked(struct net_device *netdev)
Check link block state of network device.
static void dhcp_proxy_expired(struct dhcp_session *dhcp)
Handle timer expiry during ProxyDHCP request.
sa_family_t sin_family
Socket address family (part of struct sockaddr)
static const uint8_t dhcp_op[]
DHCP operation types.
#define DHCP_PROXY_START_TIMEOUT_SEC
int no_pxedhcp
ProxyDHCP protocol extensions should be ignored.
int strncmp(const char *first, const char *second, size_t max)
Compare strings.
#define DHCP_REQ_END_TIMEOUT_SEC
static void pxebs_list(struct dhcp_session *dhcp, void *raw, size_t raw_len, struct in_addr *ip)
Retrieve list of PXE boot servers for a given server type.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
struct in_addr proxy_server
ProxyDHCP server.
uint32_t xid
Transaction ID (in network-endian order)
Data transfer interfaces.
static void dhcp_proxy_rx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer, uint8_t msgtype, struct in_addr server_id, struct in_addr pseudo_id)
Handle received packet during ProxyDHCP request.
int dhcp_create_packet(struct dhcp_packet *dhcppkt, struct net_device *netdev, uint8_t msgtype, uint32_t xid, const void *options, size_t options_len, void *data, size_t max_len)
Create a DHCP packet.
static int dhcp_discovery_tx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt __unused, struct sockaddr_in *peer)
Construct transmitted packet for DHCP discovery.
struct dhcp_session_state * state
State of the session.
static void uuid_mangle(union uuid *uuid)
Change UUID endianness.
uint64_t tag
Setting tag, if applicable.
static struct interface_operation dhcp_job_op[]
DHCP job control interface operations.
struct sockaddr_in local
Local socket address.
static void dhcp_defer(struct dhcp_session *dhcp)
Defer DHCP discovery.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
const char * name
State name.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
DHCP client architecture definitions.
#define __unused
Declare a variable or data structure as unused.
static struct interface_descriptor dhcp_xfer_desc
DHCP data transfer interface descriptor.
static struct dhcp_session_state dhcp_state_request
DHCP request state operations.
int ipv4_has_any_addr(struct net_device *netdev)
Check if network device has any IPv4 address.
#define DHCP_ROOT_PATH
Root path.
#define BOOTP_REQUEST
Opcode for a request from client to server.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define PROXYDHCP_SETTINGS_NAME
Settings block name used for ProxyDHCP responses.
#define container_of(ptr, type, field)
Get containing structure.
static void dhcp_pxebs_rx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer, uint8_t msgtype, struct in_addr server_id, struct in_addr pseudo_id)
Handle received packet during PXE Boot Server Discovery.
#define DHCP_MAX_MESSAGE_SIZE
Maximum DHCP message size.
static void dhcp_pxebs_expired(struct dhcp_session *dhcp)
Handle timer expiry during PXE Boot Server Discovery.
const struct setting dhcp_server_setting __setting(SETTING_MISC, dhcp-server)
DHCP server address setting.
#define DHCP_SERVER_IDENTIFIER
DHCP server identifier.
#define DHCP_MAGIC_COOKIE
DHCP magic cookie.
#define DHCP_MIN_LEN
DHCP minimum packet length.
static struct dhcp_session_state dhcp_state_proxy
ProxyDHCP request state operations.
#define DHCP_SETTINGS_NAME
Settings block name used for DHCP responses.
uint8_t min_timeout_sec
Timeout parameters.
int(* tx)(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer)
Construct transmitted packet.
uint16_t pxe_type
PXE Boot Server type.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static struct net_device * netdev
Transport-network layer interface.
#define DHCP_CLIENT_NDI
Client network device interface.
#define DHCP_ARCH_CLIENT_ARCHITECTURE
DHCP client architecture.
struct in_addr ciaddr
"Client" IP address
#define DHCP_CLIENT_ARCHITECTURE
Client system architecture.
#define DHCP_DOMAIN_SEARCH
DNS domain search list.
#define DHCP_CLIENT_UUID_TYPE
#define PXEBS_SETTINGS_NAME
Setting block name used for BootServerDHCP responses.
struct in_addr siaddr
"Server" IP address
#define DHCP_MTU
Maximum transmission unit.
#define DHCP_WORD(value)
Construct a word-valued DHCP option.
#define DHCP_SUBNET_MASK
Subnet mask.
static int dhcp_tx(struct dhcp_session *dhcp)
Transmit DHCP request.
Generalized socket address structure.
An object interface descriptor.
struct interface xfer
Data transfer interface.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
struct in_addr ip[0]
IPv4 addresses.
void * zalloc(size_t size)
Allocate cleared memory.
uint16_t sin_port
TCP/IP port (part of struct sockaddr_tcpip)
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
int dhcppkt_fetch(struct dhcp_packet *dhcppkt, unsigned int tag, void *data, size_t len)
Fetch value of DHCP packet setting.
uint8_t chaddr[16]
Client hardware address.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
#define DHCP_REQ_PROXY_TIMEOUT_SEC
int priority
DHCP offer priority.
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
static size_t iob_tailroom(struct io_buffer *iobuf)
Calculate available space at end of an I/O buffer.
Network device descriptor.
int xfer_deliver(struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram.
int dhcppkt_store(struct dhcp_packet *dhcppkt, unsigned int tag, const void *data, size_t len)
Store value of DHCP packet setting.
char * inet_ntoa(struct in_addr in)
Convert IPv4 address to dotted-quad notation.
IP4_t ip
Destination IP address.
#define DHCP_BYTE(value)
Construct a byte-valued DHCP option.
Data transfer interface opening.
unsigned long fetch_uintz_setting(struct settings *settings, const struct setting *setting)
Fetch value of unsigned integer setting, or zero.
static struct net_device * netdev_get(struct net_device *netdev)
Get reference to network device.
struct in_addr server
DHCP server.
#define DHCP_PXE_BOOT_MENU
PXE boot menu.
struct in_addr yiaddr
"Your" IP address
#define DHCP_DISC_PROXY_TIMEOUT_SEC
uint16_t ll_proto
Link-layer protocol.
#define DHCP_PXE_BOOT_MENU_ITEM
PXE boot menu item.
#define le16_to_cpu(value)
Accept only servers in DHCP_PXE_BOOT_SERVERS list.
Inhibit broadcast discovery.
static const char * dhcp_msgtype_name(unsigned int msgtype)
Name a DHCP packet type.
struct settings settings
Settings interface.
void start_timer(struct retry_timer *timer)
Start timer.
Network device management.
void start_timer_fixed(struct retry_timer *timer, unsigned long timeout)
Start timer with a specified timeout.
#define DHCP_VENDOR_CLASS_ID
Vendor class identifier.
struct in_addr sin_addr
IPv4 address.
uint8_t type
Identifier type.
void dhcppkt_init(struct dhcp_packet *dhcppkt, struct dhcphdr *data, size_t len)
Initialise DHCP packet.
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
void stop_timer(struct retry_timer *timer)
Stop timer.
#define ENOSPC
No space left on device.
uint32_t dhcp_last_xid
Most recent DHCP transaction ID.
#define DHCP_CLIENT_ID
Client identifier.
#define DHCP_STRING(...)
Construct a DHCP option from a list of characters.
struct dhcphdr * dhcphdr
The DHCP packet contents.
static int dhcp_request_tx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer)
Construct transmitted packet for DHCP request.
static void dhcppkt_put(struct dhcp_packet *dhcppkt)
Decrement reference count on DHCP packet.
#define DHCP_EB_PRIORITY
Priority of this options block.
#define DHCP_ARCH_CLIENT_NDI
DHCP client network device interface.
uint16_t priority
Priotity.
static struct dhcp_session_state dhcp_state_discover
DHCP discovery state operations.
static int dhcp_proxy_tx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer)
Construct transmitted packet for ProxyDHCP request.
static int dhcp_pxebs_tx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer)
Construct transmitted packet for PXE Boot Server Discovery.
void * data
Start of data.
static size_t dhcppkt_len(struct dhcp_packet *dhcppkt)
Get used length of DHCP packet.
A network device configurator.
#define BOOTPC_PORT
BOOTP/DHCP client port.
struct in_addr * pxe_attempt
List of PXE Boot Servers to attempt.
static struct dhcp_session_state dhcp_state_pxebs
PXE Boot Server Discovery state operations.
struct settings * find_settings(const char *name)
Find settings block.
#define cpu_to_le16(value)
uint8_t data[48]
Additional event data.
#define DHCP_BOOTFILE_NAME
Bootfile name.
uint32_t magic
DHCP magic cookie.
static struct dhcp_packet * dhcppkt_get(struct dhcp_packet *dhcppkt)
Increment reference count on DHCP packet.
const char *(* ntoa)(const void *ll_addr)
Transcribe link-layer address.
#define DHCP_DNS_SERVERS
DNS servers.
#define DHCP_REQ_START_TIMEOUT_SEC
#define PXEBS_END_TIMEOUT_SEC
int register_settings(struct settings *settings, struct settings *parent, const char *name)
Register settings block.
#define DHCP_END
End of options.
int fetch_uuid_setting(struct settings *settings, const struct setting *setting, union uuid *uuid)
Fetch value of UUID setting.
#define DHCP_VENDOR_ENCAP
Vendor encapsulated options.
struct in_addr * pxe_accept
List of PXE Boot Servers to accept.
struct mschapv2_challenge peer
Peer challenge.
typeof(acpi_finder=acpi_find)
ACPI table finder.
#define DHCP_USER_CLASS_ID
User class identifier.
#define DHCP_VENDOR_PXECLIENT(arch, ndi)
Vendor class identifier for PXE clients.
int start_pxebs(struct interface *job, struct net_device *netdev, unsigned int pxe_type)
Start PXE Boot Server Discovery on a network device.
static void dhcp_request_expired(struct dhcp_session *dhcp)
Handle timer expiry during DHCP discovery.
#define DHCP_PXE_DISCOVERY_CONTROL
PXE boot server discovery control.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
unsigned long currticks(void)
Get current system time in ticks.
#define DBG(...)
Print a debugging message.
uint8_t hlen
Hardware address length.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
#define DHCP_TFTP_SERVER_NAME
TFTP server name.
#define DHCP_EB_BUS_ID
Network device descriptor.
struct net_device_configurator dhcp_configurator __net_device_configurator
DHCP network device configurator.
#define PXEBS_START_TIMEOUT_SEC
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
#define DHCP_PXE_BOOT_SERVER_MCAST
PXE boot server multicast address.
#define ETIMEDOUT
Connection timed out.
#define DHCP_PARAMETER_REQUEST_LIST
Parameter request list.
#define DHCP_PXE_BOOT_SERVERS
PXE boot servers.
struct bofm_section_header done
Inhibit multicast discovery.
uint8_t ll_proto
Link-layer protocol.
#define AF_INET
IPv4 Internet addresses.
#define DHCP_DISC_START_TIMEOUT_SEC
static void dhcp_request_rx(struct dhcp_session *dhcp, struct dhcp_packet *dhcppkt, struct sockaddr_in *peer, uint8_t msgtype, struct in_addr server_id, struct in_addr pseudo_id)
Handle received packet during DHCP request.
#define DHCP_OPTION(...)
Construct a DHCP option from a list of bytes.
#define PXEBS_MAX_TIMEOUT_SEC
struct ll_protocol * ll_protocol
Link-layer protocol.
#define ref_put(refcnt)
Drop reference to object.
#define DHCP_DISC_END_TIMEOUT_SEC
void * memset(void *dest, int character, size_t len) __nonnull
struct net_device * netdev
Network device being configured.
#define table_num_entries(table)
Get number of entries in linker table.