Function prototypes for iface.c
.
More...
Go to the source code of this file.
Function prototypes for iface.c
.
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
-
ifaces | Pointer to a list of struct iface_t structures representing network interfaces |
epfd | File 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
-
ifaces | Pointer 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
-
iface | Pointer to a struct iface_t representing an interface |
src_mac | Pointer 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
-
mac | Pointer 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)