The Modules API is used to implement the modules. If you only want to use the library, you do not need this. See below for the available compiled-in modules.
More...
|
moep_frame_t | moep_frame_create (struct moep_frame_ops *l1_ops, struct moep_frame_ops *l2_ops) |
| create a frame More...
|
|
void | moep_frame_convert (moep_frame_t frame, struct moep_frame_ops *l1_ops, struct moep_frame_ops *l2_ops) |
| convert a frame More...
|
|
void * | moep_frame_l1_hdr (moep_frame_t frame, struct moep_frame_ops *l1_ops) |
| layer 1 header More...
|
|
void * | moep_frame_l2_hdr (moep_frame_t frame, struct moep_frame_ops *l2_ops) |
| layer 2 header More...
|
|
moep_dev_t | moep_dev_open (int fd, int mtu, struct moep_dev_ops *ops, void *priv, struct moep_frame_ops *l1_ops, struct moep_frame_ops *l2_ops) |
| open a moep device More...
|
|
void * | moep_dev_get_priv (moep_dev_t dev, struct moep_dev_ops *ops) |
| return the private data of a moep device More...
|
|
The Modules API is used to implement the modules. If you only want to use the library, you do not need this. See below for the available compiled-in modules.
Layer 2 modules:
Layer 1 modules:
create a frame
The function moep_frame_create() is used to create a frame with the given frame header operations.
- Parameters
-
l1_ops | frame header operations for layer 1 |
l2_ops | frame header operations for layer 2 |
- Returns
- This function returns a moep frame.
- Return values
-
NULL | on error, errno is set appropriately. |
- Errors
ENOMEM | Not enough memory available |
convert a frame
The function moep_frame_convert() is used to convert the headers of a frame to the format required by the given frame header operations. This function does not convert any header data, it only removes the old headers and creates new empty headers in the specified format. This function is useful if you want to convert a frame, without copying the payload.
- Parameters
-
frame | the frame |
l1_ops | frame header operations for layer 1 |
l2_ops | frame header operations for layer 2 |
layer 1 header
The function moep_frame_l1_hdr() is used to get the layer 1 header of a frame.
- Parameters
-
frame | the frame |
l1_ops | frame header operations for layer 1 |
- Returns
- This function returns the layer 1 header.
- Return values
-
NULL | on error, errno is set appropriately. |
- Errors
- These are some standard errors generated by this function. Additional errors may be generated and returned from the underlying device specific functions.
EACCES | The frame has not the header format specified by l1_ops. |
layer 2 header
The function moep_frame_l2_hdr() is used to get the layer 2 header of a frame.
- Parameters
-
frame | the frame |
l2_ops | frame header operations for layer 2 |
- Returns
- This function returns the layer 2 header.
- Return values
-
NULL | on error, errno is set appropriately. |
- Errors
- These are some standard errors generated by this function. Additional errors may be generated and returned from the underlying device specific functions.
EACCES | The frame has not the header format specified by l2_ops. |
open a moep device
The function moep_dev_open() is used to open a moep device. The passed file descriptor must refer to the underlying device and support read and write operations. The MTU includes all headers.
- Parameters
-
fd | file descriptor of the device |
mtu | the MTU of the device |
ops | moep device operations |
priv | private data |
l1_ops | frame header operations for layer 1 |
l2_ops | frame header operations for layer 2 |
- Returns
- This function returns a new moep device.
- Return values
-
NULL | on error, errno is set appropriately. |
- Errors
- These are some standard errors generated and returned by this function. Additional errors may be generated and returned from the underlying system calls.
EINVAL | Invalid argument |
EMFILE | Too many open files; Some file descriptors are too big for select. |
ENOMEM | Not enough memory available |
return the private data of a moep device
The function moep_dev_get_priv() is used to get the private data of the moep device.
- Parameters
-
dev | the moep device |
ops | moep device operations |
- Returns
- This function returns the private data of the moep device.
- Return values
-
NULL | on error (errno is set appropriately) or if the private data is NULL |
- Errors
EACCES | The moep device has not the type specified by ops |