diff options
Diffstat (limited to 'lib/if.c')
| -rw-r--r-- | lib/if.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -217,16 +217,14 @@ struct interface *if_create_name(const char *name, vrf_id_t vrf_id) return ifp; } -struct interface *if_create_ifindex(ifindex_t ifindex, vrf_id_t vrf_id, - char *optional_name) +struct interface *if_create_ifindex(ifindex_t ifindex, vrf_id_t vrf_id) { struct interface *ifp; ifp = if_new(vrf_id); if_set_index(ifp, ifindex); - if (optional_name) - if_set_name(ifp, optional_name); + hook_call(if_add, ifp); return ifp; } @@ -573,8 +571,7 @@ struct interface *if_get_by_name(const char *name, vrf_id_t vrf_id) return NULL; } -struct interface *if_get_by_ifindex(ifindex_t ifindex, vrf_id_t vrf_id, - char *optional_name) +struct interface *if_get_by_ifindex(ifindex_t ifindex, vrf_id_t vrf_id) { struct interface *ifp; @@ -584,7 +581,7 @@ struct interface *if_get_by_ifindex(ifindex_t ifindex, vrf_id_t vrf_id, ifp = if_lookup_by_ifindex(ifindex, vrf_id); if (ifp) return ifp; - return if_create_ifindex(ifindex, vrf_id, optional_name); + return if_create_ifindex(ifindex, vrf_id); case VRF_BACKEND_VRF_LITE: ifp = if_lookup_by_index_all_vrf(ifindex); if (ifp) { @@ -596,7 +593,7 @@ struct interface *if_get_by_ifindex(ifindex_t ifindex, vrf_id_t vrf_id, if_update_to_new_vrf(ifp, vrf_id); return ifp; } - return if_create_ifindex(ifindex, vrf_id, optional_name); + return if_create_ifindex(ifindex, vrf_id); } return NULL; @@ -1321,7 +1318,7 @@ void if_link_params_free(struct interface *ifp) /* * XPath: /frr-interface:lib/interface */ -DEFPY_NOSH (interface, +DEFPY_YANG_NOSH (interface, interface_cmd, "interface IFNAME [vrf NAME$vrf_name]", "Select an interface to configure\n" @@ -1384,6 +1381,7 @@ DEFPY_NOSH (interface, * all interface-level commands are converted to the new * northbound model. */ + nb_cli_pending_commit_check(vty); ifp = if_lookup_by_name(ifname, vrf_id); if (ifp) VTY_PUSH_CONTEXT(INTERFACE_NODE, ifp); @@ -1392,7 +1390,7 @@ DEFPY_NOSH (interface, return ret; } -DEFPY (no_interface, +DEFPY_YANG (no_interface, no_interface_cmd, "no interface IFNAME [vrf NAME$vrf_name]", NO_STR @@ -1427,7 +1425,7 @@ static void cli_show_interface(struct vty *vty, struct lyd_node *dnode, /* * XPath: /frr-interface:lib/interface/description */ -DEFPY (interface_desc, +DEFPY_YANG (interface_desc, interface_desc_cmd, "description LINE...", "Interface specific description\n" @@ -1444,7 +1442,7 @@ DEFPY (interface_desc, return ret; } -DEFPY (no_interface_desc, +DEFPY_YANG (no_interface_desc, no_interface_desc_cmd, "no description", NO_STR |
