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

Files

file  moep8023.h
 

Data Structures

struct  moep8023_hdr
 

Macros

#define MOEP8023_FRAME_DISCRIMINATOR   0x88b5
 

Functions

moep_dev_t moep_dev_moep8023_open (const char *devname, u8 *addr, const struct in_addr *ip, int prefixlen, int mtu)
 open a moep8023 device More...
 
moep_dev_t moep_dev_moep8023_tap_open (u8 *addr, const struct in_addr *ip, int prefixlen, int mtu)
 open a moep8023 tap device More...
 
moep_dev_t moep_dev_moep8023_unix_open (const char *devname, int mtu)
 open a moep8023 unix device More...
 
moep_frame_t moep_frame_moep8023_create (void)
 create a moep8023 frame More...
 
moep_frame_t moep_frame_moep8023_tap_create (void)
 create a moep8023 tap frame More...
 
moep_frame_t moep_frame_moep8023_unix_create (void)
 create a moep8023 unix frame More...
 
struct moep8023_hdrmoep_frame_moep8023_hdr (moep_frame_t frame)
 moep8023 header More...
 

Detailed Description

Function Documentation

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

open a moep8023 device

The function moep_dev_moep8023_open() is used to open a moep8023 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_moep8023_tap_open ( u8 *  addr,
const struct in_addr *  ip,
int  prefixlen,
int  mtu 
)

open a moep8023 tap device

The function moep_dev_moep8023_tap_open() is used to open a moep8023 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_moep8023_unix_open ( const char *  devname,
int  mtu 
)

open a moep8023 unix device

The function moep_dev_moep8023_unix_open() is used to open a moep8023 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_moep8023_create ( void  )

create a moep8023 frame

The function moep_frame_moep8023_create() is used to create a moep8023 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_moep8023_tap_create ( void  )

create a moep8023 tap frame

The function moep_frame_moep8023_tap_create() is used to create a moep8023 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_moep8023_unix_create ( void  )

create a moep8023 unix frame

The function moep_frame_moep8023_unix_create() is used to create a moep8023 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 moep8023_hdr* moep_frame_moep8023_hdr ( moep_frame_t  frame)

moep8023 header

The function moep_frame_moep8023_hdr() is used to get the moep8023 header of a frame.

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