#include <netinet/in.h>
#include <netdb.h>
Go to the source code of this file.
Data Structures | |
union | addr_storage |
Functions | |
int | init_udp_socket () |
int | get_mac_by_dev (unsigned char *, const char *) |
int | get_ip_by_dev (addr_storage *, const char *) |
int | get_mtu_by_dev (const char *) |
int | bind_net_socket (const struct addrinfo *addr) |
int | open_tap_socket (const char *) |
Definition in file netdevice.h.
int bind_net_socket | ( | const struct addrinfo * | addr | ) |
Create UDP network socket and bind to given address
addr | Address info structure to bind socket |
Definition at line 206 of file netdevice.c.
int get_ip_by_dev | ( | addr_storage * | addr, | |
const char * | dev_name | |||
) |
Return IP address of a given interface
addr | Struct to fill in IP address (sockaddr_in or sockaddr_in6) | |
dev_name | Device name of requested address |
Definition at line 93 of file netdevice.c.
int get_mac_by_dev | ( | unsigned char * | mac, | |
const char * | dev_name | |||
) |
Return the MAC address of the given interface
mac | 6 bytes char array to fill in the MAC address | |
dev_name | Device name of requested address |
Definition at line 67 of file netdevice.c.
int get_mtu_by_dev | ( | const char * | dev_name | ) |
Return the MTU of the given interfaces
dev_name | Virtual wireless device name |
Definition at line 181 of file netdevice.c.
int init_udp_socket | ( | void | ) |
Initialize UPD socket file descriptor (IPv4 or IPv6)
Definition at line 52 of file netdevice.c.
int open_tap_socket | ( | const char * | dev_name | ) |
Return file descriptor for TAP device
dev_name | Virtual wireless device name |
Definition at line 232 of file netdevice.c.