diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/affinitymap_cli.c | 4 | ||||
| -rw-r--r-- | lib/filter_cli.c | 58 | ||||
| -rw-r--r-- | lib/filter_nb.c | 22 | ||||
| -rw-r--r-- | lib/if.c | 6 | ||||
| -rw-r--r-- | lib/if_rmap.c | 12 | ||||
| -rw-r--r-- | lib/routemap_cli.c | 16 | ||||
| -rw-r--r-- | lib/routemap_northbound.c | 6 | ||||
| -rw-r--r-- | lib/routing_nb_config.c | 6 | ||||
| -rw-r--r-- | lib/vrf.c | 2 | ||||
| -rw-r--r-- | lib/yang_translator.c | 8 |
10 files changed, 70 insertions, 70 deletions
diff --git a/lib/affinitymap_cli.c b/lib/affinitymap_cli.c index a2d5e8eccf..d417ae1951 100644 --- a/lib/affinitymap_cli.c +++ b/lib/affinitymap_cli.c @@ -93,8 +93,8 @@ void cli_show_affinity_map(struct vty *vty, const struct lyd_node *dnode, bool show_defaults __attribute__((__unused__))) { vty_out(vty, "affinity-map %s bit-position %u\n", - yang_dnode_get_string(dnode, "./name"), - yang_dnode_get_uint16(dnode, "./value")); + yang_dnode_get_string(dnode, "name"), + yang_dnode_get_uint16(dnode, "value")); } /* Initialization of affinity map vector. */ diff --git a/lib/filter_cli.c b/lib/filter_cli.c index 5c3dc5e49d..529b46b6ad 100644 --- a/lib/filter_cli.c +++ b/lib/filter_cli.c @@ -1004,8 +1004,8 @@ ALIAS( int access_list_cmp(const struct lyd_node *dnode1, const struct lyd_node *dnode2) { - uint32_t seq1 = yang_dnode_get_uint32(dnode1, "./sequence"); - uint32_t seq2 = yang_dnode_get_uint32(dnode2, "./sequence"); + uint32_t seq1 = yang_dnode_get_uint32(dnode1, "sequence"); + uint32_t seq2 = yang_dnode_get_uint32(dnode2, "sequence"); return seq1 - seq2; } @@ -1022,23 +1022,23 @@ void access_list_show(struct vty *vty, const struct lyd_node *dnode, struct in_addr addr, mask; char macstr[PREFIX2STR_BUFFER]; - is_any = yang_dnode_exists(dnode, "./any"); + is_any = yang_dnode_exists(dnode, "any"); switch (type) { case YALT_IPV4: if (is_any) break; - if (yang_dnode_exists(dnode, "./host") - || yang_dnode_exists(dnode, "./network/address") - || yang_dnode_exists(dnode, "./source-any")) { + if (yang_dnode_exists(dnode, "host") + || yang_dnode_exists(dnode, "network/address") + || yang_dnode_exists(dnode, "source-any")) { cisco_style = true; - if (yang_dnode_exists(dnode, "./destination-host") + if (yang_dnode_exists(dnode, "destination-host") || yang_dnode_exists( dnode, "./destination-network/address") - || yang_dnode_exists(dnode, "./destination-any")) + || yang_dnode_exists(dnode, "destination-any")) cisco_extended = true; } else { - yang_dnode_get_prefix(&p, dnode, "./ipv4-prefix"); + yang_dnode_get_prefix(&p, dnode, "ipv4-prefix"); is_exact = yang_dnode_get_bool(dnode, "./ipv4-exact-match"); } @@ -1048,39 +1048,39 @@ void access_list_show(struct vty *vty, const struct lyd_node *dnode, if (is_any) break; - yang_dnode_get_prefix(&p, dnode, "./ipv6-prefix"); - is_exact = yang_dnode_get_bool(dnode, "./ipv6-exact-match"); + yang_dnode_get_prefix(&p, dnode, "ipv6-prefix"); + is_exact = yang_dnode_get_bool(dnode, "ipv6-exact-match"); break; case YALT_MAC: /* mac */ vty_out(vty, "mac "); if (is_any) break; - yang_dnode_get_prefix(&p, dnode, "./mac"); + yang_dnode_get_prefix(&p, dnode, "mac"); break; } vty_out(vty, "access-list %s seq %s %s", yang_dnode_get_string(dnode, "../name"), - yang_dnode_get_string(dnode, "./sequence"), - yang_dnode_get_string(dnode, "./action")); + yang_dnode_get_string(dnode, "sequence"), + yang_dnode_get_string(dnode, "action")); /* Handle Cisco style access lists. */ if (cisco_style) { if (cisco_extended) vty_out(vty, " ip"); - if (yang_dnode_exists(dnode, "./network")) { - yang_dnode_get_ipv4(&addr, dnode, "./network/address"); - yang_dnode_get_ipv4(&mask, dnode, "./network/mask"); + if (yang_dnode_exists(dnode, "network")) { + yang_dnode_get_ipv4(&addr, dnode, "network/address"); + yang_dnode_get_ipv4(&mask, dnode, "network/mask"); vty_out(vty, " %pI4 %pI4", &addr, &mask); - } else if (yang_dnode_exists(dnode, "./host")) { + } else if (yang_dnode_exists(dnode, "host")) { if (cisco_extended) vty_out(vty, " host"); vty_out(vty, " %s", - yang_dnode_get_string(dnode, "./host")); - } else if (yang_dnode_exists(dnode, "./source-any")) + yang_dnode_get_string(dnode, "host")); + } else if (yang_dnode_exists(dnode, "source-any")) vty_out(vty, " any"); /* Not extended, exit earlier. */ @@ -1090,17 +1090,17 @@ void access_list_show(struct vty *vty, const struct lyd_node *dnode, } /* Handle destination address. */ - if (yang_dnode_exists(dnode, "./destination-network")) { + if (yang_dnode_exists(dnode, "destination-network")) { yang_dnode_get_ipv4(&addr, dnode, "./destination-network/address"); yang_dnode_get_ipv4(&mask, dnode, "./destination-network/mask"); vty_out(vty, " %pI4 %pI4", &addr, &mask); - } else if (yang_dnode_exists(dnode, "./destination-host")) + } else if (yang_dnode_exists(dnode, "destination-host")) vty_out(vty, " host %s", yang_dnode_get_string(dnode, "./destination-host")); - else if (yang_dnode_exists(dnode, "./destination-any")) + else if (yang_dnode_exists(dnode, "destination-any")) vty_out(vty, " any"); vty_out(vty, "\n"); @@ -1644,8 +1644,8 @@ ALIAS( int prefix_list_cmp(const struct lyd_node *dnode1, const struct lyd_node *dnode2) { - uint32_t seq1 = yang_dnode_get_uint32(dnode1, "./sequence"); - uint32_t seq2 = yang_dnode_get_uint32(dnode2, "./sequence"); + uint32_t seq1 = yang_dnode_get_uint32(dnode1, "sequence"); + uint32_t seq2 = yang_dnode_get_uint32(dnode2, "sequence"); return seq1 - seq2; } @@ -1658,11 +1658,11 @@ void prefix_list_show(struct vty *vty, const struct lyd_node *dnode, bool is_any; struct prefix p; - is_any = yang_dnode_exists(dnode, "./any"); + is_any = yang_dnode_exists(dnode, "any"); switch (type) { case YPLT_IPV4: if (!is_any) - yang_dnode_get_prefix(&p, dnode, "./ipv4-prefix"); + yang_dnode_get_prefix(&p, dnode, "ipv4-prefix"); if (yang_dnode_exists(dnode, "./ipv4-prefix-length-greater-or-equal")) ge_str = yang_dnode_get_string( @@ -1692,8 +1692,8 @@ void prefix_list_show(struct vty *vty, const struct lyd_node *dnode, vty_out(vty, "prefix-list %s seq %s %s", yang_dnode_get_string(dnode, "../name"), - yang_dnode_get_string(dnode, "./sequence"), - yang_dnode_get_string(dnode, "./action")); + yang_dnode_get_string(dnode, "sequence"), + yang_dnode_get_string(dnode, "action")); if (is_any) { vty_out(vty, " any\n"); diff --git a/lib/filter_nb.c b/lib/filter_nb.c index 9511b8f5b5..1c436cc6f1 100644 --- a/lib/filter_nb.c +++ b/lib/filter_nb.c @@ -112,7 +112,7 @@ prefix_list_nb_validate_v4_af_type(const struct lyd_node *plist_dnode, { int af_type; - af_type = yang_dnode_get_enum(plist_dnode, "./type"); + af_type = yang_dnode_get_enum(plist_dnode, "type"); if (af_type != YPLT_IPV4) { snprintf(errmsg, errmsg_len, "prefix-list type %u is mismatched.", af_type); @@ -128,7 +128,7 @@ prefix_list_nb_validate_v6_af_type(const struct lyd_node *plist_dnode, { int af_type; - af_type = yang_dnode_get_enum(plist_dnode, "./type"); + af_type = yang_dnode_get_enum(plist_dnode, "type"); if (af_type != YPLT_IPV6) { snprintf(errmsg, errmsg_len, "prefix-list type %u is mismatched.", af_type); @@ -381,14 +381,14 @@ static void plist_dnode_to_prefix(const struct lyd_node *dnode, bool *any, *ge = 0; *le = 0; - if (yang_dnode_exists(dnode, "./any")) { + if (yang_dnode_exists(dnode, "any")) { *any = true; return; } switch (yang_dnode_get_enum(dnode, "../type")) { case YPLT_IPV4: - yang_dnode_get_prefix(p, dnode, "./ipv4-prefix"); + yang_dnode_get_prefix(p, dnode, "ipv4-prefix"); if (yang_dnode_exists(dnode, "./ipv4-prefix-length-greater-or-equal")) *ge = yang_dnode_get_uint8( @@ -399,7 +399,7 @@ static void plist_dnode_to_prefix(const struct lyd_node *dnode, bool *any, dnode, "./ipv4-prefix-length-lesser-or-equal"); break; case YPLT_IPV6: - yang_dnode_get_prefix(p, dnode, "./ipv6-prefix"); + yang_dnode_get_prefix(p, dnode, "ipv6-prefix"); if (yang_dnode_exists(dnode, "./ipv6-prefix-length-greater-or-equal")) *ge = yang_dnode_get_uint8( @@ -468,8 +468,8 @@ static int lib_access_list_create(struct nb_cb_create_args *args) if (args->event != NB_EV_APPLY) return NB_OK; - type = yang_dnode_get_enum(args->dnode, "./type"); - acl_name = yang_dnode_get_string(args->dnode, "./name"); + type = yang_dnode_get_enum(args->dnode, "type"); + acl_name = yang_dnode_get_string(args->dnode, "name"); switch (type) { case YALT_IPV4: @@ -550,7 +550,7 @@ static int lib_access_list_entry_create(struct nb_cb_create_args *args) return NB_OK; f = filter_new(); - f->seq = yang_dnode_get_uint32(args->dnode, "./sequence"); + f->seq = yang_dnode_get_uint32(args->dnode, "sequence"); acl = nb_running_get_entry(args->dnode, NULL, true); f->acl = acl; @@ -1123,8 +1123,8 @@ static int lib_prefix_list_create(struct nb_cb_create_args *args) if (args->event != NB_EV_APPLY) return NB_OK; - type = yang_dnode_get_enum(args->dnode, "./type"); - name = yang_dnode_get_string(args->dnode, "./name"); + type = yang_dnode_get_enum(args->dnode, "type"); + name = yang_dnode_get_string(args->dnode, "name"); switch (type) { case 0: /* ipv4 */ pl = prefix_list_get(AFI_IP, 0, name); @@ -1201,7 +1201,7 @@ static int lib_prefix_list_entry_create(struct nb_cb_create_args *args) pl = nb_running_get_entry(args->dnode, NULL, true); ple = prefix_list_entry_new(); ple->pl = pl; - ple->seq = yang_dnode_get_uint32(args->dnode, "./sequence"); + ple->seq = yang_dnode_get_uint32(args->dnode, "sequence"); prefix_list_entry_set_empty(ple); nb_running_set_entry(args->dnode, ple); @@ -1319,14 +1319,14 @@ static void cli_show_interface(struct vty *vty, const struct lyd_node *dnode, char ifname[XPATH_MAXLEN]; char vrfname[XPATH_MAXLEN]; - netns_ifname_split(yang_dnode_get_string(dnode, "./name"), + netns_ifname_split(yang_dnode_get_string(dnode, "name"), ifname, vrfname); vty_out(vty, "interface %s", ifname); if (!strmatch(vrfname, VRF_DEFAULT_NAME)) vty_out(vty, " vrf %s", vrfname); } else { - const char *ifname = yang_dnode_get_string(dnode, "./name"); + const char *ifname = yang_dnode_get_string(dnode, "name"); vty_out(vty, "interface %s", ifname); } @@ -1466,7 +1466,7 @@ static int lib_interface_create(struct nb_cb_create_args *args) const char *ifname; struct interface *ifp; - ifname = yang_dnode_get_string(args->dnode, "./name"); + ifname = yang_dnode_get_string(args->dnode, "name"); switch (args->event) { case NB_EV_VALIDATE: diff --git a/lib/if_rmap.c b/lib/if_rmap.c index 42e162072f..5fe5061a3c 100644 --- a/lib/if_rmap.c +++ b/lib/if_rmap.c @@ -243,14 +243,14 @@ DEFPY_YANG(no_if_ipv6_route_map, no_if_ipv6_route_map_cmd, void cli_show_if_route_map(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { - if (yang_dnode_exists(dnode, "./in-route-map")) + if (yang_dnode_exists(dnode, "in-route-map")) vty_out(vty, " route-map %s in %s\n", - yang_dnode_get_string(dnode, "./in-route-map"), - yang_dnode_get_string(dnode, "./interface")); - if (yang_dnode_exists(dnode, "./out-route-map")) + yang_dnode_get_string(dnode, "in-route-map"), + yang_dnode_get_string(dnode, "interface")); + if (yang_dnode_exists(dnode, "out-route-map")) vty_out(vty, " route-map %s out %s\n", - yang_dnode_get_string(dnode, "./out-route-map"), - yang_dnode_get_string(dnode, "./interface")); + yang_dnode_get_string(dnode, "out-route-map"), + yang_dnode_get_string(dnode, "interface")); } void if_rmap_yang_modify_cb(struct if_rmap_ctx *ctx, diff --git a/lib/routemap_cli.c b/lib/routemap_cli.c index 20a157e955..f24d574278 100644 --- a/lib/routemap_cli.c +++ b/lib/routemap_cli.c @@ -90,8 +90,8 @@ DEFPY_YANG( int route_map_instance_cmp(const struct lyd_node *dnode1, const struct lyd_node *dnode2) { - uint16_t seq1 = yang_dnode_get_uint16(dnode1, "./sequence"); - uint16_t seq2 = yang_dnode_get_uint16(dnode2, "./sequence"); + uint16_t seq1 = yang_dnode_get_uint16(dnode1, "sequence"); + uint16_t seq2 = yang_dnode_get_uint16(dnode2, "sequence"); return seq1 - seq2; } @@ -100,8 +100,8 @@ void route_map_instance_show(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { const char *name = yang_dnode_get_string(dnode, "../name"); - const char *action = yang_dnode_get_string(dnode, "./action"); - const char *sequence = yang_dnode_get_string(dnode, "./sequence"); + const char *action = yang_dnode_get_string(dnode, "action"); + const char *sequence = yang_dnode_get_string(dnode, "sequence"); vty_out(vty, "route-map %s %s %s\n", name, action, sequence); @@ -526,7 +526,7 @@ DEFPY_YANG( void route_map_condition_show(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { - const char *condition = yang_dnode_get_string(dnode, "./condition"); + const char *condition = yang_dnode_get_string(dnode, "condition"); const struct lyd_node *ln; const char *acl; @@ -1050,7 +1050,7 @@ DEFUN_YANG (no_set_srte_color, void route_map_action_show(struct vty *vty, const struct lyd_node *dnode, bool show_defaults) { - const char *action = yang_dnode_get_string(dnode, "./action"); + const char *action = yang_dnode_get_string(dnode, "action"); const struct lyd_node *ln; const char *acl; @@ -1102,7 +1102,7 @@ void route_map_action_show(struct vty *vty, const struct lyd_node *dnode, "./rmap-set-action/max-metric")); } else if (IS_SET_TAG(action)) { vty_out(vty, " set tag %s\n", - yang_dnode_get_string(dnode, "./rmap-set-action/tag")); + yang_dnode_get_string(dnode, "rmap-set-action/tag")); } else if (IS_SET_SR_TE_COLOR(action)) { vty_out(vty, " set sr-te color %s\n", yang_dnode_get_string(dnode, @@ -1196,7 +1196,7 @@ void route_map_action_show(struct vty *vty, const struct lyd_node *dnode, vty_out(vty, " set large-comm-list %s delete\n", acl); } else if (IS_SET_EXTCOMM_LIST_DEL(action)) { acl = NULL; - ln = yang_dnode_get(dnode, "./rmap-set-action/frr-bgp-route-map:comm-list-name"); + ln = yang_dnode_get(dnode, "rmap-set-action/frr-bgp-route-map:comm-list-name"); if (ln) acl = yang_dnode_get_string(ln, NULL); diff --git a/lib/routemap_northbound.c b/lib/routemap_northbound.c index 9e25d2beb2..a7a77cc23b 100644 --- a/lib/routemap_northbound.c +++ b/lib/routemap_northbound.c @@ -98,7 +98,7 @@ static int lib_route_map_create(struct nb_cb_create_args *args) /* NOTHING */ break; case NB_EV_APPLY: - rm_name = yang_dnode_get_string(args->dnode, "./name"); + rm_name = yang_dnode_get_string(args->dnode, "name"); rm = route_map_get(rm_name); nb_running_set_entry(args->dnode, rm); break; @@ -167,8 +167,8 @@ static int lib_route_map_entry_create(struct nb_cb_create_args *args) /* NOTHING */ break; case NB_EV_APPLY: - sequence = yang_dnode_get_uint16(args->dnode, "./sequence"); - action = yang_dnode_get_enum(args->dnode, "./action") == 0 + sequence = yang_dnode_get_uint16(args->dnode, "sequence"); + action = yang_dnode_get_enum(args->dnode, "action") == 0 ? RMAP_PERMIT : RMAP_DENY; rm = nb_running_get_entry(args->dnode, NULL, true); diff --git a/lib/routing_nb_config.c b/lib/routing_nb_config.c index f4fe48f5b3..2b20e6c14b 100644 --- a/lib/routing_nb_config.c +++ b/lib/routing_nb_config.c @@ -44,7 +44,7 @@ int routing_control_plane_protocols_control_plane_protocol_create( * find the vrf and store the pointer. */ if (nb_node_has_dependency(args->dnode->schema->priv)) { - vrfname = yang_dnode_get_string(args->dnode, "./vrf"); + vrfname = yang_dnode_get_string(args->dnode, "vrf"); vrf = vrf_lookup_by_name(vrfname); assert(vrf); nb_running_set_entry(args->dnode, vrf); @@ -76,7 +76,7 @@ static void vrf_to_control_plane_protocol(const struct lyd_node *dnode, { const char *vrf; - vrf = yang_dnode_get_string(dnode, "./name"); + vrf = yang_dnode_get_string(dnode, "name"); snprintf(xpath, XPATH_MAXLEN, FRR_ROUTING_KEY_XPATH_VRF, vrf); } @@ -86,7 +86,7 @@ static void control_plane_protocol_to_vrf(const struct lyd_node *dnode, { const char *vrf; - vrf = yang_dnode_get_string(dnode, "./vrf"); + vrf = yang_dnode_get_string(dnode, "vrf"); snprintf(xpath, XPATH_MAXLEN, FRR_VRF_KEY_XPATH, vrf); } @@ -914,7 +914,7 @@ static int lib_vrf_create(struct nb_cb_create_args *args) const char *vrfname; struct vrf *vrfp; - vrfname = yang_dnode_get_string(args->dnode, "./name"); + vrfname = yang_dnode_get_string(args->dnode, "name"); if (args->event != NB_EV_APPLY) return NB_OK; diff --git a/lib/yang_translator.c b/lib/yang_translator.c index eae7577a0d..005f6422f3 100644 --- a/lib/yang_translator.c +++ b/lib/yang_translator.c @@ -146,7 +146,7 @@ struct yang_translator *yang_translator_load(const char *path) */ assert(dnode); - family = yang_dnode_get_string(dnode, "./family"); + family = yang_dnode_get_string(dnode, "family"); translator = yang_translator_find(family); if (translator != NULL) { flog_warn(EC_LIB_YANG_TRANSLATOR_LOAD, @@ -182,7 +182,7 @@ struct yang_translator *yang_translator_load(const char *path) tmodule = XCALLOC(MTYPE_YANG_TRANSLATOR_MODULE, sizeof(*tmodule)); - module_name = yang_dnode_get_string(set->dnodes[i], "./name"); + module_name = yang_dnode_get_string(set->dnodes[i], "name"); tmodule->module = ly_ctx_load_module(translator->ly_ctx, module_name, NULL, NULL); if (!tmodule->module) { @@ -233,7 +233,7 @@ struct yang_translator *yang_translator_load(const char *path) const struct lysc_node *snode_custom, *snode_native; xpath_custom = - yang_dnode_get_string(set->dnodes[i], "./custom"); + yang_dnode_get_string(set->dnodes[i], "custom"); snode_custom = yang_find_snode(translator->ly_ctx, xpath_custom, 0); @@ -246,7 +246,7 @@ struct yang_translator *yang_translator_load(const char *path) } xpath_native = - yang_dnode_get_string(set->dnodes[i], "./native"); + yang_dnode_get_string(set->dnodes[i], "native"); snode_native = yang_find_snode(ly_native_ctx, xpath_native, 0); if (!snode_native) { flog_warn(EC_LIB_YANG_TRANSLATOR_LOAD, |
