1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

[sys/net/sixlowpan/sixlowpan.h sys/net/sixlowpan/sixlowpan.c]

* seperated initialization of adhoc routers from initialization process
This commit is contained in:
mlenders 2011-06-22 12:36:26 +02:00
parent a2d7628a73
commit 9b1dbd43fb
2 changed files with 10 additions and 5 deletions

View File

@ -936,12 +936,8 @@ void sixlowpan_init(transceiver_type_t trans, uint8_t r_addr){
/* init global buffer mutex */
mutex_init(&buf_mutex);
/* init link-local address and network prefix */
/* init link-local address */
ipv6_set_ll_prefix(&loaddr);
ipv6_addr_t prefix, tmp;
ipv6_init_address(&tmp, 0xabcd,0,0,0,0,0,0,0);
ipv6_set_prefix(&prefix, &tmp);
plist_add(&prefix, 64, OPT_PI_VLIFETIME_INFINITE,0,1,OPT_PI_FLAG_A);
memcpy(&(loaddr.uint8[8]), &(iface.laddr.uint8[0]), 8);
ipv6_iface_add_addr(&loaddr, ADDR_STATE_PREFERRED, 0, 0,
@ -953,3 +949,11 @@ void sixlowpan_init(transceiver_type_t trans, uint8_t r_addr){
PRIORITY_MAIN-1, CREATE_STACKTEST,
nbr_cache_auto_rem, "nbr_cache_rem");
}
void sixlowpan_adhoc_init(transceiver_type_t trans, ipv6_addr_t *prefix, uint8_t r_addr){
/* init network prefix */
ipv6_set_prefix(prefix, prefix);
plist_add(prefix, 64, OPT_PI_VLIFETIME_INFINITE,0,1,OPT_PI_FLAG_A);
ipv6_init_iface_as_router();
sixlowpan_init(trans, r_addr);
}

View File

@ -34,6 +34,7 @@ typedef struct lowpan_context_t {
} lowpan_context_t;
void sixlowpan_init(transceiver_type_t trans, uint8_t r_addr);
void sixlowpan_adhoc_init(transceiver_type_t trans, ipv6_addr_t *prefix, uint8_t r_addr);
void lowpan_init(ieee_802154_long_t *addr, uint8_t *data);
void lowpan_read(uint8_t *data, uint8_t length, ieee_802154_long_t *s_laddr,
ieee_802154_long_t *d_laddr);