60 #ifdef EFI_DOWNGRADE_UX 61 static EFI_GUID dummy_pxe_base_code_protocol_guid = {
62 0x70647523, 0x2320, 0x7477,
63 { 0x66, 0x20, 0x23, 0x6d, 0x6f, 0x72, 0x6f, 0x6e }
65 #define efi_pxe_base_code_protocol_guid dummy_pxe_base_code_protocol_guid 298 for ( i = 0 ; i <
filter->IpCnt ; i++ ) {
336 const void *
data,
size_t len ) {
427 const char *filename ) {
436 DBGC ( pxe,
"PXE %s could not parse %s:%s\n", pxe->
name,
444 DBGC ( pxe,
"PXE %s could not open: %s\n",
530 goto err_unsupported;
536 pshdr_len = (
sizeof ( *pshdr ) + ( 2 * addr_len ) );
541 pshdr =
iob_push ( iobuf,
sizeof ( *pshdr ) );
584 DBGC ( pxe,
"PXE %s could not open UDP connection: %s\n",
646 return "DhcpDiscover";
647 }
else if ( packet == &mode->
DhcpAck ) {
652 return "PxeDiscover";
653 }
else if ( packet == &mode->
PxeReply ) {
656 return "PxeBisReply";
685 if ( (
rc = fake ( pxe->
netdev, packet, sizeof ( *packet ) ) != 0 ) ) {
686 DBGC ( pxe,
"PXE %s could not fake %s: %s\n", pxe->
name,
711 if (
len <
sizeof ( *packet ) )
759 DBGC ( pxe,
"PXE %s START %s\n",
760 pxe->
name, ( use_ipv6 ?
"IPv6" :
"IPv4" ) );
763 memset ( mode, 0,
sizeof ( *mode ) );
777 if ( ! pxe->
tcpip ) {
778 DBGC ( pxe,
"PXE %s has no support for %s\n",
794 DBGC ( pxe,
"PXE %s using %s\n",
810 DBGC ( pxe,
"PXE %s STOP\n", pxe->
name );
837 DBGC ( pxe,
"PXE %s DHCP %s\n",
838 pxe->
name, ( sort ?
"sorted" :
"unsorted" ) );
845 DBGC ( pxe,
"PXE %s could not initiate configuration: %s\n",
891 DBGC ( pxe,
"PXE %s DISCOVER type %d layer %d%s\n",
892 pxe->
name,
type, *layer, ( bis ?
" bis" :
"" ) );
894 DBGC ( pxe,
"%s%s%s%s %s",
895 (
info->UseMCast ?
" mcast" :
"" ),
896 (
info->UseBCast ?
" bcast" :
"" ),
897 (
info->UseUCast ?
" ucast" :
"" ),
898 (
info->MustUseList ?
" list" :
"" ),
900 for ( i = 0 ; i <
info->IpCnt ; i++ ) {
901 ip = &
info->SrvList[i].IpAddr;
902 DBGC ( pxe,
" %d%s:%s",
info->SrvList[i].Type,
903 (
info->SrvList[i].AcceptAnyResponse ?
940 DBGC ( pxe,
" blksize %zd", ( (
size_t ) *
blksize ) );
943 DBGC ( pxe,
" %s:%d:%d:%d:%d",
946 info->TransmitTimeout );
948 DBGC ( pxe,
"%s\n", ( callback ?
" callback" :
"" ) );
953 DBGC ( pxe,
"PXE %s unsupported MTFTP opcode %d\n",
974 ( (
const char * ) filename ) ) ) != 0 )
981 if ( (
rc = pxe->
rc ) != 0 ) {
982 DBGC ( pxe,
"PXE %s download failed: %s\n",
1032 DBGC2 ( pxe,
"PXE %s UDP WRITE ", pxe->
name );
1046 DBGC2 ( pxe,
" %p+%zx",
hdr, ( (
size_t ) *hdr_len ) );
1049 DBGC2 ( pxe,
" frag" );
1050 DBGC2 ( pxe,
"\n" );
1077 ( *
len + ( hdr_len ? *hdr_len : 0 ) ) );
1097 DBGC ( pxe,
"PXE %s could not transmit: %s\n",
1141 DBGC2 ( pxe,
"PXE %s UDP READ ", pxe->
name );
1143 DBGC2 ( pxe,
"(filter)" );
1155 DBGC2 ( pxe,
"<NULL>" );
1157 DBGC2 ( pxe,
"<-" );
1163 DBGC2 ( pxe,
"<NULL>" );
1171 DBGC2 ( pxe,
"<NULL>" );
1174 DBGC2 ( pxe,
" %p+%zx",
hdr, ( (
size_t ) *hdr_len ) );
1194 pshdr = iobuf->
data;
1196 iob_pull ( iobuf,
sizeof ( *pshdr ) );
1197 actual_dest_ip = iobuf->
data;
1199 actual_src_ip = iobuf->
data;
1201 DBGC2 ( pxe,
"PXE %s UDP RX %s:%d", pxe->
name,
1203 DBGC2 ( pxe,
"<-%s:%d len %#zx\n", pshdr->
net->
ntoa ( actual_src_ip ),
1207 if ( pshdr->
net != pxe->
net ) {
1208 DBGC2 ( pxe,
"PXE %s filtered out %s packet\n",
1217 DBGC2 ( pxe,
"PXE %s filtered out destination port %d\n",
1224 DBGC2 ( pxe,
"PXE %s filtered out source port %d\n",
1233 (
memcmp (
src_ip, actual_src_ip, addr_len ) == 0 ) ) ) ) {
1234 DBGC2 ( pxe,
"PXE %s filtered out source IP %s\n",
1246 addr_len ) == 0 ) ) ) ) ) ) {
1247 DBGC2 ( pxe,
"PXE %s filtered out destination IP %s\n",
1266 if ( frag_len > *hdr_len )
1267 frag_len = *hdr_len;
1270 *hdr_len = frag_len;
1275 if ( frag_len > *
len )
1313 DBGC ( pxe,
"PXE %s SET IP FILTER %02x",
1315 for ( i = 0 ; i <
filter->IpCnt ; i++ ) {
1340 DBGC ( pxe,
"PXE %s ARP %s %p\n",
1365 DBGC ( pxe,
"PXE %s SET PARAMETERS", pxe->
name );
1367 DBGC ( pxe,
" %s", ( *autoarp ?
"autoarp" :
"noautoarp" ) );
1369 DBGC ( pxe,
" %s", ( *sendguid ?
"sendguid" :
"sendmac" ) );
1371 DBGC ( pxe,
" ttl %d", *ttl );
1373 DBGC ( pxe,
" tos %d", *tos );
1376 ( *callback ?
"callback" :
"nocallback" ) );
1409 DBGC ( pxe,
"PXE %s SET STATION IP ", pxe->
name );
1456 DBGC ( pxe,
"PXE %s SET PACKETS\n", pxe->
name );
1463 if ( proxyoffer_ok )
1526 if ( *
len <
sizeof ( *packet ) ) {
1527 *
len =
sizeof ( *packet );
1533 *
len =
sizeof ( *packet );
1601 pxe =
zalloc (
sizeof ( *pxe ) );
1613 sizeof ( pxe->
apple ) );
1626 use_ipv6 = (
ip.s_addr ?
FALSE : ( ipv6 !=
NULL ) );
1638 DBGC ( pxe,
"PXE %s could not install base code protocol: %s\n",
1640 goto err_install_protocol;
1645 DBGC ( pxe,
"PXE %s installed for %s\n",
1654 DBGC ( pxe,
"PXE %s could not uninstall: %s\n",
1660 err_install_protocol:
1665 DBGC ( pxe,
"PXE %s nullified and leaked\n", pxe->
name );
1683 DBG (
"PXE could not find base code for %s\n",
1698 DBGC ( pxe,
"PXE %s could not uninstall: %s\n",
1712 DBGC ( pxe,
"PXE %s nullified and leaked\n", pxe->
name );
static size_t efi_pxe_tftp_window(struct efi_pxe *pxe)
Check PXE (M)TFTP download flow control window.
#define iob_pull(iobuf, len)
EFI_BOOT_SERVICES * BootServices
A pointer to the EFI Boot Services Table.
An object interface operation.
#define EFI_UNSUPPORTED
Enumeration of EFI_STATUS.
#define EFI_PXE_BASE_CODE_IP_FILTER_BROADCAST
struct arbelprm_rc_send_wqe rc
EFI_PXE_BASE_CODE_MODE mode
PXE base code mode.
static void efi_pxe_ip_sockaddr(struct efi_pxe *pxe, EFI_IP_ADDRESS *ip, struct sockaddr *sa)
Populate socket address from EFI IP address.
void intf_close(struct interface *intf, int rc)
Close an object interface.
const char * name
Protocol name.
static EFI_STATUS EFIAPI efi_pxe_arp(EFI_PXE_BASE_CODE_PROTOCOL *base, EFI_IP_ADDRESS *ip, EFI_MAC_ADDRESS *mac)
Resolve MAC address.
static struct efi_pxe * efi_pxe_find(EFI_HANDLE handle)
Locate PXE base code.
void intf_restart(struct interface *intf, int rc)
Shut down and restart an object interface.
int netdev_configuration_in_progress(struct net_device *netdev)
Check if network device configuration is in progress.
#define iob_put(iobuf, len)
int xferbuf_deliver(struct xfer_buffer *xferbuf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Add received data to data transfer buffer.
#define EEFI(efirc)
Convert an EFI status code to an iPXE status code.
#define AF_INET6
IPv6 Internet addresses.
struct list_head list
List of PXE base codes.
static void uri_put(struct uri *uri)
Decrement URI reference count.
GET_DHCP_RESPONSE GetDhcpResponse
static const char * efi_pxe_ip_ntoa(struct efi_pxe *pxe, EFI_IP_ADDRESS *ip)
Transcribe EFI IP address (for debugging)
static EFI_STATUS EFIAPI efi_pxe_set_packets(EFI_PXE_BASE_CODE_PROTOCOL *base, BOOLEAN *dhcpdisc_ok, BOOLEAN *dhcpack_ok, BOOLEAN *proxyoffer_ok, BOOLEAN *pxebsdisc_ok, BOOLEAN *pxebsack_ok, BOOLEAN *pxebsbis_ok, EFI_PXE_BASE_CODE_PACKET *dhcpdisc, EFI_PXE_BASE_CODE_PACKET *dhcpack, EFI_PXE_BASE_CODE_PACKET *proxyoffer, EFI_PXE_BASE_CODE_PACKET *pxebsdisc, EFI_PXE_BASE_CODE_PACKET *pxebsack, EFI_PXE_BASE_CODE_PACKET *pxebsbis)
Update cached DHCP packets.
static LIST_HEAD(efi_pxes)
List of PXE base codes.
static EFI_STATUS EFIAPI efi_pxe_dhcp(EFI_PXE_BASE_CODE_PROTOCOL *base, BOOLEAN sort)
Perform DHCP.
static EFI_STATUS EFIAPI efi_pxe_start(EFI_PXE_BASE_CODE_PROTOCOL *base, BOOLEAN use_ipv6)
Start PXE base code.
EFI PXE base code protocol.
static EFI_STATUS EFIAPI efi_pxe_set_ip_filter(EFI_PXE_BASE_CODE_PROTOCOL *base, EFI_PXE_BASE_CODE_IP_FILTER *filter)
Set receive filter.
struct refcnt refcnt
Reference count.
128 bit buffer containing a unique identifier value.
UINT8_t filter
Receive packet filter.
#define ref_init(refcnt, free)
Initialise a reference counter.
static void efi_pxe_buf_write(struct xfer_buffer *xferbuf, size_t offset, const void *data, size_t len)
Write data to PXE data transfer buffer.
struct golan_inbox_hdr hdr
Message header.
#define iob_push(iobuf, len)
int fetch_ipv4_setting(struct settings *settings, const struct setting *setting, struct in_addr *inp)
Fetch value of IPv4 address setting.
32-byte buffer containing a network Media Access Control address.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct uri * pxe_uri(struct sockaddr *sa_server, const char *filename)
Construct URI from server address and filename.
uint64_t address
Base address.
uint32_t type
Operating system type.
static int efi_pxe_tftp_open(struct efi_pxe *pxe, EFI_IP_ADDRESS *ip, const char *filename)
Open (M)TFTP download interface.
int xfer_open_uri(struct interface *intf, struct uri *uri)
Open URI.
static struct interface_descriptor efi_pxe_tftp_desc
PXE file data transfer interface descriptor.
EFI_PXE_BASE_CODE_PROTOCOL base
PXE base code protocol.
int create_fakedhcpack(struct net_device *netdev, void *data, size_t max_len)
Create fake DHCPACK packet.
EFI_IP_ADDRESS se_addr
IP address.
static EFI_STATUS EFIAPI efi_pxe_set_parameters(EFI_PXE_BASE_CODE_PROTOCOL *base, BOOLEAN *autoarp, BOOLEAN *sendguid, UINT8 *ttl, UINT8 *tos, BOOLEAN *callback)
Set parameters.
sa_family_t sa_family
Socket address family.
static const char * efi_pxe_fake_name(struct efi_pxe *pxe, EFI_PXE_BASE_CODE_PACKET *packet)
Name fake DHCP packet.
struct interface udp
UDP interface.
struct xfer_buffer buf
Data transfer buffer.
EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces
EFI_APPLE_NET_BOOT_PROTOCOL apple
Apple NetBoot protocol.
#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS_MULTICAST
EFI_PXE_BASE_CODE_DHCPV4_PACKET Dhcpv4
struct io_buffer * xfer_alloc_iob(struct interface *intf, size_t len)
Allocate I/O buffer.
static int efi_pxe_ip_filter(struct efi_pxe *pxe, EFI_IP_ADDRESS *ip)
Check if IP address matches filter.
EFI_IP_ADDRESS SubnetMask
uint16_t se_flags
Flags (part of struct sockaddr_tcpip)
EFI_GUID efi_pxe_base_code_protocol_guid
PXE base code protocol GUID.
static struct process_descriptor efi_pxe_process_desc
UDP close process descriptor.
static EFI_STATUS EFIAPI efi_apple_get_bsdp_response(EFI_APPLE_NET_BOOT_PROTOCOL *apple, UINTN *len, VOID *data)
Get BSDP response.
#define PROC_DESC_ONCE(object_type, process, _step)
Define a process descriptor for a process that runs only once.
EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible devices for network ac...
EFI_PXE_BASE_CODE_PACKET PxeReply
static void efi_snp_claim(void)
Claim network devices for use by iPXE.
static EFI_STATUS EFIAPI efi_pxe_udp_read(EFI_PXE_BASE_CODE_PROTOCOL *base, UINT16 flags, EFI_IP_ADDRESS *dest_ip, EFI_PXE_BASE_CODE_UDP_PORT *dest_port, EFI_IP_ADDRESS *src_ip, EFI_PXE_BASE_CODE_UDP_PORT *src_port, UINTN *hdr_len, VOID *hdr, UINTN *len, VOID *data)
Receive UDP packet.
uint8_t mac[ETH_ALEN]
MAC address.
#define EFI_BUFFER_TOO_SMALL
Enumeration of EFI_STATUS.
Uniform Resource Identifiers.
IP4_t src_ip
IP address of this station.
void process_del(struct process *process)
Remove process from process list.
unsigned int scope_id
Scope ID.
size_t xfer_window(struct interface *intf)
Check flow control window.
static struct settings * netdev_settings(struct net_device *netdev)
Get per-netdevice configuration settings block.
int create_fakedhcpdiscover(struct net_device *netdev, void *data, size_t max_len)
Create fake DHCPDISCOVER packet.
static EFI_STATUS EFIAPI efi_pxe_set_station_ip(EFI_PXE_BASE_CODE_PROTOCOL *base, EFI_IP_ADDRESS *ip, EFI_IP_ADDRESS *netmask)
Set IP address.
#define ENOTSUP
Operation not supported.
A doubly-linked list entry (or list head)
Data transfer buffer operations.
int netdev_configure_all(struct net_device *netdev)
Start network device configuration via all supported configurators.
#define list_empty(list)
Test whether a list is empty.
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_PORT
#define list_first_entry(list, type, member)
Get the container of the first entry in a list.
static EFI_STATUS EFIAPI efi_apple_get_dhcp_response(EFI_APPLE_NET_BOOT_PROTOCOL *apple, UINTN *len, VOID *data)
Get DHCP response.
#define list_del(list)
Delete an entry from a list.
EFI_HANDLE handle
Installed handle.
#define ENOMEM
Not enough space.
#define iob_disown(iobuf)
Disown an I/O buffer.
void * memcpy(void *dest, const void *src, size_t len) __nonnull
static int efi_pxe_ip(struct efi_pxe *pxe)
Populate local IP address.
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_USE_FILTER
size_t blksize
Block size (for TFTP)
void efi_pxe_uninstall(EFI_HANDLE handle)
Uninstall PXE base code protocol.
#define EFI_PXE_BASE_CODE_PROTOCOL_REVISION
struct net_device * netdev
Underlying network device.
#define EFI_PXE_BASE_CODE_IP_FILTER_PROMISCUOUS
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
int rc
Overall return status.
static EFI_STATUS EFIAPI efi_pxe_discover(EFI_PXE_BASE_CODE_PROTOCOL *base, UINT16 type, UINT16 *layer, BOOLEAN bis, EFI_PXE_BASE_CODE_DISCOVER_INFO *info)
Perform boot server discovery.
static int efi_pxe_tftp_deliver(struct efi_pxe *pxe, struct io_buffer *iobuf, struct xfer_metadata *meta)
Receive new PXE (M)TFTP download data.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define container_of(ptr, type, field)
Get containing structure.
static EFI_STATUS EFIAPI efi_apple_get_response(EFI_PXE_BASE_CODE_PACKET *packet, UINTN *len, VOID *data)
Get DHCP/BSDP response.
static EFI_STATUS EFIAPI efi_pxe_udp_write(EFI_PXE_BASE_CODE_PROTOCOL *base, UINT16 flags, EFI_IP_ADDRESS *dest_ip, EFI_PXE_BASE_CODE_UDP_PORT *dest_port, EFI_IP_ADDRESS *gateway, EFI_IP_ADDRESS *src_ip, EFI_PXE_BASE_CODE_UDP_PORT *src_port, UINTN *hdr_len, VOID *hdr, UINTN *len, VOID *data)
Transmit UDP packet.
16-byte buffer aligned on a 4-byte boundary.
#define list_for_each_entry(pos, head, member)
Iterate over entries in a list.
#define __unused
Declare a variable or data structure as unused.
#define list_add_tail(new, head)
Add a new entry to the tail of a list.
const char *(* ntoa)(const void *net_addr)
Transcribe network-layer address.
struct tcpip_net_protocol * tcpip_net_protocol(sa_family_t sa_family)
Find TCP/IP network-layer protocol.
UDP_PORT_t src_port
Source UDP port.
uint16_t se_port
TCP/IP port (part of struct sockaddr_tcpip)
BOOLEAN PxeBisReplyReceived
EFI_PXE_BASE_CODE_PACKET PxeBisReply
void efi_nullify_pxe(EFI_PXE_BASE_CODE_PROTOCOL *pxe)
Nullify PXE base code protocol.
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_DEST_IP
static int efi_pxe_buf_realloc(struct xfer_buffer *xferbuf __unused, size_t len __unused)
Reallocate PXE data transfer buffer.
static struct net_device * netdev
uint16_t sa_family_t
A socket address family.
struct net_protocol * net_protocol
Network-layer protocol.
Transport-network layer interface.
UINT16 EFI_PXE_BASE_CODE_UDP_PORT
static void efi_pxe_udp_scheduled_close(struct efi_pxe *pxe)
Scheduled close of UDP interface.
int udp_open_promisc(struct interface *xfer)
Open a promiscuous UDP connection.
static struct interface_operation efi_pxe_tftp_operations[]
PXE file data transfer interface operations.
#define list_for_each_entry_safe(pos, tmp, head, member)
Iterate over entries in a list, safe against deletion of the current entry.
#define EINPROGRESS
Operation in progress.
void process_add(struct process *process)
Add process to process list.
const char * efi_handle_name(EFI_HANDLE handle)
Get name of an EFI handle.
Generalized socket address structure.
An object interface descriptor.
int efi_pxe_install(EFI_HANDLE handle, struct net_device *netdev)
Install PXE base code protocol.
struct xfer_buffer_operations * op
Data transfer buffer operations.
static EFI_APPLE_NET_BOOT_PROTOCOL efi_apple_net_boot_protocol
Apple NetBoot protocol.
#define ERANGE
Result too large.
char * strerror(int errno)
Retrieve string representation of error number.
static void efi_pxe_udp_schedule_close(struct efi_pxe *pxe)
Schedule close of UDP interface.
static void(* free)(struct refcnt *refcnt))
static struct xfer_buffer_operations efi_pxe_buf_operations
PXE data transfer buffer operations.
void * zalloc(size_t size)
Allocate cleared memory.
sa_family_t sa_family
Network address family.
UINT64 Revision
The revision of the EFI_PXE_BASE_CODE_PROTOCOL.
struct net_protocol * net
Network-layer protocol.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_PORT
IP4_t dest_ip
Destination IP address.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
#define DEFAULT_TTL
Default IP TTL and ToS.
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces
long int random(void)
Generate a pseudo-random number between 0 and 2147483647L or 2147483562?
static void efi_snp_release(void)
Release network devices for use via SNP.
int xfer_deliver(struct interface *intf, struct io_buffer *iobuf, struct xfer_metadata *meta)
Deliver datagram.
IP4_t ip
Destination IP address.
static int efi_pxe_udp_deliver(struct efi_pxe *pxe, struct io_buffer *iobuf, struct xfer_metadata *meta)
Receive UDP packet.
static const char * socket_family_name(int family)
Name address family.
Data transfer interface opening.
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_MAY_FRAGMENT
UINT64 UINTN
Unsigned value of native width.
static struct interface_operation efi_pxe_udp_operations[]
PXE UDP interface operations.
IP Receive Filter structure.
static struct interface_descriptor efi_pxe_udp_desc
PXE UDP interface descriptor.
static struct net_device * netdev_get(struct net_device *netdev)
Get reference to network device.
static void process_init_stopped(struct process *process, struct process_descriptor *desc, struct refcnt *refcnt)
Initialise process without adding to process list.
static void efi_pxe_fake_all(struct efi_pxe *pxe)
Construct fake DHCP packets.
static EFI_STATUS EFIAPI efi_pxe_mtftp(EFI_PXE_BASE_CODE_PROTOCOL *base, EFI_PXE_BASE_CODE_TFTP_OPCODE opcode, VOID *data, BOOLEAN overwrite, UINT64 *len, UINTN *blksize, EFI_IP_ADDRESS *ip, UINT8 *filename, EFI_PXE_BASE_CODE_MTFTP_INFO *info, BOOLEAN callback)
Perform (M)TFTP.
#define VOID
Undeclared type.
unsigned long long UINT64
static void efi_pxe_tftp_close(struct efi_pxe *pxe, int rc)
Close PXE (M)TFTP download interface.
struct tcpip_net_protocol * tcpip
TCP/IP network-layer protocol.
static int process_running(struct process *process)
Check if process is running.
BOOLEAN ProxyOfferReceived
A network-layer protocol.
struct interface tftp
(M)TFTP download interface
Network device management.
EFI_PXE_BASE_CODE_PACKET DhcpDiscover
Discover() information override structure.
#define EFI_PXE_BASE_CODE_IP_FILTER_STATION_IP
void dhcppkt_init(struct dhcp_packet *dhcppkt, struct dhcphdr *data, size_t len)
Initialise DHCP packet.
static uint16_t struct vmbus_xfer_pages_operations * op
#define INIT_LIST_HEAD(list)
Initialise a list head.
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
EFI_GUID efi_apple_net_boot_protocol_guid
Apple NetBoot protocol GUID.
char name[NETDEV_NAME_LEN]
Name of this network device.
#define EFI_PXE_BASE_CODE_UDP_OPFLAGS_ANY_SRC_IP
struct list_head list
List of which this buffer is a member.
EFI_PXE_BASE_CODE_PACKET DhcpAck
struct process process
UDP interface closer process.
uint8_t net_addr_len
Network-layer address length.
#define EFI_SUCCESS
Enumeration of EFI_STATUS.
void * data
Start of data.
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
static size_t dhcppkt_len(struct dhcp_packet *dhcppkt)
Get used length of DHCP packet.
void step(void)
Single-step a single process.
int(* realloc)(struct xfer_buffer *xferbuf, size_t len)
Reallocate data buffer.
struct list_head queue
List of received UDP packets.
static int efi_pxe_udp_open(struct efi_pxe *pxe)
Open UDP interface.
BOOLEAN DhcpDiscoverValid
if(len >=6 *4) __asm__ __volatile__("movsl" if(len >=5 *4) __asm__ __volatile__("movsl" if(len >=4 *4) __asm__ __volatile__("movsl" if(len >=3 *4) __asm__ __volatile__("movsl" if(len >=2 *4) __asm__ __volatile__("movsl" if(len >=1 *4) __asm__ __volatile__("movsl" if((len % 4) >=2) __asm__ __volatile__("movsw" if((len % 2) >=1) __asm__ __volatile__("movsb" return dest
uint8_t data[48]
Additional event data.
EFI_PXE_BASE_CODE_TFTP_OPCODE
TFTP opcode definitions.
#define IN6_IS_ADDR_MULTICAST(addr)
EFI_PXE_BASE_CODE_IP_FILTER IpFilter
A Uniform Resource Identifier.
static BOOLEAN efi_pxe_fake(struct efi_pxe *pxe, int(*fake)(struct net_device *netdev, void *data, size_t len), EFI_PXE_BASE_CODE_PACKET *packet)
Construct fake DHCP packet and flag.
#define DHCP_END
End of options.
Network interface management.
uint16_t offset
Offset to command line.
A network-layer protocol of the TCP/IP stack (eg.
uint32_t blksize
Cipher block size.
uint16_t se_scope_id
Scope ID (part of struct sockaddr_tcpip)
#define IN_IS_MULTICAST(addr)
EFI_SYSTEM_TABLE * efi_systab
typeof(acpi_finder=acpi_find)
ACPI table finder.
char pad[sizeof(struct sockaddr) -(sizeof(sa_family_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(uint16_t)+sizeof(EFI_IP_ADDRESS))]
Padding.
void efi_nullify_apple(EFI_APPLE_NET_BOOT_PROTOCOL *apple)
Nullify Apple Net Boot protocol.
EFI_PXE_BASE_CODE_MODE * Mode
The pointer to the EFI_PXE_BASE_CODE_MODE data for this device.
#define DBG(...)
Print a debugging message.
The EFI_PXE_BASE_CODE_PROTOCOL is used to control PXE-compatible devices.
static void intf_init(struct interface *intf, struct interface_descriptor *desc, struct refcnt *refcnt)
Initialise an object interface.
int overwrite(const WINDOW *, WINDOW *)
static void efi_pxe_free(struct refcnt *refcnt)
Free PXE base code.
static void efi_pxe_udp_close(struct efi_pxe *pxe, int rc)
Close UDP interface.
int iob_ensure_headroom(struct io_buffer *iobuf, size_t len)
Ensure I/O buffer has sufficient headroom.
sa_family_t se_family
Socket address family (part of struct sockaddr)
EFI_PXE_BASE_CODE_PACKET PxeDiscover
int netdev_configuration_ok(struct net_device *netdev)
Check if network device has at least one successful configuration.
static EFI_STATUS EFIAPI efi_pxe_stop(EFI_PXE_BASE_CODE_PROTOCOL *base)
Stop PXE base code.
int memcmp(const void *first, const void *second, size_t len)
Compare memory regions.
#define NULL
NULL pointer (VOID *)
EFI_PXE_BASE_CODE_PACKET ProxyOffer
static EFI_PXE_BASE_CODE_PROTOCOL efi_pxe_base_code_protocol
PXE base code protocol.
#define ETIMEDOUT
Connection timed out.
int create_fakepxebsack(struct net_device *netdev, void *data, size_t max_len)
Create fake PXE Boot Server ACK packet.
#define AF_INET
IPv4 Internet addresses.
#define EFIRC(rc)
Convert an iPXE status code to an EFI status code.
#define ref_put(refcnt)
Drop reference to object.
void * memset(void *dest, int character, size_t len) __nonnull
int efi_shutdown_in_progress
EFI shutdown is in progress.