Moep Library  2.0-nc
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
Modules

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...

Modules

 Ethernet
 
 ieee80211
 
 ieee8023
 
 moep80211
 
 moep8023
 
 Radio
 
 Tap
 
 Unix
 

Files

file  module.h
 

Data Structures

struct  moep_frame_ops
 frame header operations More...
 
struct  moep_dev_ops
 moep device operations More...
 

Functions

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...
 

Detailed Description

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:

Function Documentation

moep_frame_t moep_frame_create ( struct moep_frame_ops l1_ops,
struct moep_frame_ops l2_ops 
)

create a frame

The function moep_frame_create() is used to create a frame with the given frame header operations.

Parameters
l1_opsframe header operations for layer 1
l2_opsframe header operations for layer 2
Returns
This function returns a moep frame.
Return values
NULLon error, errno is set appropriately.
Errors
ENOMEMNot enough memory available
void moep_frame_convert ( moep_frame_t  frame,
struct moep_frame_ops l1_ops,
struct moep_frame_ops l2_ops 
)

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
framethe frame
l1_opsframe header operations for layer 1
l2_opsframe header operations for layer 2
void* moep_frame_l1_hdr ( moep_frame_t  frame,
struct moep_frame_ops l1_ops 
)

layer 1 header

The function moep_frame_l1_hdr() is used to get the layer 1 header of a frame.

Parameters
framethe frame
l1_opsframe header operations for layer 1
Returns
This function returns the layer 1 header.
Return values
NULLon 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.
EACCESThe frame has not the header format specified by l1_ops.
void* moep_frame_l2_hdr ( moep_frame_t  frame,
struct moep_frame_ops l2_ops 
)

layer 2 header

The function moep_frame_l2_hdr() is used to get the layer 2 header of a frame.

Parameters
framethe frame
l2_opsframe header operations for layer 2
Returns
This function returns the layer 2 header.
Return values
NULLon 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.
EACCESThe frame has not the header format specified by l2_ops.
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

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
fdfile descriptor of the device
mtuthe MTU of the device
opsmoep device operations
privprivate data
l1_opsframe header operations for layer 1
l2_opsframe header operations for layer 2
Returns
This function returns a new moep device.
Return values
NULLon 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.
EINVALInvalid argument
EMFILEToo many open files; Some file descriptors are too big for select.
ENOMEMNot enough memory available
void* moep_dev_get_priv ( moep_dev_t  dev,
struct moep_dev_ops ops 
)

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
devthe moep device
opsmoep device operations
Returns
This function returns the private data of the moep device.
Return values
NULLon error (errno is set appropriately) or if the private data is NULL
Errors
EACCESThe moep device has not the type specified by ops