aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/pppoe/pppoe_test.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2019-12-06 14:23:10 +0100
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-12-07 11:18:58 +0000
commit04338e85ae4979222029d18c314a9cc09d723572 (patch)
tree2d9d168508aaaedba617d675f2920ca42689da1e /src/plugins/pppoe/pppoe_test.c
parent69885b72a982defbbfddec6c8e82efde88fbb86d (diff)
pppoe: use explicit types in api
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: Ifd1e1907740e55420dc040eb2afbbbf9887aea3c
Diffstat (limited to 'src/plugins/pppoe/pppoe_test.c')
-rw-r--r--src/plugins/pppoe/pppoe_test.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/pppoe/pppoe_test.c b/src/plugins/pppoe/pppoe_test.c
index 72d186546e7..d66eab1ba63 100644
--- a/src/plugins/pppoe/pppoe_test.c
+++ b/src/plugins/pppoe/pppoe_test.c
@@ -19,6 +19,9 @@
#include <vppinfra/error.h>
#include <pppoe/pppoe.h>
+#include <vnet/format_fns.h>
+
+#include <vnet/ip/ip_types_api.h>
#define __plugin_msg_base pppoe_test_main.msg_id_base
#include <vlibapi/vat_helper_macros.h>
@@ -158,19 +161,19 @@ api_pppoe_add_del_session (vat_main_t * vam)
M (PPPOE_ADD_DEL_SESSION, mp);
+
if (ipv6_set)
{
- clib_memcpy (mp->client_ip, &client_ip.ip6, sizeof (client_ip.ip6));
+ ip_address_encode(&client_ip, IP46_TYPE_IP6, &mp->client_ip);
}
else
{
- clib_memcpy (mp->client_ip, &client_ip.ip4, sizeof (client_ip.ip4));
+ ip_address_encode(&client_ip, IP46_TYPE_IP4, &mp->client_ip);
}
mp->decap_vrf_id = ntohl (decap_vrf_id);
mp->session_id = ntohl (session_id);
mp->is_add = is_add;
- mp->is_ipv6 = ipv6_set;
memcpy (mp->client_mac, client_mac, 6);
S (mp);
@@ -182,8 +185,8 @@ static void vl_api_pppoe_session_details_t_handler
(vl_api_pppoe_session_details_t * mp)
{
vat_main_t *vam = &vat_main;
- ip46_address_t client_ip = to_ip46 (mp->is_ipv6, mp->client_ip);
-
+ ip46_address_t client_ip;
+ ip_address_decode(&mp->client_ip, &client_ip);
print (vam->ofp, "%11d%14d%24U%14d%14d%30U%30U",
ntohl (mp->sw_if_index), ntohl (mp->session_id),
format_ip46_address, &client_ip, IP46_TYPE_ANY,