core/net: Added support for "bridge mode".
"Bridge mode" allows devices to more easily send 802.15.4 packets as if they were a different device. It also turns off any packet filtering that may be implemented at layer 2. It works by allowing `PACKETBUF_ADDR_SENDER` to be set earlier in the stack. This is useful for implementing 6LoWPAN-ethernet bridges. Enabled via setting `NETSTACK_CONF_BRIDGE_MODE` to 1. Disabled by default.
This commit is contained in:
parent
4e40cb8a8d
commit
c0a693672c
4 changed files with 17 additions and 0 deletions
|
@ -429,7 +429,10 @@ send_packet(void)
|
|||
|
||||
|
||||
/* Create the X-MAC header for the data packet. */
|
||||
#if !NETSTACK_CONF_BRIDGE_MODE
|
||||
/* If NETSTACK_CONF_BRIDGE_MODE is set, assume PACKETBUF_ADDR_SENDER is already set. */
|
||||
packetbuf_set_addr(PACKETBUF_ADDR_SENDER, &rimeaddr_node_addr);
|
||||
#endif
|
||||
if(rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER), &rimeaddr_null)) {
|
||||
is_broadcast = 1;
|
||||
PRINTDEBUG("cxmac: send broadcast\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue