iPXE
Functions | Variables
eapol.c File Reference

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.

Detailed Description

802.1X Extensible Authentication Protocol over LANs demultiplexer

Definition in file eapol.c.


Function Documentation

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.

Parameters:
iobI/O buffer
netdevNetwork device
ll_destLink-layer destination address
ll_sourceLink-layer source address
flagsPacket 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]

Transcribe EAPOL network-layer address.

Parameters:
net_addrNetwork-layer address
Return values:
strString representation of network-layer address

EAPOL doesn't have network-layer addresses, so we just return the string "<EAPOL>".

Definition at line 77 of file eapol.c.

{
        return "<EAPOL>";
}

Variable Documentation

struct net_protocol eapol_protocol __net_protocol
Initial value:
 {
        .name = "EAPOL",
        .rx = eapol_rx,
        .ntoa = eapol_ntoa,
        .net_proto = htons ( ETH_P_EAPOL ),
}

EAPOL network protocol.

AoE protocol.

Definition at line 83 of file eapol.c.