peapod
0.1.0
EAPOL Proxy Daemon
|
Function prototypes for packet.c
, EAPOL/EAP data structures.
More...
Go to the source code of this file.
Data Structures | |
struct | packet_auxdata_t |
A redefinition of struct tpacket_auxdata from <linux/if_packet.h> . More... | |
struct | eapol_eap |
EAPOL-EAP (EAP Packet) format. More... | |
struct | eapol_key |
EAPOL-Key (Key Descriptor) format. More... | |
struct | eapol_mpdu |
EAPOL MAC Protocol Data Unit (MPDU) format. More... | |
struct | peapod_packet |
Represents an EAPOL packet with some metadata already extracted. More... | |
struct | decode_t |
Matches a single-byte value with a description. More... | |
Macros | |
EAPOL Packet Types | |
| |
#define | EAPOL_EAP 0 |
#define | EAPOL_START 1 |
#define | EAPOL_LOGOFF 2 |
#define | EAPOL_KEY 3 |
#define | EAPOL_ENCAPSULATED_ASF_ALERT 4 |
#define | EAPOL_MKA 5 |
#define | EAPOL_ANNOUNCEMENT_GENERIC 6 |
#define | EAPOL_ANNOUNCEMENT_SPECIFIC 7 |
#define | EAPOL_ANNOUNCEMENT_REQ 8 |
EAP Code | |
| |
#define | EAP_CODE_REQUEST 1 |
#define | EAP_CODE_RESPONSE 2 |
#define | EAP_CODE_SUCCESS 3 |
#define | EAP_CODE_FAILURE 4 |
EAP-Request/Response Type | |
These apply if the EAP packet has Code of either Request or Response.
| |
#define | EAP_TYPE_IDENTITY 1 |
#define | EAP_TYPE_NOTIFICATION 2 |
#define | EAP_TYPE_NAK 3 |
#define | EAP_TYPE_MD5_CHALLENGE 4 |
#define | EAP_TYPE_OTP 5 |
#define | EAP_TYPE_GTC 6 |
#define | EAP_TYPE_TLS 13 |
#define | EAP_TYPE_SIM 18 |
#define | EAP_TYPE_TTLS 21 |
#define | EAP_TYPE_AKA_OLD 23 |
#define | EAP_TYPE_PEAP 25 |
#define | EAP_TYPE_MS_CHAP_V2 26 |
#define | EAP_TYPE_MS_CHAP_V2_OLD 29 |
#define | EAP_TYPE_FAST 43 |
#define | EAP_TYPE_IKEV2 49 |
#define | EAP_TYPE_EXPANDED_TYPES 254 |
#define | EAP_TYPE_EXPERIMENTAL_USE 255 |
EAPOL-Key Descriptor Type | |
| |
#define | EAPOL_KEY_TYPE_RC4 1 |
#define | EAPOL_KEY_TYPE_IEEE_80211 2 |
Functions | |
void | packet_init (struct iface_t *ifaces) |
Allocate the main buffer for the EAPOL packet. More... | |
uint8_t * | packet_buf (struct peapod_packet packet, uint8_t orig) |
Return a pointer to a raw EAPOL packet. More... | |
char * | packet_decode (uint8_t val, const struct decode_t *decode) |
Decode a byte in an EAPOL packet to a C string. More... | |
uint32_t | packet_tcitonl (struct tci_t tci) |
Convert a struct tci_t to a 4-byte 802.1Q tag. More... | |
int | packet_send (struct peapod_packet packet, struct iface_t *iface) |
Send an EAPOL packet on a network interface. More... | |
struct peapod_packet | packet_recvmsg (struct iface_t *iface) |
Receive an EAPOL packet on a network interface. More... | |
Variables | |
static const struct decode_t | eapol_types [] |
EAPOL Packet Type descriptions. More... | |
static const struct decode_t | eap_codes [] |
EAP Code descriptions. More... | |
static const struct decode_t | eap_types [] |
EAP-Request/Response Type descriptions. More... | |
static const struct decode_t | eapol_key_types [] |
Descriptions for EAPOL-Key Descriptor Type. More... | |
Function prototypes for packet.c
, EAPOL/EAP data structures.
#define EAPOL_EAP 0 |
#define EAPOL_START 1 |
#define EAPOL_LOGOFF 2 |
#define EAPOL_KEY 3 |
#define EAPOL_ENCAPSULATED_ASF_ALERT 4 |
#define EAPOL_MKA 5 |
#define EAPOL_ANNOUNCEMENT_GENERIC 6 |
#define EAPOL_ANNOUNCEMENT_SPECIFIC 7 |
#define EAPOL_ANNOUNCEMENT_REQ 8 |
#define EAP_CODE_REQUEST 1 |
#define EAP_CODE_RESPONSE 2 |
#define EAP_CODE_SUCCESS 3 |
#define EAP_CODE_FAILURE 4 |
#define EAP_TYPE_IDENTITY 1 |
#define EAP_TYPE_NOTIFICATION 2 |
#define EAP_TYPE_NAK 3 |
#define EAP_TYPE_MD5_CHALLENGE 4 |
#define EAP_TYPE_OTP 5 |
#define EAP_TYPE_GTC 6 |
#define EAP_TYPE_TLS 13 |
#define EAP_TYPE_SIM 18 |
#define EAP_TYPE_TTLS 21 |
#define EAP_TYPE_AKA_OLD 23 |
#define EAP_TYPE_PEAP 25 |
#define EAP_TYPE_MS_CHAP_V2 26 |
#define EAP_TYPE_MS_CHAP_V2_OLD 29 |
#define EAP_TYPE_FAST 43 |
#define EAP_TYPE_IKEV2 49 |
#define EAP_TYPE_EXPANDED_TYPES 254 |
#define EAP_TYPE_EXPERIMENTAL_USE 255 |
#define EAPOL_KEY_TYPE_RC4 1 |
#define EAPOL_KEY_TYPE_IEEE_80211 2 |
void packet_init | ( | struct iface_t * | ifaces | ) |
Allocate the main buffer for the EAPOL packet.
The size of the buffer is determined according to the highest MTU of the network interfaces used by the program.
ifaces | Pointer to a list of struct iface_t structures representing network interfaces |
valgrind
claims the memory allocated here is "possibly lost". Ignore it; we're "doing unusual things with pointers that could cause them to
point into the middle of an allocated block". Quite deliberately so. uint8_t* packet_buf | ( | struct peapod_packet | packet, |
uint8_t | orig | ||
) |
Return a pointer to a raw EAPOL packet.
Rewrites the first 16 bytes of the main packet buffer. The result shall point to the beginning of a raw EAPOL packet that is either:
The result may then be used by the caller to (hex)dump, Base64-encode, and/or send the packet.
packet | A struct peapod_packet representing an EAPOL packet |
orig | Flag: Reconstruct original packet as seen on ingress interface? |
char* packet_decode | ( | uint8_t | val, |
const struct decode_t * | decode | ||
) |
Decode a byte in an EAPOL packet to a C string.
The byte may be one of the following:
val | Value of the relevant byte to decode |
decode | Pointer to a struct decode_t matching field values with descriptions |
decode
. uint32_t packet_tcitonl | ( | struct tci_t | tci | ) |
int packet_send | ( | struct peapod_packet | packet, |
struct iface_t * | iface | ||
) |
Send an EAPOL packet on a network interface.
May execute an egress script.
packet | A struct peapod_packet representing an EAPOL packet |
iface | Pointer to a struct iface_t representing an interface |
struct peapod_packet packet_recvmsg | ( | struct iface_t * | iface | ) |
Receive an EAPOL packet on a network interface.
struct peapod_packet
representing an EAPOL packet with its len
field set to one of the following:
|
static |
EAPOL Packet Type descriptions.
|
static |
EAP Code descriptions.
|
static |
EAP-Request/Response Type descriptions.
The text of the descriptions is as stated in the relevant RFCs.
|
static |
Descriptions for EAPOL-Key Descriptor Type.