peapod  0.1.0
EAPOL Proxy Daemon
Functions
iface.h File Reference

Function prototypes for iface.c. More...

#include "parser.h"
Include dependency graph for iface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int iface_init (struct iface_t *ifaces, int epfd)
 Create raw sockets for interfaces in a list and add them to an epoll instance. More...
 
int iface_count (struct iface_t *ifaces)
 Count number of items in a list of struct iface_t. More...
 
void iface_reset_flags (struct iface_t *iface)
 
int iface_set_flags (struct iface_t *iface)
 
int iface_set_mac (struct iface_t *iface, u_char *src_mac)
 Set the MAC address of a network interface. More...
 
char * iface_strmac (u_char *mac)
 Convert a MAC address to a string. More...
 

Detailed Description

Function prototypes for iface.c.

Function Documentation

int iface_init ( struct iface_t ifaces,
int  epfd 
)

Create raw sockets for interfaces in a list and add them to an epoll instance.

Also set interface MAC if set-mac was specified in the config file.

Parameters
ifacesPointer to a list of struct iface_t structures representing network interfaces
epfdFile descriptor for an epoll instance
Returns
The number of interfaces added to epoll
int iface_count ( struct iface_t ifaces)

Count number of items in a list of struct iface_t.

Parameters
ifacesPointer to a list of struct iface_t structures representing network interfaces
Returns
The length of the list
void iface_reset_flags ( struct iface_t iface)
int iface_set_flags ( struct iface_t iface)
int iface_set_mac ( struct iface_t iface,
u_char *  src_mac 
)

Set the MAC address of a network interface.

Parameters
ifacePointer to a struct iface_t representing an interface
src_macPointer to ETH_ALEN bytes containing a MAC address
Returns
0 if successful, or -1 if unsuccessful
Note
Brings the interface down and back up, invalidating all sockets on it
char* iface_strmac ( u_char *  mac)

Convert a MAC address to a string.

Parameters
macPointer to ETH_ALEN bytes containing a MAC address
Returns
Static buffer containing mac converted to a human-readable, colon-delimited MAC address
Note
Like ether_ntoa(3)
See also
ether_ntoa(3)