2011-01-07 13:02:27 +01:00
|
|
|
#ifndef SIXLOWPAN_H
|
|
|
|
#define SIXLOWPAN_H
|
|
|
|
|
2011-01-07 23:38:42 +01:00
|
|
|
#define IP_PROCESS_STACKSIZE 2048
|
2011-01-24 22:41:32 +01:00
|
|
|
#define NC_STACKSIZE 512
|
2011-01-07 23:38:42 +01:00
|
|
|
|
2011-01-07 13:02:27 +01:00
|
|
|
/* fragment size in bytes*/
|
|
|
|
#define FRAG_PART_ONE_HDR_LEN 4
|
|
|
|
#define FRAG_PART_N_HDR_LEN 5
|
|
|
|
|
2011-01-24 22:41:32 +01:00
|
|
|
#define LOWPAN_IPHC_DISPATCH 0x60
|
|
|
|
#define LOWPAN_IPHC_FL_C 0x10
|
|
|
|
#define LOWPAN_IPHC_TC_C 0x08
|
|
|
|
#define LOWPAN_IPHC_CID 0x80
|
|
|
|
#define LOWPAN_IPHC_SAC 0x40
|
|
|
|
#define LOWPAN_IPHC_SAM 0x30
|
|
|
|
#define LOWPAN_IPHC_DAC 0x04
|
|
|
|
#define LOWPAN_IPHC_DAM 0x03
|
|
|
|
#define LOWPAN_IPHC_M 0x08
|
|
|
|
#define LOWPAN_IPHC_NH 0x04
|
2010-10-06 17:15:05 +02:00
|
|
|
|
2011-01-24 22:41:32 +01:00
|
|
|
#define LOWPAN_IPV6_DISPATCH 0x41
|
|
|
|
#define LOWPAN_CONTEXT_MAX 16
|
2010-10-06 17:15:05 +02:00
|
|
|
|
2011-01-24 22:41:32 +01:00
|
|
|
#include "transceiver.h"
|
2010-10-06 17:55:31 +02:00
|
|
|
|
2011-01-24 22:41:32 +01:00
|
|
|
typedef struct lowpan_context_t {
|
|
|
|
uint8_t num;
|
|
|
|
uint8_t prefix[8];
|
|
|
|
} lowpan_context_t;
|
2011-01-07 13:02:27 +01:00
|
|
|
|
2011-01-24 22:41:32 +01:00
|
|
|
void sixlowpan_init(transceiver_type_t trans, uint8_t r_addr);
|
|
|
|
void output(ieee_802154_long_t *addr, uint8_t *data);
|
|
|
|
void input(uint8_t *data, uint8_t length, ieee_802154_long_t *s_laddr,
|
|
|
|
ieee_802154_long_t *d_laddr);
|
|
|
|
void lowpan_iphc_encoding(ieee_802154_long_t *dest);
|
|
|
|
void lowpan_iphc_decoding(uint8_t *data, uint8_t length,
|
|
|
|
ieee_802154_long_t *s_laddr,
|
|
|
|
ieee_802154_long_t *d_laddr);
|
|
|
|
lowpan_context_t * lowpan_context_lookup(ipv6_addr_t *addr);
|
|
|
|
lowpan_context_t * lowpan_context_num_lookup(uint8_t num);
|
|
|
|
void lowpan_ipv6_set_dispatch(uint8_t *data);
|
2010-12-13 11:14:41 +01:00
|
|
|
#endif
|