Moep Library
2.0-nc
|
Files | |
file | eth.h |
Functions | |
moep_dev_t | moep_dev_eth_open (const char *devname, u8 *addr, const struct in_addr *ip, int prefixlen, int mtu, struct moep_frame_ops *l2_ops) |
open an eth device More... | |
int | moep_dev_eth_get_hwaddr (moep_dev_t dev, u8 *addr) |
get hardware address More... | |
moep_frame_t | moep_frame_eth_create (struct moep_frame_ops *l2_ops) |
create an eth frame More... | |
moep_dev_t moep_dev_eth_open | ( | const char * | devname, |
u8 * | addr, | ||
const struct in_addr * | ip, | ||
int | prefixlen, | ||
int | mtu, | ||
struct moep_frame_ops * | l2_ops | ||
) |
open an eth device
The function moep_dev_eth_open() is used to open an eth device.
devname | the device name, e.g. eth0 |
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_eth_get_hwaddr | ( | moep_dev_t | dev, |
u8 * | addr | ||
) |
get hardware address
The function moep_dev_eth_get_hwaddr() is used to get the hardware address of a tap device.
dev | the eth device |
addr | a buffer for the address |
0 | on success |
-1 | on error, errno is set appropriately. |
EACCES | The moep device is not an eth device. |
moep_frame_t moep_frame_eth_create | ( | struct moep_frame_ops * | l2_ops | ) |
create an eth frame
The function moep_frame_eth_create() is used to create an eth 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. |