eapol.c File Reference

802.1X Extensible Authentication Protocol over LANs demultiplexer More...

#include <gpxe/netdevice.h>
#include <gpxe/iobuf.h>
#include <gpxe/if_ether.h>
#include <gpxe/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_source)
 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_source 
) [static]

Receive EAPOL network-layer packet.

Parameters:
iob I/O buffer
netdev Network device
ll_source Link-layer source address
This function takes ownership of the I/O buffer passed to it.

Definition at line 43 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.

00045 {
00046         struct eapol_frame *eapol = iob->data;
00047         struct eapol_handler *handler;
00048 
00049         if ( iob_len ( iob ) < EAPOL_HDR_LEN ) {
00050                 free_iob ( iob );
00051                 return -EINVAL;
00052         }
00053 
00054         for_each_table_entry ( handler, EAPOL_HANDLERS ) {
00055                 if ( handler->type == eapol->type ) {
00056                         iob_pull ( iob, EAPOL_HDR_LEN );
00057                         return handler->rx ( iob, netdev, ll_source );
00058                 }
00059         }
00060 
00061         free_iob ( iob );
00062         return -( ENOTSUP | ( ( eapol->type & 0x1f ) << 8 ) );
00063 }

static const char* eapol_ntoa ( const void *net_addr  __unused  )  [static]

Transcribe EAPOL network-layer address.

Parameters:
net_addr Network-layer address
Return values:
str String representation of network-layer address
EAPOL doesn't have network-layer addresses, so we just return the string "<EAPOL>".

Definition at line 74 of file eapol.c.

00075 {
00076         return "<EAPOL>";
00077 }


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 80 of file eapol.c.


Generated on Tue Apr 6 20:01:55 2010 for gPXE by  doxygen 1.5.7.1