Browse Source

ipv6_addr: remove ng_ prefix

dev/timer
Martine Lenders 8 years ago
parent
commit
203561e741
  1. 8
      Makefile.dep
  2. 4
      examples/ng_networking/udp.c
  3. 4
      sys/Makefile
  4. 39
      sys/include/net/ipv6.h
  5. 229
      sys/include/net/ipv6/addr.h
  6. 2
      sys/include/net/ng_ipv6.h
  7. 4
      sys/include/net/ng_ipv6/ext/rh.h
  8. 12
      sys/include/net/ng_ipv6/hdr.h
  9. 12
      sys/include/net/ng_ipv6/nc.h
  10. 33
      sys/include/net/ng_ipv6/netif.h
  11. 6
      sys/include/net/ng_ndp.h
  12. 12
      sys/include/net/ng_ndp/internal.h
  13. 2
      sys/include/net/ng_ndp/node.h
  14. 10
      sys/include/net/ng_ndp/types.h
  15. 4
      sys/include/net/ng_rpl/srh.h
  16. 8
      sys/include/net/ng_sixlowpan/ctx.h
  17. 6
      sys/include/net/ng_zep.h
  18. 2
      sys/include/universal_address.h
  19. 8
      sys/net/application_layer/ng_zep/ng_zep.c
  20. 2
      sys/net/crosslayer/ng_pktdump/ng_pktdump.c
  21. 2
      sys/net/include/socket_base/socket.h
  22. 16
      sys/net/network_layer/fib/fib.c
  23. 2
      sys/net/network_layer/ipv6/addr/Makefile
  24. 8
      sys/net/network_layer/ipv6/addr/ipv6_addr.c
  25. 18
      sys/net/network_layer/ipv6/addr/ipv6_addr_from_str.c
  26. 9
      sys/net/network_layer/ipv6/addr/ipv6_addr_to_str.c
  27. 8
      sys/net/network_layer/ng_icmpv6/echo/ng_icmpv6_echo.c
  28. 2
      sys/net/network_layer/ng_ipv6/ext/rh/ng_ipv6_ext_rh.c
  29. 30
      sys/net/network_layer/ng_ipv6/hdr/ng_ipv6_hdr.c
  30. 6
      sys/net/network_layer/ng_ipv6/hdr/ng_ipv6_hdr_print.c
  31. 40
      sys/net/network_layer/ng_ipv6/nc/ng_ipv6_nc.c
  32. 107
      sys/net/network_layer/ng_ipv6/netif/ng_ipv6_netif.c
  33. 30
      sys/net/network_layer/ng_ipv6/ng_ipv6.c
  34. 39
      sys/net/network_layer/ng_ndp/internal/ng_ndp_internal.c
  35. 44
      sys/net/network_layer/ng_ndp/ng_ndp.c
  36. 26
      sys/net/network_layer/ng_ndp/node/ng_ndp_node.c
  37. 27
      sys/net/network_layer/ng_sixlowpan/ctx/ng_sixlowpan_ctx.c
  38. 66
      sys/net/network_layer/ng_sixlowpan/iphc/ng_sixlowpan_iphc.c
  39. 2
      sys/net/routing/ng_rpl/srh/ng_rpl_srh.c
  40. 2
      sys/posix/pnet/include/netinet/in.h
  41. 2
      sys/shell/commands/Makefile
  42. 12
      sys/shell/commands/sc_icmpv6_echo.c
  43. 18
      sys/shell/commands/sc_ipv6_nc.c
  44. 26
      sys/shell/commands/sc_netif.c
  45. 6
      sys/shell/commands/sc_zep.c
  46. 4
      sys/shell/commands/shell_commands.c
  47. 2
      tests/unittests/tests-ipv6_addr/Makefile.include
  48. 456
      tests/unittests/tests-ipv6_addr/tests-ipv6_addr.c
  49. 2
      tests/unittests/tests-ipv6_addr/tests-ipv6_addr.h
  50. 42
      tests/unittests/tests-ipv6_hdr/tests-ipv6_hdr.c
  51. 58
      tests/unittests/tests-ipv6_nc/tests-ipv6_nc.c
  52. 2
      tests/unittests/tests-ipv6_netif/Makefile.include
  53. 152
      tests/unittests/tests-ipv6_netif/tests-ipv6_netif.c
  54. 32
      tests/unittests/tests-sixlowpan_ctx/tests-sixlowpan_ctx.c

8
Makefile.dep

@ -70,7 +70,7 @@ ifneq (,$(filter ng_sixlowpan,$(USEMODULE)))
endif
ifneq (,$(filter ng_sixlowpan_ctx,$(USEMODULE)))
USEMODULE += ng_ipv6_addr
USEMODULE += ipv6_addr
USEMODULE += vtimer
endif
@ -130,7 +130,7 @@ endif
ifneq (,$(filter ng_ipv6,$(USEMODULE)))
USEMODULE += inet_csum
USEMODULE += ng_ipv6_addr
USEMODULE += ipv6_addr
USEMODULE += ng_ipv6_hdr
USEMODULE += ng_ipv6_nc
USEMODULE += ng_ipv6_netif
@ -138,11 +138,11 @@ ifneq (,$(filter ng_ipv6,$(USEMODULE)))
endif
ifneq (,$(filter ng_ipv6_nc,$(USEMODULE)))
USEMODULE += ng_ipv6_addr
USEMODULE += ipv6_addr
endif
ifneq (,$(filter ng_ipv6_netif,$(USEMODULE)))
USEMODULE += ng_ipv6_addr
USEMODULE += ipv6_addr
USEMODULE += ng_netif
endif

4
examples/ng_networking/udp.c

@ -36,11 +36,11 @@ static void send(char *addr_str, char *port_str, char *data)
uint8_t port[2];
uint16_t tmp;
ng_pktsnip_t *payload, *udp, *ip;
ng_ipv6_addr_t addr;
ipv6_addr_t addr;
ng_netreg_entry_t *sendto;
/* parse destination address */
if (ng_ipv6_addr_from_str(&addr, addr_str) == NULL) {
if (ipv6_addr_from_str(&addr, addr_str) == NULL) {
puts("Error: unable to parse destination address");
return;
}

4
sys/Makefile

@ -25,8 +25,8 @@ endif
ifneq (,$(filter ng_ipv6,$(USEMODULE)))
DIRS += net/network_layer/ng_ipv6
endif
ifneq (,$(filter ng_ipv6_addr,$(USEMODULE)))
DIRS += net/network_layer/ng_ipv6/addr
ifneq (,$(filter ipv6_addr,$(USEMODULE)))
DIRS += net/network_layer/ipv6/addr
endif
ifneq (,$(filter ng_ipv6_ext,$(USEMODULE)))
DIRS += net/network_layer/ng_ipv6/ext

39
sys/include/net/ipv6.h

@ -0,0 +1,39 @@
/*
* Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @defgroup net_ipv6 IPv6
* @ingroup net
* @brief Provides types and helper functions related to Internet Protocol
* version 6 (IPv6)
* @see <a href="http://tools.ietf.org/html/rfc2460">
* RFC 2460
* </a> et al.
* @{
*
* @file
* @brief IPv6 include gathering header.
*
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#ifndef IPV6_H_
#define IPV6_H_
#include "ipv6/addr.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* IPV6_H_ */
/** @} */

229
sys/include/net/ng_ipv6/addr.h → sys/include/net/ipv6/addr.h

@ -7,8 +7,8 @@
*/
/**
* @defgroup net_ng_ipv6_addr IPv6 addresses
* @ingroup net_ng_ipv6
* @defgroup net_ipv6_addr IPv6 addresses
* @ingroup net_ipv6
* @brief IPv6 address architecture
*
* @see <a href="http://tools.ietf.org/html/rfc4291">
@ -24,8 +24,8 @@
*/
#ifndef NG_IPV6_ADDR_H_
#define NG_IPV6_ADDR_H_
#ifndef IPV6_ADDR_H_
#define IPV6_ADDR_H_
#include <stdbool.h>
@ -38,12 +38,12 @@ extern "C" {
/**
* @brief Length of an IPv6 address in bit.
*/
#define NG_IPV6_ADDR_BIT_LEN (128)
#define IPV6_ADDR_BIT_LEN (128)
/**
* @brief Maximum length of an IPv6 address as string.
*/
#define NG_IPV6_ADDR_MAX_STR_LEN (sizeof("ffff:ffff:ffff:ffff:" \
#define IPV6_ADDR_MAX_STR_LEN (sizeof("ffff:ffff:ffff:ffff:" \
"ffff:ffff:255.255.255.255"))
/**
@ -57,7 +57,7 @@ extern "C" {
* href="http://tools.ietf.org/html/rfc3879">SLDEP</a>. They are only
* defined here for the distinction of global unicast addresses.
*/
#define NG_IPV6_ADDR_SITE_LOCAL_PREFIX (0xFEC0)
#define IPV6_ADDR_SITE_LOCAL_PREFIX (0xfec0)
/**
* @brief Data type to represent an IPv6 address.
@ -67,7 +67,7 @@ typedef union {
network_uint16_t u16[8]; /**< divided by 8 16-bit words. */
network_uint32_t u32[4]; /**< divided by 4 32-bit words. */
network_uint64_t u64[2]; /**< divided by 2 64-bit words. */
} ng_ipv6_addr_t;
} ipv6_addr_t;
/**
* @brief Static initializer for the unspecified IPv6 address (::)
@ -76,7 +76,10 @@ typedef union {
* RFC 4291, section 2.5.2
* </a>
*/
#define NG_IPV6_ADDR_UNSPECIFIED {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }}
#define IPV6_ADDR_UNSPECIFIED {{ 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00 }}
/**
* @brief Static initializer for the loopback IPv6 address (::1)
@ -85,8 +88,10 @@ typedef union {
* RFC 4291, section 2.5.3
* </a>
*/
#define NG_IPV6_ADDR_LOOPBACK {{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }}
#define IPV6_ADDR_LOOPBACK {{ 0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x01 }}
/**
* @brief Static initializer for the interface-local all nodes multicast IPv6
* address (ff01::1)
@ -95,8 +100,10 @@ typedef union {
* RFC 4291, section 2.7
* </a>
*/
#define NG_IPV6_ADDR_ALL_NODES_IF_LOCAL {{ 0xff, 0x01, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 1 }}
#define IPV6_ADDR_ALL_NODES_IF_LOCAL {{ 0xff, 0x01, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x01 }}
/**
* @brief Static initializer for the link-local all nodes multicast IPv6
@ -106,8 +113,10 @@ typedef union {
* RFC 4291, section 2.7
* </a>
*/
#define NG_IPV6_ADDR_ALL_NODES_LINK_LOCAL {{ 0xff, 0x02, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 1 }}
#define IPV6_ADDR_ALL_NODES_LINK_LOCAL {{ 0xff, 0x02, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x01 }}
/**
* @brief Static initializer for the interface-local all routers multicast IPv6
@ -117,8 +126,10 @@ typedef union {
* RFC 4291, section 2.7
* </a>
*/
#define NG_IPV6_ADDR_ALL_ROUTERS_IF_LOCAL {{ 0xff, 0x01, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 2 }}
#define IPV6_ADDR_ALL_ROUTERS_IF_LOCAL {{ 0xff, 0x01, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x02 }}
/**
* @brief Static initializer for the link-local all routers multicast IPv6
@ -128,8 +139,10 @@ typedef union {
* RFC 4291, section 2.7
* </a>
*/
#define NG_IPV6_ADDR_ALL_ROUTERS_LINK_LOCAL {{ 0xff, 0x02, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 2 }}
#define IPV6_ADDR_ALL_ROUTERS_LINK_LOCAL {{ 0xff, 0x02, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x02 }}
/**
@ -140,68 +153,73 @@ typedef union {
* RFC 4291, section 2.7
* </a>
*/
#define NG_IPV6_ADDR_ALL_ROUTERS_SITE_LOCAL {{ 0xff, 0x05, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 2 }}
#define IPV6_ADDR_ALL_ROUTERS_SITE_LOCAL {{ 0xff, 0x05, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x02 }}
/**
* @name Multicast address flags
* @brief Values for the flag field in multicast addresses.
* @{
*
* @see <a href="http://tools.ietf.org/html/rfc4291#section-2.7">
* RFC 4291, section 2.7
* </a>
*/
typedef enum {
/**
* @brief The address is transient, i.e. not well-known, permanantly
* assigned address by IANA.
*/
NG_IPV6_ADDR_MCAST_FLAG_TRANSIENT = 0x01,
/**
* @brief The address is based on a network prefix
*
* @see <a href="http://tools.ietf.org/html/rfc3306#section-4">
* RFC 3306, section 4
* </a>
*/
NG_IPV6_ADDR_MCAST_FLAG_PREFIX_BASED = 0x02,
/**
* @brief The address embeds the address on the rendezvous point
*
* @see <a href="http://tools.ietf.org/html/rfc3956#section-3">
* RFC 3956, section 3
* </a>
*/
NG_IPV6_ADDR_MCAST_FLAG_EMBED_ON_RP = 0x04,
} ng_ipv6_addr_mcast_flag_t;
/**
* @brief The address is transient, i.e. not well-known, permanantly
* assigned address by IANA.
*/
#define IPV6_ADDR_MCAST_FLAG_TRANSIENT (0x01)
/**
* @brief The address is based on a network prefix
*
* @see <a href="http://tools.ietf.org/html/rfc3306#section-4">
* RFC 3306, section 4
* </a>
*/
#define IPV6_ADDR_MCAST_FLAG_PREFIX_BASED (0x02)
/**
* @brief The address embeds the address on the rendezvous point
*
* @see <a href="http://tools.ietf.org/html/rfc3956#section-3">
* RFC 3956, section 3
* </a>
*/
#define IPV6_ADDR_MCAST_FLAG_EMBED_ON_RP (0x04)
/** @} */
/**
* @name Multicast address scopes
* @brief Values for the scope field in multicast addresses.
* @{
*
* @see <a href="http://tools.ietf.org/html/rfc4291#section-2.7">
* RFC 4291, section 2.7
* </a>
*/
typedef enum {
NG_IPV6_ADDR_MCAST_SCP_IF_LOCAL = 0x1, /**< interface-local scope */
NG_IPV6_ADDR_MCAST_SCP_LINK_LOCAL = 0x2, /**< link-local scope */
/**
* @brief realm-local scope
*
* @see <a href="http://tools.ietf.org/html/rfc7346#section-3">
* RFC 7346, section 3
* </a> and
* <a href="http://tools.ietf.org/html/rfc7346#section-5">
* RFC 7346, section 5
* </a> and
*/
NG_IPV6_ADDR_MCAST_SCP_REALM_LOCAL = 0x3,
NG_IPV6_ADDR_MCAST_SCP_ADMIN_LOCAL = 0x4, /**< admin-local scope */
NG_IPV6_ADDR_MCAST_SCP_SITE_LOCAL = 0x5, /**< site-local scope */
NG_IPV6_ADDR_MCAST_SCP_ORG_LOCAL = 0x8, /**< organization-local scope */
NG_IPV6_ADDR_MCAST_SCP_GLOBAL = 0xe, /**< global scope */
} ng_ipv6_addr_mcast_scp_t;
#define IPV6_ADDR_MCAST_SCP_IF_LOCAL (0x1) /**< interface-local scope */
#define IPV6_ADDR_MCAST_SCP_LINK_LOCAL (0x2) /**< link-local scope */
/**
* @brief realm-local scope
*
* @see <a href="http://tools.ietf.org/html/rfc7346#section-3">
* RFC 7346, section 3
* </a> and
* <a href="http://tools.ietf.org/html/rfc7346#section-5">
* RFC 7346, section 5
* </a> and
*/
#define IPV6_ADDR_MCAST_SCP_REALM_LOCAL (0x3)
#define IPV6_ADDR_MCAST_SCP_ADMIN_LOCAL (0x4) /**< admin-local scope */
#define IPV6_ADDR_MCAST_SCP_SITE_LOCAL (0x5) /**< site-local scope */
#define IPV6_ADDR_MCAST_SCP_ORG_LOCAL (0x8) /**< organization-local scope */
#define IPV6_ADDR_MCAST_SCP_GLOBAL (0xe) /**< global scope */
/** @} */
/**
* @brief Checks if two IPv6 addresses are equal.
@ -212,8 +230,7 @@ typedef enum {
* @return true, if @p a and @p b are equal
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_equal(const ng_ipv6_addr_t *a,
const ng_ipv6_addr_t *b)
static inline bool ipv6_addr_equal(const ipv6_addr_t *a, const ipv6_addr_t *b)
{
return (a->u64[0].u64 == b->u64[0].u64) &&
(a->u64[1].u64 == b->u64[1].u64);
@ -231,7 +248,7 @@ static inline bool ng_ipv6_addr_equal(const ng_ipv6_addr_t *a,
* @return true, if @p addr is unspecified address
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_unspecified(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_unspecified(const ipv6_addr_t *addr)
{
return (addr->u64[0].u64 == 0) &&
(addr->u64[1].u64 == 0);
@ -249,7 +266,7 @@ static inline bool ng_ipv6_addr_is_unspecified(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is loopback address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_loopback(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_loopback(const ipv6_addr_t *addr)
{
return (addr->u64[0].u64 == 0) &&
(byteorder_ntohll(addr->u64[1]) == 1);
@ -267,7 +284,7 @@ static inline bool ng_ipv6_addr_is_loopback(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is an IPv4-compatible IPv6 address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_ipv4_compat(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_ipv4_compat(const ipv6_addr_t *addr)
{
return (addr->u64[0].u64 == 0) &&
(addr->u32[2].u32 == 0);
@ -285,11 +302,11 @@ static inline bool ng_ipv6_addr_is_ipv4_compat(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is an IPv4-compatible IPv6 address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_ipv4_mapped(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_ipv4_mapped(const ipv6_addr_t *addr)
{
return ((addr->u64[0].u64 == 0) &&
(addr->u16[4].u16 == 0) &&
(addr->u16[5].u16 == 0xFFFF));
(addr->u16[5].u16 == 0xffff));
}
/**
@ -304,7 +321,7 @@ static inline bool ng_ipv6_addr_is_ipv4_mapped(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is multicast address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_multicast(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_multicast(const ipv6_addr_t *addr)
{
return (addr->u8[0] == 0xff);
}
@ -324,11 +341,11 @@ static inline bool ng_ipv6_addr_is_multicast(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is link-local address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_link_local(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_link_local(const ipv6_addr_t *addr)
{
return (byteorder_ntohll(addr->u64[0]) == 0xfe80000000000000) ||
(ng_ipv6_addr_is_multicast(addr) &&
(addr->u8[1] & 0x0f) == NG_IPV6_ADDR_MCAST_SCP_LINK_LOCAL);
(ipv6_addr_is_multicast(addr) &&
(addr->u8[1] & 0x0f) == IPV6_ADDR_MCAST_SCP_LINK_LOCAL);
}
/**
@ -347,12 +364,12 @@ static inline bool ng_ipv6_addr_is_link_local(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is a site-local unicast address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_site_local(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_site_local(const ipv6_addr_t *addr)
{
return (((byteorder_ntohs(addr->u16[0]) & 0xFFC0) ==
NG_IPV6_ADDR_SITE_LOCAL_PREFIX) ||
(ng_ipv6_addr_is_multicast(addr) &&
(addr->u8[1] & 0x0f) == NG_IPV6_ADDR_MCAST_SCP_SITE_LOCAL));
return (((byteorder_ntohs(addr->u16[0]) & 0xffc0) ==
IPV6_ADDR_SITE_LOCAL_PREFIX) ||
(ipv6_addr_is_multicast(addr) &&
(addr->u8[1] & 0x0f) == IPV6_ADDR_MCAST_SCP_SITE_LOCAL));
}
/**
@ -367,7 +384,7 @@ static inline bool ng_ipv6_addr_is_site_local(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is unique local unicast address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_unique_local_unicast(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_unique_local_unicast(const ipv6_addr_t *addr)
{
return ((addr->u8[0] == 0xfc) || (addr->u8[0] == 0xfd));
}
@ -384,22 +401,22 @@ static inline bool ng_ipv6_addr_is_unique_local_unicast(const ng_ipv6_addr_t *ad
* @return true, if @p addr is global unicast address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_global(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_global(const ipv6_addr_t *addr)
{
/* first check for multicast with global scope */
if (ng_ipv6_addr_is_multicast(addr)) {
return ((addr->u8[1] & 0x0f) == NG_IPV6_ADDR_MCAST_SCP_GLOBAL);
if (ipv6_addr_is_multicast(addr)) {
return ((addr->u8[1] & 0x0f) == IPV6_ADDR_MCAST_SCP_GLOBAL);
}
else {
/* for unicast check if: */
/* - not unspecific or loopback */
return (!((addr->u64[0].u64 == 0) &&
((byteorder_ntohll(addr->u64[1]) & (0xfffffffffffffffe)) == 0)) &&
((byteorder_ntohll(addr->u64[1]) & (0xfffffffffffffffe)) == 0)) &&
/* - not link-local */
(byteorder_ntohll(addr->u64[0]) != 0xfe80000000000000) &&
/* - not site-local */
((byteorder_ntohs(addr->u16[0]) & 0xffc0) !=
NG_IPV6_ADDR_SITE_LOCAL_PREFIX));
IPV6_ADDR_SITE_LOCAL_PREFIX));
}
}
@ -416,7 +433,7 @@ static inline bool ng_ipv6_addr_is_global(const ng_ipv6_addr_t *addr)
* @return true, if @p addr is solicited-node multicast address,
* @return false, otherwise.
*/
static inline bool ng_ipv6_addr_is_solicited_node(const ng_ipv6_addr_t *addr)
static inline bool ipv6_addr_is_solicited_node(const ipv6_addr_t *addr)
{
return (byteorder_ntohll(addr->u64[0]) == 0xff02000000000000) &&
(byteorder_ntohl(addr->u32[2]) == 1) &&
@ -433,7 +450,7 @@ static inline bool ng_ipv6_addr_is_solicited_node(const ng_ipv6_addr_t *addr)
*
* @return The number of bits @p a and @p b match in their prefix
*/
uint8_t ng_ipv6_addr_match_prefix(const ng_ipv6_addr_t *a, const ng_ipv6_addr_t *b);
uint8_t ipv6_addr_match_prefix(const ipv6_addr_t *a, const ipv6_addr_t *b);
/**
* @brief Sets IPv6 address @p out with the first @p bits taken
@ -444,8 +461,7 @@ uint8_t ng_ipv6_addr_match_prefix(const ng_ipv6_addr_t *a, const ng_ipv6_addr_t
* @param[in] bits Bits to be copied from @p prefix to @p out
* (set to 128 when greater than 128).
*/
void ng_ipv6_addr_init_prefix(ng_ipv6_addr_t *out, const ng_ipv6_addr_t *prefix,
uint8_t bits);
void ipv6_addr_init_prefix(ipv6_addr_t *out, const ipv6_addr_t *prefix, uint8_t bits);
/**
* @brief Sets @p addr dynamically to the unspecified IPv6 address (::).
@ -456,7 +472,7 @@ void ng_ipv6_addr_init_prefix(ng_ipv6_addr_t *out, const ng_ipv6_addr_t *prefix,
*
* @param[in,out] addr The address to set.
*/
static inline void ng_ipv6_addr_set_unspecified(ng_ipv6_addr_t *addr)
static inline void ipv6_addr_set_unspecified(ipv6_addr_t *addr)
{
addr->u64[0].u64 = 0;
addr->u64[1].u64 = 0;
@ -471,7 +487,7 @@ static inline void ng_ipv6_addr_set_unspecified(ng_ipv6_addr_t *addr)
*
* @param[in,out] addr The address to set.
*/
static inline void ng_ipv6_addr_set_loopback(ng_ipv6_addr_t *addr)
static inline void ipv6_addr_set_loopback(ipv6_addr_t *addr)
{
addr->u64[0].u64 = 0;
addr->u64[1] = byteorder_htonll(1);
@ -486,7 +502,7 @@ static inline void ng_ipv6_addr_set_loopback(ng_ipv6_addr_t *addr)
*
* @param[in,out] addr The address to set.
*/
static inline void ng_ipv6_addr_set_link_local_prefix(ng_ipv6_addr_t *addr)
static inline void ipv6_addr_set_link_local_prefix(ipv6_addr_t *addr)
{
addr->u64[0] = byteorder_htonll(0xfe80000000000000);
}
@ -502,7 +518,7 @@ static inline void ng_ipv6_addr_set_link_local_prefix(ng_ipv6_addr_t *addr)
* @param[in,out] addr The address to set.
* @param[in] iid The interface ID as integer to set.
*/
static inline void ng_ipv6_addr_set_iid(ng_ipv6_addr_t *addr, uint64_t iid)
static inline void ipv6_addr_set_iid(ipv6_addr_t *addr, uint64_t iid)
{
addr->u64[1] = byteorder_htonll(iid);
}
@ -518,7 +534,7 @@ static inline void ng_ipv6_addr_set_iid(ng_ipv6_addr_t *addr, uint64_t iid)
* @param[in,out] addr The address to set.
* @param[in] iid The interface ID as array of at least length 8 to set.
*/
static inline void ng_ipv6_addr_set_aiid(ng_ipv6_addr_t *addr, uint8_t *iid)
static inline void ipv6_addr_set_aiid(ipv6_addr_t *addr, uint8_t *iid)
{
addr->u8[8] = iid[0];
addr->u8[9] = iid[1];
@ -541,9 +557,8 @@ static inline void ng_ipv6_addr_set_aiid(ng_ipv6_addr_t *addr, uint8_t *iid)
* @param[in] flags The multicast address' flags.
* @param[in] scope The multicast address' scope.
*/
static inline void ng_ipv6_addr_set_multicast(ng_ipv6_addr_t *addr,
ng_ipv6_addr_mcast_flag_t flags,
ng_ipv6_addr_mcast_scp_t scope)
static inline void ipv6_addr_set_multicast(ipv6_addr_t *addr, unsigned int flags,
unsigned int scope)
{
addr->u8[0] = 0xff;
addr->u8[1] = (((uint8_t)flags) << 4) | (((uint8_t) scope) & 0x0f);
@ -560,8 +575,7 @@ static inline void ng_ipv6_addr_set_multicast(ng_ipv6_addr_t *addr,
* @param[in,out] addr The address to set.
* @param[in] scope The multicast address' scope.
*/
static inline void ng_ipv6_addr_set_all_nodes_multicast(ng_ipv6_addr_t *addr,
ng_ipv6_addr_mcast_scp_t scope)
static inline void ipv6_addr_set_all_nodes_multicast(ipv6_addr_t *addr, unsigned int scope)
{
addr->u64[0] = byteorder_htonll(0xff00000000000000);
addr->u8[1] = (uint8_t)scope;
@ -579,8 +593,7 @@ static inline void ng_ipv6_addr_set_all_nodes_multicast(ng_ipv6_addr_t *addr,
* @param[in,out] addr The address to set.
* @param[in] scope The multicast address' scope.
*/
static inline void ng_ipv6_addr_set_all_routers_multicast(ng_ipv6_addr_t *addr,
ng_ipv6_addr_mcast_scp_t scope)
static inline void ipv6_addr_set_all_routers_multicast(ipv6_addr_t *addr, unsigned int scope)
{
addr->u64[0] = byteorder_htonll(0xff00000000000000);
addr->u8[1] = (uint8_t)scope;
@ -598,8 +611,7 @@ static inline void ng_ipv6_addr_set_all_routers_multicast(ng_ipv6_addr_t *addr,
* @param[out] out Is set to solicited-node address of this node.
* @param[in] in The IPv6 address the solicited-node address.
*/
static inline void ng_ipv6_addr_set_solicited_nodes(ng_ipv6_addr_t *out,
const ng_ipv6_addr_t *in)
static inline void ipv6_addr_set_solicited_nodes(ipv6_addr_t *out, const ipv6_addr_t *in)
{
out->u64[0] = byteorder_htonll(0xff02000000000000);
out->u32[2] = byteorder_htonl(1);
@ -623,8 +635,7 @@ static inline void ng_ipv6_addr_set_solicited_nodes(ng_ipv6_addr_t *out,
* @return NULL, if @p result_len was smaller than needed
* @return NULL, if @p result or @p addr was NULL
*/
char *ng_ipv6_addr_to_str(char *result, const ng_ipv6_addr_t *addr,
uint8_t result_len);
char *ipv6_addr_to_str(char *result, const ipv6_addr_t *addr, uint8_t result_len);
/**
* @brief Converts an IPv6 address string representation to a byte-represented
@ -641,13 +652,13 @@ char *ng_ipv6_addr_to_str(char *result, const ng_ipv6_addr_t *addr,
* @return NULL, if @p addr was malformed
* @return NULL, if @p result or @p addr was NULL
*/
ng_ipv6_addr_t *ng_ipv6_addr_from_str(ng_ipv6_addr_t *result, const char *addr);
ipv6_addr_t *ipv6_addr_from_str(ipv6_addr_t *result, const char *addr);
#ifdef __cplusplus
}
#endif
#endif /* NG_IPV6_ADDR_H_ */
#endif /* IPV6_ADDR_H_ */
/**
* @}
*/

2
sys/include/net/ng_ipv6.h

@ -32,7 +32,7 @@
#include "net/ng_netbase.h"
#include "thread.h"
#include "net/ng_ipv6/addr.h"
#include "net/ipv6.h"
#include "net/ng_ipv6/ext.h"
#include "net/ng_ipv6/hdr.h"
#include "net/ng_ipv6/nc.h"

4
sys/include/net/ng_ipv6/ext/rh.h

@ -20,7 +20,7 @@
#ifndef NG_IPV6_EXT_RH_H_
#define NG_IPV6_EXT_RH_H_
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/ng_ipv6/hdr.h"
#ifdef __cplusplus
@ -51,7 +51,7 @@ typedef struct __attribute__((packed)) {
* @return next hop on success, on success
* @return NULL, if not found.
*/
ng_ipv6_addr_t *ng_ipv6_ext_rh_next_hop(ng_ipv6_hdr_t *ipv6);
ipv6_addr_t *ng_ipv6_ext_rh_next_hop(ng_ipv6_hdr_t *ipv6);
#ifdef __cplusplus
}

12
sys/include/net/ng_ipv6/hdr.h

@ -23,7 +23,7 @@
#include <stdbool.h>
#include "byteorder.h"
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/inet_csum.h"
#include "net/ng_pkt.h"
@ -92,8 +92,8 @@ typedef struct __attribute__((packed)) {
network_uint16_t len; /**< payload length of this packet. */
uint8_t nh; /**< type of next header in this packet. */
uint8_t hl; /**< hop limit for this packet. */
ng_ipv6_addr_t src; /**< source address of this packet. */
ng_ipv6_addr_t dst; /**< destination address of this packet. */
ipv6_addr_t src; /**< source address of this packet. */
ipv6_addr_t dst; /**< destination address of this packet. */
} ng_ipv6_hdr_t;
/**
@ -295,7 +295,7 @@ static inline uint16_t ng_ipv6_hdr_inet_csum(uint16_t sum, ng_ipv6_hdr_t *hdr,
}
return inet_csum(sum + len + prot_num, hdr->src.u8,
(2 * sizeof(ng_ipv6_addr_t)));
(2 * sizeof(ipv6_addr_t)));
}
/**
@ -308,11 +308,11 @@ static inline uint16_t ng_ipv6_hdr_inet_csum(uint16_t sum, ng_ipv6_hdr_t *hdr,
* @param[in] src Source address for the header. Can be NULL if not
* known or required.
* @param[in] src_len Length of @p src. Can be 0 if not known or required or
* must be `sizeof(ng_ipv6_addr_t)`.
* must be `sizeof(ipv6_addr_t)`.
* @param[in] dst Destination address for the header. Can be NULL if not
* known or required.
* @param[in] dst_len Length of @p dst. Can be 0 if not known or required or
* must be `sizeof(ng_ipv6_addr_t)`.
* must be `sizeof(ipv6_addr_t)`.
*
* @return The an IPv6 header in packet buffer on success.
* @return NULL on error.

12
sys/include/net/ng_ipv6/nc.h

@ -25,7 +25,7 @@
#include <stdint.h>
#include "kernel_types.h"
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/ng_netif.h"
#include "net/ng_pktqueue.h"
#include "vtimer.h"
@ -119,7 +119,7 @@ extern "C" {
*/
typedef struct {
ng_pktqueue_t *pkts; /**< Packets waiting for address resolution */
ng_ipv6_addr_t ipv6_addr; /**< IPv6 address of the neighbor */
ipv6_addr_t ipv6_addr; /**< IPv6 address of the neighbor */
uint8_t l2_addr[NG_IPV6_NC_L2_ADDR_MAX];/**< Link layer address of the neighbor */
uint8_t l2_addr_len; /**< Length of ng_ipv6_nc_t::l2_addr */
uint8_t flags; /**< Flags as defined above */
@ -167,7 +167,7 @@ void ng_ipv6_nc_init(void);
* @return Pointer to new neighbor cache entry on success
* @return NULL, on failure
*/
ng_ipv6_nc_t *ng_ipv6_nc_add(kernel_pid_t iface, const ng_ipv6_addr_t *ipv6_addr,
ng_ipv6_nc_t *ng_ipv6_nc_add(kernel_pid_t iface, const ipv6_addr_t *ipv6_addr,
const void *l2_addr, size_t l2_addr_len, uint8_t flags);
/**
@ -178,7 +178,7 @@ ng_ipv6_nc_t *ng_ipv6_nc_add(kernel_pid_t iface, const ng_ipv6_addr_t *ipv6_addr
* interfaces.
* @param[in] ipv6_addr IPv6 address of the neighbor
*/
void ng_ipv6_nc_remove(kernel_pid_t iface, const ng_ipv6_addr_t *ipv6_addr);
void ng_ipv6_nc_remove(kernel_pid_t iface, const ipv6_addr_t *ipv6_addr);
/**
* @brief Searches for any neighbor cache entry fitting the @p ipv6_addr.
@ -191,7 +191,7 @@ void ng_ipv6_nc_remove(kernel_pid_t iface, const ng_ipv6_addr_t *ipv6_addr);
* @return The neighbor cache entry, if one is found.
* @return NULL, if none is found.
*/
ng_ipv6_nc_t *ng_ipv6_nc_get(kernel_pid_t iface, const ng_ipv6_addr_t *ipv6_addr);
ng_ipv6_nc_t *ng_ipv6_nc_get(kernel_pid_t iface, const ipv6_addr_t *ipv6_addr);
/**
* @brief Gets next entry in neighbor cache after @p prev.
@ -273,7 +273,7 @@ static inline bool ng_ipv6_nc_is_reachable(const ng_ipv6_nc_t *entry)
* @return The neighbor cache entry, if one is found.
* @return NULL, if none is found.
*/
ng_ipv6_nc_t *ng_ipv6_nc_still_reachable(const ng_ipv6_addr_t *ipv6_addr);
ng_ipv6_nc_t *ng_ipv6_nc_still_reachable(const ipv6_addr_t *ipv6_addr);
#ifdef __cplusplus
}

33
sys/include/net/ng_ipv6/netif.h

@ -28,7 +28,7 @@
#include "kernel_macros.h"
#include "kernel_types.h"
#include "mutex.h"
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "vtimer.h"
#ifdef __cplusplus
@ -153,7 +153,7 @@ extern "C" {
* @brief Type to represent an IPv6 address registered to an interface.
*/
typedef struct {
ng_ipv6_addr_t addr; /**< The address data */
ipv6_addr_t addr; /**< The address data */
uint8_t flags; /**< flags */
uint8_t prefix_len; /**< length of the prefix of the address */
/**
@ -290,10 +290,9 @@ static inline void ng_ipv6_netif_set_rtr_adv(ng_ipv6_netif_t *netif, bool enable
*
* @param[in] netif The interface.
* @param[in] dst The address of the neighboring router.
* May be NULL for @ref NG_IPV6_ADDR_ALL_ROUTERS_LINK_LOCAL.
* May be NULL for @ref IPV6_ADDR_ALL_ROUTERS_LINK_LOCAL.
*/
static inline void ng_ipv6_netif_sol_router(ng_ipv6_netif_t *netif,
ng_ipv6_addr_t *dst)
static inline void ng_ipv6_netif_sol_router(ng_ipv6_netif_t *netif, ipv6_addr_t *dst)
{
(void)netif; /* TODO */
(void)dst;
@ -321,8 +320,8 @@ static inline void ng_ipv6_netif_sol_router(ng_ipv6_netif_t *netif,
* @return The address on the interface, on success.
* @return NULL, on failure
*/
ng_ipv6_addr_t *ng_ipv6_netif_add_addr(kernel_pid_t pid, const ng_ipv6_addr_t *addr,
uint8_t prefix_len, uint8_t flags);
ipv6_addr_t *ng_ipv6_netif_add_addr(kernel_pid_t pid, const ipv6_addr_t *addr, uint8_t prefix_len,
uint8_t flags);
/**
* @brief Remove an address from the interface.
@ -331,7 +330,7 @@ ng_ipv6_addr_t *ng_ipv6_netif_add_addr(kernel_pid_t pid, const ng_ipv6_addr_t *a
* it will be removed from all interfaces.
* @param[in] addr An address you want to remove from interface.
*/
void ng_ipv6_netif_remove_addr(kernel_pid_t pid, ng_ipv6_addr_t *addr);
void ng_ipv6_netif_remove_addr(kernel_pid_t pid, ipv6_addr_t *addr);
/**
* @brief Removes all addresses from the interface.
@ -349,8 +348,7 @@ void ng_ipv6_netif_reset_addr(kernel_pid_t pid);
* @return The PID to the interface the address is registered to.
* @return KERNEL_PID_UNDEF, if the address can not be found on any interface.
*/
kernel_pid_t ng_ipv6_netif_find_by_addr(ng_ipv6_addr_t **out,
const ng_ipv6_addr_t *addr);
kernel_pid_t ng_ipv6_netif_find_by_addr(ipv6_addr_t **out, const ipv6_addr_t *addr);
/**
* @brief Searches for an address on an interface.
@ -362,8 +360,7 @@ kernel_pid_t ng_ipv6_netif_find_by_addr(ng_ipv6_addr_t **out,
* @return NULL, if the address can not be found on the interface.
* @return NULL, if @p pid is no interface.
*/
ng_ipv6_addr_t *ng_ipv6_netif_find_addr(kernel_pid_t pid,
const ng_ipv6_addr_t *addr);
ipv6_addr_t *ng_ipv6_netif_find_addr(kernel_pid_t pid, const ipv6_addr_t *addr);
/**
* @brief Searches for the first address matching a prefix best on all
@ -376,8 +373,7 @@ ng_ipv6_addr_t *ng_ipv6_netif_find_addr(kernel_pid_t pid,
* @return KERNEL_PID_UNDEF, if no matching address can not be found on any
* interface.
*/
kernel_pid_t ng_ipv6_netif_find_by_prefix(ng_ipv6_addr_t **out,
const ng_ipv6_addr_t *prefix);
kernel_pid_t ng_ipv6_netif_find_by_prefix(ipv6_addr_t **out, const ipv6_addr_t *prefix);
/**
* @brief Searches for the first address matching a prefix best on an
@ -390,8 +386,7 @@ kernel_pid_t ng_ipv6_netif_find_by_prefix(ng_ipv6_addr_t **out,
* @return NULL, if no matching address can be found on the interface.
* @return NULL, if @p pid is no interface.
*/
ng_ipv6_addr_t *ng_ipv6_netif_match_prefix(kernel_pid_t pid,
const ng_ipv6_addr_t *prefix);
ipv6_addr_t *ng_ipv6_netif_match_prefix(kernel_pid_t pid, const ipv6_addr_t *prefix);
/**
* @brief Searches for the best address on an interface usable as a
@ -405,7 +400,7 @@ ng_ipv6_addr_t *ng_ipv6_netif_match_prefix(kernel_pid_t pid,
* @return NULL, if no matching address can be found on the interface.
* @return NULL, if @p pid is no interface.
*/
ng_ipv6_addr_t *ng_ipv6_netif_find_best_src_addr(kernel_pid_t pid, const ng_ipv6_addr_t *dest);
ipv6_addr_t *ng_ipv6_netif_find_best_src_addr(kernel_pid_t pid, const ipv6_addr_t *dest);
/**
* @brief Get interface specific meta-information on an address
@ -426,7 +421,7 @@ ng_ipv6_addr_t *ng_ipv6_netif_find_best_src_addr(kernel_pid_t pid, const ng_ipv6
*
* @return Interface specific meta-information on @p addr
*/
static inline ng_ipv6_netif_addr_t *ng_ipv6_netif_addr_get(const ng_ipv6_addr_t *addr)
static inline ng_ipv6_netif_addr_t *ng_ipv6_netif_addr_get(const ipv6_addr_t *addr)
{
return container_of(addr, ng_ipv6_netif_addr_t, addr);
}
@ -451,7 +446,7 @@ static inline ng_ipv6_netif_addr_t *ng_ipv6_netif_addr_get(const ng_ipv6_addr_t
* @return true, if address is anycast or multicast.
* @return false, if address is unicast.
*/
static inline bool ng_ipv6_netif_addr_is_non_unicast(const ng_ipv6_addr_t *addr)
static inline bool ng_ipv6_netif_addr_is_non_unicast(const ipv6_addr_t *addr)
{
return (bool)(container_of(addr, ng_ipv6_netif_addr_t, addr)->flags &
NG_IPV6_NETIF_ADDR_FLAGS_NON_UNICAST);

6
sys/include/net/ng_ndp.h

@ -23,7 +23,7 @@
#include "byteorder.h"
#include "net/ng_pkt.h"
#include "net/ng_icmpv6.h"
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/ng_ipv6/nc.h"
#include "net/ng_ipv6/netif.h"
@ -181,7 +181,7 @@ void ng_ndp_netif_remove(ng_ipv6_netif_t *iface);
* @return The resulting ICMPv6 packet on success.
* @return NULL, on failure.
*/
ng_pktsnip_t *ng_ndp_nbr_sol_build(ng_ipv6_addr_t *tgt, ng_pktsnip_t *options);
ng_pktsnip_t *ng_ndp_nbr_sol_build(ipv6_addr_t *tgt, ng_pktsnip_t *options);
/**
* @brief Builds a neighbor advertisement message for sending.
@ -209,7 +209,7 @@ ng_pktsnip_t *ng_ndp_nbr_sol_build(ng_ipv6_addr_t *tgt, ng_pktsnip_t *options);
* @return The resulting ICMPv6 packet on success.
* @return NULL, on failure.
*/
ng_pktsnip_t *ng_ndp_nbr_adv_build(uint8_t flags, ng_ipv6_addr_t *tgt,
ng_pktsnip_t *ng_ndp_nbr_adv_build(uint8_t flags, ipv6_addr_t *tgt,
ng_pktsnip_t *options);
/**

12
sys/include/net/ng_ndp/internal.h

@ -22,7 +22,7 @@
#ifndef INTERNAL_H_
#define INTERNAL_H_
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/ng_ndp/types.h"
#ifdef __cplusplus
@ -41,7 +41,7 @@ extern "C" {
* @return Address to a default router.
* @return NULL, if the default router list is empty.
*/
ng_ipv6_addr_t *ng_ndp_internal_default_router(void);
ipv6_addr_t *ng_ndp_internal_default_router(void);
/**
* @brief Sets state of a neighbor cache entry and triggers required actions.
@ -64,8 +64,8 @@ void ng_ndp_internal_set_state(ng_ipv6_nc_t *nc_entry, uint8_t state);
* @param[in] dst Destination address for neighbor solicitation. May not be
* NULL.
*/
void ng_ndp_internal_send_nbr_sol(kernel_pid_t iface, ng_ipv6_addr_t *tgt,
ng_ipv6_addr_t *dst);
void ng_ndp_internal_send_nbr_sol(kernel_pid_t iface, ipv6_addr_t *tgt,
ipv6_addr_t *dst);
/**
* @brief Send precompiled neighbor advertisement.
@ -80,8 +80,8 @@ void ng_ndp_internal_send_nbr_sol(kernel_pid_t iface, ng_ipv6_addr_t *tgt,
* @param[in] supply_tl2a Add target link-layer address option to neighbor
* advertisement if link-layer has addresses.
*/
void ng_ndp_internal_send_nbr_adv(kernel_pid_t iface, ng_ipv6_addr_t *tgt,
ng_ipv6_addr_t *dst, bool supply_tl2a);
void ng_ndp_internal_send_nbr_adv(kernel_pid_t iface, ipv6_addr_t *tgt,
ipv6_addr_t *dst, bool supply_tl2a);
/**
* @brief Handles a SL2A option.

2
sys/include/net/ng_ndp/node.h

@ -42,7 +42,7 @@ extern "C" {
* would be long.
*/
kernel_pid_t ng_ndp_node_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_len,
kernel_pid_t iface, ng_ipv6_addr_t *dst,
kernel_pid_t iface, ipv6_addr_t *dst,
ng_pktsnip_t *pkt);
#ifdef __cplusplus

10
sys/include/net/ng_ndp/types.h

@ -142,7 +142,7 @@ typedef struct __attribute__((packed)) {
uint8_t code; /**< message code */
network_uint16_t csum; /**< checksum */
network_uint32_t resv; /**< reserved field */
ng_ipv6_addr_t tgt; /**< target address */
ipv6_addr_t tgt; /**< target address */
} ng_ndp_nbr_sol_t;
/**
@ -159,7 +159,7 @@ typedef struct __attribute__((packed)) {
network_uint16_t csum; /**< checksum */
uint8_t flags; /**< flags */
uint8_t resv[3]; /**< reserved fields */
ng_ipv6_addr_t tgt; /**< target address */
ipv6_addr_t tgt; /**< target address */
} ng_ndp_nbr_adv_t;
/**
@ -175,8 +175,8 @@ typedef struct __attribute__((packed)) {
uint8_t code; /**< message code */
network_uint16_t csum; /**< checksum */
network_uint32_t resv; /**< reserved field */
ng_ipv6_addr_t tgt; /**< target address */
ng_ipv6_addr_t dst; /**< destination address */
ipv6_addr_t tgt; /**< target address */
ipv6_addr_t dst; /**< destination address */
} ng_ndp_redirect_t;
/**
@ -209,7 +209,7 @@ typedef struct __attribute__((packed)) {
network_uint32_t valid_ltime; /**< valid lifetime */
network_uint32_t pref_ltime; /**< preferred lifetime */
network_uint32_t resv; /**< reserved field */
ng_ipv6_addr_t prefix; /**< prefix */
ipv6_addr_t prefix; /**< prefix */
} ng_ndp_opt_pi_t;
/**

4
sys/include/net/ng_rpl/srh.h

@ -23,7 +23,7 @@
#ifndef NG_RPL_SRH_H_
#define NG_RPL_SRH_H_
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/ng_ipv6/ext.h"
#ifdef __cplusplus
@ -59,7 +59,7 @@ typedef struct __attribute__((packed)) {
* @return next hop, on success
* @return NULL, if not found.
*/
ng_ipv6_addr_t *ng_rpl_srh_next_hop(ng_rpl_srh_t *rh);
ipv6_addr_t *ng_rpl_srh_next_hop(ng_rpl_srh_t *rh);
#ifdef __cplusplus
}

8
sys/include/net/ng_sixlowpan/ctx.h

@ -32,7 +32,7 @@
#include <inttypes.h>
#include <stdbool.h>
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#ifdef __cplusplus
extern "C" {
@ -56,7 +56,7 @@ extern "C" {
* @brief Entry in the 6LoWPAN context buffer.
*/
typedef struct {
ng_ipv6_addr_t prefix; /**< The prefix associated to this context. */
ipv6_addr_t prefix; /**< The prefix associated to this context. */
uint8_t prefix_len; /**< Length of ng_sixlowpan_ctx_t::prefix in bit. */
/**
* @brief 4-bit flags, 4-bit Context ID.
@ -85,7 +85,7 @@ typedef struct {
* @return The context associated with the best prefix for @p addr.
* @return NULL if there is no such context.
*/
ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_lookup_addr(const ng_ipv6_addr_t *addr);
ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_lookup_addr(const ipv6_addr_t *addr);
/**
* @brief Gets context by ID.
@ -112,7 +112,7 @@ ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_lookup_id(uint8_t id);
* @return The new context on success.
* @return NULL, on error or on removal.
*/
ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_update(uint8_t id, const ng_ipv6_addr_t *prefix,
ng_sixlowpan_ctx_t *ng_sixlowpan_ctx_update(uint8_t id, const ipv6_addr_t *prefix,
uint8_t prefix_len, uint16_t ltime,
bool comp);

6
sys/include/net/ng_zep.h

@ -34,7 +34,7 @@
#include "byteorder.h"
#include "kernel_types.h"
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/ng_nettype.h"
#include "thread.h"
@ -198,7 +198,7 @@ typedef struct {
le_uint16_t pan; /**< the device's PAN ID */
uint16_t flags; /**< the device's option flags */
uint32_t seq; /**< the current sequence number for frames */
ng_ipv6_addr_t dst; /**< destination IPv6 address */
ipv6_addr_t dst; /**< destination IPv6 address */
uint16_t src_port; /**< source UDP port */
uint16_t dst_port; /**< destination UDP port */
ng_nettype_t proto; /**< the target protocol for received packets */
@ -229,7 +229,7 @@ typedef struct {
* @return -ENOTSUP, if @p dst is NULL or unspecified address (::).
* @return -EOVERFLOW, if there are too many threads running already
*/
kernel_pid_t ng_zep_init(ng_zep_t *dev, uint16_t src_port, ng_ipv6_addr_t *dst,
kernel_pid_t ng_zep_init(ng_zep_t *dev, uint16_t src_port, ipv6_addr_t *dst,
uint16_t dst_port);
#ifdef __cplusplus

2
sys/include/universal_address.h

@ -113,7 +113,7 @@ int universal_address_compare(universal_address_container_t *entry,
* @param[in] prefix pointer to the address for compare
* @param[in] prefix_size_in_bits the number of bits used for the prefix entry.
* This size MUST be the full address size including trailing '0's,
* e.g. for an ng_ipv6_addr_t it would be sizeof(ng_ipv6_addr_t)
* e.g. for an ipv6_addr_t it would be sizeof(ipv6_addr_t)
* regardless if the stored prefix is < ::/128
*
* @return 0 if the entries are equal

8
sys/net/application_layer/ng_zep/ng_zep.c

@ -24,7 +24,7 @@
#include "kernel.h"
#include "msg.h"
#include "net/ieee802154.h"
#include "net/ng_ipv6/addr.h"
#include "net/ipv6/addr.h"
#include "net/ng_ipv6/hdr.h"
#include "net/ng_netbase.h"
#include "net/ng_udp.h"
@ -89,7 +89,7 @@ static size_t _get_frame_hdr_len(uint8_t *mhr);
ng_pktsnip_t *_make_netif_hdr(uint8_t *mhr);
static uint16_t _calc_fcs(uint16_t fcs, const uint8_t *frame, uint8_t frame_len);
kernel_pid_t ng_zep_init(ng_zep_t *dev, uint16_t src_port, ng_ipv6_addr_t *dst,
kernel_pid_t ng_zep_init(ng_zep_t *dev, uint16_t src_port, ipv6_addr_t *dst,
uint16_t dst_port)
{
#if CPUID_ID_LEN
@ -107,7 +107,7 @@ kernel_pid_t ng_zep_init(ng_zep_t *dev, uint16_t src_port, ng_ipv6_addr_t *dst,
return -ENODEV;
}
if ((dst == NULL) || (ng_ipv6_addr_is_unspecified(dst))) {
if ((dst == NULL) || (ipv6_addr_is_unspecified(dst))) {
DEBUG("zep: dst (%s) was NULL or unspecified\n", dst);
return -ENOTSUP;
}
@ -250,7 +250,7 @@ static int _send(ng_netdev_t *netdev, ng_pktsnip_t *pkt)
new_pkt = hdr;
hdr = ng_ipv6_hdr_build(new_pkt, NULL, 0, (uint8_t *) &(dev->dst),
sizeof(ng_ipv6_addr_t));
sizeof(ipv6_addr_t));
if (hdr == NULL) {
DEBUG("zep: could not allocate IPv6 header in pktbuf\n");

2
sys/net/crosslayer/ng_pktdump/ng_pktdump.c

@ -28,7 +28,7 @@
#include "kernel.h"
#include "net/ng_pktdump.h"