Skip to content

Commit

Permalink
sixlowpan: rename to sixlowpan_legacy
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed Dec 5, 2014
1 parent 8c189ce commit f4328c0
Show file tree
Hide file tree
Showing 73 changed files with 1,760 additions and 1,760 deletions.
10 changes: 5 additions & 5 deletions Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ ifneq (,$(filter tcp,$(USEMODULE)))
endif

ifneq (,$(filter socket_base,$(USEMODULE)))
USEMODULE += sixlowpan
USEMODULE += sixlowpan_legacy
USEMODULE += net_help
USEMODULE += vtimer
endif

ifneq (,$(filter sixlowborder,$(USEMODULE)))
USEMODULE += sixlowpan
USEMODULE += sixlowpan_legacy
endif

ifneq (,$(filter rpl,$(USEMODULE)))
USEMODULE += routing
endif

ifneq (,$(filter routing,$(USEMODULE)))
USEMODULE += sixlowpan
USEMODULE += sixlowpan_legacy
endif

ifneq (,$(filter sixlowpan,$(USEMODULE)))
ifneq (,$(filter sixlowpan_legacy,$(USEMODULE)))
USEMODULE += ieee802154
USEMODULE += net_help
USEMODULE += net_if
Expand All @@ -49,7 +49,7 @@ endif

ifneq (,$(filter aodvv2,$(USEMODULE)))
USEMODULE += vtimer
USEMODULE += sixlowpan
USEMODULE += sixlowpan_legacy
USEMODULE += oonf_common
USEMODULE += oonf_rfc5444
endif
Expand Down
2 changes: 1 addition & 1 deletion cpu/native/include/nativenet.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
extern "C" {
#endif

#ifdef MODULE_SIXLOWPAN
#ifdef MODULE_SIXLOWPAN_LEGACY
#define NATIVE_MAX_DATA_LENGTH (127)
#else
#define NATIVE_MAX_DATA_LENGTH (TAP_MAX_DATA)
Expand Down
26 changes: 13 additions & 13 deletions examples/rpl_udp/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <stdlib.h>
#include <string.h>
#include "msg.h"
#include "sixlowpan/ip.h"
#include "sixlowpan_legacy/ip.h"
#include "transceiver.h"
#include "ieee802154_frame.h"
#include "rpl/rpl_structs.h"
Expand All @@ -33,9 +33,9 @@
#include "debug.h"

#define LL_HDR_LEN (0x4)
#define IPV6_HDR_LEN (0x28)
#define IPV6_LEGACY_HDR_LEN (0x28)

extern uint8_t ipv6_ext_hdr_len;
extern uint8_t ipv6_legacy_ext_hdr_len;

msg_t msg_q[RCV_BUFFER_SIZE];

Expand Down Expand Up @@ -63,7 +63,7 @@ void *rpl_udp_monitor(void *arg)

msg_t m;
radio_packet_t *p;
ipv6_hdr_t *ipv6_buf;
ipv6_legacy_hdr_t *ipv6_legacy_buf;
uint8_t icmp_type, icmp_code;
icmpv6_hdr_t *icmpv6_buf = NULL;

Expand All @@ -89,19 +89,19 @@ void *rpl_udp_monitor(void *arg)
p->processing--;
DEBUG("\n");
}
else if (m.type == IPV6_PACKET_RECEIVED) {
ipv6_buf = (ipv6_hdr_t *) m.content.ptr;
printf("IPv6 datagram received (next header: %02X)", ipv6_buf->nextheader);
printf(" from %s ", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
&ipv6_buf->srcaddr));

if (ipv6_buf->nextheader == IPV6_PROTO_NUM_ICMPV6) {
icmpv6_buf = (icmpv6_hdr_t *) &ipv6_buf[(LL_HDR_LEN + IPV6_HDR_LEN) + ipv6_ext_hdr_len];
else if (m.type == IPV6_LEGACY_PACKET_RECEIVED) {
ipv6_legacy_buf = (ipv6_legacy_hdr_t *) m.content.ptr;
printf("IPv6 datagram received (next header: %02X)", ipv6_legacy_buf->nextheader);
printf(" from %s ", ipv6_legacy_addr_to_str(addr_str, IPV6_LEGACY_MAX_ADDR_STR_LEN,
&ipv6_legacy_buf->srcaddr));

if (ipv6_legacy_buf->nextheader == IPV6_LEGACY_PROTO_NUM_ICMPV6) {
icmpv6_buf = (icmpv6_hdr_t *) &ipv6_legacy_buf[(LL_HDR_LEN + IPV6_LEGACY_HDR_LEN) + ipv6_legacy_ext_hdr_len];
icmp_type = icmpv6_buf->type;
icmp_code = icmpv6_buf->code;
}

if (ipv6_buf->nextheader == IPV6_PROTO_NUM_ICMPV6) {
if (ipv6_legacy_buf->nextheader == IPV6_LEGACY_PROTO_NUM_ICMPV6) {
DEBUG("\t ICMP type: %02X ", icmp_type);
DEBUG("\t ICMP code: %02X ", icmp_code);
(void) icmp_type;
Expand Down
24 changes: 12 additions & 12 deletions examples/rpl_udp/rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "vtimer.h"
#include "thread.h"
#include "net_if.h"
#include "sixlowpan.h"
#include "sixlowpan_legacy.h"
#include "udp.h"
#include "rpl.h"
#include "rpl/rpl_dodag.h"
Expand Down Expand Up @@ -83,11 +83,11 @@ void rpl_udp_init(int argc, char **argv)

if (command == 'r') {
rpl_init_root();
ipv6_iface_set_routing_provider(rpl_get_next_hop);
ipv6_legacy_iface_set_routing_provider(rpl_get_next_hop);
is_root = 1;
}
else {
ipv6_iface_set_routing_provider(rpl_get_next_hop);
ipv6_legacy_iface_set_routing_provider(rpl_get_next_hop);
}
}
else {
Expand All @@ -104,24 +104,24 @@ void rpl_udp_init(int argc, char **argv)
"monitor");
DEBUGF("Register at transceiver %02X\n", TRANSCEIVER);
transceiver_register(TRANSCEIVER, monitor_pid);
ipv6_register_packet_handler(monitor_pid);
//sixlowpan_lowpan_register(monitor_pid);
ipv6_legacy_register_packet_handler(monitor_pid);
//sixlowpan_legacy_lowpan_register(monitor_pid);
}
else {
printf("ERROR: Unknown command '%c'\n", command);
return;
}

/* add global address */
ipv6_addr_t tmp;
ipv6_legacy_addr_t tmp;
/* initialize prefix */
ipv6_addr_init(&tmp, 0xabcd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, id);
ipv6_legacy_addr_init(&tmp, 0xabcd, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, id);
/* set host suffix */
ipv6_addr_set_by_eui64(&tmp, 0, &tmp);
ipv6_net_if_add_addr(0, &tmp, NDP_ADDR_STATE_PREFERRED, 0, 0, 0);
ipv6_legacy_addr_set_by_eui64(&tmp, 0, &tmp);
ipv6_legacy_net_if_add_addr(0, &tmp, NDP_ADDR_STATE_PREFERRED, 0, 0, 0);

if (command != 'h') {
ipv6_init_as_router();
ipv6_legacy_init_as_router();
}

/* set channel to 10 */
Expand Down Expand Up @@ -152,13 +152,13 @@ void rpl_udp_dodag(int argc, char **argv)
}

printf("Part of Dodag:\n");
printf("%s\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
printf("%s\n", ipv6_legacy_addr_to_str(addr_str, IPV6_LEGACY_MAX_ADDR_STR_LEN,
(&mydodag->dodag_id)));
printf("my rank: %d\n", mydodag->my_rank);

if (!is_root) {
printf("my preferred parent:\n");
printf("%s\n", ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
printf("%s\n", ipv6_legacy_addr_to_str(addr_str, IPV6_LEGACY_MAX_ADDR_STR_LEN,
(&mydodag->my_preferred_parent->addr)));
}

Expand Down
2 changes: 1 addition & 1 deletion examples/rpl_udp/rpl_udp.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void *rpl_udp_monitor(void *arg);
extern radio_address_t id;

/** @brief Char array for IP address printing */
extern char addr_str[IPV6_MAX_ADDR_STR_LEN];
extern char addr_str[IPV6_LEGACY_MAX_ADDR_STR_LEN];

#ifdef __cplusplus
}
Expand Down
10 changes: 5 additions & 5 deletions examples/rpl_udp/udp.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define SERVER_PORT (0xFF01)

char udp_server_stack_buffer[KERNEL_CONF_STACKSIZE_MAIN];
char addr_str[IPV6_MAX_ADDR_STR_LEN];
char addr_str[IPV6_LEGACY_MAX_ADDR_STR_LEN];

static void *init_udp_server(void *);

Expand Down Expand Up @@ -97,7 +97,7 @@ void udp_send(int argc, char **argv)
{
int sock;
sockaddr6_t sa;
ipv6_addr_t ipaddr;
ipv6_legacy_addr_t ipaddr;
int bytes_sent;
int address;
char text[5];
Expand All @@ -122,10 +122,10 @@ void udp_send(int argc, char **argv)
memset(&sa, 0, sizeof(sa));

if (address) {
ipv6_addr_init(&ipaddr, 0xabcd, 0x0, 0x0, 0x0, 0x0, 0x00ff, 0xfe00, (uint16_t)address);
ipv6_legacy_addr_init(&ipaddr, 0xabcd, 0x0, 0x0, 0x0, 0x0, 0x00ff, 0xfe00, (uint16_t)address);
}
else {
ipv6_addr_set_all_nodes_addr(&ipaddr);
ipv6_legacy_addr_set_all_nodes_addr(&ipaddr);
}

sa.sin6_family = AF_INET;
Expand All @@ -141,7 +141,7 @@ void udp_send(int argc, char **argv)
}
else {
printf("Successful deliverd %i bytes over UDP to %s to 6LoWPAN\n",
bytes_sent, ipv6_addr_to_str(addr_str, IPV6_MAX_ADDR_STR_LEN,
bytes_sent, ipv6_legacy_addr_to_str(addr_str, IPV6_LEGACY_MAX_ADDR_STR_LEN,
&ipaddr));
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/libcoap/0001-Add-RIOT-Makefile.patch
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ index 0000000..f90baa1
+++ b/Makefile
@@ -0,0 +1,5 @@
+MODULE:=$(shell basename $(CURDIR))
+INCLUDES += -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_legacy/include -I$(RIOTBASE)/cpu/arm7_common/include -I$(RIOTBASE)/sys/net/transport_layer/include -I$(RIOTBASE)/sys/net/sixlowpan/include/ -I$(RIOTBASE)/sys/net/ieee802154/include -I$(RIOTBASE)/sys/net/net_help -I$(RIOTBASE)/sys/posix/include -I$(RIOTBASE)/sys/posix/pnet/include
+INCLUDES += -I$(RIOTBASE) -I$(RIOTBASE)/sys/include -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/drivers/cc110x_legacy/include -I$(RIOTBASE)/cpu/arm7_common/include -I$(RIOTBASE)/sys/net/transport_layer/include -I$(RIOTBASE)/sys/net/sixlowpan_legacy/include/ -I$(RIOTBASE)/sys/net/ieee802154/include -I$(RIOTBASE)/sys/net/net_help -I$(RIOTBASE)/sys/posix/include -I$(RIOTBASE)/sys/posix/pnet/include
+CFLAGS += -DWITH_POSIX
+
+include $(RIOTBASE)/Makefile.base
Expand Down
6 changes: 3 additions & 3 deletions sys/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ endif
ifneq (,$(filter protocol_multiplex,$(USEMODULE)))
DIRS += net/link_layer/protocol-multiplex
endif
ifneq (,$(filter sixlowpan,$(USEMODULE)))
DIRS += net/network_layer/sixlowpan
ifneq (,$(filter sixlowpan_legacy,$(USEMODULE)))
DIRS += net/network_layer/sixlowpan_legacy
endif
ifneq (,$(filter sixlowborder,$(USEMODULE)))
DIRS += net/network_layer/sixlowpan/border
DIRS += net/network_layer/sixlowpan_legacy/border
endif
ifneq (,$(filter rpl,$(USEMODULE)))
DIRS += net/routing/rpl
Expand Down
2 changes: 1 addition & 1 deletion sys/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endif
ifneq (,$(filter protocol_multiplex,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter sixlowpan,$(USEMODULE)))
ifneq (,$(filter sixlowpan_legacy,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/net/include
endif
ifneq (,$(filter rpl,$(USEMODULE)))
Expand Down
8 changes: 4 additions & 4 deletions sys/auto_init/auto_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
#include "rtc.h"
#endif

#ifdef MODULE_SIXLOWPAN
#include "sixlowpan.h"
#ifdef MODULE_SIXLOWPAN_LEGACY
#include "sixlowpan_legacy.h"
#endif

#ifdef MODULE_UDP
Expand Down Expand Up @@ -249,9 +249,9 @@ void auto_init(void)
DEBUG("Auto init net_if module.\n");
auto_init_net_if();
#endif
#ifdef MODULE_SIXLOWPAN
#ifdef MODULE_SIXLOWPAN_LEGACY
DEBUG("Auto init 6LoWPAN module.\n");
sixlowpan_lowpan_init();
sixlowpan_legacy_lowpan_init();
#endif
#ifdef MODULE_PROFILING
extern void profiling_init(void);
Expand Down
10 changes: 5 additions & 5 deletions sys/net/include/etx_beaconing.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#ifndef ETX_BEACONING_H_
#define ETX_BEACONING_H_
#include <stdint.h>
#include "sixlowpan.h"
#include "sixlowpan_legacy.h"

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -56,7 +56,7 @@ extern "C" {
#define ETX_BEST_CANDIDATES (15) //Sent only 15 candidates in a beaconing packet
#define ETX_TUPLE_SIZE (2) //1 Byte for Addr, 1 Byte for packets rec.
#define ETX_PKT_REC_OFFSET (ETX_TUPLE_SIZE - 1) //Offset in a tuple of (addr,pkt_rec), will always be the last byte
#define ETX_IPV6_LAST_BYTE (15) //The last byte for an ipv6 address
#define ETX_IPV6_LEGACY_LAST_BYTE (15) //The last byte for an ipv6_legacy address
#define ETX_MAX_JITTER (ETX_INTERVAL / 5) //The default value is 20% of ETX_INTERVAL
#define ETX_JITTER_MOD (ETX_MAX_JITTER + 1) //The modulo value for jitter computation
#define ETX_DEF_JIT_CORRECT (ETX_MAX_JITTER / 2) //Default Jitter correction value (normally ETX_MAX_JITTER / 2)
Expand Down Expand Up @@ -94,7 +94,7 @@ typedef struct __attribute__((packed)) etx_probe_t {
} etx_probe_t;

typedef struct etx_neighbor_t {
ipv6_addr_t addr; //The address of this node
ipv6_legacy_addr_t addr; //The address of this node
uint8_t tx_cur_round; //The indicator for receiving a packet from this candidate this round
uint8_t packets_tx[ETX_WINDOW]; //The packets this node has transmitted TO ME
uint8_t packets_rx; //The packets this node has received FROM ME
Expand All @@ -103,8 +103,8 @@ typedef struct etx_neighbor_t {
} etx_neighbor_t;

//prototypes
void etx_init_beaconing(ipv6_addr_t *address);
double etx_get_metric(ipv6_addr_t *address);
void etx_init_beaconing(ipv6_legacy_addr_t *address);
double etx_get_metric(ipv6_legacy_addr_t *address);
void etx_update(etx_neighbor_t *neighbor);

#define ETX_PKT_OPT (0) //Position of Option-Type-Byte
Expand Down
22 changes: 11 additions & 11 deletions sys/net/include/ipv6.h → sys/net/include/ipv6_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@
*/

/**
* @ingroup net_sixlowpan
* @ingroup net_sixlowpan_legacy
* @{
* @file ipv6.h
* @file ipv6_legacy.h
* @brief IPv6 and ICMP functions
*
* Wraps all API types, constants and functions of
* 6LoWPAN in layer 3.
*
* @author Martin Lenders <[email protected]>
*/
#ifndef IPV6_H
#define IPV6_H
#ifndef IPV6_LEGACY_H
#define IPV6_LEGACY_H

#include "sixlowpan/error.h"
#include "sixlowpan/types.h"
#include "sixlowpan/ip.h"
#include "sixlowpan/icmp.h"
#include "sixlowpan/ndp.h"
#include "sixlowpan_legacy/error.h"
#include "sixlowpan_legacy/types.h"
#include "sixlowpan_legacy/ip.h"
#include "sixlowpan_legacy/icmp.h"
#include "sixlowpan_legacy/ndp.h"

#include "../network_layer/sixlowpan/icmp.h" /* TODO: remove if not needed anymore */
#include "../network_layer/sixlowpan_legacy/icmp.h" /* TODO: remove if not needed anymore */

#ifdef __cplusplus
extern "C" {
Expand All @@ -36,7 +36,7 @@ extern "C" {
}
#endif

#endif /* IPV6_H */
#endif /* IPV6_LEGACY_H */
/**
* @}
*/
Loading

0 comments on commit f4328c0

Please sign in to comment.