#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. | |
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_source | |||
| ) | [static] |
Receive EAPOL network-layer packet.
| iob | I/O buffer | |
| netdev | Network device | |
| ll_source | Link-layer source address |
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] |
| struct net_protocol eapol_protocol __net_protocol |
Initial value:
{
.name = "EAPOL",
.rx = eapol_rx,
.ntoa = eapol_ntoa,
.net_proto = htons ( ETH_P_EAPOL ),
}
AoE protocol.
1.5.7.1