diff options
| author | Christian Hopps <chopps@labn.net> | 2023-11-29 14:37:23 -0500 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-11-29 14:37:23 -0500 |
| commit | 2c01083d35263fb3121340cc01f3b545075ae8e6 (patch) | |
| tree | 9e0aa21dd96e59c7c4cbd24bd6b3f97f01deb75b /ripd | |
| parent | 4aff978cee928cc0f8e1bf68a10d9c6ebb4b270e (diff) | |
lib: all: remove './' from xpath 22% speedup
fixes #8299
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'ripd')
| -rw-r--r-- | ripd/rip_cli.c | 42 | ||||
| -rw-r--r-- | ripd/rip_nb_config.c | 20 |
2 files changed, 31 insertions, 31 deletions
diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c index 097c708ab1..d545e692cb 100644 --- a/ripd/rip_cli.c +++ b/ripd/rip_cli.c @@ -73,7 +73,7 @@ void cli_show_router_rip(struct vty *vty, const struct lyd_node *dnode, { const char *vrf_name; - vrf_name = yang_dnode_get_string(dnode, "./vrf"); + vrf_name = yang_dnode_get_string(dnode, "vrf"); vty_out(vty, "!\n"); vty_out(vty, "router rip"); @@ -255,11 +255,11 @@ void cli_show_rip_distance_source(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { vty_out(vty, " distance %s %s", - yang_dnode_get_string(dnode, "./distance"), - yang_dnode_get_string(dnode, "./prefix")); - if (yang_dnode_exists(dnode, "./access-list")) + yang_dnode_get_string(dnode, "distance"), + yang_dnode_get_string(dnode, "prefix")); + if (yang_dnode_exists(dnode, "access-list")) vty_out(vty, " %s", - yang_dnode_get_string(dnode, "./access-list")); + yang_dnode_get_string(dnode, "access-list")); vty_out(vty, "\n"); } @@ -362,12 +362,12 @@ void cli_show_rip_offset_list(struct vty *vty, const struct lyd_node *dnode, { const char *interface; - interface = yang_dnode_get_string(dnode, "./interface"); + interface = yang_dnode_get_string(dnode, "interface"); vty_out(vty, " offset-list %s %s %s", - yang_dnode_get_string(dnode, "./access-list"), - yang_dnode_get_string(dnode, "./direction"), - yang_dnode_get_string(dnode, "./metric")); + yang_dnode_get_string(dnode, "access-list"), + yang_dnode_get_string(dnode, "direction"), + yang_dnode_get_string(dnode, "metric")); if (!strmatch(interface, "*")) vty_out(vty, " %s", interface); vty_out(vty, "\n"); @@ -475,13 +475,13 @@ void cli_show_rip_redistribute(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { vty_out(vty, " redistribute %s", - yang_dnode_get_string(dnode, "./protocol")); - if (yang_dnode_exists(dnode, "./metric")) + yang_dnode_get_string(dnode, "protocol")); + if (yang_dnode_exists(dnode, "metric")) vty_out(vty, " metric %s", - yang_dnode_get_string(dnode, "./metric")); - if (yang_dnode_exists(dnode, "./route-map")) + yang_dnode_get_string(dnode, "metric")); + if (yang_dnode_exists(dnode, "route-map")) vty_out(vty, " route-map %s", - yang_dnode_get_string(dnode, "./route-map")); + yang_dnode_get_string(dnode, "route-map")); vty_out(vty, "\n"); } @@ -550,9 +550,9 @@ void cli_show_rip_timers(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { vty_out(vty, " timers basic %s %s %s\n", - yang_dnode_get_string(dnode, "./update-interval"), - yang_dnode_get_string(dnode, "./holddown-interval"), - yang_dnode_get_string(dnode, "./flush-interval")); + yang_dnode_get_string(dnode, "update-interval"), + yang_dnode_get_string(dnode, "holddown-interval"), + yang_dnode_get_string(dnode, "flush-interval")); } /* @@ -591,7 +591,7 @@ void cli_show_rip_version(struct vty *vty, const struct lyd_node *dnode, * We have only one "version" command and three possible combinations of * send/receive values. */ - switch (yang_dnode_get_enum(dnode, "./receive")) { + switch (yang_dnode_get_enum(dnode, "receive")) { case RI_RIP_VERSION_1: vty_out(vty, " version 1\n"); break; @@ -912,7 +912,7 @@ void cli_show_ip_rip_authentication_scheme(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { - switch (yang_dnode_get_enum(dnode, "./mode")) { + switch (yang_dnode_get_enum(dnode, "mode")) { case RIP_NO_AUTH: vty_out(vty, " no ip rip authentication mode\n"); break; @@ -922,8 +922,8 @@ void cli_show_ip_rip_authentication_scheme(struct vty *vty, case RIP_AUTH_MD5: vty_out(vty, " ip rip authentication mode md5"); if (show_defaults - || !yang_dnode_is_default(dnode, "./md5-auth-length")) { - if (yang_dnode_get_enum(dnode, "./md5-auth-length") + || !yang_dnode_is_default(dnode, "md5-auth-length")) { + if (yang_dnode_get_enum(dnode, "md5-auth-length") == RIP_AUTH_MD5_SIZE) vty_out(vty, " auth-length rfc"); else diff --git a/ripd/rip_nb_config.c b/ripd/rip_nb_config.c index 8d3b670596..8b9cc922ad 100644 --- a/ripd/rip_nb_config.c +++ b/ripd/rip_nb_config.c @@ -35,7 +35,7 @@ int ripd_instance_create(struct nb_cb_create_args *args) const char *vrf_name; int socket; - vrf_name = yang_dnode_get_string(args->dnode, "./vrf"); + vrf_name = yang_dnode_get_string(args->dnode, "vrf"); vrf = vrf_lookup_by_name(vrf_name); /* @@ -189,7 +189,7 @@ int ripd_instance_distance_source_create(struct nb_cb_create_args *args) if (args->event != NB_EV_APPLY) return NB_OK; - yang_dnode_get_ipv4p(&prefix, args->dnode, "./prefix"); + yang_dnode_get_ipv4p(&prefix, args->dnode, "prefix"); apply_mask_ipv4(&prefix); /* Get RIP distance node. */ @@ -395,7 +395,7 @@ int ripd_instance_offset_list_create(struct nb_cb_create_args *args) return NB_OK; rip = nb_running_get_entry(args->dnode, NULL, true); - ifname = yang_dnode_get_string(args->dnode, "./interface"); + ifname = yang_dnode_get_string(args->dnode, "interface"); offset = rip_offset_list_new(rip, ifname); nb_running_set_entry(args->dnode, offset); @@ -411,7 +411,7 @@ int ripd_instance_offset_list_destroy(struct nb_cb_destroy_args *args) if (args->event != NB_EV_APPLY) return NB_OK; - direct = yang_dnode_get_enum(args->dnode, "./direction"); + direct = yang_dnode_get_enum(args->dnode, "direction"); offset = nb_running_unset_entry(args->dnode); if (offset->direct[direct].alist_name) { @@ -560,7 +560,7 @@ int ripd_instance_redistribute_create(struct nb_cb_create_args *args) return NB_OK; rip = nb_running_get_entry(args->dnode, NULL, true); - type = yang_dnode_get_enum(args->dnode, "./protocol"); + type = yang_dnode_get_enum(args->dnode, "protocol"); rip->redist[type].enabled = true; @@ -576,7 +576,7 @@ int ripd_instance_redistribute_destroy(struct nb_cb_destroy_args *args) return NB_OK; rip = nb_running_get_entry(args->dnode, NULL, true); - type = yang_dnode_get_enum(args->dnode, "./protocol"); + type = yang_dnode_get_enum(args->dnode, "protocol"); rip->redist[type].enabled = false; if (rip->redist[type].route_map.name) { @@ -600,7 +600,7 @@ void ripd_instance_redistribute_apply_finish( int type; rip = nb_running_get_entry(args->dnode, NULL, true); - type = yang_dnode_get_enum(args->dnode, "./protocol"); + type = yang_dnode_get_enum(args->dnode, "protocol"); if (rip->enabled) rip_redistribute_conf_update(rip, type); @@ -1123,12 +1123,12 @@ int lib_interface_rip_bfd_create(struct nb_cb_create_args *args) ifp = nb_running_get_entry(args->dnode, NULL, true); ri = ifp->info; - ri->bfd.enabled = yang_dnode_get_bool(args->dnode, "./enable"); + ri->bfd.enabled = yang_dnode_get_bool(args->dnode, "enable"); XFREE(MTYPE_RIP_BFD_PROFILE, ri->bfd.profile); - if (yang_dnode_exists(args->dnode, "./profile")) + if (yang_dnode_exists(args->dnode, "profile")) ri->bfd.profile = XSTRDUP( MTYPE_RIP_BFD_PROFILE, - yang_dnode_get_string(args->dnode, "./profile")); + yang_dnode_get_string(args->dnode, "profile")); rip_bfd_interface_update(ri); |
