diff options
author | Christian Hopps <chopps@labn.net> | 2023-11-29 20:37:23 +0100 |
---|---|---|
committer | Christian Hopps <chopps@labn.net> | 2023-11-29 20:37:23 +0100 |
commit | 2c01083d35263fb3121340cc01f3b545075ae8e6 (patch) | |
tree | 9e0aa21dd96e59c7c4cbd24bd6b3f97f01deb75b /eigrpd | |
parent | Merge pull request #14906 from Keelan10/bgp_confederation-leak (diff) | |
download | frr-2c01083d35263fb3121340cc01f3b545075ae8e6.tar.xz frr-2c01083d35263fb3121340cc01f3b545075ae8e6.zip |
lib: all: remove './' from xpath 22% speedup
fixes #8299
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'eigrpd')
-rw-r--r-- | eigrpd/eigrp_cli.c | 56 | ||||
-rw-r--r-- | eigrpd/eigrp_northbound.c | 34 |
2 files changed, 45 insertions, 45 deletions
diff --git a/eigrpd/eigrp_cli.c b/eigrpd/eigrp_cli.c index 213834afc..b961cde87 100644 --- a/eigrpd/eigrp_cli.c +++ b/eigrpd/eigrp_cli.c @@ -69,8 +69,8 @@ DEFPY_YANG( void eigrp_cli_show_header(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { - const char *asn = yang_dnode_get_string(dnode, "./asn"); - const char *vrf = yang_dnode_get_string(dnode, "./vrf"); + const char *asn = yang_dnode_get_string(dnode, "asn"); + const char *vrf = yang_dnode_get_string(dnode, "vrf"); vty_out(vty, "router eigrp %s", asn); if (strcmp(vrf, VRF_DEFAULT_NAME)) @@ -323,18 +323,18 @@ void eigrp_cli_show_metrics(struct vty *vty, const struct lyd_node *dnode, { const char *k1, *k2, *k3, *k4, *k5, *k6; - k1 = yang_dnode_exists(dnode, "./K1") ? - yang_dnode_get_string(dnode, "./K1") : "0"; - k2 = yang_dnode_exists(dnode, "./K2") ? - yang_dnode_get_string(dnode, "./K2") : "0"; - k3 = yang_dnode_exists(dnode, "./K3") ? - yang_dnode_get_string(dnode, "./K3") : "0"; - k4 = yang_dnode_exists(dnode, "./K4") ? - yang_dnode_get_string(dnode, "./K4") : "0"; - k5 = yang_dnode_exists(dnode, "./K5") ? - yang_dnode_get_string(dnode, "./K5") : "0"; - k6 = yang_dnode_exists(dnode, "./K6") ? - yang_dnode_get_string(dnode, "./K6") : "0"; + k1 = yang_dnode_exists(dnode, "K1") ? + yang_dnode_get_string(dnode, "K1") : "0"; + k2 = yang_dnode_exists(dnode, "K2") ? + yang_dnode_get_string(dnode, "K2") : "0"; + k3 = yang_dnode_exists(dnode, "K3") ? + yang_dnode_get_string(dnode, "K3") : "0"; + k4 = yang_dnode_exists(dnode, "K4") ? + yang_dnode_get_string(dnode, "K4") : "0"; + k5 = yang_dnode_exists(dnode, "K5") ? + yang_dnode_get_string(dnode, "K5") : "0"; + k6 = yang_dnode_exists(dnode, "K6") ? + yang_dnode_get_string(dnode, "K6") : "0"; vty_out(vty, " metric weights %s %s %s %s %s", k1, k2, k3, k4, k5); @@ -456,19 +456,19 @@ DEFPY_YANG( void eigrp_cli_show_redistribute(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { - const char *proto = yang_dnode_get_string(dnode, "./protocol"); + const char *proto = yang_dnode_get_string(dnode, "protocol"); const char *bw, *delay, *load, *mtu, *rlbt; - bw = yang_dnode_exists(dnode, "./metrics/bandwidth") ? - yang_dnode_get_string(dnode, "./metrics/bandwidth") : NULL; - delay = yang_dnode_exists(dnode, "./metrics/delay") ? - yang_dnode_get_string(dnode, "./metrics/delay") : NULL; - rlbt = yang_dnode_exists(dnode, "./metrics/reliability") ? - yang_dnode_get_string(dnode, "./metrics/reliability") : NULL; - load = yang_dnode_exists(dnode, "./metrics/load") ? - yang_dnode_get_string(dnode, "./metrics/load") : NULL; - mtu = yang_dnode_exists(dnode, "./metrics/mtu") ? - yang_dnode_get_string(dnode, "./metrics/mtu") : NULL; + bw = yang_dnode_exists(dnode, "metrics/bandwidth") ? + yang_dnode_get_string(dnode, "metrics/bandwidth") : NULL; + delay = yang_dnode_exists(dnode, "metrics/delay") ? + yang_dnode_get_string(dnode, "metrics/delay") : NULL; + rlbt = yang_dnode_exists(dnode, "metrics/reliability") ? + yang_dnode_get_string(dnode, "metrics/reliability") : NULL; + load = yang_dnode_exists(dnode, "metrics/load") ? + yang_dnode_get_string(dnode, "metrics/load") : NULL; + mtu = yang_dnode_exists(dnode, "metrics/mtu") ? + yang_dnode_get_string(dnode, "metrics/mtu") : NULL; vty_out(vty, " redistribute %s", proto); if (bw || rlbt || delay || load || mtu) @@ -693,7 +693,7 @@ void eigrp_cli_show_summarize_address(struct vty *vty, { const struct lyd_node *instance = yang_dnode_get_parent(dnode, "instance"); - uint16_t asn = yang_dnode_get_uint16(instance, "./asn"); + uint16_t asn = yang_dnode_get_uint16(instance, "asn"); const char *summarize_address = yang_dnode_get_string(dnode, NULL); vty_out(vty, " ip summary-address eigrp %d %s\n", asn, @@ -759,7 +759,7 @@ void eigrp_cli_show_authentication(struct vty *vty, { const struct lyd_node *instance = yang_dnode_get_parent(dnode, "instance"); - uint16_t asn = yang_dnode_get_uint16(instance, "./asn"); + uint16_t asn = yang_dnode_get_uint16(instance, "asn"); const char *crypt = yang_dnode_get_string(dnode, NULL); vty_out(vty, " ip authentication mode eigrp %d %s\n", asn, crypt); @@ -819,7 +819,7 @@ void eigrp_cli_show_keychain(struct vty *vty, const struct lyd_node *dnode, { const struct lyd_node *instance = yang_dnode_get_parent(dnode, "instance"); - uint16_t asn = yang_dnode_get_uint16(instance, "./asn"); + uint16_t asn = yang_dnode_get_uint16(instance, "asn"); const char *keychain = yang_dnode_get_string(dnode, NULL); vty_out(vty, " ip authentication key-chain eigrp %d %s\n", asn, diff --git a/eigrpd/eigrp_northbound.c b/eigrpd/eigrp_northbound.c index f50abb7e4..562c292e2 100644 --- a/eigrpd/eigrp_northbound.c +++ b/eigrpd/eigrp_northbound.c @@ -28,18 +28,18 @@ static void redistribute_get_metrics(const struct lyd_node *dnode, { memset(em, 0, sizeof(*em)); - if (yang_dnode_exists(dnode, "./bandwidth")) - em->bandwidth = yang_dnode_get_uint32(dnode, "./bandwidth"); - if (yang_dnode_exists(dnode, "./delay")) - em->delay = yang_dnode_get_uint32(dnode, "./delay"); + if (yang_dnode_exists(dnode, "bandwidth")) + em->bandwidth = yang_dnode_get_uint32(dnode, "bandwidth"); + if (yang_dnode_exists(dnode, "delay")) + em->delay = yang_dnode_get_uint32(dnode, "delay"); #if 0 /* TODO: How does MTU work? */ - if (yang_dnode_exists(dnode, "./mtu")) - em->mtu[0] = yang_dnode_get_uint32(dnode, "./mtu"); + if (yang_dnode_exists(dnode, "mtu")) + em->mtu[0] = yang_dnode_get_uint32(dnode, "mtu"); #endif - if (yang_dnode_exists(dnode, "./load")) - em->load = yang_dnode_get_uint32(dnode, "./load"); - if (yang_dnode_exists(dnode, "./reliability")) - em->reliability = yang_dnode_get_uint32(dnode, "./reliability"); + if (yang_dnode_exists(dnode, "load")) + em->load = yang_dnode_get_uint32(dnode, "load"); + if (yang_dnode_exists(dnode, "reliability")) + em->reliability = yang_dnode_get_uint32(dnode, "reliability"); } static struct eigrp_interface *eigrp_interface_lookup(const struct eigrp *eigrp, @@ -73,7 +73,7 @@ static int eigrpd_instance_create(struct nb_cb_create_args *args) /* NOTHING */ break; case NB_EV_PREPARE: - vrf = yang_dnode_get_string(args->dnode, "./vrf"); + vrf = yang_dnode_get_string(args->dnode, "vrf"); pVrf = vrf_lookup_by_name(vrf); if (pVrf) @@ -81,7 +81,7 @@ static int eigrpd_instance_create(struct nb_cb_create_args *args) else vrfid = VRF_DEFAULT; - eigrp = eigrp_get(yang_dnode_get_uint16(args->dnode, "./asn"), + eigrp = eigrp_get(yang_dnode_get_uint16(args->dnode, "asn"), vrfid); args->resource->ptr = eigrp; break; @@ -715,7 +715,7 @@ static int eigrpd_instance_redistribute_create(struct nb_cb_create_args *args) switch (args->event) { case NB_EV_VALIDATE: - proto = yang_dnode_get_enum(args->dnode, "./protocol"); + proto = yang_dnode_get_enum(args->dnode, "protocol"); vrfname = yang_dnode_get_string(args->dnode, "../vrf"); pVrf = vrf_lookup_by_name(vrfname); @@ -733,7 +733,7 @@ static int eigrpd_instance_redistribute_create(struct nb_cb_create_args *args) break; case NB_EV_APPLY: eigrp = nb_running_get_entry(args->dnode, NULL, true); - proto = yang_dnode_get_enum(args->dnode, "./protocol"); + proto = yang_dnode_get_enum(args->dnode, "protocol"); redistribute_get_metrics(args->dnode, &metrics); eigrp_redistribute_set(eigrp, proto, metrics); break; @@ -755,7 +755,7 @@ static int eigrpd_instance_redistribute_destroy(struct nb_cb_destroy_args *args) break; case NB_EV_APPLY: eigrp = nb_running_get_entry(args->dnode, NULL, true); - proto = yang_dnode_get_enum(args->dnode, "./protocol"); + proto = yang_dnode_get_enum(args->dnode, "protocol"); eigrp_redistribute_unset(eigrp, proto); break; } @@ -1120,7 +1120,7 @@ static int lib_interface_eigrp_instance_create(struct nb_cb_create_args *args) break; } - eigrp = eigrp_get(yang_dnode_get_uint16(args->dnode, "./asn"), + eigrp = eigrp_get(yang_dnode_get_uint16(args->dnode, "asn"), ifp->vrf->vrf_id); eif = eigrp_interface_lookup(eigrp, ifp->name); if (eif == NULL) @@ -1132,7 +1132,7 @@ static int lib_interface_eigrp_instance_create(struct nb_cb_create_args *args) break; case NB_EV_APPLY: ifp = nb_running_get_entry(args->dnode, NULL, true); - eigrp = eigrp_get(yang_dnode_get_uint16(args->dnode, "./asn"), + eigrp = eigrp_get(yang_dnode_get_uint16(args->dnode, "asn"), ifp->vrf->vrf_id); eif = eigrp_interface_lookup(eigrp, ifp->name); if (eif == NULL) |