48 0x01, 0x80, 0xc2, 0x00, 0x00, 0x03
62 const void *ll_dest
__unused,
const void *ll_source,
76 DBGC (
netdev,
"EAPOL %s is not an EAPoL device\n",
84 if (
iob_len ( iobuf ) <
sizeof ( *eapol ) ) {
85 DBGC (
netdev,
"EAPOL %s underlength header:\n",
92 remaining = (
iob_len ( iobuf ) -
sizeof ( *eapol ) );
94 if (
len > remaining ) {
95 DBGC (
netdev,
"EAPOL %s v%d type %d len %zd underlength " 108 if ( handler->
type == eapol->
type ) {
114 DBGC (
netdev,
"EAPOL %s v%d type %d unsupported\n",
148 eapol =
iob_pull ( iobuf,
sizeof ( *eapol ) );
153 DBGC (
netdev,
"EAPOL %s v%d EAP failed: %s\n",
161 if ( timer_running ( &supplicant->
timer ) ) {
170 supplicant->
count = 0;
194 const void *
data,
size_t len ) {
207 eapol =
iob_put ( iobuf,
sizeof ( *eapol ) );
218 DBGC (
netdev,
"EAPOL %s could not transmit type %d: %s\n",
308 if ( timer_running ( &supplicant->
timer ) ) {
318 if ( timer_running ( &supplicant->
timer ) )
327 supplicant->
count = 0;
#define iob_pull(iobuf, len)
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
const char * name
Protocol name.
struct net_driver eapol_driver __net_driver
EAPoL driver.
#define iob_put(iobuf, len)
static void start_timer_nodelay(struct retry_timer *timer)
Start timer with no delay.
struct net_protocol eapol_protocol __net_protocol
EAPoL protocol.
static int eapol_eap_rx(struct eapol_supplicant *supplicant, struct io_buffer *iobuf, const void *ll_source __unused)
Process EAPoL-encapsulated EAP packet.
static int eapol_eap_tx(struct eap_supplicant *eap, const void *data, size_t len)
Transmit EAPoL-encapsulated EAP packet.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
uint32_t type
Operating system type.
#define EAPOL_START_INTERVAL
Delay between EAPoL-Start packets.
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.
static void eapol_expired(struct retry_timer *timer, int fail __unused)
(Re)transmit EAPoL-Start packet
int eap_rx(struct eap_supplicant *supplicant, const void *data, size_t len)
Handle EAP packet.
#define EAPOL_HANDLERS
EAPoL handler table.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
A network upper-layer driver.
Address Resolution Protocol constants and types.
#define ENOTSUP
Operation not supported.
static const uint8_t eapol_mac[ETH_ALEN]
EAPoL destination MAC address.
#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 netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define container_of(ptr, type, field)
Get containing structure.
void * netdev_priv(struct net_device *netdev, struct net_driver *driver)
Get network device driver private data.
#define __unused
Declare a variable or data structure as unused.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
struct eap_supplicant eap
EAP supplicant.
static struct net_device * netdev
#define EAP_FL_PASSIVE
EAP supplicant is passive.
#define MAX_LL_HEADER_LEN
Maximum length of a link-layer header.
Extensible Authentication Protocol over LAN (EAPoL)
#define EAP_FL_ONGOING
EAP authentication is in progress.
static void eapol_notify(struct net_device *netdev, void *priv)
Handle EAPoL supplicant state change.
#define iob_unput(iobuf, len)
char * strerror(int errno)
Retrieve string representation of error number.
struct refcnt refcnt
Reference counter.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define EAPOL_VERSION_2001
802.1X-2001
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
#define EAPOL_TYPE_EAP
EAPoL-encapsulated EAP packets.
#define EAPOL_TYPE_START
EAPoL start.
int(* rx)(struct eapol_supplicant *supplicant, struct io_buffer *iobuf, const void *ll_source)
Process received packet.
uint16_t ll_proto
Link-layer protocol.
A network-layer protocol.
Network device management.
void start_timer_fixed(struct retry_timer *timer, unsigned long timeout)
Start timer with a specified timeout.
#define iob_reserve(iobuf, len)
void stop_timer(struct retry_timer *timer)
Stop timer.
char name[NETDEV_NAME_LEN]
Name of this network device.
int(* tx)(struct eap_supplicant *supplicant, const void *data, size_t len)
Transmit EAP response.
int net_tx(struct io_buffer *iobuf, struct net_device *netdev, struct net_protocol *net_protocol, const void *ll_dest, const void *ll_source)
Transmit network-layer packet.
static struct tlan_private * priv
#define ENOTTY
Inappropriate I/O control operation.
struct retry_timer timer
EAPoL-Start retransmission timer.
void * data
Start of data.
static int eapol_probe(struct net_device *netdev, void *priv)
Create EAPoL supplicant.
#define EAP_WAIT_TIMEOUT
EAP protocol wait timeout.
uint8_t data[48]
Additional event data.
unsigned int count
EAPoL-Start transmission count.
struct net_device * netdev
Network device.
#define EAPOL_START_COUNT
Maximum number of EAPoL-Start packets to transmit.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
static unsigned int vlan_tag(struct net_device *netdev)
Get the VLAN tag.
#define ARPHRD_ETHER
Ethernet 10Mbps.
#define NULL
NULL pointer (VOID *)
static int eapol_tx(struct eapol_supplicant *supplicant, unsigned int type, const void *data, size_t len)
Transmit EAPoL packet.
struct eapol_handler eapol_eap __eapol_handler
EAPoL handler for EAP packets.
struct ll_protocol * ll_protocol
Link-layer protocol.
Extensible Authentication Protocol.