EXTERNAL / PUBLIC. More...
Defines | |
#define | DESSERT_FLAG_SPARSE 0x1 |
flag for dessert_msg.flags - message len is hlen+plen if not set buffer len is assumed as DESSERT_MAXFRAMELEN + DESSERT_MSGPROCLEN | |
#define | DESSERT_LFLAG_SRC_SELF 0x0002 |
flag for dessert_msg_proc.lflags - l25 src is one of our interfaces | |
#define | DESSERT_LFLAG_DST_MULTICAST 0x0004 |
flag for dessert_msg_proc.lflags - l25 dst is multicast address | |
#define | DESSERT_LFLAG_DST_SELF 0x0008 |
flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces | |
#define | DESSERT_LFLAG_DST_BROADCAST 0x0010 |
flag for dessert_msg_proc.lflags - l25 dst is broadcast | |
#define | DESSERT_LFLAG_PREVHOP_SELF 0x0020 |
flag for dessert_msg_proc.lflags - l2 src is one of our interfaces | |
#define | DESSERT_LFLAG_NEXTHOP_SELF 0x0040 |
flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces | |
#define | DESSERT_LFLAG_NEXTHOP_BROADCAST 0x0080 |
flag for dessert_msg_proc.lflags - l2 dst is broadcast | |
#define | DESSERT_LFLAG_DST_SELF_OVERHEARD 0x0100 |
flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces, but we received the message not via the indented interface, e.g. | |
#define | DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD 0x0200 |
flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces, but we received the message not via the indented interface, e.g. | |
#define | DESSERT_EXTLEN (sizeof(struct dessert_ext) - DESSERT_MAXEXTDATALEN) |
length of dessert_ext header | |
#define | DESSERT_EXT_ANY 0x00 |
dessert_ext type wildcard - any extension | |
#define | DESSERT_EXT_ETH 0x01 |
dessert_ext type for ethernet header | |
#define | DESSERT_EXT_TRACE 0x02 |
dessert_ext type for packet tracing | |
#define | DESSERT_EXT_USER 0x40 |
first dessert_ext type for usage by the user | |
#define | DESSERT_MSG_TRACE_HOST (ETHER_ADDR_LEN) |
packet tracing flag - only record hosts | |
#define | DESSERT_MSG_TRACE_IFACE (3*ETHER_ADDR_LEN) |
packet tracing flag - record interfaces | |
#define | dessert_ext_getdatalen(ext) (ext->len - DESSERT_EXTLEN) |
Returns the length of a given extension. | |
Functions | |
int | dessert_msg_new (dessert_msg_t **msgout) |
creates a new dessert_msg_t and initializes it. | |
int | dessert_msg_clone (dessert_msg_t **msgnew, const dessert_msg_t *msgold, uint8_t sparse) |
generates a copy of a dessert_msg | |
int | dessert_msg_check (const dessert_msg_t *msg, size_t len) |
checks whether a dessert_msg is consistent | |
void | dessert_msg_dump (const dessert_msg_t *msg, size_t len, char *buf, size_t blen) |
dump a dessert_msg_t to a string | |
void | dessert_msg_destroy (dessert_msg_t *msg) |
free a dessert_msg | |
int | dessert_msg_ethencap (const struct ether_header *eth, size_t eth_len, dessert_msg_t **msgout) |
creates a new dessert_msg from an ethernet frame. | |
int | dessert_msg_ethdecap (const dessert_msg_t *msg, struct ether_header **ethout) |
extracts an ethernet frame from a dessert_msg | |
struct ether_header * | dessert_msg_getl25ether (const dessert_msg_t *msg) |
get the ether_header sent as DESSERT_EXT_ETH in a dessert_msg | |
int | dessert_msg_proc_clone (dessert_msg_proc_t **procnew, const dessert_msg_proc_t *procold) |
generates a copy of a dessert_msg_proc | |
void | dessert_msg_proc_dump (const dessert_msg_t *msg, size_t len, const dessert_msg_proc_t *proc, char *buf, size_t blen) |
dump a dessert_msg_t to a string | |
void | dessert_msg_proc_destroy (dessert_msg_proc_t *proc) |
free a dessert_prc_msg | |
int | dessert_msg_addpayload (dessert_msg_t *msg, void **payload, int len) |
add or replace payload to a dessert_msg | |
int | dessert_msg_getpayload (dessert_msg_t *msg, void **payload) |
Retrieves a pointer to the payload of a dessert message msg. | |
int | dessert_msg_addext (dessert_msg_t *msg, dessert_ext_t **ext, uint8_t type, size_t len) |
add an extension record to a dessert_msg | |
int | dessert_msg_delext (dessert_msg_t *msg, dessert_ext_t *ext) |
remove an extension record from a dessert_msg | |
int | dessert_msg_resizeext (dessert_msg_t *msg, dessert_ext_t *ext, size_t new_len) |
Resizes a given extension record ext within in a dessert message msg to the new length new_len. | |
int | dessert_msg_getext (const dessert_msg_t *msg, dessert_ext_t **ext, uint8_t type, int index) |
get an specific or all extensions | |
int | dessert_msg_get_ext_count (const dessert_msg_t *msg, uint8_t type) |
get an specific or all extensions | |
int | dessert_msg_trace_initiate (dessert_msg_t *msg, int mode) |
add initial trace header to dessert message | |
int | dessert_msg_trace_dump (const dessert_msg_t *msg, char *buf, int blen) |
dump packet trace to string | |
int | dessert_msg_dump_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id) |
dump a dessert_msg_t to debug log | |
int | dessert_msg_check_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id) |
callback that checks whether a dessert_msg is consistent | |
int | dessert_msg_trace_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *iface, dessert_frameid_t id) |
check if the message carries a trace extension and add the current trace info if iface is NULL, the packet is ignored | |
int | dessert_msg_ifaceflags_cb (dessert_msg_t *msg, size_t len, dessert_msg_proc_t *proc, const dessert_meshif_t *riface, dessert_frameid_t id) |
callback to set the local processing flags in dessert_msg_proc_t on an arriving dessert_msg_t |
EXTERNAL / PUBLIC.
#define dessert_ext_getdatalen | ( | ext | ) | (ext->len - DESSERT_EXTLEN) |
Returns the length of a given extension.
#define DESSERT_LFLAG_DST_SELF_OVERHEARD 0x0100 |
flag for dessert_msg_proc.lflags - l25 dst is one of our interfaces, but we received the message not via the indented interface, e.g.
we overheard it
#define DESSERT_LFLAG_NEXTHOP_SELF_OVERHEARD 0x0200 |
flag for dessert_msg_proc.lflags - l2 dst is one of our interfaces, but we received the message not via the indented interface, e.g.
we overheard it
int dessert_msg_addext | ( | dessert_msg_t * | msg, | |
dessert_ext_t ** | ext, | |||
uint8_t | type, | |||
size_t | len | |||
) |
add an extension record to a dessert_msg
int dessert_msg_addpayload | ( | dessert_msg_t * | msg, | |
void ** | payload, | |||
int | len | |||
) |
add or replace payload to a dessert_msg
int dessert_msg_check | ( | const dessert_msg_t * | msg, | |
size_t | len | |||
) |
checks whether a dessert_msg is consistent
int dessert_msg_check_cb | ( | dessert_msg_t * | msg, | |
size_t | len, | |||
dessert_msg_proc_t * | proc, | |||
const dessert_meshif_t * | iface, | |||
dessert_frameid_t | id | |||
) |
callback that checks whether a dessert_msg is consistent
int dessert_msg_clone | ( | dessert_msg_t ** | msgnew, | |
const dessert_msg_t * | msgold, | |||
uint8_t | sparse | |||
) |
generates a copy of a dessert_msg
int dessert_msg_delext | ( | dessert_msg_t * | msg, | |
dessert_ext_t * | ext | |||
) |
remove an extension record from a dessert_msg
void dessert_msg_destroy | ( | dessert_msg_t * | msg | ) |
void dessert_msg_dump | ( | const dessert_msg_t * | msg, | |
size_t | len, | |||
char * | buf, | |||
size_t | blen | |||
) |
dump a dessert_msg_t to a string
int dessert_msg_dump_cb | ( | dessert_msg_t * | msg, | |
size_t | len, | |||
dessert_msg_proc_t * | proc, | |||
const dessert_meshif_t * | iface, | |||
dessert_frameid_t | id | |||
) |
dump a dessert_msg_t to debug log
int dessert_msg_ethdecap | ( | const dessert_msg_t * | msg, | |
struct ether_header ** | ethout | |||
) |
extracts an ethernet frame from a dessert_msg
int dessert_msg_ethencap | ( | const struct ether_header * | eth, | |
size_t | eth_len, | |||
dessert_msg_t ** | msgout | |||
) |
creates a new dessert_msg from an ethernet frame.
int dessert_msg_get_ext_count | ( | const dessert_msg_t * | msg, | |
uint8_t | type | |||
) |
get an specific or all extensions
int dessert_msg_getext | ( | const dessert_msg_t * | msg, | |
dessert_ext_t ** | ext, | |||
uint8_t | type, | |||
int | index | |||
) |
get an specific or all extensions
struct ether_header* dessert_msg_getl25ether | ( | const dessert_msg_t * | msg | ) | [read] |
get the ether_header sent as DESSERT_EXT_ETH in a dessert_msg
int dessert_msg_getpayload | ( | dessert_msg_t * | msg, | |
void ** | payload | |||
) |
Retrieves a pointer to the payload of a dessert message msg.
[in] | *msg | the message the payload should be retrieved from |
[out] | **payload | the pointer to place the payload in |
int dessert_msg_ifaceflags_cb | ( | dessert_msg_t * | msg, | |
size_t | len, | |||
dessert_msg_proc_t * | proc, | |||
const dessert_meshif_t * | riface, | |||
dessert_frameid_t | id | |||
) |
callback to set the local processing flags in dessert_msg_proc_t on an arriving dessert_msg_t
int dessert_msg_new | ( | dessert_msg_t ** | msgout | ) |
creates a new dessert_msg_t and initializes it.
int dessert_msg_proc_clone | ( | dessert_msg_proc_t ** | procnew, | |
const dessert_msg_proc_t * | procold | |||
) |
generates a copy of a dessert_msg_proc
void dessert_msg_proc_destroy | ( | dessert_msg_proc_t * | proc | ) |
free a dessert_prc_msg
void dessert_msg_proc_dump | ( | const dessert_msg_t * | msg, | |
size_t | len, | |||
const dessert_msg_proc_t * | proc, | |||
char * | buf, | |||
size_t | blen | |||
) |
dump a dessert_msg_t to a string
int dessert_msg_resizeext | ( | dessert_msg_t * | msg, | |
dessert_ext_t * | ext, | |||
size_t | new_len | |||
) |
Resizes a given extension record ext within in a dessert message msg to the new length new_len.
[in] | *msg | the message |
[in] | *ext | the extension record |
[in] | new_len | the new length of the extension record |
DESSERT_OK | on success |
DESCRIPTION:
int dessert_msg_trace_cb | ( | dessert_msg_t * | msg, | |
size_t | len, | |||
dessert_msg_proc_t * | proc, | |||
const dessert_meshif_t * | iface, | |||
dessert_frameid_t | id | |||
) |
check if the message carries a trace extension and add the current trace info if iface is NULL, the packet is ignored
int dessert_msg_trace_dump | ( | const dessert_msg_t * | msg, | |
char * | buf, | |||
int | blen | |||
) |
dump packet trace to string
int dessert_msg_trace_initiate | ( | dessert_msg_t * | msg, | |
int | mode | |||
) |
add initial trace header to dessert message