peapod
0.1.0
EAPOL Proxy Daemon
|
Process an EAPOL packet. More...
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include "args.h"
#include "b64enc.h"
#include "log.h"
#include "packet.h"
#include "peapod.h"
#include "process.h"
Functions | |
static void | script (struct peapod_packet packet, char *script) |
Execute a script. More... | |
int | process_filter (struct peapod_packet packet) |
Determine if an EAPOL packet should be filtered (dropped) More... | |
void | process_script (struct peapod_packet packet) |
A wrapper for script() More... | |
Variables | |
struct args_t | args |
Program arguments data structure. More... | |
char ** | environ |
uint8_t * | mpdu_buf |
The EAPOL MPDU. More... | |
int | mpdu_buf_size |
Normally 1502 bytes. More... | |
Process an EAPOL packet.
|
static |
Execute a script.
The script is run with several environment variables set containing at least the entire Base64-encoded Ethernet frame encapsulating an EAPOL packet at the time of capture on an ingress interface, the entire frame that is being sent (if applicable) on an egress interface (which may differ from the original in its 802.1Q tag), and associated metadata extracted from packet
.
packet | A struct peapod_packet representing an EAPOL packet |
script | Path of the script to be executed |
env.sh
example script for a listing of the possible environment variables and their values int process_filter | ( | struct peapod_packet | packet | ) |
Determine if an EAPOL packet should be filtered (dropped)
packet
should contain enough information to determine whether an ingress or egress filter should be applied.
packet | A struct peapod_packet representing an EAPOL packet |
void process_script | ( | struct peapod_packet | packet | ) |
A wrapper for script()
packet
should contain enough information to determine whether an ingress or egress script should be executed, upon which script()
is called with the appropriate parameters extracted from packet
.
packet | A struct peapod_packet representing an EAPOL packet |
struct args_t args |
Program arguments data structure.
char** environ |
uint8_t* mpdu_buf |
The EAPOL MPDU.
Points to byte 16 of the main EAPOL packet buffer, and thereby to the EAPOL EtherType (0x888e) followed by the MTU (normally up to 1500 bytes).
int mpdu_buf_size |
Normally 1502 bytes.