Commit graph

304 commits

Author SHA1 Message Date
kkrentz c396a85364 llsec: Added a layer in between NETSTACK_MAC and NETSTACK_NETWORK for implementing link layer security 2014-08-04 01:09:57 -07:00
Adam Dunkels cff30a394b Merge pull request #635 from nfi/linkaddr-size
Use LINKADDR_SIZE instead of sizeof(linkaddr_t) to avoid struct padding problems.
2014-06-11 23:18:27 +02:00
Adam Dunkels eceaf0c59b Merge pull request #631 from nfi/framer-len
Added function to framer that returns the estimated header length
2014-06-11 23:17:47 +02:00
Rémy Léone 25c8b0835d Closing doxygen groups 2014-05-30 11:01:20 +02:00
Niclas Finne b1335b08a8 Changed to use LINKADDR_SIZE instead of sizeof() to select between
short address and long address as some platforms might use padding in
the struct. This fixes #555.
2014-04-11 17:24:16 +02:00
Niclas Finne 68730566a3 Added method to framer that returns the header length if the framer
would create a header with the current packet information.

This allows sicslowpan to calculate the max payload size without
consuming a sequence number or clearing/restoring the packet buffer.
2014-04-11 17:03:23 +02:00
Adam Dunkels 5b1a9f5bc2 Bugfix: when a packet is sent by the RDC layer, we should count the number of transmissions made because a single callback can pertain to multiple transmissions at the RDC layer. 2014-03-24 08:36:18 +01:00
Adam Dunkels 45265249fc Changed the name of the rimeaddr module to linkaddr 2014-01-29 20:12:24 +01:00
Adam Dunkels bddd96d5c8 Removed all module makefiles. Instead, all .c files in a module directory are compiled. 2014-01-26 23:20:46 +01:00
Adam Dunkels 8eace27f9b Moved net/rime.h to net/rime/rime.h 2014-01-26 23:20:45 +01:00
Adam Dunkels 0fe08205e1 Moved the rimeaddr.[ch] code from the core/net/rime module to the core/net module, as it is used not only by rime code 2014-01-26 23:20:36 +01:00
Adam Dunkels 0f255606b0 Turned sicslowmac into a module 2014-01-26 23:20:28 +01:00
Adam Dunkels b78ab6753c Added makefiles to make core/net/mac into a separate module 2014-01-26 23:20:26 +01:00
Adam Dunkels d777ae14e4 Moved cxmac into a separate module 2014-01-26 23:20:26 +01:00
Adam Dunkels 083fe0b594 Moved the contikimac code into a core/net/mac/contikimac module 2014-01-26 23:20:25 +01:00
Adam Dunkels 5f3fe7f7c7 Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
Martin Heusse 662eb4db14 Fix compilation error when DEBUG enabled in core/net/mac/framer-nullmac.c 2014-01-24 20:23:26 +01:00
Adam Dunkels 0908924f91 Removed the lpp.c code 2013-11-28 15:24:40 +01:00
Adam Dunkels f86aaf7c14 Removed the xmac.c code 2013-11-28 15:24:22 +01:00
Nicolas Tsiftes db4cada4e7 Merge pull request #462 from adamdunkels/push/no-reserved-double-inclusion-defines
Remove all leading double underscore inclusion #defines
2013-11-26 14:26:37 -08:00
Benoît Thébaudeau 4deba89f81 rdc: duplicate packets: Keep only the last sequence number for each address
According to IEEE 802.15.4e (§6.4.3.9), in order to detect duplicate received
MAC-layer frames, only the most recently received frame's sequence number needs
to be stored for each unique device address. Doing so limits the possible false
duplicate packet detections to a single sequence number. This also allows to
keep the last sequence number of more device addresses for the same value of
MAX_SEQNOS.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-11-25 13:01:11 +01:00
Benoît Thébaudeau 477a4a7178 rdc: duplicate packets: Factor out detection code
The code detecting duplicate packets in the RDC layer had been copied into most
RDC implementations. Factor it out into a new mac-sequence module in order to
have a single instance of this code.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-11-25 13:01:11 +01:00
Benoît Thébaudeau 14db3382af csma: Initialize sequence number with random value
According to IEEE 802.15.4 (§5.1.6.1, §6.4.2), the MAC sequence numbers should
be initialized to random values. This was already the case in
framer-802154.c:create(), but not in csma.c:send_packet(), sometimes causing
false detections of duplicate MAC-layer packets in other devices when a device
was restarted too quickly. This patch decreases the probability of such an
event.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
2013-11-25 13:01:11 +01:00
Adam Dunkels bb2dcaa057 A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
Adam Dunkels bec721d313 Allow payload len to be larger than 256 bytes 2013-11-16 14:22:48 +01:00
Simon Duquennoy 03dcca15cb Implement a truncated exponential backoff for csma 2013-11-14 15:02:36 +01:00
Enrico Joerns 4ba22102fd [core/net/mac] Removed invalid struct member u8 in PRINTADDR 2013-10-15 01:43:26 +02:00
Simon Duquennoy 248301a041 Fix naming issues and includes in uip-ds6-nbr.h 2013-08-19 17:48:30 +02:00
Simon Duquennoy 5a1d8d8006 Make phase module use neighbor-table. 2013-08-19 17:48:29 +02:00
Fredrik Osterlind 8041f66d8c link-layer acks support for cooja motes 2013-08-15 14:32:35 +02:00
Adam Dunkels 0aa448f190 6lowpan fragmentation bugfix: the 6lowpan code had an unfortunate
interaction with the behavior of the rdc layer. If the first packet of a
fragment transmission was lost, the remaining packets would get dropped
on reception. Moreover, the reception code contained a bug that
sometimes would cause fragments to be misidentified as fragments. Taken
together, these problems would result in a pathelogical network
breakdown if too many fragmented packets would occur simultaneously.
2013-08-11 14:27:20 +02:00
Jelmer Tiete cf894b8b95 changed inter packet interval to 0.4ms 2013-06-21 13:15:45 +02:00
Nicolas Tsiftes 7cc8f326f4 Merge pull request #257 from adamdunkels/hotfix-csma
CSMA bugfix
2013-06-20 01:49:48 -07:00
Adam Dunkels 09f30e875d Bugfix: when a CSMA callback is received, we should remove the packet
that was transmitted and not just the first packet that happens to be on
the output queue.
2013-05-25 12:13:07 +02:00
Adam Dunkels c9de0e49be Added a number of default options for ContikiMAC, and allow them to be overridden with contiki-conf.h configuration options 2013-05-25 12:10:27 +02:00
lebrush 82d498f3a1 Removed undef 2013-05-15 16:25:34 +02:00
lebrush 071cfaf1cb Corrects some leftover uncapitalized printfs which may cause some platforms
to crash.
2013-05-15 12:21:15 +02:00
Nicolas Tsiftes 7f2a842b71 Merge pull request #174 from adamdunkels/feature-net-improvements
Improvements to the core/net/ code
2013-03-18 17:12:12 -07:00
Nicolas Tsiftes 6a07172662 Merge pull request #176 from adamdunkels/feature-net-bugfixes
Network system bugfixes
2013-03-18 13:38:44 -07:00
Adam Dunkels 7742b05d8c Major bugfix: when nullrdc is asked to send a list of packets, send the list of packets and not just the first packet - this is essential for retransmissions of fragmented IP packets to work 2013-03-18 13:35:29 +01:00
Adam Dunkels 4efd570cf9 Minor bugfix: explicitly cast pointer argument in debug printf 2013-03-18 11:22:05 +01:00
Adam Dunkels f2fbb4b49d Defensive programming: make sure that we don't fail completely if we get a callback for a NULL pointer 2013-03-18 11:22:04 +01:00
Adam Dunkels 82b755c017 Bugfix: keep track of receiver being awake as a local variable rather than a global, as it may have changed between invokations 2013-03-18 11:22:02 +01:00
Adam Dunkels 0670a8e1e2 Minor code style fixes to the contikimac and nullrdc code 2013-03-18 11:22:01 +01:00
Adam Dunkels 5993595a8f A number of updates to nullrdc
* add a few rimestats to keep track of sent and received acks
* made a number of configuration options possible to override (ack timing)
* added the logic for sending 802.15.4 link layer ack packets, despite not being able to guarentee the 802.15.4 MAC timing
* increased the number of sequence numbers to keep track of for duplicate filtering
2013-03-18 11:19:20 +01:00
Adam Dunkels 4541d3e85b Let the framer functions use ints instead of uint8_t to make them more generic 2013-03-18 11:19:18 +01:00
Robert Quattlebaum c0a693672c 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.
2013-03-10 14:45:15 -07:00
Adam Dunkels cb7842bd16 Added support for encryption and decryption of the packetbuf if macros
NETSTACK_ENCRYPT and NETSTACK_DECRYPT are defined. Those are intended
to be called as functions NETSTACK_ENCRYPT() and NETSTACK_DECRYPT() to
encrypt and decrypt the packetbuf, respectively. If needed, an
initialization function by the name NETSTACK_ENCRYPTION_INIT() can
also be defined.
2012-11-25 12:05:00 +01:00
Adam Dunkels 6ee1f72486 Removed old unused TDMA-based MAC and RDC code 2012-11-20 20:48:34 +01:00
Adam Dunkels ec8c7e9be0 Cleanup of the node-id.h files. The node-id.h file contains
declarations of functions for setting and getting a node ID number, a
functionality that exists on many platforms. Since this functionality
was not considered part of the Contiki core, each platform defined its
own node-id.h file. This commit attempts to clean this up by
collecting the node-id.h into a core/sys/node-id.h file that replaces
the old node-id.h files from the platform directories.
2012-11-20 19:59:46 +01:00