Added optional address filtering
This commit is contained in:
parent
e8a96dc202
commit
28b0479c06
1 changed files with 13 additions and 0 deletions
|
@ -52,6 +52,12 @@
|
||||||
#define PRINTF(...)
|
#define PRINTF(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef NULLRDC_CONF_ADDRESS_FILTER
|
||||||
|
#define NULLRDC_ADDRESS_FILTER NULLRDC_CONF_ADDRESS_FILTER
|
||||||
|
#else
|
||||||
|
#define NULLRDC_ADDRESS_FILTER 1
|
||||||
|
#endif /* NULLRDC_CONF_ADDRESS_FILTER */
|
||||||
|
|
||||||
#ifndef NULLRDC_802154_AUTOACK
|
#ifndef NULLRDC_802154_AUTOACK
|
||||||
#ifdef NULLRDC_CONF_802154_AUTOACK
|
#ifdef NULLRDC_CONF_802154_AUTOACK
|
||||||
#define NULLRDC_802154_AUTOACK NULLRDC_CONF_802154_AUTOACK
|
#define NULLRDC_802154_AUTOACK NULLRDC_CONF_802154_AUTOACK
|
||||||
|
@ -206,6 +212,13 @@ packet_input(void)
|
||||||
#endif /* NULLRDC_802154_AUTOACK */
|
#endif /* NULLRDC_802154_AUTOACK */
|
||||||
if(NETSTACK_FRAMER.parse() == 0) {
|
if(NETSTACK_FRAMER.parse() == 0) {
|
||||||
PRINTF("nullrdc: failed to parse %u\n", packetbuf_datalen());
|
PRINTF("nullrdc: failed to parse %u\n", packetbuf_datalen());
|
||||||
|
#if NULLRDC_ADDRESS_FILTER
|
||||||
|
} else if(!rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER),
|
||||||
|
&rimeaddr_node_addr) &&
|
||||||
|
!rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER),
|
||||||
|
&rimeaddr_null)) {
|
||||||
|
PRINTF("nullrdc: not for us\n");
|
||||||
|
#endif /* NULLRDC_ADDRESS_FILTER */
|
||||||
} else {
|
} else {
|
||||||
#if NULLRDC_802154_AUTOACK || NULLRDC_802154_AUTOACK_HW
|
#if NULLRDC_802154_AUTOACK || NULLRDC_802154_AUTOACK_HW
|
||||||
/* Check for duplicate packet by comparing the sequence number
|
/* Check for duplicate packet by comparing the sequence number
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue