Contiki-NG
Loading...
Searching...
No Matches
sicslowpan.c File Reference

6LoWPAN implementation (RFC 4944 and RFC 6282) More...

#include <string.h>
#include "contiki.h"
#include "dev/watchdog.h"
#include "net/link-stats.h"
#include "net/ipv6/uipopt.h"
#include "net/ipv6/tcpip.h"
#include "net/ipv6/uip.h"
#include "net/ipv6/uip-ds6.h"
#include "net/ipv6/uipbuf.h"
#include "net/ipv6/sicslowpan.h"
#include "net/netstack.h"
#include "net/packetbuf.h"
#include "net/queuebuf.h"
#include "net/routing/routing.h"
#include "sys/log.h"

Go to the source code of this file.

Macros

#define LOG_MODULE   "6LoWPAN"
 FOR RFC 6282 COMPLIANCE TODO: -Add compression options to UDP, currently only supports both ports compressed or both ports elided.
 
Pointers in the packetbuf buffer
Pointers in the sicslowpan and uip buffer

Functions

static void add_paging_dispatch (uint8_t page)
 Adds Paging dispatch byte.
 
static void add_6lorh_hdr (void)
 Adds 6lorh headers before IPHC.
 
static void digest_paging_dispatch (void)
 Digest 6lorh headers before IPHC.
 
static void digest_6lorh_hdr (void)
 Digest 6lorh headers before IPHC.
 
IPHC related functions


static struct sicslowpan_addr_contextaddr_context_lookup_by_prefix (uip_ipaddr_t *ipaddr)
 find the context corresponding to prefix ipaddr
 
static struct sicslowpan_addr_contextaddr_context_lookup_by_number (uint8_t number)
 find the context with the given number
 
static int compress_hdr_iphc (void)
 Compress IP/UDP header.
 
static bool uncompress_hdr_iphc (uint8_t *buf, uint16_t buf_size, uint16_t ip_len)
 Uncompress IPHC (i.e., IPHC and LOWPAN_UDP) headers and put them in sicslowpan_buf.
 
IPv6 dispatch "compression" function


Input/output functions common to all compression schemes


static void packet_sent (void *ptr, int status, int transmissions)
 Callback function for the MAC packet sent callback.
 
static void send_packet (void)
 This function is called by the 6lowpan code to send out a packet.
 
static uint8_t output (const linkaddr_t *localdest)
 Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
 
static void input (void)
 Process a received 6lowpan packet.
 

Variables

General variables
static uint8_t * packetbuf_ptr
 A pointer to the packetbuf buffer.
 
static uint8_t packetbuf_hdr_len
 packetbuf_hdr_len is the total length of (the processed) 6lowpan headers (fragment headers, IPV6 or HC1, HC2, and HC1 and HC2 non compressed fields).
 
static int packetbuf_payload_len
 The length of the payload in the Packetbuf buffer.
 
static uint8_t uncomp_hdr_len
 uncomp_hdr_len is the length of the headers before compression (if HC2 is used this includes the UDP header in addition to the IP header).
 
static int mac_max_payload
 mac_max_payload is the maimum payload space on the MAC frame.
 
static uint8_t curr_page
 The current page (RFC 4944)
 
static int last_tx_status
 the result of the last transmitted fragment
 
variables specific to RFC 6282
static uint8_t * iphc_ptr
 Addresses contexts for IPHC.
 

Detailed Description

6LoWPAN implementation (RFC 4944 and RFC 6282)

Author
Adam Dunkels adam@.nosp@m.sics.nosp@m..se
Nicolas Tsiftes nvt@s.nosp@m.ics..nosp@m.se
Niclas Finne nfi@s.nosp@m.ics..nosp@m.se
Mathilde Durvy mdurv.nosp@m.y@ci.nosp@m.sco.c.nosp@m.om
Julien Abeille jabei.nosp@m.lle@.nosp@m.cisco.nosp@m..com
Joakim Eriksson joaki.nosp@m.me@s.nosp@m.ics.s.nosp@m.e
Joel Hoglund joel@.nosp@m.sics.nosp@m..se

Definition in file sicslowpan.c.