sys Interfaces
[DES-SERT Library]

EXTERNAL / PUBLIC. More...

Collaboration diagram for sys Interfaces:

Defines

#define DESSERT_TUN   0x00
 flag for dessert_sysif_init - open tun (ip/ipv6) device
#define DESSERT_TAP   0x01
 flag for dessert_sysif_init - open tap (ethernet) device
#define DESSERT_MAKE_DEFSRC   0x02
 flag for dessert_sysif_init - set dessert_l25_defsrc to mac of tap device
#define _DESSERT_TAP_NOMAC   0x80
 flag for dessert_sysif_init - get mac for tap failed - try mac in src of first packet

Functions

int dessert_sysif_init (char *name, uint8_t flags)
 Initializes the tun/tap Interface dev for des-sert.
int dessert_sysrxcb_add (dessert_sysrxcb_t *c, int prio)
 adds a callback function to call if a packet should be injected into dessert via a tun/tap interface
int dessert_sysrxcb_del (dessert_sysrxcb_t *c)
 removes all occurrences of the callback function from the list of callbacks.
int dessert_syssend_msg (dessert_msg_t *msg)
 Send a DES-SERT Message via TUN/TAP.
int dessert_syssend (const void *pkt, size_t len)
 Send any type of packet via TUN/TAP.

Detailed Description

EXTERNAL / PUBLIC.


Function Documentation

int dessert_sysif_init ( char *  device,
uint8_t  flags 
)

Initializes the tun/tap Interface dev for des-sert.

int dessert_sysrxcb_add ( dessert_sysrxcb_t c,
int  prio 
)

adds a callback function to call if a packet should be injected into dessert via a tun/tap interface

  • *c callback function
  • prio priority of the function - lower first!
    Returns:
    DESSERT_OK on success
    -errno on error

Here is the caller graph for this function:

int dessert_sysrxcb_del ( dessert_sysrxcb_t c  ) 

removes all occurrences of the callback function from the list of callbacks.

  • c callback function
    Returns:
    DESSERT_OK on success, DESSERT_ERR on error
int dessert_syssend ( const void *  pkt,
size_t  len 
)

Send any type of packet via TUN/TAP.

  • *eth message to send
  • len length of message to send
    Returns:
    DESSERT_OK on success
    -EIO if message failed to be sent

Here is the caller graph for this function:

int dessert_syssend_msg ( dessert_msg_t msg  ) 

Send a DES-SERT Message via TUN/TAP.

  • *msg message to send
    Returns:
    DESSERT_OK on success
    -EIO if message failed to be sent