iPXE
eapol.h
Go to the documentation of this file.
1#ifndef _IPXE_EAPOL_H
2#define _IPXE_EAPOL_H
3
4/** @file
5 *
6 * Extensible Authentication Protocol over LAN (EAPoL)
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11FILE_SECBOOT ( PERMITTED );
12
13#include <stdint.h>
14#include <ipxe/netdevice.h>
15#include <ipxe/tables.h>
16#include <ipxe/eap.h>
17
18/** EAPoL header */
20 /** Version */
22 /** Type */
24 /** Payload length */
26} __attribute__ (( packed ));
27
28/** 802.1X-2001 */
29#define EAPOL_VERSION_2001 1
30
31/** EAPoL-encapsulated EAP packets */
32#define EAPOL_TYPE_EAP 0
33
34/** EAPoL start */
35#define EAPOL_TYPE_START 1
36
37/** EAPoL key */
38#define EAPOL_TYPE_KEY 5
39
40/** An EAPoL supplicant */
42 /** EAP supplicant */
44 /** EAPoL-Start retransmission timer */
46 /** EAPoL-Start transmission count */
47 unsigned int count;
48};
49
50/** Delay between EAPoL-Start packets */
51#define EAPOL_START_INTERVAL ( 2 * TICKS_PER_SEC )
52
53/** Maximum number of EAPoL-Start packets to transmit */
54#define EAPOL_START_COUNT 3
55
56/** An EAPoL handler */
58 /** Type */
60 /**
61 * Process received packet
62 *
63 * @v supplicant EAPoL supplicant
64 * @v iobuf I/O buffer
65 * @v ll_source Link-layer source address
66 * @ret rc Return status code
67 *
68 * This method takes ownership of the I/O buffer.
69 */
70 int ( * rx ) ( struct eapol_supplicant *supplicant,
71 struct io_buffer *iobuf, const void *ll_source );
72};
73
74/** EAPoL handler table */
75#define EAPOL_HANDLERS __table ( struct eapol_handler, "eapol_handlers" )
76
77/** Declare an EAPoL handler */
78#define __eapol_handler __table_entry ( EAPOL_HANDLERS, 01 )
79
80extern struct net_protocol eapol_protocol __net_protocol;
81
82#endif /* _IPXE_EAPOL_H */
unsigned short uint16_t
Definition stdint.h:11
unsigned char uint8_t
Definition stdint.h:10
Extensible Authentication Protocol.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
#define __attribute__(x)
Definition compiler.h:10
Network device management.
#define __net_protocol
Declare a network-layer protocol.
Definition netdevice.h:474
An EAP supplicant.
Definition eap.h:139
An EAPoL handler.
Definition eapol.h:57
int(* rx)(struct eapol_supplicant *supplicant, struct io_buffer *iobuf, const void *ll_source)
Process received packet.
Definition eapol.h:70
uint8_t type
Type.
Definition eapol.h:59
EAPoL header.
Definition eapol.h:19
uint8_t version
Version.
Definition eapol.h:21
uint8_t type
Type.
Definition eapol.h:23
uint16_t len
Payload length.
Definition eapol.h:25
An EAPoL supplicant.
Definition eapol.h:41
unsigned int count
EAPoL-Start transmission count.
Definition eapol.h:47
struct eap_supplicant eap
EAP supplicant.
Definition eapol.h:43
struct retry_timer timer
EAPoL-Start retransmission timer.
Definition eapol.h:45
A persistent I/O buffer.
Definition iobuf.h:38
A network-layer protocol.
Definition netdevice.h:65
A retry timer.
Definition retry.h:22
Linker tables.