Merge pull request #173 from adamdunkels/feature-ipv6-not-in-makefile

Allow IPv6 to be compiled via #define
This commit is contained in:
Nicolas Tsiftes 2013-03-19 08:17:52 -07:00
commit 199a89bac4
16 changed files with 75 additions and 24 deletions

View file

@ -62,24 +62,9 @@ THREADS = mt.c
LIBS = memb.c mmem.c timer.c list.c etimer.c ctimer.c energest.c rtimer.c stimer.c \
print-stats.c ifft.c crc16.c random.c checkpoint.c ringbuf.c
DEV = nullradio.c
NET = netstack.c uip-debug.c packetbuf.c queuebuf.c packetqueue.c
ifeq ($(UIP_CONF_IPV6),1)
CFLAGS += -DUIP_CONF_IPV6=1
UIP = uip6.c tcpip.c psock.c uip-udp-packet.c uip-split.c \
resolv.c tcpdump.c uiplib.c simple-udp.c
NET += $(UIP) uip-icmp6.c uip-nd6.c uip-packetqueue.c \
sicslowpan.c neighbor-attr.c neighbor-info.c uip-ds6.c uip-ds6-route.c
ifneq ($(UIP_CONF_RPL),0)
CFLAGS += -DUIP_CONF_IPV6_RPL=1
include $(CONTIKI)/core/net/rpl/Makefile.rpl
endif # UIP_CONF_RPL
else # UIP_CONF_IPV6
UIP = uip.c uiplib.c resolv.c tcpip.c psock.c hc.c uip-split.c uip-fw.c \
uip-fw-drv.c uip_arp.c tcpdump.c uip-neighbor.c uip-udp-packet.c \
uip-over-mesh.c dhcpc.c simple-udp.c
NET += $(UIP) uaodv.c uaodv-rt.c
endif # UIP_CONF_IPV6
include $(CONTIKI)/core/net/Makefile.uip
include $(CONTIKI)/core/net/rpl/Makefile.rpl
CTK = ctk.c
CTKVNC = $(CTK) ctk-vncserver.c libconio.c vnc-server.c vnc-out.c ctk-vncfont.c

33
core/net/Makefile.uip Normal file
View file

@ -0,0 +1,33 @@
NET = \
dhcpc.c \
hc.c \
neighbor-attr.c \
neighbor-info.c \
netstack.c \
packetbuf.c \
packetqueue.c \
psock.c \
queuebuf.c \
resolv.c \
sicslowpan.c \
simple-udp.c \
tcpdump.c \
tcpip.c \
uaodv-rt.c \
uaodv.c \
uip-debug.c \
uip-ds6-route.c \
uip-ds6.c \
uip-fw-drv.c \
uip-fw.c \
uip-icmp6.c \
uip-nd6.c \
uip-neighbor.c \
uip-over-mesh.c \
uip-packetqueue.c \
uip-split.c \
uip-udp-packet.c \
uip.c \
uip6.c \
uip_arp.c \
uiplib.c

View file

@ -57,6 +57,7 @@
#include "net/neighbor-info.h"
#if UIP_CONF_IPV6
/*---------------------------------------------------------------------------*/
extern rpl_of_t RPL_OF;
static rpl_of_t * const objective_functions[] = {&RPL_OF};
@ -1230,3 +1231,4 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
p->dtsn = dio->dtsn;
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */

View file

@ -62,6 +62,7 @@
#define UIP_EXT_HDR_OPT_PADN_BUF ((struct uip_ext_hdr_opt_padn *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
#define UIP_EXT_HDR_OPT_RPL_BUF ((struct uip_ext_hdr_opt_rpl *)&uip_buf[uip_l2_l3_hdr_len + uip_ext_opt_offset])
/*---------------------------------------------------------------------------*/
#if UIP_CONF_IPV6
int
rpl_verify_header(int uip_ext_opt_offset)
{
@ -313,3 +314,4 @@ rpl_invert_header(void)
}
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */

View file

@ -57,6 +57,7 @@
#include "net/uip-debug.h"
#if UIP_CONF_IPV6
/*---------------------------------------------------------------------------*/
#define RPL_DIO_GROUNDED 0x80
#define RPL_DIO_MOP_SHIFT 3
@ -841,3 +842,4 @@ uip_rpl_input(void)
uip_len = 0;
}
#endif /* UIP_CONF_IPV6 */

View file

@ -44,6 +44,8 @@
#include "lib/random.h"
#include "sys/ctimer.h"
#if UIP_CONF_IPV6
#define DEBUG DEBUG_NONE
#include "net/uip-debug.h"
@ -235,3 +237,4 @@ rpl_schedule_dao(rpl_instance_t *instance)
}
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */

View file

@ -52,6 +52,8 @@
#include <limits.h>
#include <string.h>
#if UIP_CONF_IPV6
#if RPL_CONF_STATS
rpl_stats_t rpl_stats;
#endif
@ -262,3 +264,4 @@ rpl_init(void)
#endif
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */

View file

@ -68,6 +68,10 @@
#include "net/neighbor-info.h"
#include "net/netstack.h"
#if UIP_CONF_IPV6
#include <stdio.h>
#define DEBUG 0
#if DEBUG
/* PRINTFI and PRINTFO are defined for input and output to debug one without changing the timing of the other */
@ -1886,3 +1890,4 @@ const struct network_driver sicslowpan_driver = {
};
/*--------------------------------------------------------------------*/
/** @} */
#endif /* UIP_CONF_IPV6 */

View file

@ -765,7 +765,7 @@ PROCESS_THREAD(tcpip_process, ev, data)
UIP_FALLBACK_INTERFACE.init();
#endif
/* initialize RPL if configured for using RPL */
#if UIP_CONF_IPV6_RPL
#if UIP_CONF_IPV6 && UIP_CONF_IPV6_RPL
rpl_init();
#endif /* UIP_CONF_IPV6_RPL */

View file

@ -35,6 +35,7 @@
#include "lib/list.h"
#include "lib/memb.h"
#if UIP_CONF_IPV6
#include <string.h>
@ -368,4 +369,4 @@ uip_ds6_defrt_periodic(void)
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */

View file

@ -48,6 +48,8 @@
#include "net/uip-ds6.h"
#include "net/uip-packetqueue.h"
#if UIP_CONF_IPV6
#define DEBUG DEBUG_NONE
#include "net/uip-debug.h"
@ -876,3 +878,4 @@ uip_ds6_compute_reachable_time(void)
/** @} */
#endif /* UIP_CONF_IPV6 */

View file

@ -34,6 +34,8 @@
#include "net/uip-fw.h"
#if !UIP_CONF_IPV6
PROCESS(uip_fw_process, "IP forwarding");
/*---------------------------------------------------------------------------*/
@ -48,3 +50,5 @@ PROCESS_THREAD(uip_fw_process, ev, data)
PROCESS_END();
}
/*---------------------------------------------------------------------------*/
#endif /* UIP_CONF_IPV6 */

View file

@ -70,6 +70,7 @@ static uip_ipaddr_t tmp_ipaddr;
#include "rpl/rpl.h"
#endif /* UIP_CONF_IPV6_RPL */
#if UIP_CONF_IPV6
/*---------------------------------------------------------------------------*/
void
uip_icmp6_echo_request_input(void)
@ -272,3 +273,4 @@ uip_icmp6_send(uip_ipaddr_t *dest, int type, int code, int payload_len)
/*---------------------------------------------------------------------------*/
/** @} */
#endif /* UIP_CONF_IPV6 */

View file

@ -74,6 +74,7 @@
#include "net/uip-ds6.h"
#include "lib/random.h"
#if UIP_CONF_IPV6
/*------------------------------------------------------------------*/
#define DEBUG 0
#include "net/uip-debug.h"
@ -662,6 +663,7 @@ uip_nd6_ra_output(uip_ipaddr_t * dest)
nd6_opt_offset = UIP_ND6_RA_LEN;
#if !UIP_CONF_ROUTER
/* Prefix list */
for(prefix = uip_ds6_prefix_list;
prefix < uip_ds6_prefix_list + UIP_DS6_PREFIX_NB; prefix++) {
@ -678,6 +680,7 @@ uip_nd6_ra_output(uip_ipaddr_t * dest)
uip_len += UIP_ND6_OPT_PREFIX_INFO_LEN;
}
}
#endif /* !UIP_CONF_ROUTER */
/* Source link-layer option */
create_llao((uint8_t *)UIP_ND6_OPT_HDR_BUF, UIP_ND6_OPT_SLLAO);
@ -960,3 +963,4 @@ discard:
#endif /* !UIP_CONF_ROUTER */
/** @} */
#endif /* UIP_CONF_IPV6 */

View file

@ -1017,11 +1017,11 @@ struct uip_udp_conn *uip_udp_new(const uip_ipaddr_t *ripaddr, uint16_t rport);
(addr1)->u16[1] == (addr2)->u16[1])
#define uip_ip6addr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0)
#if !UIP_CONF_IPV6
#define uip_ipaddr_cmp(addr1, addr2) uip_ip4addr_cmp(addr1, addr2)
#else /* !UIP_CONF_IPV6 */
#if UIP_CONF_IPV6
#define uip_ipaddr_cmp(addr1, addr2) uip_ip6addr_cmp(addr1, addr2)
#endif /* !UIP_CONF_IPV6 */
#else /* UIP_CONF_IPV6 */
#define uip_ipaddr_cmp(addr1, addr2) uip_ip4addr_cmp(addr1, addr2)
#endif /* UIP_CONF_IPV6 */
/**
* Compare two IP addresses with netmasks
@ -1936,7 +1936,7 @@ CCIF extern uip_lladdr_t uip_lladdr;
#ifdef UIP_CONF_IPV6
#if UIP_CONF_IPV6
/** Length of the link local prefix */
#define UIP_LLPREF_LEN 10

View file

@ -78,6 +78,7 @@
#include <string.h>
#if UIP_CONF_IPV6
/*---------------------------------------------------------------------------*/
/* For Debug, logging, statistics */
/*---------------------------------------------------------------------------*/
@ -2303,3 +2304,4 @@ uip_send(const void *data, int len)
}
/*---------------------------------------------------------------------------*/
/** @} */
#endif /* UIP_CONF_IPV6 */