aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip.api4
-rw-r--r--src/vnet/ip/ip_format_fns.h6
-rw-r--r--src/vnet/ip/ip_types.api17
3 files changed, 25 insertions, 2 deletions
diff --git a/src/vnet/ip/ip.api b/src/vnet/ip/ip.api
index 67cdf9377b3..5d22bc52fea 100644
--- a/src/vnet/ip/ip.api
+++ b/src/vnet/ip/ip.api
@@ -29,7 +29,7 @@ import "vnet/mfib/mfib_types.api";
/** \brief An IP table
@param is_ipv6 - V4 or V6 table
@param table_id - table ID associated with the route
- This table ID will apply to both the unicats
+ This table ID will apply to both the unicats
and mlticast FIBs
@param name - A client provided name/tag for the table. If this is
not set by the client, then VPP will generate something
@@ -496,7 +496,7 @@ define ip_address_details
{
u32 context;
u32 sw_if_index;
- vl_api_prefix_t prefix;
+ vl_api_address_with_prefix_t prefix;
};
define ip_address_dump
diff --git a/src/vnet/ip/ip_format_fns.h b/src/vnet/ip/ip_format_fns.h
index b24c59454d4..4db10d1bb41 100644
--- a/src/vnet/ip/ip_format_fns.h
+++ b/src/vnet/ip/ip_format_fns.h
@@ -83,4 +83,10 @@ format_vl_api_prefix_t (u8 * s, va_list * args)
return format (s, "%U/%u", format_vl_api_address_t, &a->address, indent, a->len);
}
+static inline u8 *
+format_vl_api_address_with_prefix_t (u8 * s, va_list * args)
+{
+ return format_vl_api_prefix_t (s, args);
+}
+
#endif
diff --git a/src/vnet/ip/ip_types.api b/src/vnet/ip/ip_types.api
index d9ad893412d..49294587991 100644
--- a/src/vnet/ip/ip_types.api
+++ b/src/vnet/ip/ip_types.api
@@ -108,6 +108,23 @@ manual_print typedef ip4_prefix {
u8 len;
};
+/** \brief
+ *
+ * The vl_api_[ip4|ip6]_address_with_prefix_t types are used as a type to denote
+ * both an IP address and a prefix. I.e. in CIDR notation
+ * '192.168.10.1/24' the address is 192.168.10.1 and the network
+ * prefix is 192.168.10.0/24.
+ *
+ * If only an address is needed use: vl_api_address_t types and if
+ * only a network prefix is needed (i.e. no hosts bits), then use the
+ * vl_api_prefix_t types.
+ *
+ **/
+
+manual_print typedef vl_api_prefix_t address_with_prefix;
+manual_print typedef vl_api_ip4_prefix_t ip4_address_with_prefix;
+manual_print typedef vl_api_ip6_prefix_t ip6_address_with_prefix;
+
/** \brief A context for matching prefixes against. (Think ip prefix list.)
The meaning (exact match / want subnets) of an unset matcher is left to the implementer.
@param le - le mut be <= to prefix.len. Default: 255 (not set).