aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2020-08-20 08:22:56 +0000
committerOle Tr�an <otroan@employees.org>2020-11-20 10:27:01 +0000
commitdc617b8df442f3e25197ec64ffd58d11411b0470 (patch)
treea573462413e12b71d71515f84e53900686424917 /src/vnet/ip
parentd01d2ce4498dae4cbcba65784babe91d56d4bae9 (diff)
ip-neighbor: Use ip_address_t rather than ip46_address_t
Type: improvement Change-Id: Ica5f395075677bda5f38d28e704f65350af88610 Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip6_forward.c5
-rw-r--r--src/vnet/ip/ip_types.c13
-rw-r--r--src/vnet/ip/ip_types.h4
3 files changed, 19 insertions, 3 deletions
diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c
index 294f632a6bf..cd753b044b1 100644
--- a/src/vnet/ip/ip6_forward.c
+++ b/src/vnet/ip/ip6_forward.c
@@ -956,7 +956,10 @@ format_ip6_forward_next_trace (u8 * s, va_list * args)
ip6_forward_next_trace_t *t = va_arg (*args, ip6_forward_next_trace_t *);
u32 indent = format_get_indent (s);
- s = format (s, "%U%U",
+ s = format (s, "%Ufib:%d adj:%d flow:%d",
+ format_white_space, indent,
+ t->fib_index, t->adj_index, t->flow_hash);
+ s = format (s, "\n%U%U",
format_white_space, indent,
format_ip6_header, t->packet_data, sizeof (t->packet_data));
return s;
diff --git a/src/vnet/ip/ip_types.c b/src/vnet/ip/ip_types.c
index 6e4bb3ba6e4..8f9f012ad77 100644
--- a/src/vnet/ip/ip_types.c
+++ b/src/vnet/ip/ip_types.c
@@ -288,6 +288,19 @@ ip_address_to_fib_prefix (const ip_address_t * addr, fib_prefix_t * prefix)
prefix->___fp___pad = 0;
}
+void
+ip_address_increment (ip_address_t * ip)
+{
+ ip46_address_increment ((ip_addr_version (ip) == AF_IP4 ?
+ IP46_TYPE_IP4 : IP46_TYPE_IP6), &ip_addr_46 (ip));
+}
+
+void
+ip_address_reset (ip_address_t * ip)
+{
+ clib_memset (ip, 0, sizeof (*ip));
+}
+
static void
ip_prefix_normalize_ip4 (ip4_address_t * ip4, u8 preflen)
{
diff --git a/src/vnet/ip/ip_types.h b/src/vnet/ip/ip_types.h
index 2049170ea23..f779fe7e864 100644
--- a/src/vnet/ip/ip_types.h
+++ b/src/vnet/ip/ip_types.h
@@ -26,8 +26,6 @@ typedef enum ip_address_family_t_
#define N_AF (AF_IP6+1)
-#define N_AF (AF_IP6+1)
-
extern uword unformat_ip_address_family (unformat_input_t * input,
va_list * args);
extern u8 *format_ip_address_family (u8 * s, va_list * args);
@@ -76,6 +74,8 @@ extern fib_protocol_t ip_address_to_46 (const ip_address_t * addr,
ip46_address_t * a);
extern void ip_address_from_46 (const ip46_address_t * a,
fib_protocol_t fproto, ip_address_t * addr);
+extern void ip_address_increment (ip_address_t * ip);
+extern void ip_address_reset (ip_address_t * ip);
/* *INDENT-OFF* */
typedef struct ip_prefix