75 #ifndef __NETFLOOD_H__
76 #define __NETFLOOD_H__
83 #define NETFLOOD_ATTRIBUTES { PACKETBUF_ADDR_ESENDER, PACKETBUF_ADDRSIZE }, \
84 { PACKETBUF_ATTR_HOPS, PACKETBUF_ATTR_BIT * 5 }, \
85 { PACKETBUF_ATTR_EPACKET_ID, PACKETBUF_ATTR_BIT * 4 }, \
88 struct netflood_callbacks {
89 int (* recv)(
struct netflood_conn *c,
const rimeaddr_t *from,
90 const rimeaddr_t *originator, uint8_t seqno, uint8_t hops);
91 void (* sent)(
struct netflood_conn *c);
92 void (* dropped)(
struct netflood_conn *c);
95 struct netflood_conn {
97 const struct netflood_callbacks *u;
98 clock_time_t queue_time;
99 rimeaddr_t last_originator;
100 uint8_t last_originator_seqno;
103 void netflood_open(
struct netflood_conn *c, clock_time_t queue_time,
104 uint16_t channel,
const struct netflood_callbacks *u);
105 void netflood_close(
struct netflood_conn *c);
107 int netflood_send(
struct netflood_conn *c, uint8_t seqno);