From 0f364f6ae61e5a5219e173ecd106291c876073c3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 16 Jan 2015 16:49:48 -0600 Subject: [PATCH] Networking: Move net/ipv6 to net/neighbor --- net/Kconfig | 18 +++++++++++++++--- net/README.txt | 4 ++-- net/devif/devif_poll.c | 2 +- net/{ipv6 => neighbor}/Kconfig | 9 +-------- net/{ipv6 => neighbor}/Make.defs | 10 +++++----- .../ipv6_neighbor.c => neighbor/neighbor.c} | 8 ++++---- net/{ipv6/ipv6.h => neighbor/neighbor.h} | 8 ++++---- 7 files changed, 32 insertions(+), 27 deletions(-) rename net/{ipv6 => neighbor}/Kconfig (57%) rename net/{ipv6 => neighbor}/Make.defs (92%) rename net/{ipv6/ipv6_neighbor.c => neighbor/neighbor.c} (97%) rename net/{ipv6/ipv6.h => neighbor/neighbor.h} (96%) diff --git a/net/Kconfig b/net/Kconfig index 524a0a6b295cf..bb039d30f163c 100644 --- a/net/Kconfig +++ b/net/Kconfig @@ -181,18 +181,30 @@ config SLIP_DEFPRIO endif # NET_SLIP endmenu # Data link support -source "net/socket/Kconfig" source "net/netdev/Kconfig" -# source "net/ipv4/Kconfig" # Currently cannot select both IPv4 and IPv6 config NET_IPv4 bool default y if !NET_IPv6 default n if NET_IPv6 + ---help--- + Build in support for IPv4. + +menu "Internet Protocol Selection" + depends on EXPERIMENTAL + +config NET_IPv6 + bool "IPv6" + default n + ---help--- + Build in support for IPv6. Not fully implemented. -source "net/ipv6/Kconfig" +source "net/neighbor/Kconfig" +endmenu # Internet Protocol Selection + +source "net/socket/Kconfig" source "net/pkt/Kconfig" source "net/tcp/Kconfig" source "net/udp/Kconfig" diff --git a/net/README.txt b/net/README.txt index d0c75f024a9ec..bbbccc0db7193 100644 --- a/net/README.txt +++ b/net/README.txt @@ -8,12 +8,12 @@ Directory Structure | `- net/ | - +- arp - Address resolution protocol + +- arp - Address resolution protocol (IPv4) +- devif - Stack/device interface layer +- icmp - Internet Control Message Protocol (IPv4) +- icmpv6 - Internet Control Message Protocol (IPv6) +- iob - I/O buffering logic - +- ipv6 - Logic unique to IPv6 + +- neighbor - Neighbor Discovery Protocol (IPv6) +- netdev - Socket network device interface +- pkt - "Raw" packet socket support +- socket - BSD socket interface diff --git a/net/devif/devif_poll.c b/net/devif/devif_poll.c index 26fc80f652078..4d365a2daf683 100644 --- a/net/devif/devif_poll.c +++ b/net/devif/devif_poll.c @@ -392,7 +392,7 @@ int devif_timer(FAR struct net_driver_s *dev, devif_poll_callback_t callback, /* Increment the timer used by the IP reassembly logic */ -#if defined(CONFIG_NET_TCP_REASSEMBLY) && !defined(CONFIG_NET_IPv6) +#if defined(CONFIG_NET_TCP_REASSEMBLY) && defined(CONFIG_NET_IPv4) if (g_reassembly_timer != 0 && g_reassembly_timer < CONFIG_NET_TCP_REASS_MAXAGE) { diff --git a/net/ipv6/Kconfig b/net/neighbor/Kconfig similarity index 57% rename from net/ipv6/Kconfig rename to net/neighbor/Kconfig index 075622bb77e30..148438fbeb3cb 100644 --- a/net/ipv6/Kconfig +++ b/net/neighbor/Kconfig @@ -3,17 +3,10 @@ # see misc/tools/kconfig-language.txt. # -config NET_IPv6 - bool "IPv6" - default n - depends on EXPERIMENTAL - ---help--- - Build in support for IPv6. Not fully implemented. - if NET_IPv6 config NET_IPV6_NCONF_ENTRIES - int "Number of neighbors" + int "Number of IPv6 neighbors" default 8 #config NET_IPV6_NEIGHBOR_ADDRTYPE diff --git a/net/ipv6/Make.defs b/net/neighbor/Make.defs similarity index 92% rename from net/ipv6/Make.defs rename to net/neighbor/Make.defs index 1636db59cdfbb..ee77ad29dcc68 100644 --- a/net/ipv6/Make.defs +++ b/net/neighbor/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# net/utils/Make.defs +# net/neighbor/Make.defs # # Copyright (C) 2014 Gregory Nutt. All rights reserved. # Author: Gregory Nutt @@ -33,14 +33,14 @@ # ############################################################################ -# IPv6-specific logic +# Logic specific to IPv6 Neighbor Discovery Protocol ifeq ($(CONFIG_NET_IPv6),y) -NET_CSRCS += ipv6_neighbor.c +NET_CSRCS += neighbor.c # Include utility build support -DEPPATH += --dep-path ipv6 -VPATH += :ipv6 +DEPPATH += --dep-path neighbor +VPATH += :neighbor endif diff --git a/net/ipv6/ipv6_neighbor.c b/net/neighbor/neighbor.c similarity index 97% rename from net/ipv6/ipv6_neighbor.c rename to net/neighbor/neighbor.c index 3be02e4c6b984..37a2460a1a3c2 100644 --- a/net/ipv6/ipv6_neighbor.c +++ b/net/neighbor/neighbor.c @@ -1,11 +1,11 @@ /**************************************************************************** - * net/ipv6/ipv6_neighbor.c + * net/neighbor/neighbor.c * Database of link-local neighbors, used by IPv6 code and to be used by * a future ARP code rewrite. * + * Copyright (c) 2006, Swedish Institute of Computer Science. All rights + * reserved. * Author: Adam Dunkels - * Copyright (c) 2006, Swedish Institute of Computer Science. - * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,7 +45,7 @@ #include -#include "ipv6/ipv6.h" +#include "neighbor/neighbor.h" /**************************************************************************** * Pre-processor Definitions diff --git a/net/ipv6/ipv6.h b/net/neighbor/neighbor.h similarity index 96% rename from net/ipv6/ipv6.h rename to net/neighbor/neighbor.h index 9ea1f0d5e3939..db43fecfabf81 100644 --- a/net/ipv6/ipv6.h +++ b/net/neighbor/neighbor.h @@ -1,5 +1,5 @@ /**************************************************************************** - * net/ipv6/ipv6.h + * net/neighbor/neighbor.h * Header file for database of link-local neighbors, used by IPv6 code and * to be used by future ARP code. * @@ -38,8 +38,8 @@ * ****************************************************************************/ -#ifndef __NET_IPV6_IPV6_H -#define __NET_IPV6_IPV6_H +#ifndef __NET_NEIGHBOR_NEIGHBOR_H +#define __NET_NEIGHBOR_NEIGHBOR_H /**************************************************************************** * Included Files @@ -81,5 +81,5 @@ struct net_neighbor_addr_s *net_neighbor_lookup(net_ipv6addr_t ipaddr); void net_neighbor_periodic(void); #endif /* CONFIG_NET_IPv6 */ -#endif /* __NET_IPV6_IPV6_H */ +#endif /* __NET_NEIGHBOR_NEIGHBOR_H */