mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
* removed incomplete sixlowpan from master branch
This commit is contained in:
parent
42871faffc
commit
820cdad59b
@ -1,20 +0,0 @@
|
||||
/* 6LoWPAN MAC - layer 2 implementations */
|
||||
|
||||
#include "sixlowmac.h"
|
||||
#include "drivers/cc110x/cc1100.h"
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
static void init_msba2_mac(mac_addr addr){
|
||||
addr.oui1 = MSBA2_OUI >> 8;
|
||||
addr.oui2 = 0x0 | MSBA2_OUI;
|
||||
addr.ext_ident = MSBA2_R8BIT;
|
||||
addr.ext_ident = cc1100_get_address();
|
||||
}
|
||||
|
||||
static void init_mac_address(mac_addr addr){
|
||||
|
||||
#ifdef SIXLOWPAN_MSBA2
|
||||
init_msba2_mac(addr);
|
||||
#endif
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
/* 6LoWPAN MAC header file */
|
||||
|
||||
#define MSBA2_OUI 0x005BA2 // 24bit OUI
|
||||
#define MSBA2_R8BIT 0xA2 // random 8bit
|
||||
|
||||
typedef struct mac_addr{
|
||||
uint16_t oui_1;
|
||||
uint8_t oui_2;
|
||||
uint8_t ext_ident_1; // MSBA2_R8BIT
|
||||
uint16_t ext_ident_2; // radio address
|
||||
} mac_addr;
|
@ -1,41 +0,0 @@
|
||||
/* 6LoWPAN layer 3 implementation */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "drivers/cc110x/cc1100.h"
|
||||
#include "sixlowmac.h"
|
||||
|
||||
|
||||
static void output(void){
|
||||
|
||||
// TODO
|
||||
// 1. get dest addr from function param
|
||||
// 2. get pointer to packet buffer
|
||||
// 3. if dest is null send broadcast
|
||||
// 4. hc1 or hc1x header compression
|
||||
// 5. check if ip-packet is to large to fit into a single mac-packet
|
||||
// if no, fragment the packet
|
||||
// frag1 dispatch + header
|
||||
// fragn dispatch
|
||||
// set fragments into queue and send it
|
||||
}
|
||||
|
||||
/* convert 48-bit MAC address to IPv6 modified EUI-64 Identifier*/
|
||||
static eui64 get_eui64_from_mac(void){
|
||||
mac_addr maddr;
|
||||
eui64 ident;
|
||||
|
||||
init_mac_address(maddr);
|
||||
|
||||
/* change bit 7 from oui1 to 1 */
|
||||
ident.oui1 = (maddr.oui_1 >> 8) | 0x2;
|
||||
ident.oui2 = (maddr.oui_1 << 8) | maddr.oui_2;
|
||||
ident.pattern = MAC_TO_EUI64_PTRN;
|
||||
ident.ext_ident_1 = maddr.ext_ident_1;
|
||||
ident.ext_ident_2 = maddr.ext_ident_1;
|
||||
|
||||
return ident;
|
||||
}
|
||||
|
||||
static void set_6lowpan_address(uint64_t prefix){
|
||||
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
/* fragmentation defines */
|
||||
#define FRAG1_HDR_LEN 32 // in bit
|
||||
#define FRAGN_HDR_LEN 40 // in bit
|
||||
#define FRAG1_DISPATCH 0xC0 // 11000000
|
||||
#define FRAGN_DISPATCH 0xE0 // 11100000
|
||||
|
||||
/* 48-bit MAC to EUI64 pattern */
|
||||
#define MAC_TO_EUI64_PTRN 0xFFFE
|
||||
|
||||
typedef struct eui64{
|
||||
uint8_t oui_1;
|
||||
uint16_t oui_2;
|
||||
uint16_t pattern;
|
||||
uint8_t ext_ident_1;
|
||||
uint16_t ext_ident_2;
|
||||
} eui64;
|
||||
|
||||
typedef struct ipv6_addr{
|
||||
uint16_t prefix[4];
|
||||
eui64 interface_id;
|
||||
} ipv6_addr;
|
Loading…
Reference in New Issue
Block a user