summaryrefslogtreecommitdiffstats
BranchCommit messageAuthorAge
masterbuild: Fix PATH shell exportRenato Botelho do Couto14 hours
stable/2410misc: VPP 24.10 Release NotesAndrew Yourtchenko2 months
stable/2406prom: test_prom fixMatus Fabian5 months
stable/2402build: update octeon-roc checksum to updated versionDave Wallace5 months
stable/2310sr: use correct reply to sr_policy_add_v2Vratko Polak9 months
stable/2306vpp-swan: fix configuration of policiesGabriel Oginski16 months
stable/2302vlib: reset stop_timer_handle on expired processesMatthew Smith16 months
stable/2210nat: fix nat44 vrf handlersDaniel Béreš21 months
stable/2206misc: VPP 22.06.1 Release NotesDave Wallace23 months
stable/2106ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/2101ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/2009ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/2005ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/2001ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/1904ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/1908ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/2110ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/2202ipsec: fix AES CBC IV generation (CVE-2022-46397)Benoît Ganne23 months
stable/1901vlib: address vlib_error_t scaling issueSteven Luong5 years
stable/1807Clean up multi-thread barrier-sync hold-down timerDave Barach6 years
stable/1810mp_safe SW_INTERFACE_DUMP, SW_INTERFACE_DETAILS, SW_INTERFACE_TAG_ADD_DEL,Steven Luong6 years
stable/1804fix packets redirect ineffective on af-packet interfacechenxiang6 years
stable/1801fix issue with missing sample_main in sample pluginDamjan Marion6 years
stable/1710l2-flood: fix restore vnet buffer's flags in the replication routineSteve Shin7 years
stable/1707Add replicate DPO header to export list for VPPSBNeale Ranns7 years
stable/1704VPP debug image with worker threads hit assert on adding IP route with traffi...Neale Ranns8 years
stable/1701Fix pretty-printing in "api trace custom-dump" (VPP-683)Andrew Yourtchenko8 years
stable/1609Vhost: Add thread sync while receiving vhost messagePierre Pfister8 years
stable/1606Fix generate-deb-changelog to handle YY.MM releaseEd Warnicke9 years
stable/testWhitespace probe for CIEd Warnicke9 years
 
TagDownloadAuthorAge
v24.10commit cfa0953251...Andrew Yourtchenko2 months
v24.10-rc2commit 466b350538...Andrew Yourtchenko3 months
v24.10-rc1commit b91e15387d...Andrew Yourtchenko3 months
v25.02-rc0commit 8f989630b0...Andrew Yourtchenko3 months
v24.06commit 6e8b350a01...Andrew Yourtchenko6 months
v24.06-rc2commit 55457075d9...Andrew Yourtchenko7 months
v24.06-rc1commit b3304b2b76...Andrew Yourtchenko8 months
v24.10-rc0commit 71e0902454...Andrew Yourtchenko8 months
v24.02commit 455960759b...Andrew Yourtchenko10 months
v24.02-rc2commit 8cbf84dce0...Andrew Yourtchenko11 months
v24.02-rc1commit 3a56e86a73...Andrew Yourtchenko11 months
v24.06-rc0commit 6fb2b3dc72...Andrew Yourtchenko11 months
v23.10commit 7c4027fa5e...Andrew Yourtchenko14 months
v23.10-rc2commit 015a6f7f17...Andrew Yourtchenko15 months
v23.10-rc1commit 14df6fc1ea...Andrew Yourtchenko16 months
v24.02-rc0commit 7419bede7a...Andrew Yourtchenko16 months
v23.06commit 493b8990d1...Andrew Yourtchenko18 months
v23.06-rc2commit 5e6bc730ef...Andrew Yourtchenko19 months
v23.06-rc1commit b60a6477eb...Andrew Yourtchenko20 months
v23.10-rc0commit a7dd04d73b...Andrew Yourtchenko20 months
v23.02commit 5516fc0f3b...Andrew Yourtchenko23 months
v22.10.1commit 57302fe52f...Dave Wallace23 months
v22.06.1commit 1513b381d8...Dave Wallace23 months
v23.02-rc2commit be1b844214...Andrew Yourtchenko23 months
v23.02-rc1commit 42b5a8767c...Andrew Yourtchenko24 months
v23.06-rc0commit 2ebb95228f...Andrew Yourtchenko24 months
v22.10commit 07e0c05e69...Andrew Yourtchenko2 years
v22.10-rc2commit 61bae8a54d...Andrew Yourtchenko2 years
v22.10-rc1commit f845abb5dd...Andrew Yourtchenko2 years
v23.02-rc0commit a2a7a4031b...Andrew Yourtchenko2 years
v22.06commit 0d352a97c5...Andrew Yourtchenko3 years
v22.06-rc2commit ea4bcec987...Andrew Yourtchenko3 years
v22.06-rc1commit 211fa4748c...Andrew Yourtchenko3 years
v22.10-rc0commit e0301eeb7b...Andrew Yourtchenko3 years
v22.02commit 7911f29c51...Andrew Yourtchenko3 years
v22.02-rc2commit 9d2db2eb2e...Andrew Yourtchenko3 years
v22.02-rc1commit 93e5bea2d3...Andrew Yourtchenko3 years
v22.06-rc0commit 017a676654...Andrew Yourtchenko3 years
v21.10.1commit 0385458a56...Andrew Yourtchenko3 years
v21.10commit 0e0384cde9...Andrew Yourtchenko3 years
v21.10-rc2commit c1931b2f09...Andrew Yourtchenko3 years
v21.10-rc1commit fd9d936b3c...Andrew Yourtchenko3 years
v22.02-rc0commit 192c55f2e7...Andrew Yourtchenko3 years
v21.01.1commit 54f8aff02a...Andrew Yourtchenko3 years
v21.06commit fc83f8cc67...Andrew Yourtchenko4 years
v21.06-rc2commit 8b297dbceb...Andrew Yourtchenko4 years
v21.06-rc1commit e82d59f381...Andrew Yourtchenko4 years
v21.10-rc0commit 91d6a94845...Andrew Yourtchenko4 years
v21.01commit 3d2d96e554...Andrew Yourtchenko4 years
v21.01-rc2commit 15db851d93...Andrew Yourtchenko4 years
v21.01-rc1commit 9dab7b9416...Andrew Yourtchenko4 years
v21.06-rc0commit 7742d5b355...Andrew Yourtchenko4 years
v20.09commit 072def4738...Andrew Yourtchenko4 years
v20.09-rc2commit a87deb77da...Andrew Yourtchenko4 years
v20.09-rc1commit fb6d768419...Andrew Yourtchenko4 years
v21.01-rc0commit 0b31630ce7...Andrew Yourtchenko4 years
v19.08.3commit 37e99c22df...Andrew Yourtchenko4 years
v20.05.1commit b1500e9fff...Andrew Yourtchenko4 years
v20.05commit ab572152d9...Andrew Yourtchenko5 years
v20.05-rc2commit 63f9e7cc0e...Andrew Yourtchenko5 years
v20.05-rc1commit b8e9009400...Andrew Yourtchenko5 years
v20.09-rc0commit b163bbb748...Andrew Yourtchenko5 years
v19.08.2commit ec9ce338f0...Andrew Yourtchenko5 years
v20.01commit fce396738f...Andrew Yourtchenko5 years
v20.01-rc2commit 29acfa2ad5...Andrew Yourtchenko5 years
v20.01-rc1commit c7fe31cfff...Andrew Yourtchenko5 years
v20.05-rc0commit 8ad070e102...Andrew Yourtchenko5 years
v19.04.4-rc0commit dfec10d137...Dave Wallace5 years
v19.04.3commit bdb89b9897...Dave Wallace5 years
v19.08.1commit f4dcae4164...Andrew Yourtchenko5 years
v19.08commit 1c586de48c...Andrew Yourtchenko5 years
v19.08-rc2commit 2f51729bb3...Andrew Yourtchenko5 years
v19.08-rc1commit 23526f78a8...Andrew Yourtchenko5 years
v20.01-rc0commit e41fd65381...Andrew Yourtchenko5 years
v19.04.2commit d95a226047...Dave Wallace5 years
v19.01.3commit bef25c30a1...Andrew Yourtchenko5 years
v19.04.2-rc0commit e4a0f9fdc0...Dave Wallace6 years
v19.01.3-rc0commit 6af8243814...Dave Wallace6 years
v19.04.1commit 1662c9cd23...Dave Wallace6 years
v19.01.2commit fa63602fcb...Andrew Yourtchenko6 years
v19.01.2-rc0commit 67a3e2d130...Dave Wallace6 years
v19.04.1-rc0commit 873b9ed405...Dave Wallace6 years
v19.04commit 3d18a191aa...Dave Wallace6 years
v19.04-rc2commit 0d7332e43f...Dave Wallace6 years
v19.08-rc0commit 40fd1f3dfd...Dave Wallace6 years
v19.04-rc1commit e29b8228a2...Dave Wallace6 years
v19.01.1commit cbd68cb711...Dave Wallace6 years
v19.01commit 67d9475ae3...Andrew Yourtchenko6 years
v19.01-rc2commit 0cb68778ec...Andrew Yourtchenko6 years
v19.01-rc1commit 3e2bc759f4...Damjan Marion6 years
v19.04-rc0commit ef080e1f9b...Andrew Yourtchenko6 years
v18.10commit 3a9a6f72d1...Marco Varlese6 years
v18.10-rc2commit b3aff922ff...Marco Varlese6 years
v19.01-rc0commit 4f611176e9...Marco Varlese6 years
v18.10-rc1commit 90395743d3...Marco Varlese6 years
v18.07.1commit 55fbdb9941...Ed Warnicke6 years
v18.07commit db6d6b3058...Ed Warnicke6 years
v18.07-rc2commit c16a23c596...Ed Warnicke6 years
v18.10-rc0commit 0e6f4d6af4...Ed Warnicke6 years
v18.07-rc0commit 3e21eba4d2...Ed Warnicke6 years
v18.07-rc1commit e400a6d1a5...Ed Warnicke6 years
v18.01.2commit 540b31ac8f...Dave Wallace7 years
v18.04commit ac2b7363f4...Chris Luke7 years
v18.04-rc2commit 18744ee680...Chris Luke7 years
v18.04-rc1commit 7ace56b9d8...Chris Luke7 years
v18.01.1commit f13bac295d...Dave Wallace7 years
v18.01commit 9d21268d0a...Dave Wallace7 years
v18.01-rc2commit bbdfeaebf2...Dave Wallace7 years
v18.01-rc1commit 8c2bacde4f...Dave Wallace7 years
v18.04-rc0commit a3a6ec63d3...Dave Wallace7 years
v17.10commit 116af2170e...Florin Coras7 years
v17.10-rc2commit cf6c343710...Florin Coras7 years
v18.01-rc0commit 75a17ecddc...Florin Coras7 years
v17.10-rc1commit 7ea28045aa...Florin Coras7 years
v17.07.01commit 839fa732c1...Neale Ranns7 years
v17.07commit f4f635e7c0...Neale Ranns7 years
v17.07-rc2commit 01d2b4b13a...Neale Ranns8 years
v17.10-rc0commit cdc74273df...Neale Ranns8 years
v17.07-rc1commit ea89b8cf66...Neale Ranns8 years
v17.04.2commit fc69a97116...Ole Troan8 years
v17.04.1commit 7d68ec6134...Ole Troan8 years
v17.04commit 511ee63cbb...Ole Troan8 years
v17.04-rc2commit 92bcecfdcc...Ole Troan8 years
v17.07-rc0commit 87edd671d7...Ole Troan8 years
v17.04-rc1commit cb92fc6edc...Ole Troan8 years
v17.01.1commit 8099e90346...Damjan Marion8 years
v17.01commit cd111b2228...Damjan Marion8 years
v17.01-rc2commit 235c64f067...Damjan Marion8 years
v17.04-rc0commit 2e70d8b31d...Damjan Marion8 years
v17.01-rc1commit 436b319354...Damjan Marion8 years
v17.01-rc0commit 931be3aca2...Ed Warnicke8 years
v16.09commit 21bc8624f5...Keith Burns (alagalah)8 years
v16.09-rc2commit 08377f8ff7...Keith Burns (alagalah)8 years
v16.12-rc0commit 694265d4f1...Dave Barach8 years
v16.09-rc1commit dbc6e3f0bb...Dave Barach8 years
v16.06commit 693f4358de...Ed Warnicke9 years
v16.06-rc3commit cf6511560e...Dave Barach9 years
v16.06-rc2commit b98a3a87a9...Dave Barach9 years
v16.09-rc0commit 862623da6e...Ed Warnicke9 years
v16.06-rc1commit 826d4f7b1f...Ed Warnicke9 years
v1.0.0commit cb9cadad57...Ed Warnicke9 years
an class="n">hi; } static void lisp_gpe_remove_iface (lisp_gpe_main_t * lgm, u32 hi_index, u32 dp_table, tunnel_lookup_t * tuns) { vnet_main_t *vnm = lgm->vnet_main; vnet_hw_interface_t *hi; uword *vnip; hi = vnet_get_hw_interface (vnm, hi_index); /* disable interface */ vnet_sw_interface_set_flags (vnm, hi->sw_if_index, 0 /* down */ ); vnet_hw_interface_set_flags (vnm, hi->hw_if_index, 0 /* down */ ); hash_unset (tuns->hw_if_index_by_dp_table, dp_table); vec_add1 (lgm->free_tunnel_hw_if_indices, hi->hw_if_index); /* clean tunnel termination and vni to sw_if_index binding */ vnip = hash_get (tuns->vni_by_sw_if_index, hi->sw_if_index); if (0 == vnip) { clib_warning ("No vni associated to interface %d", hi->sw_if_index); return; } hash_unset (tuns->sw_if_index_by_vni, vnip[0]); hash_unset (tuns->vni_by_sw_if_index, hi->sw_if_index); } static void lisp_gpe_iface_set_table (u32 sw_if_index, u32 table_id) { fib_node_index_t fib_index; fib_index = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP4, table_id, FIB_SOURCE_LISP); vec_validate (ip4_main.fib_index_by_sw_if_index, sw_if_index); ip4_main.fib_index_by_sw_if_index[sw_if_index] = fib_index; ip4_sw_interface_enable_disable (sw_if_index, 1); fib_index = fib_table_find_or_create_and_lock (FIB_PROTOCOL_IP6, table_id, FIB_SOURCE_LISP); vec_validate (ip6_main.fib_index_by_sw_if_index, sw_if_index); ip6_main.fib_index_by_sw_if_index[sw_if_index] = fib_index; ip6_sw_interface_enable_disable (sw_if_index, 1); } static void lisp_gpe_tenant_del_default_routes (u32 table_id) { fib_protocol_t proto; FOR_EACH_FIB_IP_PROTOCOL (proto) { fib_prefix_t prefix = { .fp_proto = proto, }; u32 fib_index; fib_index = fib_table_find (prefix.fp_proto, table_id); fib_table_entry_special_remove (fib_index, &prefix, FIB_SOURCE_LISP); fib_table_unlock (fib_index, prefix.fp_proto, FIB_SOURCE_LISP); } } static void lisp_gpe_tenant_add_default_routes (u32 table_id) { fib_protocol_t proto; FOR_EACH_FIB_IP_PROTOCOL (proto) { fib_prefix_t prefix = { .fp_proto = proto, }; u32 fib_index; /* * Add a deafult route that results in a control plane punt DPO */ fib_index = fib_table_find_or_create_and_lock (prefix.fp_proto, table_id, FIB_SOURCE_LISP); fib_table_entry_special_dpo_add (fib_index, &prefix, FIB_SOURCE_LISP, FIB_ENTRY_FLAG_EXCLUSIVE, lisp_cp_dpo_get (fib_proto_to_dpo (proto))); } } /** * @brief Add/del LISP-GPE L3 interface. * * Creates LISP-GPE interface, sets ingress arcs from lisp_gpeX_lookup, * installs default routes that attract all traffic with no more specific * routes to lgpe-ipx-lookup, set egress arcs to ipx-lookup, sets * the interface in the right vrf and enables it. * * @param[in] lgm Reference to @ref lisp_gpe_main_t. * @param[in] a Parameters to create interface. * * @return number of vectors in frame. */ u32 lisp_gpe_add_l3_iface (lisp_gpe_main_t * lgm, u32 vni, u32 table_id, u8 with_default_routes) { vnet_main_t *vnm = lgm->vnet_main; tunnel_lookup_t *l3_ifaces = &lgm->l3_ifaces; vnet_hw_interface_t *hi; uword *hip, *si; hip = hash_get (l3_ifaces->hw_if_index_by_dp_table, table_id); if (hip) { clib_warning ("vrf %d already mapped to a vni", table_id); return ~0; } si = hash_get (l3_ifaces->sw_if_index_by_vni, vni); if (si) { clib_warning ("Interface for vni %d already exists", vni); } /* create lisp iface and populate tunnel tables */ hi = lisp_gpe_create_iface (lgm, vni, table_id, &lisp_gpe_device_class, l3_ifaces); /* insert default routes that point to lisp-cp lookup */ lisp_gpe_iface_set_table (hi->sw_if_index, table_id); if (with_default_routes) lisp_gpe_tenant_add_default_routes (table_id); /* enable interface */ vnet_sw_interface_set_flags (vnm, hi->sw_if_index, VNET_SW_INTERFACE_FLAG_ADMIN_UP); vnet_hw_interface_set_flags (vnm, hi->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); return (hi->sw_if_index); } void lisp_gpe_del_l3_iface (lisp_gpe_main_t * lgm, u32 vni, u32 table_id) { vnet_main_t *vnm = lgm->vnet_main; tunnel_lookup_t *l3_ifaces = &lgm->l3_ifaces; vnet_hw_interface_t *hi; uword *hip; hip = hash_get (l3_ifaces->hw_if_index_by_dp_table, table_id); if (hip == 0) { clib_warning ("The interface for vrf %d doesn't exist", table_id); return; } hi = vnet_get_hw_interface (vnm, hip[0]); lisp_gpe_remove_iface (lgm, hip[0], table_id, &lgm->l3_ifaces); /* unset default routes */ ip4_sw_interface_enable_disable (hi->sw_if_index, 0); ip6_sw_interface_enable_disable (hi->sw_if_index, 0); lisp_gpe_tenant_del_default_routes (table_id); } /** * @brief Add/del LISP-GPE L2 interface. * * Creates LISP-GPE interface, sets it in L2 mode in the appropriate * bridge domain, sets egress arcs and enables it. * * @param[in] lgm Reference to @ref lisp_gpe_main_t. * @param[in] a Parameters to create interface. * * @return number of vectors in frame. */ u32 lisp_gpe_add_l2_iface (lisp_gpe_main_t * lgm, u32 vni, u32 bd_id) { vnet_main_t *vnm = lgm->vnet_main; tunnel_lookup_t *l2_ifaces = &lgm->l2_ifaces; vnet_hw_interface_t *hi; uword *hip, *si; u16 bd_index; if (bd_id > L2_BD_ID_MAX) { clib_warning ("bridge domain ID %d exceed 16M limit", bd_id); return ~0; } bd_index = bd_find_or_add_bd_index (&bd_main, bd_id); hip = hash_get (l2_ifaces->hw_if_index_by_dp_table, bd_index); if (hip) { clib_warning ("bridge domain %d already mapped to a vni", bd_id); return ~0; } si = hash_get (l2_ifaces->sw_if_index_by_vni, vni); if (si) { clib_warning ("Interface for vni %d already exists", vni); return ~0; } /* create lisp iface and populate tunnel tables */ hi = lisp_gpe_create_iface (lgm, vni, bd_index, &l2_lisp_gpe_device_class, &lgm->l2_ifaces); /* enable interface */ vnet_sw_interface_set_flags (vnm, hi->sw_if_index, VNET_SW_INTERFACE_FLAG_ADMIN_UP); vnet_hw_interface_set_flags (vnm, hi->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); l2_arc_to_lb = vlib_node_add_named_next (vlib_get_main (), hi->tx_node_index, "l2-load-balance"); /* we're ready. add iface to l2 bridge domain */ set_int_l2_mode (lgm->vlib_main, vnm, MODE_L2_BRIDGE, hi->sw_if_index, bd_index, 0, 0, 0); return (hi->sw_if_index); } /** * @brief Add/del LISP-GPE L2 interface. * * Creates LISP-GPE interface, sets it in L2 mode in the appropriate * bridge domain, sets egress arcs and enables it. * * @param[in] lgm Reference to @ref lisp_gpe_main_t. * @param[in] a Parameters to create interface. * * @return number of vectors in frame. */ void lisp_gpe_del_l2_iface (lisp_gpe_main_t * lgm, u32 vni, u32 bd_id) { tunnel_lookup_t *l2_ifaces = &lgm->l2_ifaces; vnet_hw_interface_t *hi; u32 bd_index = bd_find_index (&bd_main, bd_id); ASSERT (bd_index != ~0); uword *hip = hash_get (l2_ifaces->hw_if_index_by_dp_table, bd_index); if (hip == 0) { clib_warning ("The interface for bridge domain %d doesn't exist", bd_id); return; } /* Remove interface from bridge .. by enabling L3 mode */ hi = vnet_get_hw_interface (lgm->vnet_main, hip[0]); set_int_l2_mode (lgm->vlib_main, lgm->vnet_main, MODE_L3, hi->sw_if_index, 0, 0, 0, 0); lisp_gpe_remove_iface (lgm, hip[0], bd_index, &lgm->l2_ifaces); } /** * @brief Add LISP-GPE NSH interface. * * Creates LISP-GPE interface, sets it in L3 mode. * * @param[in] lgm Reference to @ref lisp_gpe_main_t. * @param[in] a Parameters to create interface. * * @return sw_if_index. */ u32 vnet_lisp_gpe_add_nsh_iface (lisp_gpe_main_t * lgm) { vnet_main_t *vnm = lgm->vnet_main; tunnel_lookup_t *nsh_ifaces = &lgm->nsh_ifaces; vnet_hw_interface_t *hi; uword *hip, *si; hip = hash_get (nsh_ifaces->hw_if_index_by_dp_table, 0); if (hip) { clib_warning ("NSH interface 0 already exists"); return ~0; } si = hash_get (nsh_ifaces->sw_if_index_by_vni, 0); if (si) { clib_warning ("NSH interface already exists"); return ~0; } /* create lisp iface and populate tunnel tables */ hi = lisp_gpe_create_iface (lgm, 0, 0, &nsh_lisp_gpe_device_class, &lgm->nsh_ifaces); /* enable interface */ vnet_sw_interface_set_flags (vnm, hi->sw_if_index, VNET_SW_INTERFACE_FLAG_ADMIN_UP); vnet_hw_interface_set_flags (vnm, hi->hw_if_index, VNET_HW_INTERFACE_FLAG_LINK_UP); return (hi->sw_if_index); } /** * @brief Del LISP-GPE NSH interface. * */ void vnet_lisp_gpe_del_nsh_iface (lisp_gpe_main_t * lgm) { tunnel_lookup_t *nsh_ifaces = &lgm->nsh_ifaces; uword *hip; hip = hash_get (nsh_ifaces->hw_if_index_by_dp_table, 0); if (hip == 0) { clib_warning ("The NSH 0 interface doesn't exist"); return; } lisp_gpe_remove_iface (lgm, hip[0], 0, &lgm->nsh_ifaces); } static clib_error_t * lisp_gpe_add_del_iface_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { unformat_input_t _line_input, *line_input = &_line_input; u8 is_add = 1; u32 table_id, vni, bd_id; u8 vni_is_set = 0, vrf_is_set = 0, bd_index_is_set = 0; u8 nsh_iface = 0; clib_error_t *error = NULL; if (vnet_lisp_gpe_enable_disable_status () == 0) { return clib_error_return (0, "LISP is disabled"); } /* Get a line of input. */ if (!unformat_user (input, unformat_line_input, line_input)) return 0; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) { if (unformat (line_input, "add")) is_add = 1; else if (unformat (line_input, "del")) is_add = 0; else if (unformat (line_input, "vrf %d", &table_id)) { vrf_is_set = 1; } else if (unformat (line_input, "vni %d", &vni)) { vni_is_set = 1; } else if (unformat (line_input, "bd %d", &bd_id)) { bd_index_is_set = 1; } else if (unformat (line_input, "nsh")) { nsh_iface = 1; } else { error = clib_error_return (0, "parse error: '%U'", format_unformat_error, line_input); goto done; } } if (nsh_iface) { if (is_add) { if (~0 == vnet_lisp_gpe_add_nsh_iface (&lisp_gpe_main)) { error = clib_error_return (0, "NSH interface not created"); goto done; } } else { vnet_lisp_gpe_del_nsh_iface (&lisp_gpe_main); } goto done; } if (vrf_is_set && bd_index_is_set) { error = clib_error_return (0, "Cannot set both vrf and brdige domain index!"); goto done; } if (!vni_is_set) { error = clib_error_return (0, "vni must be set!"); goto done; } if (!vrf_is_set && !bd_index_is_set) { error = clib_error_return (0, "vrf or bridge domain index must be set!"); goto done; } if (bd_index_is_set) { if (is_add) { if (~0 == lisp_gpe_tenant_l2_iface_add_or_lock (vni, bd_id)) { error = clib_error_return (0, "L2 interface not created"); goto done; } } else lisp_gpe_tenant_l2_iface_unlock (vni); } else { if (is_add) { if (~0 == lisp_gpe_tenant_l3_iface_add_or_lock (vni, table_id, 1 /* with_default_route */ )) { error = clib_error_return (0, "L3 interface not created"); goto done; } } else lisp_gpe_tenant_l3_iface_unlock (vni); } done: unformat_free (line_input); return error; } /* *INDENT-OFF* */ VLIB_CLI_COMMAND (add_del_lisp_gpe_iface_command, static) = { .path = "gpe iface", .short_help = "gpe iface add/del vni <vni> vrf <vrf>", .function = lisp_gpe_add_del_iface_command_fn, }; /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */