diff options
author | 2020-02-26 11:01:43 +0100 | |
---|---|---|
committer | 2020-08-13 08:12:25 +0000 | |
commit | 5a9769c159a8bd7163035c6e12abe87668674ff3 (patch) | |
tree | 95c60b847473bee465e08ca3fd72455037168dfa /src/vnet | |
parent | b745d7b21dd5e7c434435c9fbd36360006cc3fae (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>
(cherry picked from commit 23a386b71b287bc95000a8980856c5dbe7cdaf5a)
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/ip/ip_types_api.c | 20 |
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 0f7f0e530f9..e517b6e0412 100644 --- a/src/vnet/ip/ip_types_api.c +++ b/src/vnet/ip/ip_types_api.c @@ -217,8 +217,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 |