DES-SERT - A Simple and Extensible Routing Framework for Testbeds: G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S

# G L O B A L # D E F I N E S and T Y P E D E F S / S T R U C T U R E S

EXTERNAL / PUBLIC. More...

## Data Structures
struct | dessert_msg
| A basic message send on des-sert layer2.5. More...
struct | dessert_msg_proc
| local processing struct for dessert_msg_t More...
struct | dessert_ext
| a extension record to add to a dessert_msg More...
struct | dessert_meshif
| an interface used for dessert_msg frames More...
struct | dessert_sysif
| A tun/tap interface used to inject packets to dessert implemented daemons. More...
struct | dessert_periodic
| definition of a periodic tasklist entry More...
## Defines
#define | DESSERT_ETHPROTO 0x8042
| ethernet protocol used on layer 2
#define | DESSERT_MAXFRAMELEN ETHER_MAX_LEN
| maximum frame size to assemble as dessert_msg
#define | DESSERT_MAXEXTDATALEN 253
| maximum size of the data part in dessert_ext
#define | DESSERT_PROTO_STRLEN 4
| length of protocol string used in dessert_msg
#define | DESSERT_LBUF_LEN 1024
| size of local message processing buffer
#define | DESSERT_OK 0
| return code for many dessert_* functions
#define | DESSERT_ERR 1
| return code for many dessert_* functions
## Typedefs
typedef uint64_t | dessert_frameid_t
| runtime-unique frame id
typedef struct dessert_msg | dessert_msg_t
| A basic message send on des-sert layer2.5.
typedef struct dessert_msg_proc | dessert_msg_proc_t
| local processing struct for dessert_msg_t
typedef struct dessert_ext | dessert_ext_t
| a extension record to add to a dessert_msg
typedef struct dessert_meshif | dessert_meshif_t
| an interface used for dessert_msg frames
typedef struct dessert_sysif | dessert_sysif_t
| A tun/tap interface used to inject packets to dessert implemented daemons.
typedef int | dessert_meshrxcb_t (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)
| Callback type to call if a packed is received via a dessert mesh interface.
typedef int | dessert_sysrxcb_t (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id)
| Callback type to call if a packed should be injected into dessert via a tun/tap interface.
typedef int | dessert_periodiccallback_t (void *data, struct timeval *scheduled, struct timeval *interval)
| callbacks type to call in a periodic task
typedef struct dessert_periodic | dessert_periodic_t
| definition of a periodic tasklist entry

## Detailed Description

EXTERNAL / PUBLIC.

## Typedef Documentation

typedef int dessert_meshrxcb_t(dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id)

Callback type to call if a packed is received via a dessert mesh interface.

Parameters:

  | *msg | dessert_msg_t frame received
  | len | length of the buffer pointed to from dessert_msg_t
  | *proc | local processing buffer passed along the callback pipeline - may be NULL
  | *iface | interface received packet on - may be NULL
  | id | unique internal frame id of the packet

Return values:

  | DESSERT_MSG_KEEP | to continue processing the packet
  | DESSERT_MSG_DROP | to drop it
  | DESSERT_MSG_NEEDMSGPROC | to get a processing buffer
  | DESSERT_MSG_NEEDNOSPARSE | to get a full packet buffer (e.g. needed to add extensions)

Warning:
  The callbacks are invoked with no locks hold by the thread,
  YOU MUST make sure the thread holds no locks after the callback exits.
  YOU MUST also make sure not to do anything blocking in a callback!

If the callback exits with DESSERT_MSG_NEEDMSGPROC or DESSERT_MSG_NEEDNOSPARSE and the respective buffer is NULL or sparse, the callback is called again after providing the requested resource.

typedef struct dessert_msg dessert_msg_t

A basic message send on des-sert layer2.5.

typedef int dessert_periodiccallback_t(void *data, struct timeval *scheduled, struct timeval *interval)

callbacks type to call in a periodic task

The callbacks are invoked with no locks hold by the thread, YOU MUST make sure the thread holds no locks after the callback exits. YOU MUST also make sure not to do anything blocking in a callback!

- *data void pointer to pass to the callback
- scheduled when this call was scheduled
- interval how often this call should be scheduled ®return should be 0, otherwise the callback is unregistered

typedef struct dessert_sysif dessert_sysif_t

A tun/tap interface used to inject packets to dessert implemented daemons.

Note:
  Please make sure first fields are equal to dessert_meshif to re-use _dessert_meshif_gethwaddr().

typedef int dessert_sysrxcb_t(dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, dessert_sysif_t *sysif, dessert_frameid_t id)

Callback type to call if a packed should be injected into dessert via a tun/tap interface.

Parameters:

  | *msg | dessert msg received - original ethernet frame is encapsulated within
  | len | length of ethernet frame received
  | *proc | local processing buffer passed along the callback pipeline - may be NULL
  | *sysif | interface received packet on
  | id | unique internal frame id of the packet

Return values:

  | DESSERT_MSG_KEEP | to continue processing the packet
  | DESSERT_MSG_DROP | to drop it

Warning:
  The callbacks are invoked with no locks hold by the thread,
  YOU MUST make sure the thread holds no locks after the callback exits.
  YOU MUST also make sure not to do anything blocking in a callback!