Moep Library
2.0-nc
|
Files | |
file | tap.h |
Functions | |
moep_dev_t | moep_dev_tap_open (u8 *addr, const struct in_addr *ip, int prefixlen, int mtu, struct moep_frame_ops *l2_ops) |
open a tap device More... | |
int | moep_dev_tap_get_hwaddr (moep_dev_t dev, u8 *addr) |
get hardware address More... | |
moep_frame_t | moep_frame_tap_create (struct moep_frame_ops *l2_ops) |
create a tap frame More... | |
moep_dev_t moep_dev_tap_open | ( | u8 * | addr, |
const struct in_addr * | ip, | ||
int | prefixlen, | ||
int | mtu, | ||
struct moep_frame_ops * | l2_ops | ||
) |
open a tap device
The function moep_dev_tap_open() is used to open a tap device.
addr | the hardware address of the device; This can be NULL to be automatically set. |
ip | the IP address of the device; This can be NULL to set no IP address. |
prefixlen | the length of the IP prefix. |
mtu | the MTU of the device; This includes all headers. |
l2_ops | frame header operations for layer 2 |
NULL | on error, errno is set appropriately. |
EINVAL | Invalid argument |
EMFILE | Too many open files; Some filedescriptors are too big for select. |
ENOMEM | Not enough memory available |
int moep_dev_tap_get_hwaddr | ( | moep_dev_t | dev, |
u8 * | addr | ||
) |
get hardware address
The function moep_dev_tap_get_hwaddr() is used to get the hardware address of a tap device.
dev | the tap device |
addr | a buffer for the address |
0 | on success |
-1 | on error, errno is set appropriately. |
EACCES | The moep device is not a tap device. |
moep_frame_t moep_frame_tap_create | ( | struct moep_frame_ops * | l2_ops | ) |
create a tap frame
The function moep_frame_tap_create() is used to create a tap frame with the given frame header operations for layer 2.
l2_ops | frame header operations for layer 2 |
NULL | on error, errno is set appropriately. |