aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2020-02-26 11:01:43 +0100
committerOle Trøan <otroan@employees.org>2020-02-26 12:45:11 +0000
commit23a386b71b287bc95000a8980856c5dbe7cdaf5a (patch)
tree0125b67cacdf2c15ceaae7c3fde0b3f0d9ca90e3 /src/vnet
parentd26b8607c9f9a4385bf7af0a01b1a42efaed5053 (diff)
vat: add ip api types parser definitions
build vat with src/vnet/ip/ip_types_api.c Type: fix Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: Iab0f18bf7a89cf9512beab0629bc3a349edec383 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/ip/ip_types_api.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/vnet/ip/ip_types_api.c b/src/vnet/ip/ip_types_api.c
index 2e92e723772..d201d387f02 100644
--- a/src/vnet/ip/ip_types_api.c
+++ b/src/vnet/ip/ip_types_api.c
@@ -253,8 +253,24 @@ void
ip_prefix_encode (const fib_prefix_t * in, vl_api_prefix_t * out)
{
out->len = in->fp_len;
- ip_address_encode (&in->fp_addr,
- fib_proto_to_ip46 (in->fp_proto), &out->address);
+ ip46_type_t ip46_type;
+
+ switch (in->fp_proto)
+ {
+ case FIB_PROTOCOL_IP4:
+ ip46_type = (IP46_TYPE_IP4);
+ break;
+ case FIB_PROTOCOL_IP6:
+ ip46_type = (IP46_TYPE_IP6);
+ break;
+ case FIB_PROTOCOL_MPLS:
+ ip46_type = (IP46_TYPE_ANY);
+ break;
+ default:
+ ip46_type = (IP46_TYPE_ANY);
+ }
+
+ ip_address_encode (&in->fp_addr, ip46_type, &out->address);
}
void