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

Files

file  ieee8023.h
 

Functions

moep_dev_t moep_dev_ieee8023_open (const char *devname, u8 *addr, const struct in_addr *ip, int prefixlen, int mtu)
 open an ieee8023 device More...
 
moep_dev_t moep_dev_ieee8023_tap_open (u8 *addr, const struct in_addr *ip, int prefixlen, int mtu)
 open an ieee8023 tap device More...
 
moep_dev_t moep_dev_ieee8023_unix_open (const char *devname, int mtu)
 open an ieee8023 unix device More...
 
moep_frame_t moep_frame_ieee8023_create (void)
 create an ieee8023 frame More...
 
moep_frame_t moep_frame_ieee8023_tap_create (void)
 create an ieee8023 tap frame More...
 
moep_frame_t moep_frame_ieee8023_unix_create (void)
 create an ieee8023 unix frame More...
 
struct ether_header * moep_frame_ieee8023_hdr (moep_frame_t frame)
 ieee8023 header More...
 

Detailed Description

Function Documentation

moep_dev_t moep_dev_ieee8023_open ( const char *  devname,
u8 *  addr,
const struct in_addr *  ip,
int  prefixlen,
int  mtu 
)

open an ieee8023 device

The function moep_dev_ieee8023_open() is used to open an ieee8023 device.

Parameters
devname,thedevice name, e.g. eth0
addrthe hardware address of the device; This can be NULL to be automatically set.
ipthe IP address of the device; This can be NULL to set no IP address.
prefixlenthe length of the IP prefix.
mtuthe MTU of the device; This includes all headers.
Returns
This function returns a 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 filedescriptors are too big for select.
ENOMEMNot enough memory available
moep_dev_t moep_dev_ieee8023_tap_open ( u8 *  addr,
const struct in_addr *  ip,
int  prefixlen,
int  mtu 
)

open an ieee8023 tap device

The function moep_dev_ieee8023_tap_open() is used to open an ieee8023 tap device.

Parameters
addrthe hardware address of the device; This can be NULL to be automatically set.
ipthe IP address of the device; This can be NULL to set no IP address.
prefixlenthe length of the IP prefix.
mtuthe MTU of the device; This includes all headers.
Returns
This function returns a 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 filedescriptors are too big for select.
ENOMEMNot enough memory available
moep_dev_t moep_dev_ieee8023_unix_open ( const char *  devname,
int  mtu 
)

open an ieee8023 unix device

The function moep_dev_ieee8023_unix_open() is used to open an ieee8023 unix device.

Parameters
devnamethe device name; This must be the path of a unix domain socket.
mtuthe MTU of the device; This includes all headers.
Returns
This function returns a 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 filedescriptors are too big for select.
ENOMEMNot enough memory available
moep_frame_t moep_frame_ieee8023_create ( void  )

create an ieee8023 frame

The function moep_frame_ieee8023_create() is used to create an ieee8023 frame.

Returns
This function returns a moep frame.
Return values
NULLon error, errno is set appropriately.
Errors
The error values are the same as for moep_frame_create().
moep_frame_t moep_frame_ieee8023_tap_create ( void  )

create an ieee8023 tap frame

The function moep_frame_ieee8023_tap_create() is used to create an ieee8023 tap frame.

Returns
This function returns a moep frame.
Return values
NULLon error, errno is set appropriately.
Errors
The error values are the same as for moep_frame_create().
moep_frame_t moep_frame_ieee8023_unix_create ( void  )

create an ieee8023 unix frame

The function moep_frame_ieee8023_unix_create() is used to create an ieee8023 unix frame.

Returns
This function returns a moep frame.
Return values
NULLon error, errno is set appropriately.
Errors
The error values are the same as for moep_frame_create().
struct ether_header* moep_frame_ieee8023_hdr ( moep_frame_t  frame)

ieee8023 header

The function moep_frame_ieee8023_hdr() is used to get the ieee8023 header of a frame.

Parameters
framethe frame
Returns
This function returns the ieee8023 header.
Return values
NULLon error, errno is set appropriately.
Errors
EACCESThe frame is not an ieee8023 frame.
ENOMEMNot enough memory available.