summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-09-11 17:49:08 +0200
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-09-19 14:24:54 +0000
commit75761b933f3e28494bae4b2cf5636a07ffe6ce18 (patch)
treea9663623eba8a5c26c6bcceab1606c946ce29754 /src/vnet
parentfbc388986e3f38aaedff87b843137be81b7d4f91 (diff)
api: split vl_api_prefix into two
One type for address with prefix and one type for prefix. Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Icfec51d9b7d5cde1d69fbecdd97498688ab7b295 Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/interface.api2
-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
-rw-r--r--src/vnet/mpls/mpls.api3
5 files changed, 27 insertions, 5 deletions
diff --git a/src/vnet/interface.api b/src/vnet/interface.api
index dff954438af..ff0946538f4 100644
--- a/src/vnet/interface.api
+++ b/src/vnet/interface.api
@@ -223,7 +223,7 @@ autoreply define sw_interface_add_del_address
bool is_add;
bool del_all;
- vl_api_prefix_t prefix;
+ vl_api_address_with_prefix_t prefix;
};
/** \brief Associate the specified interface with a fib table
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).
diff --git a/src/vnet/mpls/mpls.api b/src/vnet/mpls/mpls.api
index 2a0c83d4dd5..535bcea2b60 100644
--- a/src/vnet/mpls/mpls.api
+++ b/src/vnet/mpls/mpls.api
@@ -26,8 +26,7 @@ import "vnet/ip/ip_types.api";
@param mb_ip_table_id - The IP table-id of the IP prefix to bind to.
@param mb_is_bind - Bind or unbind
@param mb_is_ip4 - The prefix to bind to is IPv4
- @param mb_address_length - Length of IP prefix
- @param mb_address[16] - IP prefix/
+ @param mb_prefix - IP prefix
*/
autoreply define mpls_ip_bind_unbind
{