The Moep Header Extension API is used to create, manipulate and delete moep extension headers.
More...
|
#define | MOEP_HDR_NEXTHDR_PRESENT 0x40 |
|
#define | MOEP_HDR_MASK (MOEP_HDR_NEXTHDR_PRESENT - 1) |
|
|
enum | moep_hdr_type { MOEP_HDR_INVALID = 0x00,
MOEP_HDR_PCTRL,
MOEP_HDR_VENDOR_MIN = 0x20,
MOEP_HDR_COUNT = MOEP_HDR_MASK + 1
} |
|
The Moep Header Extension API is used to create, manipulate and delete moep extension headers.
moep header extension
The function moep_frame_moep_hdr_ext() is used to get a moep header extension of a frame.
- Parameters
-
frame | the frame |
type | the type of the header extension |
- Returns
- This function returns the moep header extension.
- Return values
-
NULL | on error (errno is set appropriately) or if the specified header extension is not set. |
- Errors
EACCES | The frame is not a moep frame. |
EINVAL | The parameter type is not a valid moep header extension type. |
ENOMEM | Not enough memory available |
add a moep header extension
The function moep_frame_add_moep_hdr_ext() is used to add a moep header extension to a frame. Any previous header extension of the same type is removed.
- Parameters
-
frame | the frame |
type | the type of the header extension |
len | the len of the header extension |
- Returns
- This function returns the new moep header extension.
- Return values
-
NULL | on error, errno is set appropriately. |
- Errors
EACCES | The frame is not a moep frame. |
EINVAL | The parameter type is not a valid moep header extension type. |
ENOMEM | Not enough memory available |
set a moep header extension
The function moep_frame_set_moep_hdr_ext() is used to add a moep header extension to a frame. Any previous header extension of the same type is removed. The content of the header extension is copied to an internal buffer so that ext does not need to be preserved.
- Parameters
-
frame | the frame |
ext | a pointer to the header extension |
- Returns
- This function returns the new moep header extension.
- Return values
-
NULL | on error, errno is set appropriately. |
- Errors
EACCES | The frame is not a moep frame. |
EINVAL | Invalid argument |
ENOMEM | Not enough memory available |
int moep_frame_del_moep_hdr_ext |
( |
moep_frame_t |
frame, |
|
|
enum moep_hdr_type |
type |
|
) |
| |
delete a moep header extension
The function moep_frame_del_moep_hdr_ext() is used to remove a moep header extension from a frame.
- Parameters
-
frame | the frame |
type | the type of the header extension |
- Return values
-
0 | on success |
-1 | on error, errno is set appropriately. |
- Errors
EACCES | The frame is not a moep frame. |
EINVAL | The parameter type is not a valid moep header extension type. |
ENOMEM | Not enough memory available |