iPXE
|
Extensible Authentication Protocol over LAN (EAPoL) More...
#include <assert.h>
#include <errno.h>
#include <byteswap.h>
#include <ipxe/iobuf.h>
#include <ipxe/if_ether.h>
#include <ipxe/if_arp.h>
#include <ipxe/netdevice.h>
#include <ipxe/vlan.h>
#include <ipxe/retry.h>
#include <ipxe/eap.h>
#include <ipxe/eapol.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | eapol_rx (struct io_buffer *iobuf, struct net_device *netdev, const void *ll_dest __unused, const void *ll_source, unsigned int flags __unused) |
Process EAPoL packet. More... | |
static int | eapol_eap_rx (struct eapol_supplicant *supplicant, struct io_buffer *iobuf, const void *ll_source __unused) |
Process EAPoL-encapsulated EAP packet. More... | |
static int | eapol_tx (struct eapol_supplicant *supplicant, unsigned int type, const void *data, size_t len) |
Transmit EAPoL packet. More... | |
static int | eapol_eap_tx (struct eap_supplicant *eap, const void *data, size_t len) |
Transmit EAPoL-encapsulated EAP packet. More... | |
static void | eapol_expired (struct retry_timer *timer, int fail __unused) |
(Re)transmit EAPoL-Start packet More... | |
static int | eapol_probe (struct net_device *netdev, void *priv) |
Create EAPoL supplicant. More... | |
static void | eapol_notify (struct net_device *netdev, void *priv) |
Handle EAPoL supplicant state change. More... | |
Variables | |
struct net_driver eapol_driver | __net_driver |
EAPoL driver. More... | |
static const uint8_t | eapol_mac [ETH_ALEN] |
EAPoL destination MAC address. More... | |
struct net_protocol eapol_protocol | __net_protocol |
EAPoL protocol. More... | |
struct eapol_handler eapol_eap | __eapol_handler |
EAPoL handler for EAP packets. More... | |
Extensible Authentication Protocol over LAN (EAPoL)
Definition in file eapol.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Process EAPoL packet.
iobuf | I/O buffer |
netdev | Network device |
ll_dest | Link-layer destination address |
ll_source | Link-layer source address |
flags | Packet flags |
rc | Return status code |
Definition at line 61 of file eapol.c.
References io_buffer::data, DBGC, DBGC_HDA, eapol_supplicant::eap, EAPOL_HANDLERS, EINVAL, ENOTSUP, ENOTTY, for_each_table_entry, free_iob(), iob_disown, iob_len(), iob_unput, len, eapol_header::len, net_device::name, netdev, eap_supplicant::netdev, netdev_priv(), ntohs, rc, eapol_handler::rx, eapol_header::type, eapol_handler::type, and eapol_header::version.
|
static |
Process EAPoL-encapsulated EAP packet.
supplicant | EAPoL supplicant |
ll_source | Link-layer source address |
rc | Return status code |
Definition at line 137 of file eapol.c.
References assert(), eapol_supplicant::count, io_buffer::data, DBGC, eapol_supplicant::eap, EAP_FL_ONGOING, EAP_FL_PASSIVE, eap_rx(), EAP_WAIT_TIMEOUT, eap_supplicant::flags, free_iob(), iob_len(), iob_pull, net_device::name, netdev, eap_supplicant::netdev, rc, start_timer_fixed(), stop_timer(), strerror(), eapol_supplicant::timer, and eapol_header::version.
|
static |
Transmit EAPoL packet.
supplicant | EAPoL supplicant |
type | Packet type |
data | Packet body |
len | Length of packet body |
rc | Return status code |
Definition at line 193 of file eapol.c.
References alloc_iob(), data, DBGC, DBGC_HDA, eapol_supplicant::eap, eapol_mac, EAPOL_VERSION_2001, ENOMEM, htons, iob_disown, iob_put, iob_reserve, len, eapol_header::len, net_device::ll_addr, MAX_LL_HEADER_LEN, memcpy(), net_device::name, net_tx(), netdev, eap_supplicant::netdev, rc, strerror(), type, eapol_header::type, and eapol_header::version.
Referenced by eapol_eap_tx(), and eapol_expired().
|
static |
Transmit EAPoL-encapsulated EAP packet.
supplicant | EAPoL supplicant |
ll_source | Link-layer source address |
rc | Return status code |
Definition at line 234 of file eapol.c.
References container_of, data, eapol_supplicant::eap, eapol_tx(), EAPOL_TYPE_EAP, and len.
Referenced by eapol_probe().
|
static |
(Re)transmit EAPoL-Start packet
timer | EAPoL-Start timer |
expired | Failure indicator |
Definition at line 249 of file eapol.c.
References container_of, eapol_supplicant::count, DBGC, DBGC2, eapol_supplicant::eap, EAPOL_START_COUNT, EAPOL_START_INTERVAL, eapol_tx(), EAPOL_TYPE_START, net_device::name, netdev, eap_supplicant::netdev, NULL, and start_timer_fixed().
Referenced by eapol_probe().
|
static |
Create EAPoL supplicant.
netdev | Network device |
priv | Private data |
rc | Return status code |
Definition at line 275 of file eapol.c.
References ARPHRD_ETHER, eapol_supplicant::eap, eapol_eap_tx(), eapol_expired(), htons, ll_protocol::ll_proto, net_device::ll_protocol, netdev, eap_supplicant::netdev, priv, net_device::refcnt, eapol_supplicant::timer, eap_supplicant::tx, and vlan_tag().
|
static |
Handle EAPoL supplicant state change.
netdev | Network device |
priv | Private data |
Definition at line 299 of file eapol.c.
References eapol_supplicant::count, DBGC, eapol_supplicant::eap, EAP_FL_PASSIVE, eap_supplicant::flags, net_device::name, netdev, eap_supplicant::netdev, netdev_is_open(), netdev_link_ok(), priv, start_timer_nodelay(), stop_timer(), and eapol_supplicant::timer.
struct net_driver eapol_driver __net_driver |
EAPoL driver.
EAPoL destination MAC address.
Definition at line 47 of file eapol.c.
Referenced by eapol_tx().
struct net_protocol eapol_protocol __net_protocol |
EAPoL protocol.
AoE protocol.
struct eapol_handler eapol_eap __eapol_handler |
EAPoL handler for EAP packets.