DES-SERT - A Simple and Extensible Routing Framework for Testbeds: S Y S - I N T E R F A C E S

# S Y S - I N T E R F A C E S

EXTERNAL / PUBLIC. More...

## 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)
| sends a packet via tun/tap interface to the kernel
int | dessert_syssend (const struct ether_header *eth, size_t len)
| sends a packet via tun/tap interface to the kernel

## Detailed Description

EXTERNAL / PUBLIC.

## Function Documentation

int dessert_sysif_init | ( | char * | device,
|  | uint8_t | flags |
| ) |  |  |

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

- *device interface name
- flags
  See also:
    DESSERT_TUN
    DESSERT_TAP
    DESSERT_MAKE_DEFSRC
  Returns:
    0 -- on success
    EINVAL -- if message is broken
    EFAULT -- if interface not specified and not guessed

Here is the caller graph for this function:

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 struct ether_header * | eth,
|  | size_t | len |
| ) |  |  |

sends a packet via tun/tap interface to the kernel

- *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 | ) |

sends a packet via tun/tap interface to the kernel

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