iPXE
|
802.1X Extensible Authentication Protocol over LANs demultiplexer More...
#include <ipxe/netdevice.h>
#include <ipxe/iobuf.h>
#include <ipxe/if_ether.h>
#include <ipxe/eapol.h>
#include <errno.h>
#include <byteswap.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER) | |
static int | eapol_rx (struct io_buffer *iob, struct net_device *netdev, const void *ll_dest, const void *ll_source, unsigned int flags __unused) |
Receive EAPOL network-layer packet. | |
static const char * | eapol_ntoa (const void *net_addr __unused) |
Transcribe EAPOL network-layer address. | |
Variables | |
struct net_protocol eapol_protocol | __net_protocol |
EAPOL network protocol. |
802.1X Extensible Authentication Protocol over LANs demultiplexer
Definition in file eapol.c.
FILE_LICENCE | ( | GPL2_OR_LATER | ) |
static int eapol_rx | ( | struct io_buffer * | iob, |
struct net_device * | netdev, | ||
const void * | ll_dest, | ||
const void * | ll_source, | ||
unsigned int flags | __unused | ||
) | [static] |
Receive EAPOL network-layer packet.
iob | I/O buffer |
netdev | Network device |
ll_dest | Link-layer destination address |
ll_source | Link-layer source address |
flags | Packet flags |
This function takes ownership of the I/O buffer passed to it.
Definition at line 46 of file eapol.c.
References io_buffer::data, EAPOL_HANDLERS, EAPOL_HDR_LEN, EINVAL, ENOTSUP, for_each_table_entry, free_iob(), iob_len(), iob_pull, eapol_handler::rx, eapol_frame::type, and eapol_handler::type.
{ struct eapol_frame *eapol = iob->data; struct eapol_handler *handler; if ( iob_len ( iob ) < EAPOL_HDR_LEN ) { free_iob ( iob ); return -EINVAL; } for_each_table_entry ( handler, EAPOL_HANDLERS ) { if ( handler->type == eapol->type ) { iob_pull ( iob, EAPOL_HDR_LEN ); return handler->rx ( iob, netdev, ll_dest, ll_source ); } } free_iob ( iob ); return -( ENOTSUP | ( ( eapol->type & 0x1f ) << 8 ) ); }
static const char* eapol_ntoa | ( | const void *net_addr | __unused | ) | [static] |
struct net_protocol eapol_protocol __net_protocol |
{ .name = "EAPOL", .rx = eapol_rx, .ntoa = eapol_ntoa, .net_proto = htons ( ETH_P_EAPOL ), }
EAPOL network protocol.
AoE protocol.