From 340b10a38ed84600ed3336657ef3a104d9ebe877 Mon Sep 17 00:00:00 2001 From: zstas Date: Sat, 9 May 2020 16:57:23 +0000 Subject: pppoe: make pppoe plugin work with dot1q subinterfaces - Enabling arc "device-input" with the next node "pppoe-input" on the pppoe cp interface: to get rid of L3_MAC_MISMATCH error - Parsing in the "pppoe-input" node fixed to parse all headers from the scratch - Getting mac address directly from encap interface when filling up DPO adjacency. Anyway, in the case of the dot1q subinterface, we need to get vlan tags to fill the DPO adjacency. Type: improvement Change-Id: I5405931b0f58bef7b852c079a7e66e0da8b5de0f Signed-off-by: Stanislav Zaikin --- src/plugins/pppoe/pppoe_test.c | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'src/plugins/pppoe/pppoe_test.c') diff --git a/src/plugins/pppoe/pppoe_test.c b/src/plugins/pppoe/pppoe_test.c index d66eab1ba63..b2daadba896 100644 --- a/src/plugins/pppoe/pppoe_test.c +++ b/src/plugins/pppoe/pppoe_test.c @@ -237,4 +237,49 @@ api_pppoe_session_dump (vat_main_t * vam) return ret; } +static void vl_api_pppoe_add_del_cp_reply_t_handler + (vl_api_pppoe_add_del_session_reply_t * mp) +{ + vat_main_t *vam = &vat_main; + i32 retval = ntohl (mp->retval); + if (vam->async_mode) + { + vam->async_errors += (retval < 0); + } + else + { + vam->retval = retval; + vam->result_ready = 1; + } +} + +static int +api_pppoe_add_del_cp (vat_main_t * vam) +{ + unformat_input_t *line_input = vam->input; + vl_api_pppoe_add_del_cp_t *mp; + u8 is_add = 1; + u32 sw_if_index = ~0; + int ret; + + while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) + { + if (unformat (line_input, "del")) + { + is_add = 0; + } + else if (unformat (line_input, "cp-if-index %d", &sw_if_index)) + ; + } + + M (PPPOE_ADD_DEL_CP, mp); + + mp->is_add = is_add; + mp->sw_if_index = sw_if_index; + + S (mp); + W (ret); + return ret; +} + #include -- cgit 1.2.3-korg