46 #define PRINTF(...) printf(__VA_ARGS__)
47 #define PRINTADDR(addr) PRINTF(" %02x%02x:%02x%02x:%02x%02x:%02x%02x ", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7])
50 #define PRINTADDR(addr)
62 return sizeof(
struct nullmac_hdr);
68 struct nullmac_hdr *hdr;
73 linkaddr_copy(&(hdr->receiver), packetbuf_addr(PACKETBUF_ADDR_RECEIVER));
74 return sizeof(
struct nullmac_hdr);
76 PRINTF(
"PNULLMAC-UT: too large header: %u\n",
sizeof(
struct nullmac_hdr));
83 struct nullmac_hdr *hdr;
86 packetbuf_set_addr(PACKETBUF_ADDR_SENDER, &(hdr->sender));
87 packetbuf_set_addr(PACKETBUF_ADDR_RECEIVER, &(hdr->receiver));
89 PRINTF(
"PNULLMAC-IN: ");
90 PRINTADDR(packetbuf_addr(PACKETBUF_ADDR_SENDER));
91 PRINTADDR(packetbuf_addr(PACKETBUF_ADDR_RECEIVER));
94 return sizeof(
struct nullmac_hdr);
99 const struct framer framer_nullmac = {
102 framer_canonical_create_and_secure,
int packetbuf_hdralloc(int size)
Extend the header of the packetbuf, for outbound packets.
linkaddr_t linkaddr_node_addr
The Rime address of the node.
Header file for the Rime buffer (packetbuf) management
uint16_t packetbuf_datalen(void)
Get the length of the data in the packetbuf.
void linkaddr_copy(linkaddr_t *dest, const linkaddr_t *src)
Copy a Rime address.
void * packetbuf_hdrptr(void)
Get a pointer to the header in the packetbuf, for outbound packets.
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.
int packetbuf_hdrreduce(int size)
Reduce the header in the packetbuf, for incoming packets.