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 | |
| parent | 4aff978cee928cc0f8e1bf68a10d9c6ebb4b270e (diff) | |
lib: all: remove './' from xpath 22% speedup
fixes #8299
Signed-off-by: Christian Hopps <chopps@labn.net>
33 files changed, 534 insertions, 534 deletions
diff --git a/bfdd/bfdd_cli.c b/bfdd/bfdd_cli.c index 44439c6756..75034d220c 100644 --- a/bfdd/bfdd_cli.c +++ b/bfdd/bfdd_cli.c @@ -219,24 +219,24 @@ static void _bfd_cli_show_peer(struct vty *vty, const struct lyd_node *dnode,  			       bool show_defaults __attribute__((__unused__)),  			       bool mhop)  { -	const char *vrf = yang_dnode_get_string(dnode, "./vrf"); +	const char *vrf = yang_dnode_get_string(dnode, "vrf");  	vty_out(vty, " peer %s", -		yang_dnode_get_string(dnode, "./dest-addr")); +		yang_dnode_get_string(dnode, "dest-addr"));  	if (mhop)  		vty_out(vty, " multihop"); -	if (yang_dnode_exists(dnode, "./source-addr")) +	if (yang_dnode_exists(dnode, "source-addr"))  		vty_out(vty, " local-address %s", -			yang_dnode_get_string(dnode, "./source-addr")); +			yang_dnode_get_string(dnode, "source-addr"));  	if (strcmp(vrf, VRF_DEFAULT_NAME))  		vty_out(vty, " vrf %s", vrf);  	if (!mhop) {  		const char *ifname = -			yang_dnode_get_string(dnode, "./interface"); +			yang_dnode_get_string(dnode, "interface");  		if (strcmp(ifname, "*"))  			vty_out(vty, " interface %s", ifname);  	} @@ -567,7 +567,7 @@ DEFPY_YANG(no_bfd_profile, no_bfd_profile_cmd,  void bfd_cli_show_profile(struct vty *vty, const struct lyd_node *dnode,  			  bool show_defaults)  { -	vty_out(vty, " profile %s\n", yang_dnode_get_string(dnode, "./name")); +	vty_out(vty, " profile %s\n", yang_dnode_get_string(dnode, "name"));  }  ALIAS_YANG(bfd_peer_mult, bfd_profile_mult_cmd, diff --git a/bfdd/bfdd_nb_config.c b/bfdd/bfdd_nb_config.c index 8cf2f0a6f1..48fbe7139c 100644 --- a/bfdd/bfdd_nb_config.c +++ b/bfdd/bfdd_nb_config.c @@ -24,17 +24,17 @@ static void bfd_session_get_key(bool mhop, const struct lyd_node *dnode,  	struct sockaddr_any psa, lsa;  	/* Required destination parameter. */ -	strtosa(yang_dnode_get_string(dnode, "./dest-addr"), &psa); +	strtosa(yang_dnode_get_string(dnode, "dest-addr"), &psa);  	/* Get optional source address. */  	memset(&lsa, 0, sizeof(lsa)); -	if (yang_dnode_exists(dnode, "./source-addr")) -		strtosa(yang_dnode_get_string(dnode, "./source-addr"), &lsa); +	if (yang_dnode_exists(dnode, "source-addr")) +		strtosa(yang_dnode_get_string(dnode, "source-addr"), &lsa); -	vrfname = yang_dnode_get_string(dnode, "./vrf"); +	vrfname = yang_dnode_get_string(dnode, "vrf");  	if (!mhop) { -		ifname = yang_dnode_get_string(dnode, "./interface"); +		ifname = yang_dnode_get_string(dnode, "interface");  		if (strcmp(ifname, "*") == 0)  			ifname = NULL;  	} @@ -53,7 +53,7 @@ static int session_iter_cb(const struct lyd_node *dnode, void *arg)  	struct session_iter *iter = arg;  	const char *ifname; -	ifname = yang_dnode_get_string(dnode, "./interface"); +	ifname = yang_dnode_get_string(dnode, "interface");  	if (strmatch(ifname, "*"))  		iter->wildcard = true; @@ -76,7 +76,7 @@ static int bfd_session_create(struct nb_cb_create_args *args, bool mhop)  	switch (args->event) {  	case NB_EV_VALIDATE: -		yang_dnode_get_prefix(&p, args->dnode, "./dest-addr"); +		yang_dnode_get_prefix(&p, args->dnode, "dest-addr");  		if (mhop) {  			/* @@ -97,7 +97,7 @@ static int bfd_session_create(struct nb_cb_create_args *args, bool mhop)  		 * require interface name, otherwise we can't figure  		 * which interface to use to send the packets.  		 */ -		ifname = yang_dnode_get_string(args->dnode, "./interface"); +		ifname = yang_dnode_get_string(args->dnode, "interface");  		if (p.family == AF_INET6 && IN6_IS_ADDR_LINKLOCAL(&p.u.prefix6)  		    && strcmp(ifname, "*") == 0) { @@ -112,8 +112,8 @@ static int bfd_session_create(struct nb_cb_create_args *args, bool mhop)  		sess_dnode = yang_dnode_get_parent(args->dnode, "sessions"); -		dest = yang_dnode_get_string(args->dnode, "./dest-addr"); -		vrfname = yang_dnode_get_string(args->dnode, "./vrf"); +		dest = yang_dnode_get_string(args->dnode, "dest-addr"); +		vrfname = yang_dnode_get_string(args->dnode, "vrf");  		yang_dnode_iterate(session_iter_cb, &iter, sess_dnode,  				   "./single-hop[dest-addr='%s'][vrf='%s']", @@ -275,7 +275,7 @@ int bfdd_bfd_profile_create(struct nb_cb_create_args *args)  	if (args->event != NB_EV_APPLY)  		return NB_OK; -	name = yang_dnode_get_string(args->dnode, "./name"); +	name = yang_dnode_get_string(args->dnode, "name");  	bp = bfd_profile_new(name);  	nb_running_set_entry(args->dnode, bp); diff --git a/bgpd/bgp_routemap_nb_config.c b/bgpd/bgp_routemap_nb_config.c index d6fa94f401..5df22b171d 100644 --- a/bgpd/bgp_routemap_nb_config.c +++ b/bgpd/bgp_routemap_nb_config.c @@ -1135,14 +1135,14 @@ lib_route_map_entry_match_condition_rmap_match_condition_comm_list_finish(  	/* Add configuration. */  	rhc = nb_running_get_entry(args->dnode, NULL, true); -	value = yang_dnode_get_string(args->dnode, "./comm-list-name"); +	value = yang_dnode_get_string(args->dnode, "comm-list-name"); -	if (yang_dnode_exists(args->dnode, "./comm-list-name-exact-match")) +	if (yang_dnode_exists(args->dnode, "comm-list-name-exact-match"))  		exact_match = yang_dnode_get_bool(  			args->dnode, "./comm-list-name-exact-match"); -	if (yang_dnode_exists(args->dnode, "./comm-list-name-any")) -		any = yang_dnode_get_bool(args->dnode, "./comm-list-name-any"); +	if (yang_dnode_exists(args->dnode, "comm-list-name-any")) +		any = yang_dnode_get_bool(args->dnode, "comm-list-name-any");  	if (exact_match) {  		argstr = XMALLOC(MTYPE_ROUTE_MAP_COMPILED, @@ -2745,8 +2745,8 @@ void lib_route_map_entry_set_action_rmap_set_action_aggregator_finish(  	/* Add configuration. */  	rhc = nb_running_get_entry(args->dnode, NULL, true); -	asn = yang_dnode_get_string(args->dnode, "./aggregator-asn"); -	addr = yang_dnode_get_string(args->dnode, "./aggregator-address"); +	asn = yang_dnode_get_string(args->dnode, "aggregator-asn"); +	addr = yang_dnode_get_string(args->dnode, "aggregator-address");  	argstr = XMALLOC(MTYPE_ROUTE_MAP_COMPILED,  			 strlen(asn) + strlen(addr) + 2); @@ -2929,7 +2929,7 @@ lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish(  	/* Add configuration. */  	rhc = nb_running_get_entry(args->dnode, NULL, true); -	lb_type = yang_dnode_get_enum(args->dnode, "./lb-type"); +	lb_type = yang_dnode_get_enum(args->dnode, "lb-type");  	/* Set destroy information. */  	rhc->rhc_shook = generic_set_delete; @@ -2938,7 +2938,7 @@ lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish(  	switch (lb_type) {  	case EXPLICIT_BANDWIDTH: -		bandwidth = yang_dnode_get_uint16(args->dnode, "./bandwidth"); +		bandwidth = yang_dnode_get_uint16(args->dnode, "bandwidth");  		snprintf(str, sizeof(str), "%d", bandwidth);  		break;  	case CUMULATIVE_BANDWIDTH: @@ -2948,7 +2948,7 @@ lib_route_map_entry_set_action_rmap_set_action_extcommunity_lb_finish(  		snprintf(str, sizeof(str), "%s", "num-multipaths");  	} -	if (yang_dnode_get_bool(args->dnode, "./two-octet-as-specific")) +	if (yang_dnode_get_bool(args->dnode, "two-octet-as-specific"))  		strlcat(str, " non-transitive", sizeof(str));  	ret = generic_set_add(rhc->rhc_rmi, "extcommunity bandwidth", str, diff --git a/eigrpd/eigrp_cli.c b/eigrpd/eigrp_cli.c index 213834afc8..b961cde871 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 f50abb7e48..562c292e2a 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) diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index 9718a457ed..bcc9456d2c 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -85,13 +85,13 @@ void cli_show_router_isis(struct vty *vty, const struct lyd_node *dnode,  {  	const char *vrf = NULL; -	vrf = yang_dnode_get_string(dnode, "./vrf"); +	vrf = yang_dnode_get_string(dnode, "vrf");  	vty_out(vty, "!\n");  	vty_out(vty, "router isis %s", -		yang_dnode_get_string(dnode, "./area-tag")); +		yang_dnode_get_string(dnode, "area-tag"));  	if (!strmatch(vrf, VRF_DEFAULT_NAME)) -		vty_out(vty, " vrf %s", yang_dnode_get_string(dnode, "./vrf")); +		vty_out(vty, " vrf %s", yang_dnode_get_string(dnode, "vrf"));  	vty_out(vty, "\n");  } @@ -172,7 +172,7 @@ DEFPY_YANG(no_ip_router_isis, no_ip_router_isis_cmd,  	 * If both ipv4 and ipv6 are off delete the interface isis container.  	 */  	if (strmatch(ip, "ipv6")) { -		if (!yang_dnode_get_bool(dnode, "./ipv4-routing")) +		if (!yang_dnode_get_bool(dnode, "ipv4-routing"))  			nb_cli_enqueue_change(vty, "./frr-isisd:isis",  					      NB_OP_DESTROY, NULL);  		else @@ -180,7 +180,7 @@ DEFPY_YANG(no_ip_router_isis, no_ip_router_isis_cmd,  					      "./frr-isisd:isis/ipv6-routing",  					      NB_OP_MODIFY, "false");  	} else { -		if (!yang_dnode_get_bool(dnode, "./ipv6-routing")) +		if (!yang_dnode_get_bool(dnode, "ipv6-routing"))  			nb_cli_enqueue_change(vty, "./frr-isisd:isis",  					      NB_OP_DESTROY, NULL);  		else @@ -280,16 +280,16 @@ void cli_show_ip_isis_bfd_monitoring(struct vty *vty,  				     const struct lyd_node *dnode,  				     bool show_defaults)  { -	if (!yang_dnode_get_bool(dnode, "./enabled")) { +	if (!yang_dnode_get_bool(dnode, "enabled")) {  		if (show_defaults)  			vty_out(vty, " no isis bfd\n");  	} else {  		vty_out(vty, " isis bfd\n");  	} -	if (yang_dnode_exists(dnode, "./profile")) +	if (yang_dnode_exists(dnode, "profile"))  		vty_out(vty, " isis bfd profile %s\n", -			yang_dnode_get_string(dnode, "./profile")); +			yang_dnode_get_string(dnode, "profile"));  }  /* @@ -588,9 +588,9 @@ void cli_show_isis_area_pwd(struct vty *vty, const struct lyd_node *dnode,  	const char *snp;  	vty_out(vty, " area-password %s %s", -		yang_dnode_get_string(dnode, "./password-type"), -		yang_dnode_get_string(dnode, "./password")); -	snp = yang_dnode_get_string(dnode, "./authenticate-snp"); +		yang_dnode_get_string(dnode, "password-type"), +		yang_dnode_get_string(dnode, "password")); +	snp = yang_dnode_get_string(dnode, "authenticate-snp");  	if (!strmatch("none", snp))  		vty_out(vty, " authenticate snp %s", snp);  	vty_out(vty, "\n"); @@ -638,9 +638,9 @@ void cli_show_isis_domain_pwd(struct vty *vty, const struct lyd_node *dnode,  	const char *snp;  	vty_out(vty, " domain-password %s %s", -		yang_dnode_get_string(dnode, "./password-type"), -		yang_dnode_get_string(dnode, "./password")); -	snp = yang_dnode_get_string(dnode, "./authenticate-snp"); +		yang_dnode_get_string(dnode, "password-type"), +		yang_dnode_get_string(dnode, "password")); +	snp = yang_dnode_get_string(dnode, "authenticate-snp");  	if (!strmatch("none", snp))  		vty_out(vty, " authenticate snp %s", snp);  	vty_out(vty, "\n"); @@ -861,17 +861,17 @@ void cli_show_isis_lsp_timers(struct vty *vty, const struct lyd_node *dnode,  			      bool show_defaults)  {  	const char *l1_refresh = -		yang_dnode_get_string(dnode, "./level-1/refresh-interval"); +		yang_dnode_get_string(dnode, "level-1/refresh-interval");  	const char *l2_refresh = -		yang_dnode_get_string(dnode, "./level-2/refresh-interval"); +		yang_dnode_get_string(dnode, "level-2/refresh-interval");  	const char *l1_lifetime = -		yang_dnode_get_string(dnode, "./level-1/maximum-lifetime"); +		yang_dnode_get_string(dnode, "level-1/maximum-lifetime");  	const char *l2_lifetime = -		yang_dnode_get_string(dnode, "./level-2/maximum-lifetime"); +		yang_dnode_get_string(dnode, "level-2/maximum-lifetime");  	const char *l1_gen = -		yang_dnode_get_string(dnode, "./level-1/generation-interval"); +		yang_dnode_get_string(dnode, "level-1/generation-interval");  	const char *l2_gen = -		yang_dnode_get_string(dnode, "./level-2/generation-interval"); +		yang_dnode_get_string(dnode, "level-2/generation-interval");  	if (strmatch(l1_refresh, l2_refresh)  	    && strmatch(l1_lifetime, l2_lifetime) && strmatch(l1_gen, l2_gen))  		vty_out(vty, @@ -980,8 +980,8 @@ void cli_show_isis_spf_min_interval(struct vty *vty,  				    const struct lyd_node *dnode,  				    bool show_defaults)  { -	const char *l1 = yang_dnode_get_string(dnode, "./level-1"); -	const char *l2 = yang_dnode_get_string(dnode, "./level-2"); +	const char *l1 = yang_dnode_get_string(dnode, "level-1"); +	const char *l2 = yang_dnode_get_string(dnode, "level-2");  	if (strmatch(l1, l2))  		vty_out(vty, " spf-interval %s\n", l1); @@ -1051,11 +1051,11 @@ void cli_show_isis_spf_ietf_backoff(struct vty *vty,  {  	vty_out(vty,  		" spf-delay-ietf init-delay %s short-delay %s long-delay %s holddown %s time-to-learn %s\n", -		yang_dnode_get_string(dnode, "./init-delay"), -		yang_dnode_get_string(dnode, "./short-delay"), -		yang_dnode_get_string(dnode, "./long-delay"), -		yang_dnode_get_string(dnode, "./hold-down"), -		yang_dnode_get_string(dnode, "./time-to-learn")); +		yang_dnode_get_string(dnode, "init-delay"), +		yang_dnode_get_string(dnode, "short-delay"), +		yang_dnode_get_string(dnode, "long-delay"), +		yang_dnode_get_string(dnode, "hold-down"), +		yang_dnode_get_string(dnode, "time-to-learn"));  }  /* @@ -1364,15 +1364,15 @@ static void vty_print_def_origin(struct vty *vty, const struct lyd_node *dnode,  				 bool show_defaults)  {  	vty_out(vty, " default-information originate %s %s", family, level); -	if (yang_dnode_get_bool(dnode, "./always")) +	if (yang_dnode_get_bool(dnode, "always"))  		vty_out(vty, " always"); -	if (yang_dnode_exists(dnode, "./route-map")) +	if (yang_dnode_exists(dnode, "route-map"))  		vty_out(vty, " route-map %s", -			yang_dnode_get_string(dnode, "./route-map")); -	if (show_defaults || !yang_dnode_is_default(dnode, "./metric")) +			yang_dnode_get_string(dnode, "route-map")); +	if (show_defaults || !yang_dnode_is_default(dnode, "metric"))  		vty_out(vty, " metric %s", -			yang_dnode_get_string(dnode, "./metric")); +			yang_dnode_get_string(dnode, "metric"));  	vty_out(vty, "\n");  } @@ -1381,7 +1381,7 @@ void cli_show_isis_def_origin_ipv4(struct vty *vty,  				   const struct lyd_node *dnode,  				   bool show_defaults)  { -	const char *level = yang_dnode_get_string(dnode, "./level"); +	const char *level = yang_dnode_get_string(dnode, "level");  	vty_print_def_origin(vty, dnode, "ipv4", level, show_defaults);  } @@ -1390,7 +1390,7 @@ void cli_show_isis_def_origin_ipv6(struct vty *vty,  				   const struct lyd_node *dnode,  				   bool show_defaults)  { -	const char *level = yang_dnode_get_string(dnode, "./level"); +	const char *level = yang_dnode_get_string(dnode, "level");  	vty_print_def_origin(vty, dnode, "ipv6", level, show_defaults);  } @@ -1505,22 +1505,22 @@ static void vty_print_redistribute(struct vty *vty, const struct lyd_node *dnode  	if (table) {  		level = yang_dnode_get_string(dnode, "../level"); -		tableid = yang_dnode_get_uint16(dnode, "./table"); +		tableid = yang_dnode_get_uint16(dnode, "table");  		vty_out(vty, " redistribute %s table %d ", family, tableid);  	} else { -		protocol = yang_dnode_get_string(dnode, "./protocol"); +		protocol = yang_dnode_get_string(dnode, "protocol");  		if (!table && strmatch(protocol, "table"))  			return; -		level = yang_dnode_get_string(dnode, "./level"); +		level = yang_dnode_get_string(dnode, "level");  		vty_out(vty, " redistribute %s %s ", family, protocol);  	}  	vty_out(vty, "%s", level); -	if (show_defaults || !yang_dnode_is_default(dnode, "./metric")) +	if (show_defaults || !yang_dnode_is_default(dnode, "metric"))  		vty_out(vty, " metric %s", -			yang_dnode_get_string(dnode, "%s", "./metric")); +			yang_dnode_get_string(dnode, "%s", "metric")); -	if (yang_dnode_exists(dnode, "./route-map")) -		routemap = yang_dnode_get_string(dnode, "./route-map"); +	if (yang_dnode_exists(dnode, "route-map")) +		routemap = yang_dnode_get_string(dnode, "route-map");  	if (routemap)  		vty_out(vty, " route-map %s", routemap);  	vty_out(vty, "\n"); @@ -1557,8 +1557,8 @@ void cli_show_isis_redistribute_ipv6_table(struct vty *vty,  int cli_cmp_isis_redistribute_table(const struct lyd_node *dnode1,  				    const struct lyd_node *dnode2)  { -	uint16_t table1 = yang_dnode_get_uint16(dnode1, "./table"); -	uint16_t table2 = yang_dnode_get_uint16(dnode2, "./table"); +	uint16_t table1 = yang_dnode_get_uint16(dnode1, "table"); +	uint16_t table2 = yang_dnode_get_uint16(dnode2, "table");  	return table1 - table2;  } @@ -1619,7 +1619,7 @@ void cli_show_isis_mt_ipv4_multicast(struct vty *vty,  				     bool show_defaults)  {  	vty_out(vty, " topology ipv4-multicast"); -	if (yang_dnode_get_bool(dnode, "./overload")) +	if (yang_dnode_get_bool(dnode, "overload"))  		vty_out(vty, " overload");  	vty_out(vty, "\n");  } @@ -1628,7 +1628,7 @@ void cli_show_isis_mt_ipv4_mgmt(struct vty *vty, const struct lyd_node *dnode,  				bool show_defaults)  {  	vty_out(vty, " topology ipv4-mgmt"); -	if (yang_dnode_get_bool(dnode, "./overload")) +	if (yang_dnode_get_bool(dnode, "overload"))  		vty_out(vty, " overload");  	vty_out(vty, "\n");  } @@ -1638,7 +1638,7 @@ void cli_show_isis_mt_ipv6_unicast(struct vty *vty,  				   bool show_defaults)  {  	vty_out(vty, " topology ipv6-unicast"); -	if (yang_dnode_get_bool(dnode, "./overload")) +	if (yang_dnode_get_bool(dnode, "overload"))  		vty_out(vty, " overload");  	vty_out(vty, "\n");  } @@ -1648,7 +1648,7 @@ void cli_show_isis_mt_ipv6_multicast(struct vty *vty,  				     bool show_defaults)  {  	vty_out(vty, " topology ipv6-multicast"); -	if (yang_dnode_get_bool(dnode, "./overload")) +	if (yang_dnode_get_bool(dnode, "overload"))  		vty_out(vty, " overload");  	vty_out(vty, "\n");  } @@ -1657,7 +1657,7 @@ void cli_show_isis_mt_ipv6_mgmt(struct vty *vty, const struct lyd_node *dnode,  				bool show_defaults)  {  	vty_out(vty, " topology ipv6-mgmt"); -	if (yang_dnode_get_bool(dnode, "./overload")) +	if (yang_dnode_get_bool(dnode, "overload"))  		vty_out(vty, " overload");  	vty_out(vty, "\n");  } @@ -1666,7 +1666,7 @@ void cli_show_isis_mt_ipv6_dstsrc(struct vty *vty, const struct lyd_node *dnode,  				  bool show_defaults)  {  	vty_out(vty, " topology ipv6-dstsrc"); -	if (yang_dnode_get_bool(dnode, "./overload")) +	if (yang_dnode_get_bool(dnode, "overload"))  		vty_out(vty, " overload");  	vty_out(vty, "\n");  } @@ -1771,13 +1771,13 @@ void cli_show_isis_label_blocks(struct vty *vty, const struct lyd_node *dnode,  				bool show_defaults)  {  	vty_out(vty, " segment-routing global-block %s %s", -		yang_dnode_get_string(dnode, "./srgb/lower-bound"), -		yang_dnode_get_string(dnode, "./srgb/upper-bound")); -	if (!yang_dnode_is_default(dnode, "./srlb/lower-bound") -	    || !yang_dnode_is_default(dnode, "./srlb/upper-bound")) +		yang_dnode_get_string(dnode, "srgb/lower-bound"), +		yang_dnode_get_string(dnode, "srgb/upper-bound")); +	if (!yang_dnode_is_default(dnode, "srlb/lower-bound") +	    || !yang_dnode_is_default(dnode, "srlb/upper-bound"))  		vty_out(vty, " local-block %s %s", -			yang_dnode_get_string(dnode, "./srlb/lower-bound"), -			yang_dnode_get_string(dnode, "./srlb/upper-bound")); +			yang_dnode_get_string(dnode, "srlb/lower-bound"), +			yang_dnode_get_string(dnode, "srlb/upper-bound"));  	vty_out(vty, "\n");  } @@ -1899,11 +1899,11 @@ void cli_show_isis_prefix_sid(struct vty *vty, const struct lyd_node *dnode,  	const char *sid_value;  	bool n_flag_clear; -	prefix = yang_dnode_get_string(dnode, "./prefix"); -	lh_behavior = yang_dnode_get_string(dnode, "./last-hop-behavior"); -	sid_value_type = yang_dnode_get_string(dnode, "./sid-value-type"); -	sid_value = yang_dnode_get_string(dnode, "./sid-value"); -	n_flag_clear = yang_dnode_get_bool(dnode, "./n-flag-clear"); +	prefix = yang_dnode_get_string(dnode, "prefix"); +	lh_behavior = yang_dnode_get_string(dnode, "last-hop-behavior"); +	sid_value_type = yang_dnode_get_string(dnode, "sid-value-type"); +	sid_value = yang_dnode_get_string(dnode, "sid-value"); +	n_flag_clear = yang_dnode_get_bool(dnode, "n-flag-clear");  	vty_out(vty, " segment-routing prefix %s", prefix);  	if (strmatch(sid_value_type, "absolute")) @@ -2013,12 +2013,12 @@ void cli_show_isis_prefix_sid_algorithm(struct vty *vty,  	bool n_flag_clear;  	uint32_t algorithm; -	prefix = yang_dnode_get_string(dnode, "./prefix"); -	sid_value_type = yang_dnode_get_string(dnode, "./sid-value-type"); -	sid_value = yang_dnode_get_string(dnode, "./sid-value"); -	algorithm = yang_dnode_get_uint32(dnode, "./algo"); -	lh_behavior = yang_dnode_get_string(dnode, "./last-hop-behavior"); -	n_flag_clear = yang_dnode_get_bool(dnode, "./n-flag-clear"); +	prefix = yang_dnode_get_string(dnode, "prefix"); +	sid_value_type = yang_dnode_get_string(dnode, "sid-value-type"); +	sid_value = yang_dnode_get_string(dnode, "sid-value"); +	algorithm = yang_dnode_get_uint32(dnode, "algo"); +	lh_behavior = yang_dnode_get_string(dnode, "last-hop-behavior"); +	n_flag_clear = yang_dnode_get_bool(dnode, "n-flag-clear");  	vty_out(vty, " segment-routing prefix %s", prefix);  	vty_out(vty, " algorithm %u", algorithm); @@ -2220,22 +2220,22 @@ void cli_show_isis_srv6_node_msd(struct vty *vty, const struct lyd_node *dnode,  				 bool show_defaults)  {  	vty_out(vty, "  node-msd\n"); -	if (yang_dnode_get_uint8(dnode, "./max-segs-left") != +	if (yang_dnode_get_uint8(dnode, "max-segs-left") !=  	    yang_get_default_uint8("%s/msd/node-msd/max-segs-left", ISIS_SRV6))  		vty_out(vty, "   max-segs-left %u\n", -			yang_dnode_get_uint8(dnode, "./max-segs-left")); -	if (yang_dnode_get_uint8(dnode, "./max-end-pop") != +			yang_dnode_get_uint8(dnode, "max-segs-left")); +	if (yang_dnode_get_uint8(dnode, "max-end-pop") !=  	    yang_get_default_uint8("%s/msd/node-msd/max-end-pop", ISIS_SRV6))  		vty_out(vty, "   max-end-pop %u\n", -			yang_dnode_get_uint8(dnode, "./max-end-pop")); -	if (yang_dnode_get_uint8(dnode, "./max-h-encaps") != +			yang_dnode_get_uint8(dnode, "max-end-pop")); +	if (yang_dnode_get_uint8(dnode, "max-h-encaps") !=  	    yang_get_default_uint8("%s/msd/node-msd/max-h-encaps", ISIS_SRV6))  		vty_out(vty, "   max-h-encaps %u\n", -			yang_dnode_get_uint8(dnode, "./max-h-encaps")); -	if (yang_dnode_get_uint8(dnode, "./max-end-d") != +			yang_dnode_get_uint8(dnode, "max-h-encaps")); +	if (yang_dnode_get_uint8(dnode, "max-end-d") !=  	    yang_get_default_uint8("%s/msd/node-msd/max-end-d", ISIS_SRV6))  		vty_out(vty, "   max-end-d %u\n", -			yang_dnode_get_uint8(dnode, "./max-end-d")); +			yang_dnode_get_uint8(dnode, "max-end-d"));  }  /* @@ -2381,8 +2381,8 @@ void cli_show_isis_frr_lfa_tiebreaker(struct vty *vty,  				      bool show_defaults)  {  	vty_out(vty, " fast-reroute lfa tiebreaker %s index %s %s\n", -		yang_dnode_get_string(dnode, "./type"), -		yang_dnode_get_string(dnode, "./index"), +		yang_dnode_get_string(dnode, "type"), +		yang_dnode_get_string(dnode, "index"),  		dnode->parent->parent->schema->name);  } @@ -2554,8 +2554,8 @@ void cli_show_ip_isis_password(struct vty *vty, const struct lyd_node *dnode,  			       bool show_defaults)  {  	vty_out(vty, " isis password %s %s\n", -		yang_dnode_get_string(dnode, "./password-type"), -		yang_dnode_get_string(dnode, "./password")); +		yang_dnode_get_string(dnode, "password-type"), +		yang_dnode_get_string(dnode, "password"));  }  /* @@ -2601,8 +2601,8 @@ DEFPY_YANG(no_isis_metric, no_isis_metric_cmd,  void cli_show_ip_isis_metric(struct vty *vty, const struct lyd_node *dnode,  			     bool show_defaults)  { -	const char *l1 = yang_dnode_get_string(dnode, "./level-1"); -	const char *l2 = yang_dnode_get_string(dnode, "./level-2"); +	const char *l1 = yang_dnode_get_string(dnode, "level-1"); +	const char *l2 = yang_dnode_get_string(dnode, "level-2");  	if (strmatch(l1, l2))  		vty_out(vty, " isis metric %s\n", l1); @@ -2660,8 +2660,8 @@ void cli_show_ip_isis_hello_interval(struct vty *vty,  				     const struct lyd_node *dnode,  				     bool show_defaults)  { -	const char *l1 = yang_dnode_get_string(dnode, "./level-1"); -	const char *l2 = yang_dnode_get_string(dnode, "./level-2"); +	const char *l1 = yang_dnode_get_string(dnode, "level-1"); +	const char *l2 = yang_dnode_get_string(dnode, "level-2");  	if (strmatch(l1, l2))  		vty_out(vty, " isis hello-interval %s\n", l1); @@ -2718,8 +2718,8 @@ DEFPY_YANG(no_isis_hello_multiplier, no_isis_hello_multiplier_cmd,  void cli_show_ip_isis_hello_multi(struct vty *vty, const struct lyd_node *dnode,  				  bool show_defaults)  { -	const char *l1 = yang_dnode_get_string(dnode, "./level-1"); -	const char *l2 = yang_dnode_get_string(dnode, "./level-2"); +	const char *l1 = yang_dnode_get_string(dnode, "level-1"); +	const char *l2 = yang_dnode_get_string(dnode, "level-2");  	if (strmatch(l1, l2))  		vty_out(vty, " isis hello-multiplier %s\n", l1); @@ -2837,8 +2837,8 @@ void cli_show_ip_isis_csnp_interval(struct vty *vty,  				    const struct lyd_node *dnode,  				    bool show_defaults)  { -	const char *l1 = yang_dnode_get_string(dnode, "./level-1"); -	const char *l2 = yang_dnode_get_string(dnode, "./level-2"); +	const char *l1 = yang_dnode_get_string(dnode, "level-1"); +	const char *l2 = yang_dnode_get_string(dnode, "level-2");  	if (strmatch(l1, l2))  		vty_out(vty, " isis csnp-interval %s\n", l1); @@ -2896,8 +2896,8 @@ void cli_show_ip_isis_psnp_interval(struct vty *vty,  				    const struct lyd_node *dnode,  				    bool show_defaults)  { -	const char *l1 = yang_dnode_get_string(dnode, "./level-1"); -	const char *l2 = yang_dnode_get_string(dnode, "./level-2"); +	const char *l1 = yang_dnode_get_string(dnode, "level-1"); +	const char *l2 = yang_dnode_get_string(dnode, "level-2");  	if (strmatch(l1, l2))  		vty_out(vty, " isis psnp-interval %s\n", l1); @@ -3140,8 +3140,8 @@ DEFPY_YANG(no_isis_priority, no_isis_priority_cmd,  void cli_show_ip_isis_priority(struct vty *vty, const struct lyd_node *dnode,  			       bool show_defaults)  { -	const char *l1 = yang_dnode_get_string(dnode, "./level-1"); -	const char *l2 = yang_dnode_get_string(dnode, "./level-2"); +	const char *l1 = yang_dnode_get_string(dnode, "level-1"); +	const char *l2 = yang_dnode_get_string(dnode, "level-2");  	if (strmatch(l1, l2))  		vty_out(vty, " isis priority %s\n", l1); @@ -3162,8 +3162,8 @@ void cli_show_ip_isis_frr(struct vty *vty, const struct lyd_node *dnode,  	bool l1_link_fallback, l2_link_fallback;  	/* Classic LFA */ -	l1_enabled = yang_dnode_get_bool(dnode, "./level-1/lfa/enable"); -	l2_enabled = yang_dnode_get_bool(dnode, "./level-2/lfa/enable"); +	l1_enabled = yang_dnode_get_bool(dnode, "level-1/lfa/enable"); +	l2_enabled = yang_dnode_get_bool(dnode, "level-2/lfa/enable");  	if (l1_enabled || l2_enabled) {  		if (l1_enabled == l2_enabled) { @@ -3180,8 +3180,8 @@ void cli_show_ip_isis_frr(struct vty *vty, const struct lyd_node *dnode,  	}  	/* Remote LFA */ -	l1_enabled = yang_dnode_get_bool(dnode, "./level-1/remote-lfa/enable"); -	l2_enabled = yang_dnode_get_bool(dnode, "./level-2/remote-lfa/enable"); +	l1_enabled = yang_dnode_get_bool(dnode, "level-1/remote-lfa/enable"); +	l2_enabled = yang_dnode_get_bool(dnode, "level-2/remote-lfa/enable");  	if (l1_enabled || l2_enabled) {  		if (l1_enabled == l2_enabled) { @@ -3199,16 +3199,16 @@ void cli_show_ip_isis_frr(struct vty *vty, const struct lyd_node *dnode,  	}  	/* TI-LFA */ -	l1_enabled = yang_dnode_get_bool(dnode, "./level-1/ti-lfa/enable"); -	l2_enabled = yang_dnode_get_bool(dnode, "./level-2/ti-lfa/enable"); +	l1_enabled = yang_dnode_get_bool(dnode, "level-1/ti-lfa/enable"); +	l2_enabled = yang_dnode_get_bool(dnode, "level-2/ti-lfa/enable");  	l1_node_protection = -		yang_dnode_get_bool(dnode, "./level-1/ti-lfa/node-protection"); +		yang_dnode_get_bool(dnode, "level-1/ti-lfa/node-protection");  	l2_node_protection = -		yang_dnode_get_bool(dnode, "./level-2/ti-lfa/node-protection"); +		yang_dnode_get_bool(dnode, "level-2/ti-lfa/node-protection");  	l1_link_fallback = -		yang_dnode_get_bool(dnode, "./level-1/ti-lfa/link-fallback"); +		yang_dnode_get_bool(dnode, "level-1/ti-lfa/link-fallback");  	l2_link_fallback = -		yang_dnode_get_bool(dnode, "./level-2/ti-lfa/link-fallback"); +		yang_dnode_get_bool(dnode, "level-2/ti-lfa/link-fallback");  	if (l1_enabled || l2_enabled) { @@ -3874,24 +3874,24 @@ void cli_show_isis_flex_algo(struct vty *vty, const struct lyd_node *dnode,  	uint32_t priority;  	char type_str[10]; -	algorithm = yang_dnode_get_uint32(dnode, "./flex-algo"); +	algorithm = yang_dnode_get_uint32(dnode, "flex-algo");  	vty_out(vty, " flex-algo %u\n", algorithm); -	if (yang_dnode_exists(dnode, "./advertise-definition")) +	if (yang_dnode_exists(dnode, "advertise-definition"))  		vty_out(vty, "  advertise-definition\n"); -	if (yang_dnode_exists(dnode, "./dplane-sr-mpls")) +	if (yang_dnode_exists(dnode, "dplane-sr-mpls"))  		vty_out(vty, "  dataplane sr-mpls\n"); -	if (yang_dnode_exists(dnode, "./dplane-srv6")) +	if (yang_dnode_exists(dnode, "dplane-srv6"))  		vty_out(vty, "  dataplane srv6\n"); -	if (yang_dnode_exists(dnode, "./dplane-ip")) +	if (yang_dnode_exists(dnode, "dplane-ip"))  		vty_out(vty, "  dataplane ip\n"); -	if (yang_dnode_exists(dnode, "./prefix-metric")) +	if (yang_dnode_exists(dnode, "prefix-metric"))  		vty_out(vty, "  prefix-metric\n"); -	if (yang_dnode_exists(dnode, "./metric-type")) { -		metric_type = yang_dnode_get_enum(dnode, "./metric-type"); +	if (yang_dnode_exists(dnode, "metric-type")) { +		metric_type = yang_dnode_get_enum(dnode, "metric-type");  		if (metric_type != MT_IGP) {  			flex_algo_metric_type_print(type_str, sizeof(type_str),  						    metric_type); @@ -3899,8 +3899,8 @@ void cli_show_isis_flex_algo(struct vty *vty, const struct lyd_node *dnode,  		}  	} -	if (yang_dnode_exists(dnode, "./priority")) { -		priority = yang_dnode_get_uint32(dnode, "./priority"); +	if (yang_dnode_exists(dnode, "priority")) { +		priority = yang_dnode_get_uint32(dnode, "priority");  		if (priority != FLEX_ALGO_PRIO_DEFAULT)  			vty_out(vty, "  priority %u\n", priority);  	} diff --git a/isisd/isis_nb_config.c b/isisd/isis_nb_config.c index b6ee073fd5..5794e16a11 100644 --- a/isisd/isis_nb_config.c +++ b/isisd/isis_nb_config.c @@ -60,8 +60,8 @@ int isis_instance_create(struct nb_cb_create_args *args)  	if (args->event != NB_EV_APPLY)  		return NB_OK; -	vrf_name = yang_dnode_get_string(args->dnode, "./vrf"); -	area_tag = yang_dnode_get_string(args->dnode, "./area-tag"); +	vrf_name = yang_dnode_get_string(args->dnode, "vrf"); +	area_tag = yang_dnode_get_string(args->dnode, "area-tag");  	area = isis_area_lookup_by_vrf(area_tag, vrf_name);  	if (area) @@ -650,12 +650,12 @@ int isis_instance_lsp_generation_interval_level_2_modify(   */  void ietf_backoff_delay_apply_finish(struct nb_cb_apply_finish_args *args)  { -	long init_delay = yang_dnode_get_uint16(args->dnode, "./init-delay"); -	long short_delay = yang_dnode_get_uint16(args->dnode, "./short-delay"); -	long long_delay = yang_dnode_get_uint16(args->dnode, "./long-delay"); -	long holddown = yang_dnode_get_uint16(args->dnode, "./hold-down"); +	long init_delay = yang_dnode_get_uint16(args->dnode, "init-delay"); +	long short_delay = yang_dnode_get_uint16(args->dnode, "short-delay"); +	long long_delay = yang_dnode_get_uint16(args->dnode, "long-delay"); +	long holddown = yang_dnode_get_uint16(args->dnode, "hold-down");  	long timetolearn = -		yang_dnode_get_uint16(args->dnode, "./time-to-learn"); +		yang_dnode_get_uint16(args->dnode, "time-to-learn");  	struct isis_area *area = nb_running_get_entry(args->dnode, NULL, true);  	size_t bufsiz = strlen(area->area_tag) + sizeof("IS-IS  Lx");  	char *buf = XCALLOC(MTYPE_TMP, bufsiz); @@ -926,11 +926,11 @@ int isis_instance_spf_prefix_priorities_medium_access_list_name_destroy(   */  void area_password_apply_finish(struct nb_cb_apply_finish_args *args)  { -	const char *password = yang_dnode_get_string(args->dnode, "./password"); +	const char *password = yang_dnode_get_string(args->dnode, "password");  	struct isis_area *area = nb_running_get_entry(args->dnode, NULL, true); -	int pass_type = yang_dnode_get_enum(args->dnode, "./password-type"); +	int pass_type = yang_dnode_get_enum(args->dnode, "password-type");  	uint8_t snp_auth = -		yang_dnode_get_enum(args->dnode, "./authenticate-snp"); +		yang_dnode_get_enum(args->dnode, "authenticate-snp");  	switch (pass_type) {  	case ISIS_PASSWD_TYPE_CLEARTXT: @@ -997,11 +997,11 @@ int isis_instance_area_password_authenticate_snp_modify(   */  void domain_password_apply_finish(struct nb_cb_apply_finish_args *args)  { -	const char *password = yang_dnode_get_string(args->dnode, "./password"); +	const char *password = yang_dnode_get_string(args->dnode, "password");  	struct isis_area *area = nb_running_get_entry(args->dnode, NULL, true); -	int pass_type = yang_dnode_get_enum(args->dnode, "./password-type"); +	int pass_type = yang_dnode_get_enum(args->dnode, "password-type");  	uint8_t snp_auth = -		yang_dnode_get_enum(args->dnode, "./authenticate-snp"); +		yang_dnode_get_enum(args->dnode, "authenticate-snp");  	switch (pass_type) {  	case ISIS_PASSWD_TYPE_CLEARTXT: @@ -1073,9 +1073,9 @@ void default_info_origin_apply_finish(const struct lyd_node *dnode, int family)  	unsigned long metric = 0;  	const char *routemap = NULL;  	struct isis_area *area = nb_running_get_entry(dnode, NULL, true); -	int level = yang_dnode_get_enum(dnode, "./level"); +	int level = yang_dnode_get_enum(dnode, "level"); -	if (yang_dnode_get_bool(dnode, "./always")) { +	if (yang_dnode_get_bool(dnode, "always")) {  		originate_type = DEFAULT_ORIGINATE_ALWAYS;  	} else if (family == AF_INET6) {  		zlog_warn( @@ -1083,10 +1083,10 @@ void default_info_origin_apply_finish(const struct lyd_node *dnode, int family)  			__func__);  	} -	if (yang_dnode_exists(dnode, "./metric")) -		metric = yang_dnode_get_uint32(dnode, "./metric"); -	if (yang_dnode_exists(dnode, "./route-map")) -		routemap = yang_dnode_get_string(dnode, "./route-map"); +	if (yang_dnode_exists(dnode, "metric")) +		metric = yang_dnode_get_uint32(dnode, "metric"); +	if (yang_dnode_exists(dnode, "route-map")) +		routemap = yang_dnode_get_string(dnode, "route-map");  	isis_redist_set(area, level, family, DEFAULT_ROUTE, metric, routemap,  			originate_type, 0); @@ -1119,7 +1119,7 @@ int isis_instance_default_information_originate_ipv4_destroy(  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	level = yang_dnode_get_enum(args->dnode, "./level"); +	level = yang_dnode_get_enum(args->dnode, "level");  	isis_redist_unset(area, level, AF_INET, DEFAULT_ROUTE, 0);  	return NB_OK; @@ -1182,7 +1182,7 @@ int isis_instance_default_information_originate_ipv6_destroy(  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	level = yang_dnode_get_enum(args->dnode, "./level"); +	level = yang_dnode_get_enum(args->dnode, "level");  	isis_redist_unset(area, level, AF_INET6, DEFAULT_ROUTE, 0);  	return NB_OK; @@ -1236,14 +1236,14 @@ void redistribute_apply_finish(const struct lyd_node *dnode, int family)  	const char *routemap = NULL;  	struct isis_area *area; -	type = yang_dnode_get_enum(dnode, "./protocol"); -	level = yang_dnode_get_enum(dnode, "./level"); +	type = yang_dnode_get_enum(dnode, "protocol"); +	level = yang_dnode_get_enum(dnode, "level");  	area = nb_running_get_entry(dnode, NULL, true); -	if (yang_dnode_exists(dnode, "./metric")) -		metric = yang_dnode_get_uint32(dnode, "./metric"); -	if (yang_dnode_exists(dnode, "./route-map")) -		routemap = yang_dnode_get_string(dnode, "./route-map"); +	if (yang_dnode_exists(dnode, "metric")) +		metric = yang_dnode_get_uint32(dnode, "metric"); +	if (yang_dnode_exists(dnode, "route-map")) +		routemap = yang_dnode_get_string(dnode, "route-map");  	isis_redist_set(area, level, family, type, metric, routemap, 0, 0);  } @@ -1273,8 +1273,8 @@ int isis_instance_redistribute_ipv4_destroy(struct nb_cb_destroy_args *args)  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	level = yang_dnode_get_enum(args->dnode, "./level"); -	type = yang_dnode_get_enum(args->dnode, "./protocol"); +	level = yang_dnode_get_enum(args->dnode, "level"); +	type = yang_dnode_get_enum(args->dnode, "protocol");  	isis_redist_unset(area, level, AF_INET, type, 0);  	return NB_OK; @@ -1333,12 +1333,12 @@ int isis_instance_redistribute_ipv4_table_create(struct nb_cb_create_args *args)  	level = yang_dnode_get_enum(args->dnode, "../level");  	area = nb_running_get_entry(args->dnode, "../.", true); -	if (yang_dnode_exists(args->dnode, "./metric")) -		metric = yang_dnode_get_uint32(args->dnode, "./metric"); -	if (yang_dnode_exists(args->dnode, "./route-map")) -		routemap = yang_dnode_get_string(args->dnode, "./route-map"); +	if (yang_dnode_exists(args->dnode, "metric")) +		metric = yang_dnode_get_uint32(args->dnode, "metric"); +	if (yang_dnode_exists(args->dnode, "route-map")) +		routemap = yang_dnode_get_string(args->dnode, "route-map"); -	table = yang_dnode_get_uint16(args->dnode, "./table"); +	table = yang_dnode_get_uint16(args->dnode, "table");  	isis_redist_set(area, level, AF_INET, type, metric, routemap, 0, table);  	return NB_OK; @@ -1355,7 +1355,7 @@ int isis_instance_redistribute_ipv4_table_destroy(struct nb_cb_destroy_args *arg  	area = nb_running_get_entry(args->dnode, "../.", true);  	level = yang_dnode_get_enum(args->dnode, "../level");  	type = yang_dnode_get_enum(args->dnode, "../protocol"); -	table = yang_dnode_get_uint16(args->dnode, "./table"); +	table = yang_dnode_get_uint16(args->dnode, "table");  	isis_redist_unset(area, level, AF_INET, type, table);  	return NB_OK; @@ -1379,8 +1379,8 @@ int isis_instance_redistribute_ipv6_destroy(struct nb_cb_destroy_args *args)  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	level = yang_dnode_get_enum(args->dnode, "./level"); -	type = yang_dnode_get_enum(args->dnode, "./protocol"); +	level = yang_dnode_get_enum(args->dnode, "level"); +	type = yang_dnode_get_enum(args->dnode, "protocol");  	isis_redist_unset(area, level, AF_INET6, type, 0);  	return NB_OK; @@ -1732,8 +1732,8 @@ int isis_instance_fast_reroute_level_1_lfa_tiebreaker_create(  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	index = yang_dnode_get_uint8(args->dnode, "./index"); -	type = yang_dnode_get_enum(args->dnode, "./type"); +	index = yang_dnode_get_uint8(args->dnode, "index"); +	type = yang_dnode_get_enum(args->dnode, "type");  	tie_b = isis_lfa_tiebreaker_add(area, ISIS_LEVEL1, index, type);  	nb_running_set_entry(args->dnode, tie_b); @@ -1881,8 +1881,8 @@ int isis_instance_fast_reroute_level_2_lfa_tiebreaker_create(  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	index = yang_dnode_get_uint8(args->dnode, "./index"); -	type = yang_dnode_get_enum(args->dnode, "./type"); +	index = yang_dnode_get_uint8(args->dnode, "index"); +	type = yang_dnode_get_enum(args->dnode, "type");  	tie_b = isis_lfa_tiebreaker_add(area, ISIS_LEVEL2, index, type);  	nb_running_set_entry(args->dnode, tie_b); @@ -2212,10 +2212,10 @@ int isis_instance_segment_routing_label_blocks_pre_validate(  	uint32_t srlb_lbound;  	uint32_t srlb_ubound; -	srgb_lbound = yang_dnode_get_uint32(args->dnode, "./srgb/lower-bound"); -	srgb_ubound = yang_dnode_get_uint32(args->dnode, "./srgb/upper-bound"); -	srlb_lbound = yang_dnode_get_uint32(args->dnode, "./srlb/lower-bound"); -	srlb_ubound = yang_dnode_get_uint32(args->dnode, "./srlb/upper-bound"); +	srgb_lbound = yang_dnode_get_uint32(args->dnode, "srgb/lower-bound"); +	srgb_ubound = yang_dnode_get_uint32(args->dnode, "srgb/upper-bound"); +	srlb_lbound = yang_dnode_get_uint32(args->dnode, "srlb/lower-bound"); +	srlb_ubound = yang_dnode_get_uint32(args->dnode, "srlb/upper-bound");  	/* Check that the block size does not exceed 65535 */  	if ((srgb_ubound - srgb_lbound + 1) > 65535) { @@ -2255,8 +2255,8 @@ void isis_instance_segment_routing_srgb_apply_finish(  	uint32_t lower_bound, upper_bound;  	area = nb_running_get_entry(args->dnode, NULL, true); -	lower_bound = yang_dnode_get_uint32(args->dnode, "./lower-bound"); -	upper_bound = yang_dnode_get_uint32(args->dnode, "./upper-bound"); +	lower_bound = yang_dnode_get_uint32(args->dnode, "lower-bound"); +	upper_bound = yang_dnode_get_uint32(args->dnode, "upper-bound");  	isis_sr_cfg_srgb_update(area, lower_bound, upper_bound);  } @@ -2321,8 +2321,8 @@ void isis_instance_segment_routing_srlb_apply_finish(  	uint32_t lower_bound, upper_bound;  	area = nb_running_get_entry(args->dnode, NULL, true); -	lower_bound = yang_dnode_get_uint32(args->dnode, "./lower-bound"); -	upper_bound = yang_dnode_get_uint32(args->dnode, "./upper-bound"); +	lower_bound = yang_dnode_get_uint32(args->dnode, "lower-bound"); +	upper_bound = yang_dnode_get_uint32(args->dnode, "upper-bound");  	isis_sr_cfg_srlb_update(area, lower_bound, upper_bound);  } @@ -2428,7 +2428,7 @@ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_create(  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	yang_dnode_get_prefix(&prefix, args->dnode, "./prefix"); +	yang_dnode_get_prefix(&prefix, args->dnode, "prefix");  	pcfg = isis_sr_cfg_prefix_add(area, &prefix, SR_ALGORITHM_SPF);  	nb_running_set_entry(args->dnode, pcfg); @@ -2466,13 +2466,13 @@ int isis_instance_segment_routing_prefix_sid_map_prefix_sid_pre_validate(  	enum sr_sid_value_type sid_type;  	struct isis_prefix_sid psid = {}; -	yang_dnode_get_prefix(&prefix, args->dnode, "./prefix"); +	yang_dnode_get_prefix(&prefix, args->dnode, "prefix");  	srgb_lbound = yang_dnode_get_uint32(  		args->dnode, "../../label-blocks/srgb/lower-bound");  	srgb_ubound = yang_dnode_get_uint32(  		args->dnode, "../../label-blocks/srgb/upper-bound"); -	sid = yang_dnode_get_uint32(args->dnode, "./sid-value"); -	sid_type = yang_dnode_get_enum(args->dnode, "./sid-value-type"); +	sid = yang_dnode_get_uint32(args->dnode, "sid-value"); +	sid_type = yang_dnode_get_enum(args->dnode, "sid-value-type");  	/* Check for invalid indexes/labels. */  	srgb_range = srgb_ubound - srgb_lbound + 1; @@ -2636,8 +2636,8 @@ int isis_instance_segment_routing_algorithm_prefix_sid_create(  		return NB_OK;  	area = nb_running_get_entry(args->dnode, NULL, true); -	yang_dnode_get_prefix(&prefix, args->dnode, "./prefix"); -	algorithm = yang_dnode_get_uint32(args->dnode, "./algo"); +	yang_dnode_get_prefix(&prefix, args->dnode, "prefix"); +	algorithm = yang_dnode_get_uint32(args->dnode, "algo");  	pcfg = isis_sr_cfg_prefix_add(area, &prefix, algorithm);  	pcfg->algorithm = algorithm; @@ -2676,13 +2676,13 @@ int isis_instance_segment_routing_algorithm_prefix_sid_pre_validate(  	enum sr_sid_value_type sid_type;  	struct isis_prefix_sid psid = {}; -	yang_dnode_get_prefix(&prefix, args->dnode, "./prefix"); +	yang_dnode_get_prefix(&prefix, args->dnode, "prefix");  	srgb_lbound = yang_dnode_get_uint32(  		args->dnode, "../../label-blocks/srgb/lower-bound");  	srgb_ubound = yang_dnode_get_uint32(  		args->dnode, "../../label-blocks/srgb/upper-bound"); -	sid = yang_dnode_get_uint32(args->dnode, "./sid-value"); -	sid_type = yang_dnode_get_enum(args->dnode, "./sid-value-type"); +	sid = yang_dnode_get_uint32(args->dnode, "sid-value"); +	sid_type = yang_dnode_get_enum(args->dnode, "sid-value-type");  	/* Check for invalid indexes/labels. */  	srgb_range = srgb_ubound - srgb_lbound + 1; @@ -2840,8 +2840,8 @@ int isis_instance_flex_algo_create(struct nb_cb_create_args *args)  	uint32_t priority = FLEX_ALGO_PRIO_DEFAULT;  	struct isis_flex_algo_alloc_arg arg; -	algorithm = yang_dnode_get_uint32(args->dnode, "./flex-algo"); -	advertise = yang_dnode_exists(args->dnode, "./advertise-definition"); +	algorithm = yang_dnode_get_uint32(args->dnode, "flex-algo"); +	advertise = yang_dnode_exists(args->dnode, "advertise-definition");  	switch (args->event) {  	case NB_EV_APPLY: @@ -2875,7 +2875,7 @@ int isis_instance_flex_algo_destroy(struct nb_cb_destroy_args *args)  	struct isis_area *area;  	uint32_t algorithm; -	algorithm = yang_dnode_get_uint32(args->dnode, "./flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "flex-algo");  	area = nb_running_get_entry(args->dnode, NULL, true);  	switch (args->event) { @@ -2904,8 +2904,8 @@ int isis_instance_flex_algo_advertise_definition_modify(  	uint32_t algorithm; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); -	advertise = yang_dnode_exists(args->dnode, "./../advertise-definition"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo"); +	advertise = yang_dnode_exists(args->dnode, "../advertise-definition");  	switch (args->event) {  	case NB_EV_APPLY: @@ -2937,7 +2937,7 @@ int isis_instance_flex_algo_advertise_definition_destroy(  	area = nb_running_get_entry(args->dnode, NULL, true); -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: @@ -3153,7 +3153,7 @@ int isis_instance_flex_algo_prefix_metric_create(struct nb_cb_create_args *args)  	if (!area)  		return NB_ERR_RESOURCE; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: @@ -3188,7 +3188,7 @@ int isis_instance_flex_algo_prefix_metric_destroy(  	if (!area)  		return NB_ERR_RESOURCE; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: @@ -3223,7 +3223,7 @@ static int isis_instance_flex_algo_dplane_set(struct nb_cb_create_args *args,  	if (!area)  		return NB_ERR_RESOURCE; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: @@ -3265,7 +3265,7 @@ static int isis_instance_flex_algo_dplane_unset(struct nb_cb_destroy_args *args,  	if (!area)  		return NB_ERR_RESOURCE; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	switch (args->event) {  	case NB_EV_APPLY: @@ -3348,7 +3348,7 @@ int isis_instance_flex_algo_metric_type_modify(struct nb_cb_modify_args *args)  	if (!area)  		return NB_ERR_RESOURCE; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	metric_type = yang_dnode_get_enum(args->dnode, NULL);  	switch (args->event) { @@ -3388,7 +3388,7 @@ int isis_instance_flex_algo_priority_modify(struct nb_cb_modify_args *args)  	if (!area)  		return NB_ERR_RESOURCE; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	priority = yang_dnode_get_uint32(args->dnode, NULL);  	switch (args->event) { @@ -3424,7 +3424,7 @@ int isis_instance_flex_algo_priority_destroy(struct nb_cb_destroy_args *args)  	if (!area)  		return NB_ERR_RESOURCE; -	algorithm = yang_dnode_get_uint32(args->dnode, "./../flex-algo"); +	algorithm = yang_dnode_get_uint32(args->dnode, "../flex-algo");  	priority = yang_dnode_get_uint32(args->dnode, NULL);  	switch (args->event) { @@ -3754,7 +3754,7 @@ int lib_interface_isis_create(struct nb_cb_create_args *args)  {  	struct interface *ifp;  	struct isis_circuit *circuit = NULL; -	const char *area_tag = yang_dnode_get_string(args->dnode, "./area-tag"); +	const char *area_tag = yang_dnode_get_string(args->dnode, "area-tag");  	switch (args->event) {  	case NB_EV_PREPARE: 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, diff --git a/pathd/path_cli.c b/pathd/path_cli.c index 45f4ac7ab8..0d9d3bca6d 100644 --- a/pathd/path_cli.c +++ b/pathd/path_cli.c @@ -287,7 +287,7 @@ void cli_show_srte_segment_list(struct vty *vty, const struct lyd_node *dnode,  				bool show_defaults)  {  	vty_out(vty, "  segment-list %s\n", -		yang_dnode_get_string(dnode, "./name")); +		yang_dnode_get_string(dnode, "name"));  }  void cli_show_srte_segment_list_end(struct vty *vty, @@ -546,37 +546,37 @@ void cli_show_srte_segment_list_segment(struct vty *vty,  					const struct lyd_node *dnode,  					bool show_defaults)  { -	vty_out(vty, "   index %s", yang_dnode_get_string(dnode, "./index")); -	if (yang_dnode_exists(dnode, "./sid-value")) { +	vty_out(vty, "   index %s", yang_dnode_get_string(dnode, "index")); +	if (yang_dnode_exists(dnode, "sid-value")) {  		vty_out(vty, " mpls label %s", -			yang_dnode_get_string(dnode, "./sid-value")); +			yang_dnode_get_string(dnode, "sid-value"));  	} -	if (yang_dnode_exists(dnode, "./nai")) { +	if (yang_dnode_exists(dnode, "nai")) {  		struct ipaddr addr;  		struct ipaddr addr_rmt; -		switch (yang_dnode_get_enum(dnode, "./nai/type")) { +		switch (yang_dnode_get_enum(dnode, "nai/type")) {  		case SRTE_SEGMENT_NAI_TYPE_IPV4_NODE:  		case SRTE_SEGMENT_NAI_TYPE_IPV4_LOCAL_IFACE:  		case SRTE_SEGMENT_NAI_TYPE_IPV4_ALGORITHM: -			yang_dnode_get_ip(&addr, dnode, "./nai/local-address"); +			yang_dnode_get_ip(&addr, dnode, "nai/local-address");  			vty_out(vty, " nai prefix %pI4", &addr.ipaddr_v4);  			break;  		case SRTE_SEGMENT_NAI_TYPE_IPV6_NODE:  		case SRTE_SEGMENT_NAI_TYPE_IPV6_LOCAL_IFACE:  		case SRTE_SEGMENT_NAI_TYPE_IPV6_ALGORITHM: -			yang_dnode_get_ip(&addr, dnode, "./nai/local-address"); +			yang_dnode_get_ip(&addr, dnode, "nai/local-address");  			vty_out(vty, " nai prefix %pI6", &addr.ipaddr_v6);  			break;  		case SRTE_SEGMENT_NAI_TYPE_IPV4_ADJACENCY: -			yang_dnode_get_ip(&addr, dnode, "./nai/local-address"); +			yang_dnode_get_ip(&addr, dnode, "nai/local-address");  			yang_dnode_get_ip(&addr_rmt, dnode,  					  "./nai/remote-address");  			vty_out(vty, " nai adjacency %pI4", &addr.ipaddr_v4);  			vty_out(vty, " %pI4", &addr_rmt.ipaddr_v4);  			break;  		case SRTE_SEGMENT_NAI_TYPE_IPV6_ADJACENCY: -			yang_dnode_get_ip(&addr, dnode, "./nai/local-address"); +			yang_dnode_get_ip(&addr, dnode, "nai/local-address");  			yang_dnode_get_ip(&addr_rmt, dnode,  					  "./nai/remote-address");  			vty_out(vty, " nai adjacency %pI6", &addr.ipaddr_v6); @@ -585,17 +585,17 @@ void cli_show_srte_segment_list_segment(struct vty *vty,  		default:  			break;  		} -		if (yang_dnode_exists(dnode, "./nai/local-prefix-len")) { +		if (yang_dnode_exists(dnode, "nai/local-prefix-len")) {  			vty_out(vty, "/%s",  				yang_dnode_get_string(  					dnode, "./nai/local-prefix-len"));  		} -		if (yang_dnode_exists(dnode, "./nai/local-interface")) { +		if (yang_dnode_exists(dnode, "nai/local-interface")) {  			vty_out(vty, " iface %s",  				yang_dnode_get_string(dnode,  						      "./nai/local-interface"));  		} -		if (yang_dnode_exists(dnode, "./nai/algorithm")) { +		if (yang_dnode_exists(dnode, "nai/algorithm")) {  			vty_out(vty, " algorithm %s",  				yang_dnode_get_string(dnode,  						      "./nai/algorithm")); @@ -658,8 +658,8 @@ void cli_show_srte_policy(struct vty *vty, const struct lyd_node *dnode,  			  bool show_defaults)  {  	vty_out(vty, "  policy color %s endpoint %s\n", -		yang_dnode_get_string(dnode, "./color"), -		yang_dnode_get_string(dnode, "./endpoint")); +		yang_dnode_get_string(dnode, "color"), +		yang_dnode_get_string(dnode, "endpoint"));  }  void cli_show_srte_policy_end(struct vty *vty, const struct lyd_node *dnode) @@ -1183,11 +1183,11 @@ static int config_write_metric_cb(const struct lyd_node *dnode, void *arg)  	bool required, is_bound = false;  	float value; -	type = yang_dnode_get_enum(dnode, "./type"); -	value = (float)yang_dnode_get_dec64(dnode, "./value"); -	required = yang_dnode_get_bool(dnode, "./required"); -	if (yang_dnode_exists(dnode, "./is-bound")) -		is_bound = yang_dnode_get_bool(dnode, "./is-bound"); +	type = yang_dnode_get_enum(dnode, "type"); +	value = (float)yang_dnode_get_dec64(dnode, "value"); +	required = yang_dnode_get_bool(dnode, "required"); +	if (yang_dnode_exists(dnode, "is-bound")) +		is_bound = yang_dnode_get_bool(dnode, "is-bound");  	config_write_metric(vty, type, value, required, is_bound);  	return YANG_ITER_CONTINUE; @@ -1201,18 +1201,18 @@ void cli_show_srte_policy_candidate_path(struct vty *vty,  	uint32_t affinity;  	bool required;  	enum objfun_type objfun_type; -	const char *type = yang_dnode_get_string(dnode, "./type"); +	const char *type = yang_dnode_get_string(dnode, "type");  	vty_out(vty, "   candidate-path preference %s name %s %s", -		yang_dnode_get_string(dnode, "./preference"), -		yang_dnode_get_string(dnode, "./name"), type); +		yang_dnode_get_string(dnode, "preference"), +		yang_dnode_get_string(dnode, "name"), type);  	if (strmatch(type, "explicit"))  		vty_out(vty, " segment-list %s", -			yang_dnode_get_string(dnode, "./segment-list-name")); +			yang_dnode_get_string(dnode, "segment-list-name"));  	vty_out(vty, "\n");  	if (strmatch(type, "dynamic")) { -		if (yang_dnode_exists(dnode, "./constraints/bandwidth")) { +		if (yang_dnode_exists(dnode, "constraints/bandwidth")) {  			bandwidth = (float)yang_dnode_get_dec64(  				dnode, "./constraints/bandwidth/value");  			required = yang_dnode_get_bool( @@ -1262,7 +1262,7 @@ void cli_show_srte_policy_candidate_path(struct vty *vty,  void cli_show_srte_policy_candidate_path_end(struct vty *vty,  					     const struct lyd_node *dnode)  { -	const char *type = yang_dnode_get_string(dnode, "./type"); +	const char *type = yang_dnode_get_string(dnode, "type");  	if (strmatch(type, "dynamic"))  		vty_out(vty, "   exit\n"); diff --git a/pathd/path_nb.c b/pathd/path_nb.c index 9e919571dd..e1c0cc3efa 100644 --- a/pathd/path_nb.c +++ b/pathd/path_nb.c @@ -313,8 +313,8 @@ int iter_objfun_cb(const struct lyd_node *dnode, void *arg)  	pref = &of_arg->prefs[of_arg->free_slot++]; -	pref->index = yang_dnode_get_uint32(dnode, "./index"); -	pref->type = yang_dnode_get_enum(dnode, "./type"); +	pref->index = yang_dnode_get_uint32(dnode, "index"); +	pref->type = yang_dnode_get_enum(dnode, "type");  	/* Simplistic insertion sort */  	p = &of_arg->first; diff --git a/pathd/path_nb_config.c b/pathd/path_nb_config.c index ad24f23dd9..48531ba433 100644 --- a/pathd/path_nb_config.c +++ b/pathd/path_nb_config.c @@ -31,7 +31,7 @@ int pathd_srte_segment_list_create(struct nb_cb_create_args *args)  	if (args->event != NB_EV_APPLY)  		return NB_OK; -	name = yang_dnode_get_string(args->dnode, "./name"); +	name = yang_dnode_get_string(args->dnode, "name");  	segment_list = srte_segment_list_add(name);  	nb_running_set_entry(args->dnode, segment_list);  	SET_FLAG(segment_list->flags, F_SEGMENT_LIST_NEW); @@ -104,7 +104,7 @@ int pathd_srte_segment_list_segment_create(struct nb_cb_create_args *args)  		return NB_OK;  	segment_list = nb_running_get_entry(args->dnode, NULL, true); -	index = yang_dnode_get_uint32(args->dnode, "./index"); +	index = yang_dnode_get_uint32(args->dnode, "index");  	segment = srte_segment_entry_add(segment_list, index);  	nb_running_set_entry(args->dnode, segment);  	SET_FLAG(segment_list->flags, F_SEGMENT_LIST_MODIFIED); @@ -191,9 +191,9 @@ void pathd_srte_segment_list_segment_nai_apply_finish(  	const char *algo_buf, *local_prefix_len_buf;  	segment = nb_running_get_entry(args->dnode, NULL, true); -	type = yang_dnode_get_enum(args->dnode, "./type"); +	type = yang_dnode_get_enum(args->dnode, "type"); -	yang_dnode_get_ip(&local_addr, args->dnode, "./local-address"); +	yang_dnode_get_ip(&local_addr, args->dnode, "local-address");  	switch (type) {  	case SRTE_SEGMENT_NAI_TYPE_IPV4_NODE: @@ -208,12 +208,12 @@ void pathd_srte_segment_list_segment_nai_apply_finish(  		yang_dnode_get_ip(&remote_addr, args->dnode,  				  "./remote-address");  		local_iface = -			yang_dnode_get_uint32(args->dnode, "./local-interface"); +			yang_dnode_get_uint32(args->dnode, "local-interface");  		remote_iface = yang_dnode_get_uint32(args->dnode,  						     "./remote-interface");  		break;  	case SRTE_SEGMENT_NAI_TYPE_IPV4_ALGORITHM: -		algo_buf = yang_dnode_get_string(args->dnode, "./algorithm"); +		algo_buf = yang_dnode_get_string(args->dnode, "algorithm");  		algo = atoi(algo_buf);  		local_prefix_len_buf = yang_dnode_get_string(  			args->dnode, "./local-prefix-len"); @@ -221,7 +221,7 @@ void pathd_srte_segment_list_segment_nai_apply_finish(  		break;  	case SRTE_SEGMENT_NAI_TYPE_IPV4_LOCAL_IFACE:  		local_iface = -			yang_dnode_get_uint32(args->dnode, "./local-interface"); +			yang_dnode_get_uint32(args->dnode, "local-interface");  		local_prefix_len_buf = yang_dnode_get_string(  			args->dnode, "./local-prefix-len");  		local_prefix_len = atoi(local_prefix_len_buf); @@ -254,8 +254,8 @@ int pathd_srte_policy_create(struct nb_cb_create_args *args)  	if (args->event != NB_EV_APPLY)  		return NB_OK; -	color = yang_dnode_get_uint32(args->dnode, "./color"); -	yang_dnode_get_ip(&endpoint, args->dnode, "./endpoint"); +	color = yang_dnode_get_uint32(args->dnode, "color"); +	yang_dnode_get_ip(&endpoint, args->dnode, "endpoint");  	policy = srte_policy_add(color, &endpoint, SRTE_ORIGIN_LOCAL, NULL);  	nb_running_set_entry(args->dnode, policy); @@ -377,7 +377,7 @@ int pathd_srte_policy_candidate_path_create(struct nb_cb_create_args *args)  		return NB_OK;  	policy = nb_running_get_entry(args->dnode, NULL, true); -	preference = yang_dnode_get_uint32(args->dnode, "./preference"); +	preference = yang_dnode_get_uint32(args->dnode, "preference");  	candidate =  		srte_candidate_add(policy, preference, SRTE_ORIGIN_LOCAL, NULL);  	nb_running_set_entry(args->dnode, candidate); @@ -539,7 +539,7 @@ int pathd_srte_policy_candidate_path_metrics_destroy(  	assert(args->context != NULL);  	candidate = nb_running_get_entry(args->dnode, NULL, true); -	type = yang_dnode_get_enum(args->dnode, "./type"); +	type = yang_dnode_get_enum(args->dnode, "type");  	srte_candidate_unset_metric(candidate, type);  	return NB_OK; @@ -557,13 +557,13 @@ void pathd_srte_policy_candidate_path_metrics_apply_finish(  	candidate = nb_running_get_entry(args->dnode, NULL, true); -	type = yang_dnode_get_enum(args->dnode, "./type"); -	value = (float)yang_dnode_get_dec64(args->dnode, "./value"); -	required = yang_dnode_get_bool(args->dnode, "./required"); -	if (yang_dnode_exists(args->dnode, "./is-bound")) -		is_bound = yang_dnode_get_bool(args->dnode, "./is-bound"); -	if (yang_dnode_exists(args->dnode, "./is-computed")) -		is_computed = yang_dnode_get_bool(args->dnode, "./is-computed"); +	type = yang_dnode_get_enum(args->dnode, "type"); +	value = (float)yang_dnode_get_dec64(args->dnode, "value"); +	required = yang_dnode_get_bool(args->dnode, "required"); +	if (yang_dnode_exists(args->dnode, "is-bound")) +		is_bound = yang_dnode_get_bool(args->dnode, "is-bound"); +	if (yang_dnode_exists(args->dnode, "is-computed")) +		is_computed = yang_dnode_get_bool(args->dnode, "is-computed");  	srte_candidate_set_metric(candidate, type, value, required, is_bound,  				  is_computed); @@ -597,8 +597,8 @@ void pathd_srte_policy_candidate_path_objfun_apply_finish(  	bool required;  	candidate = nb_running_get_entry(args->dnode, NULL, true); -	required = yang_dnode_get_bool(args->dnode, "./required"); -	type = yang_dnode_get_enum(args->dnode, "./type"); +	required = yang_dnode_get_bool(args->dnode, "required"); +	type = yang_dnode_get_enum(args->dnode, "type");  	srte_candidate_set_objfun(candidate, required, type);  } @@ -739,8 +739,8 @@ void pathd_srte_policy_candidate_path_bandwidth_apply_finish(  	assert(args->context != NULL);  	candidate = nb_running_get_entry(args->dnode, NULL, true); -	value = (float)yang_dnode_get_dec64(args->dnode, "./value"); -	required = yang_dnode_get_bool(args->dnode, "./required"); +	value = (float)yang_dnode_get_dec64(args->dnode, "value"); +	required = yang_dnode_get_bool(args->dnode, "required");  	srte_candidate_set_bandwidth(candidate, value, required);  } diff --git a/pimd/pim_cmd_common.c b/pimd/pim_cmd_common.c index b831de00e3..1ea79a10ed 100644 --- a/pimd/pim_cmd_common.c +++ b/pimd/pim_cmd_common.c @@ -68,7 +68,7 @@ const char *pim_cli_get_vrf_name(struct vty *vty)  		return NULL;  	} -	return yang_dnode_get_string(vrf_node, "./name"); +	return yang_dnode_get_string(vrf_node, "name");  }  int pim_process_join_prune_cmd(struct vty *vty, const char *jpi_str) diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index be05b69401..9a6b98de7e 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -485,7 +485,7 @@ int routing_control_plane_protocols_name_validate(  {  	const char *name; -	name = yang_dnode_get_string(args->dnode, "./name"); +	name = yang_dnode_get_string(args->dnode, "name");  	if (!strmatch(name, "pim")) {  		snprintf(args->errmsg, args->errmsg_len,  				"pim supports only one instance with name pimd"); @@ -779,7 +779,7 @@ void routing_control_plane_protocols_control_plane_protocol_pim_address_family_s  	vrf = nb_running_get_entry(args->dnode, NULL, true);  	pim = vrf->info; -	spt_switch_action = yang_dnode_get_enum(args->dnode, "./spt-action"); +	spt_switch_action = yang_dnode_get_enum(args->dnode, "spt-action");  	switch (spt_switch_action) {  	case PIM_SPT_INFINITY: @@ -1233,8 +1233,8 @@ int routing_control_plane_protocols_control_plane_protocol_pim_address_family_ms  	case NB_EV_APPLY:  		vrf = nb_running_get_entry(args->dnode, NULL, true);  		pim = vrf->info; -		yang_dnode_get_ip(&peer_ip, args->dnode, "./peer-ip"); -		yang_dnode_get_ip(&source_ip, args->dnode, "./source-ip"); +		yang_dnode_get_ip(&peer_ip, args->dnode, "peer-ip"); +		yang_dnode_get_ip(&source_ip, args->dnode, "source-ip");  		mp = pim_msdp_peer_add(pim, &peer_ip.ipaddr_v4,  				       &source_ip.ipaddr_v4, NULL);  		nb_running_set_entry(args->dnode, mp); @@ -1338,16 +1338,16 @@ void routing_control_plane_protocols_control_plane_protocol_pim_address_family_m  	struct interface *ifp;  	struct ipaddr reg_addr; -	ifname = yang_dnode_get_string(args->dnode, "./peerlink-rif"); +	ifname = yang_dnode_get_string(args->dnode, "peerlink-rif");  	ifp = if_lookup_by_name(ifname, VRF_DEFAULT);  	if (!ifp) {  		snprintf(args->errmsg, args->errmsg_len,  			 "No such interface name %s", ifname);  		return;  	} -	role = yang_dnode_get_enum(args->dnode, "./my-role"); -	peer_state = yang_dnode_get_bool(args->dnode, "./peer-state"); -	yang_dnode_get_ip(®_addr, args->dnode, "./reg-address"); +	role = yang_dnode_get_enum(args->dnode, "my-role"); +	peer_state = yang_dnode_get_bool(args->dnode, "peer-state"); +	yang_dnode_get_ip(®_addr, args->dnode, "reg-address");  	pim_vxlan_mlag_update(true, peer_state, role, ifp,  			®_addr.ip._v4_addr); @@ -1759,11 +1759,11 @@ void lib_interface_pim_address_family_bfd_apply_finish(  	}  	pim_ifp->bfd_config.detection_multiplier = -		yang_dnode_get_uint8(args->dnode, "./detect_mult"); +		yang_dnode_get_uint8(args->dnode, "detect_mult");  	pim_ifp->bfd_config.min_rx = -		yang_dnode_get_uint16(args->dnode, "./min-rx-interval"); +		yang_dnode_get_uint16(args->dnode, "min-rx-interval");  	pim_ifp->bfd_config.min_tx = -		yang_dnode_get_uint16(args->dnode, "./min-tx-interval"); +		yang_dnode_get_uint16(args->dnode, "min-tx-interval");  	pim_bfd_reg_dereg_all_nbr(ifp);  } @@ -2191,7 +2191,7 @@ int lib_interface_pim_address_family_mroute_destroy(  		pim_iifp = iif->info;  		pim = pim_iifp->pim; -		oifname = yang_dnode_get_string(args->dnode, "./oif"); +		oifname = yang_dnode_get_string(args->dnode, "oif");  		oif = if_lookup_by_name(oifname, pim->vrf->vrf_id);  		if (!oif) { @@ -2201,8 +2201,8 @@ int lib_interface_pim_address_family_mroute_destroy(  			return NB_ERR_INCONSISTENCY;  		} -		yang_dnode_get_pimaddr(&source_addr, args->dnode, "./source-addr"); -		yang_dnode_get_pimaddr(&group_addr, args->dnode, "./group-addr"); +		yang_dnode_get_pimaddr(&source_addr, args->dnode, "source-addr"); +		yang_dnode_get_pimaddr(&group_addr, args->dnode, "group-addr");  		if (pim_static_del(pim, iif, oif, group_addr, source_addr)) {  			snprintf(args->errmsg, args->errmsg_len, @@ -2341,9 +2341,9 @@ int routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp  	case NB_EV_APPLY:  		vrf = nb_running_get_entry(args->dnode, NULL, true);  		pim = vrf->info; -		yang_dnode_get_pimaddr(&rp_addr, args->dnode, "./rp-address"); +		yang_dnode_get_pimaddr(&rp_addr, args->dnode, "rp-address"); -		if (yang_dnode_get(args->dnode, "./group-list")) { +		if (yang_dnode_get(args->dnode, "group-list")) {  			yang_dnode_get_prefix(&group, args->dnode,  					      "./group-list");  			apply_mask(&group); @@ -2352,7 +2352,7 @@ int routing_control_plane_protocols_control_plane_protocol_pim_address_family_rp  						      args->errmsg_len);  		} -		else if (yang_dnode_get(args->dnode, "./prefix-list")) { +		else if (yang_dnode_get(args->dnode, "prefix-list")) {  			plist = yang_dnode_get_string(args->dnode,  					"./prefix-list");  			if (!pim_get_all_mcast_group(&group)) { 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); diff --git a/ripngd/ripng_cli.c b/ripngd/ripng_cli.c index 9a96e29313..88b9354d95 100644 --- a/ripngd/ripng_cli.c +++ b/ripngd/ripng_cli.c @@ -73,7 +73,7 @@ void cli_show_router_ripng(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 ripng"); @@ -267,12 +267,12 @@ void cli_show_ripng_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"); @@ -335,13 +335,13 @@ void cli_show_ripng_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");  } @@ -435,9 +435,9 @@ void cli_show_ripng_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"));  }  /* diff --git a/ripngd/ripng_nb_config.c b/ripngd/ripng_nb_config.c index 0b1bd68eca..6ce1c1e356 100644 --- a/ripngd/ripng_nb_config.c +++ b/ripngd/ripng_nb_config.c @@ -35,7 +35,7 @@ int ripngd_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);  	/* @@ -262,7 +262,7 @@ int ripngd_instance_offset_list_create(struct nb_cb_create_args *args)  		return NB_OK;  	ripng = 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 = ripng_offset_list_new(ripng, ifname);  	nb_running_set_entry(args->dnode, offset); @@ -278,7 +278,7 @@ int ripngd_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) { @@ -380,7 +380,7 @@ int ripngd_instance_redistribute_create(struct nb_cb_create_args *args)  		return NB_OK;  	ripng = nb_running_get_entry(args->dnode, NULL, true); -	type = yang_dnode_get_enum(args->dnode, "./protocol"); +	type = yang_dnode_get_enum(args->dnode, "protocol");  	ripng->redist[type].enabled = true; @@ -396,7 +396,7 @@ int ripngd_instance_redistribute_destroy(struct nb_cb_destroy_args *args)  		return NB_OK;  	ripng = nb_running_get_entry(args->dnode, NULL, true); -	type = yang_dnode_get_enum(args->dnode, "./protocol"); +	type = yang_dnode_get_enum(args->dnode, "protocol");  	ripng->redist[type].enabled = false;  	if (ripng->redist[type].route_map.name) { @@ -420,7 +420,7 @@ void ripngd_instance_redistribute_apply_finish(  	int type;  	ripng = 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 (ripng->enabled)  		ripng_redistribute_conf_update(ripng, type); diff --git a/staticd/static_bfd.c b/staticd/static_bfd.c index 507c64e6a4..b0b2566150 100644 --- a/staticd/static_bfd.c +++ b/staticd/static_bfd.c @@ -91,11 +91,11 @@ void static_next_hop_bfd_monitor_enable(struct static_nexthop *sn,  	struct vrf *vrf = NULL;  	use_interface = false; -	use_source = yang_dnode_exists(dnode, "./source"); -	use_profile = yang_dnode_exists(dnode, "./profile"); +	use_source = yang_dnode_exists(dnode, "source"); +	use_profile = yang_dnode_exists(dnode, "profile");  	onlink = yang_dnode_exists(dnode, "../onlink") &&  		 yang_dnode_get_bool(dnode, "../onlink"); -	mhop = yang_dnode_get_bool(dnode, "./multi-hop"); +	mhop = yang_dnode_get_bool(dnode, "multi-hop");  	vrf = vrf_lookup_by_name(yang_dnode_get_string(dnode, "../vrf"));  	family = static_next_hop_type_to_family(sn); @@ -112,7 +112,7 @@ void static_next_hop_bfd_monitor_enable(struct static_nexthop *sn,  	/* Configure the session. */  	if (use_source) -		yang_dnode_get_ip(&source, dnode, "./source"); +		yang_dnode_get_ip(&source, dnode, "source");  	if (onlink || mhop == false)  		bfd_sess_set_auto_source(sn->bsp, false); diff --git a/staticd/static_nb_config.c b/staticd/static_nb_config.c index ede2e38754..ed20b41049 100644 --- a/staticd/static_nb_config.c +++ b/staticd/static_nb_config.c @@ -33,8 +33,8 @@ static int static_path_list_create(struct nb_cb_create_args *args)  	case NB_EV_VALIDATE:  		vrf_dnode = yang_dnode_get_parent(args->dnode,  						  "control-plane-protocol"); -		vrf = yang_dnode_get_string(vrf_dnode, "./vrf"); -		table_id = yang_dnode_get_uint32(args->dnode, "./table-id"); +		vrf = yang_dnode_get_string(vrf_dnode, "vrf"); +		table_id = yang_dnode_get_uint32(args->dnode, "table-id");  		/*  		 * TableId is not applicable for VRF. Consider the case of @@ -55,8 +55,8 @@ static int static_path_list_create(struct nb_cb_create_args *args)  		break;  	case NB_EV_APPLY:  		rn = nb_running_get_entry(args->dnode, NULL, true); -		distance = yang_dnode_get_uint8(args->dnode, "./distance"); -		table_id = yang_dnode_get_uint32(args->dnode, "./table-id"); +		distance = yang_dnode_get_uint8(args->dnode, "distance"); +		table_id = yang_dnode_get_uint32(args->dnode, "table-id");  		pn = static_add_path(rn, table_id, distance);  		nb_running_set_entry(args->dnode, pn);  	} @@ -111,7 +111,7 @@ static int nexthop_iter_cb(const struct lyd_node *dnode, void *arg)  	struct nexthop_iter *iter = arg;  	enum static_nh_type nh_type; -	nh_type = yang_dnode_get_enum(dnode, "./nh-type"); +	nh_type = yang_dnode_get_enum(dnode, "nh-type");  	if (nh_type == STATIC_BLACKHOLE)  		iter->blackhole = true; @@ -134,8 +134,8 @@ static bool static_nexthop_create(struct nb_cb_create_args *args)  	switch (args->event) {  	case NB_EV_VALIDATE: -		ifname = yang_dnode_get_string(args->dnode, "./interface"); -		nh_type = yang_dnode_get_enum(args->dnode, "./nh-type"); +		ifname = yang_dnode_get_string(args->dnode, "interface"); +		nh_type = yang_dnode_get_enum(args->dnode, "nh-type");  		if (ifname != NULL && nh_type != STATIC_BLACKHOLE) {  			if (strcasecmp(ifname, "Null0") == 0  			    || strcasecmp(ifname, "reject") == 0 @@ -170,10 +170,10 @@ static bool static_nexthop_create(struct nb_cb_create_args *args)  	case NB_EV_ABORT:  		break;  	case NB_EV_APPLY: -		yang_dnode_get_ip(&ipaddr, args->dnode, "./gateway"); -		nh_type = yang_dnode_get_enum(args->dnode, "./nh-type"); -		ifname = yang_dnode_get_string(args->dnode, "./interface"); -		nh_vrf = yang_dnode_get_string(args->dnode, "./vrf"); +		yang_dnode_get_ip(&ipaddr, args->dnode, "gateway"); +		nh_type = yang_dnode_get_enum(args->dnode, "nh-type"); +		ifname = yang_dnode_get_string(args->dnode, "interface"); +		nh_vrf = yang_dnode_get_string(args->dnode, "vrf");  		pn = nb_running_get_entry(args->dnode, NULL, true);  		if (!static_add_nexthop_validate(nh_vrf, nh_type, &ipaddr)) @@ -535,7 +535,7 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_pa  	const struct lyd_node *mls_dnode;  	uint32_t count; -	mls_dnode = yang_dnode_get(args->dnode, "./mpls-label-stack"); +	mls_dnode = yang_dnode_get(args->dnode, "mpls-label-stack");  	count = yang_get_list_elements_count(lyd_child(mls_dnode));  	if (count > MPLS_MAX_LABELS) { @@ -552,7 +552,7 @@ int routing_control_plane_protocols_name_validate(  {  	const char *name; -	name = yang_dnode_get_string(args->dnode, "./name"); +	name = yang_dnode_get_string(args->dnode, "name");  	if (!strmatch(name, "staticd")) {  		snprintf(args->errmsg, args->errmsg_len,  			"static routing supports only one instance with name staticd"); @@ -579,15 +579,15 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_cr  	switch (args->event) {  	case NB_EV_VALIDATE: -		yang_dnode_get_prefix(&prefix, args->dnode, "./prefix"); -		afi_safi = yang_dnode_get_string(args->dnode, "./afi-safi"); +		yang_dnode_get_prefix(&prefix, args->dnode, "prefix"); +		afi_safi = yang_dnode_get_string(args->dnode, "afi-safi");  		yang_afi_safi_identity2value(afi_safi, &afi, &safi);  		prefix_afi = family2afi(prefix.family);  		if (afi != prefix_afi) {  			flog_warn(  				EC_LIB_NB_CB_CONFIG_VALIDATE,  				"route node %s creation failed", -				yang_dnode_get_string(args->dnode, "./prefix")); +				yang_dnode_get_string(args->dnode, "prefix"));  			return NB_ERR_VALIDATION;  		}  		break; @@ -600,8 +600,8 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_cr  		vrf = nb_running_get_entry(vrf_dnode, NULL, true);  		s_vrf = vrf->info; -		yang_dnode_get_prefix(&prefix, args->dnode, "./prefix"); -		afi_safi = yang_dnode_get_string(args->dnode, "./afi-safi"); +		yang_dnode_get_prefix(&prefix, args->dnode, "prefix"); +		afi_safi = yang_dnode_get_string(args->dnode, "afi-safi");  		yang_afi_safi_identity2value(afi_safi, &afi, &safi);  		rn = static_add_route(afi, safi, &prefix, NULL, s_vrf); @@ -609,7 +609,7 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_cr  			snprintf(  				args->errmsg, args->errmsg_len,  				"Static Route to %s not installed currently because dependent config not fully available", -				yang_dnode_get_string(args->dnode, "./prefix")); +				yang_dnode_get_string(args->dnode, "prefix"));  		nb_running_set_entry(args->dnode, rn);  		break;  	} @@ -1036,7 +1036,7 @@ int routing_control_plane_protocols_control_plane_protocol_staticd_route_list_sr  		rn = nb_running_get_entry(args->dnode, NULL, true);  		info = route_table_get_info(rn->table);  		s_vrf = info->svrf; -		yang_dnode_get_ipv6p(&src_prefix, args->dnode, "./src-prefix"); +		yang_dnode_get_ipv6p(&src_prefix, args->dnode, "src-prefix");  		afi = family2afi(src_prefix.family);  		src_rn =  			static_add_route(afi, safi, &rn->p, &src_prefix, s_vrf); diff --git a/staticd/static_vty.c b/staticd/static_vty.c index d9d4554c73..70ea6c525a 100644 --- a/staticd/static_vty.c +++ b/staticd/static_vty.c @@ -101,7 +101,7 @@ static int static_route_nb_run(struct vty *vty, struct static_route_args *args)  			return CMD_WARNING_CONFIG_FAILED;  		} -		args->vrf = yang_dnode_get_string(vrf_dnode, "./name"); +		args->vrf = yang_dnode_get_string(vrf_dnode, "name");  	} else {  		if (args->vrf == NULL)  			args->vrf = VRF_DEFAULT_NAME; @@ -1264,13 +1264,13 @@ static int mpls_label_iter_cb(const struct lyd_node *dnode, void *arg)  {  	struct mpls_label_iter *iter = arg; -	if (yang_dnode_exists(dnode, "./label")) { +	if (yang_dnode_exists(dnode, "label")) {  		if (iter->first)  			vty_out(iter->vty, " label %s", -				yang_dnode_get_string(dnode, "./label")); +				yang_dnode_get_string(dnode, "label"));  		else  			vty_out(iter->vty, "/%s", -				yang_dnode_get_string(dnode, "./label")); +				yang_dnode_get_string(dnode, "label"));  		iter->first = false;  	} @@ -1288,16 +1288,16 @@ static int srv6_seg_iter_cb(const struct lyd_node *dnode, void *arg)  	char buffer[INET6_ADDRSTRLEN];  	struct in6_addr cli_seg; -	if (yang_dnode_exists(dnode, "./seg")) { +	if (yang_dnode_exists(dnode, "seg")) {  		if (iter->first) { -			yang_dnode_get_ipv6(&cli_seg, dnode, "./seg"); +			yang_dnode_get_ipv6(&cli_seg, dnode, "seg");  			if (inet_ntop(AF_INET6, &cli_seg, buffer,  				      INET6_ADDRSTRLEN) == NULL) {  				return 1;  			}  			vty_out(iter->vty, " segments %s", buffer);  		} else { -			yang_dnode_get_ipv6(&cli_seg, dnode, "./seg"); +			yang_dnode_get_ipv6(&cli_seg, dnode, "seg");  			if (inet_ntop(AF_INET6, &cli_seg, buffer,  				      INET6_ADDRSTRLEN) == NULL) {  				return 1; @@ -1331,7 +1331,7 @@ static void nexthop_cli_show(struct vty *vty, const struct lyd_node *route,  	vrf = yang_dnode_get_string(route, "../../vrf"); -	afi_safi = yang_dnode_get_string(route, "./afi-safi"); +	afi_safi = yang_dnode_get_string(route, "afi-safi");  	yang_afi_safi_identity2value(afi_safi, &afi, &safi);  	if (afi == AFI_IP) @@ -1346,32 +1346,32 @@ static void nexthop_cli_show(struct vty *vty, const struct lyd_node *route,  	else  		vty_out(vty, " mroute"); -	vty_out(vty, " %s", yang_dnode_get_string(route, "./prefix")); +	vty_out(vty, " %s", yang_dnode_get_string(route, "prefix"));  	if (src)  		vty_out(vty, " from %s", -			yang_dnode_get_string(src, "./src-prefix")); +			yang_dnode_get_string(src, "src-prefix")); -	nh_type = yang_dnode_get_enum(nexthop, "./nh-type"); +	nh_type = yang_dnode_get_enum(nexthop, "nh-type");  	switch (nh_type) {  	case STATIC_IFNAME:  		vty_out(vty, " %s", -			yang_dnode_get_string(nexthop, "./interface")); +			yang_dnode_get_string(nexthop, "interface"));  		break;  	case STATIC_IPV4_GATEWAY:  	case STATIC_IPV6_GATEWAY:  		vty_out(vty, " %s", -			yang_dnode_get_string(nexthop, "./gateway")); +			yang_dnode_get_string(nexthop, "gateway"));  		break;  	case STATIC_IPV4_GATEWAY_IFNAME:  	case STATIC_IPV6_GATEWAY_IFNAME:  		vty_out(vty, " %s", -			yang_dnode_get_string(nexthop, "./gateway")); +			yang_dnode_get_string(nexthop, "gateway"));  		vty_out(vty, " %s", -			yang_dnode_get_string(nexthop, "./interface")); +			yang_dnode_get_string(nexthop, "interface"));  		break;  	case STATIC_BLACKHOLE: -		bh_type = yang_dnode_get_enum(nexthop, "./bh-type"); +		bh_type = yang_dnode_get_enum(nexthop, "bh-type");  		switch (bh_type) {  		case STATIC_BLACKHOLE_DROP:  			vty_out(vty, " blackhole"); @@ -1386,13 +1386,13 @@ static void nexthop_cli_show(struct vty *vty, const struct lyd_node *route,  		break;  	} -	if (yang_dnode_exists(path, "./tag")) { -		tag = yang_dnode_get_uint32(path, "./tag"); +	if (yang_dnode_exists(path, "tag")) { +		tag = yang_dnode_get_uint32(path, "tag");  		if (tag != 0 || show_defaults)  			vty_out(vty, " tag %" PRIu32, tag);  	} -	distance = yang_dnode_get_uint8(path, "./distance"); +	distance = yang_dnode_get_uint8(path, "distance");  	if (distance != ZEBRA_STATIC_DISTANCE_DEFAULT || show_defaults)  		vty_out(vty, " %" PRIu8, distance); @@ -1406,41 +1406,41 @@ static void nexthop_cli_show(struct vty *vty, const struct lyd_node *route,  	yang_dnode_iterate(srv6_seg_iter_cb, &seg_iter, nexthop,  			   "./srv6-segs-stack/entry"); -	nexthop_vrf = yang_dnode_get_string(nexthop, "./vrf"); +	nexthop_vrf = yang_dnode_get_string(nexthop, "vrf");  	if (strcmp(vrf, nexthop_vrf))  		vty_out(vty, " nexthop-vrf %s", nexthop_vrf); -	table_id = yang_dnode_get_uint32(path, "./table-id"); +	table_id = yang_dnode_get_uint32(path, "table-id");  	if (table_id || show_defaults)  		vty_out(vty, " table %" PRIu32, table_id); -	if (yang_dnode_exists(nexthop, "./onlink")) { -		onlink = yang_dnode_get_bool(nexthop, "./onlink"); +	if (yang_dnode_exists(nexthop, "onlink")) { +		onlink = yang_dnode_get_bool(nexthop, "onlink");  		if (onlink)  			vty_out(vty, " onlink");  	} -	if (yang_dnode_exists(nexthop, "./srte-color")) +	if (yang_dnode_exists(nexthop, "srte-color"))  		vty_out(vty, " color %s", -			yang_dnode_get_string(nexthop, "./srte-color")); +			yang_dnode_get_string(nexthop, "srte-color")); -	if (yang_dnode_exists(nexthop, "./bfd-monitoring")) { +	if (yang_dnode_exists(nexthop, "bfd-monitoring")) {  		const struct lyd_node *bfd_dnode = -			yang_dnode_get(nexthop, "./bfd-monitoring"); +			yang_dnode_get(nexthop, "bfd-monitoring"); -		if (yang_dnode_get_bool(bfd_dnode, "./multi-hop")) { +		if (yang_dnode_get_bool(bfd_dnode, "multi-hop")) {  			vty_out(vty, " bfd multi-hop"); -			if (yang_dnode_exists(bfd_dnode, "./source")) +			if (yang_dnode_exists(bfd_dnode, "source"))  				vty_out(vty, " source %s",  					yang_dnode_get_string(bfd_dnode,  							      "./source"));  		} else  			vty_out(vty, " bfd"); -		if (yang_dnode_exists(bfd_dnode, "./profile")) +		if (yang_dnode_exists(bfd_dnode, "profile"))  			vty_out(vty, " profile %s", -				yang_dnode_get_string(bfd_dnode, "./profile")); +				yang_dnode_get_string(bfd_dnode, "profile"));  	}  	vty_out(vty, "\n"); @@ -1476,8 +1476,8 @@ static int static_nexthop_cli_cmp(const struct lyd_node *dnode1,  	const char *vrf1, *vrf2;  	int ret = 0; -	nh_type1 = yang_dnode_get_enum(dnode1, "./nh-type"); -	nh_type2 = yang_dnode_get_enum(dnode2, "./nh-type"); +	nh_type1 = yang_dnode_get_enum(dnode1, "nh-type"); +	nh_type2 = yang_dnode_get_enum(dnode2, "nh-type");  	if (nh_type1 != nh_type2)  		return (int)nh_type1 - (int)nh_type2; @@ -1485,24 +1485,24 @@ static int static_nexthop_cli_cmp(const struct lyd_node *dnode1,  	switch (nh_type1) {  	case STATIC_IFNAME:  		ret = if_cmp_name_func( -			yang_dnode_get_string(dnode1, "./interface"), -			yang_dnode_get_string(dnode2, "./interface")); +			yang_dnode_get_string(dnode1, "interface"), +			yang_dnode_get_string(dnode2, "interface"));  		break;  	case STATIC_IPV4_GATEWAY:  	case STATIC_IPV6_GATEWAY: -		yang_dnode_get_prefix(&prefix1, dnode1, "./gateway"); -		yang_dnode_get_prefix(&prefix2, dnode2, "./gateway"); +		yang_dnode_get_prefix(&prefix1, dnode1, "gateway"); +		yang_dnode_get_prefix(&prefix2, dnode2, "gateway");  		ret = prefix_cmp(&prefix1, &prefix2);  		break;  	case STATIC_IPV4_GATEWAY_IFNAME:  	case STATIC_IPV6_GATEWAY_IFNAME: -		yang_dnode_get_prefix(&prefix1, dnode1, "./gateway"); -		yang_dnode_get_prefix(&prefix2, dnode2, "./gateway"); +		yang_dnode_get_prefix(&prefix1, dnode1, "gateway"); +		yang_dnode_get_prefix(&prefix2, dnode2, "gateway");  		ret = prefix_cmp(&prefix1, &prefix2);  		if (!ret)  			ret = if_cmp_name_func( -				yang_dnode_get_string(dnode1, "./interface"), -				yang_dnode_get_string(dnode2, "./interface")); +				yang_dnode_get_string(dnode1, "interface"), +				yang_dnode_get_string(dnode2, "interface"));  		break;  	case STATIC_BLACKHOLE:  		/* There's only one blackhole nexthop per route */ @@ -1513,10 +1513,10 @@ static int static_nexthop_cli_cmp(const struct lyd_node *dnode1,  	if (ret)  		return ret; -	vrf1 = yang_dnode_get_string(dnode1, "./vrf"); +	vrf1 = yang_dnode_get_string(dnode1, "vrf");  	if (strmatch(vrf1, "default"))  		vrf1 = ""; -	vrf2 = yang_dnode_get_string(dnode2, "./vrf"); +	vrf2 = yang_dnode_get_string(dnode2, "vrf");  	if (strmatch(vrf2, "default"))  		vrf2 = ""; @@ -1531,10 +1531,10 @@ static int static_route_list_cli_cmp(const struct lyd_node *dnode1,  	safi_t safi1, safi2;  	struct prefix prefix1, prefix2; -	afi_safi1 = yang_dnode_get_string(dnode1, "./afi-safi"); +	afi_safi1 = yang_dnode_get_string(dnode1, "afi-safi");  	yang_afi_safi_identity2value(afi_safi1, &afi1, &safi1); -	afi_safi2 = yang_dnode_get_string(dnode2, "./afi-safi"); +	afi_safi2 = yang_dnode_get_string(dnode2, "afi-safi");  	yang_afi_safi_identity2value(afi_safi2, &afi2, &safi2);  	if (afi1 != afi2) @@ -1543,8 +1543,8 @@ static int static_route_list_cli_cmp(const struct lyd_node *dnode1,  	if (safi1 != safi2)  		return (int)safi1 - (int)safi2; -	yang_dnode_get_prefix(&prefix1, dnode1, "./prefix"); -	yang_dnode_get_prefix(&prefix2, dnode2, "./prefix"); +	yang_dnode_get_prefix(&prefix1, dnode1, "prefix"); +	yang_dnode_get_prefix(&prefix2, dnode2, "prefix");  	return prefix_cmp(&prefix1, &prefix2);  } @@ -1554,8 +1554,8 @@ static int static_src_list_cli_cmp(const struct lyd_node *dnode1,  {  	struct prefix prefix1, prefix2; -	yang_dnode_get_prefix(&prefix1, dnode1, "./src-prefix"); -	yang_dnode_get_prefix(&prefix2, dnode2, "./src-prefix"); +	yang_dnode_get_prefix(&prefix1, dnode1, "src-prefix"); +	yang_dnode_get_prefix(&prefix2, dnode2, "src-prefix");  	return prefix_cmp(&prefix1, &prefix2);  } @@ -1566,14 +1566,14 @@ static int static_path_list_cli_cmp(const struct lyd_node *dnode1,  	uint32_t table_id1, table_id2;  	uint8_t distance1, distance2; -	table_id1 = yang_dnode_get_uint32(dnode1, "./table-id"); -	table_id2 = yang_dnode_get_uint32(dnode2, "./table-id"); +	table_id1 = yang_dnode_get_uint32(dnode1, "table-id"); +	table_id2 = yang_dnode_get_uint32(dnode2, "table-id");  	if (table_id1 != table_id2)  		return (int)table_id1 - (int)table_id2; -	distance1 = yang_dnode_get_uint8(dnode1, "./distance"); -	distance2 = yang_dnode_get_uint8(dnode2, "./distance"); +	distance1 = yang_dnode_get_uint8(dnode1, "distance"); +	distance2 = yang_dnode_get_uint8(dnode2, "distance");  	return (int)distance1 - (int)distance2;  } diff --git a/vrrpd/vrrp_northbound.c b/vrrpd/vrrp_northbound.c index 1f8da4cf20..2947a416d8 100644 --- a/vrrpd/vrrp_northbound.c +++ b/vrrpd/vrrp_northbound.c @@ -27,8 +27,8 @@ static int lib_interface_vrrp_vrrp_group_create(struct nb_cb_create_args *args)  	uint8_t version = 3;  	struct vrrp_vrouter *vr; -	vrid = yang_dnode_get_uint8(args->dnode, "./virtual-router-id"); -	version = yang_dnode_get_enum(args->dnode, "./version"); +	vrid = yang_dnode_get_uint8(args->dnode, "virtual-router-id"); +	version = yang_dnode_get_enum(args->dnode, "version");  	switch (args->event) {  	case NB_EV_VALIDATE: diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c index 9971df58a3..bbdf48b326 100644 --- a/vrrpd/vrrp_vty.c +++ b/vrrpd/vrrp_vty.c @@ -62,11 +62,11 @@ DEFPY_YANG(vrrp_vrid,  void cli_show_vrrp(struct vty *vty, const struct lyd_node *dnode, bool show_defaults)  { -	const char *vrid = yang_dnode_get_string(dnode, "./virtual-router-id"); -	const char *ver = yang_dnode_get_string(dnode, "./version"); +	const char *vrid = yang_dnode_get_string(dnode, "virtual-router-id"); +	const char *ver = yang_dnode_get_string(dnode, "version");  	vty_out(vty, " vrrp %s", vrid); -	if (show_defaults || !yang_dnode_is_default(dnode, "./version")) +	if (show_defaults || !yang_dnode_is_default(dnode, "version"))  		vty_out(vty, " version %s", ver);  	vty_out(vty, "\n");  } diff --git a/zebra/interface.c b/zebra/interface.c index 58a28c607d..c4a952e1a7 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -4804,11 +4804,11 @@ static int ag_iter_cb(const struct lyd_node *dnode, void *arg)  void cli_show_legacy_admin_group(struct vty *vty, const struct lyd_node *dnode,  				 bool show_defaults)  { -	if (!yang_dnode_exists(dnode, "./legacy-admin-group")) +	if (!yang_dnode_exists(dnode, "legacy-admin-group"))  		return;  	vty_out(vty, "  admin-group 0x%x\n", -		yang_dnode_get_uint32(dnode, "./legacy-admin-group")); +		yang_dnode_get_uint32(dnode, "legacy-admin-group"));  }  void cli_show_affinity_mode(struct vty *vty, const struct lyd_node *dnode, @@ -4825,11 +4825,11 @@ void cli_show_affinity_mode(struct vty *vty, const struct lyd_node *dnode,  void cli_show_affinity(struct vty *vty, const struct lyd_node *dnode,  		       bool show_defaults)  { -	if (!yang_dnode_exists(dnode, "./affinity")) +	if (!yang_dnode_exists(dnode, "affinity"))  		return;  	vty_out(vty, "  affinity"); -	yang_dnode_iterate(ag_iter_cb, vty, dnode, "./affinity"); +	yang_dnode_iterate(ag_iter_cb, vty, dnode, "affinity");  	vty_out(vty, "\n");  } diff --git a/zebra/zebra_nb_config.c b/zebra/zebra_nb_config.c index 4d3e4c63e5..50caaa819e 100644 --- a/zebra/zebra_nb_config.c +++ b/zebra/zebra_nb_config.c @@ -830,8 +830,8 @@ int lib_interface_zebra_ip_addrs_create(struct nb_cb_create_args *args)  	struct interface *ifp;  	struct prefix prefix; -	// addr_family = yang_dnode_get_enum(dnode, "./address-family"); -	yang_dnode_get_prefix(&prefix, args->dnode, "./ip-prefix"); +	// addr_family = yang_dnode_get_enum(dnode, "address-family"); +	yang_dnode_get_prefix(&prefix, args->dnode, "ip-prefix");  	apply_mask(&prefix);  	switch (args->event) { @@ -870,7 +870,7 @@ int lib_interface_zebra_ip_addrs_destroy(struct nb_cb_destroy_args *args)  	struct prefix prefix;  	struct connected *ifc; -	yang_dnode_get_prefix(&prefix, args->dnode, "./ip-prefix"); +	yang_dnode_get_prefix(&prefix, args->dnode, "ip-prefix");  	apply_mask(&prefix);  	switch (args->event) { @@ -1033,7 +1033,7 @@ int lib_interface_zebra_link_detect_modify(struct nb_cb_modify_args *args)  	bool link_detect;  	ifp = nb_running_get_entry(args->dnode, NULL, true); -	link_detect = yang_dnode_get_bool(args->dnode, "./link-detect"); +	link_detect = yang_dnode_get_bool(args->dnode, "link-detect");  	if_linkdetect(ifp, link_detect); @@ -1049,7 +1049,7 @@ int lib_interface_zebra_link_detect_destroy(struct nb_cb_destroy_args *args)  	bool link_detect;  	ifp = nb_running_get_entry(args->dnode, NULL, true); -	link_detect = yang_dnode_get_bool(args->dnode, "./link-detect"); +	link_detect = yang_dnode_get_bool(args->dnode, "link-detect");  	if_linkdetect(ifp, link_detect); @@ -1143,7 +1143,7 @@ int lib_interface_zebra_bandwidth_modify(struct nb_cb_modify_args *args)  	uint32_t bandwidth;  	ifp = nb_running_get_entry(args->dnode, NULL, true); -	bandwidth = yang_dnode_get_uint32(args->dnode, "./bandwidth"); +	bandwidth = yang_dnode_get_uint32(args->dnode, "bandwidth");  	ifp->bandwidth = bandwidth; @@ -1465,7 +1465,7 @@ int lib_vrf_zebra_l3vni_id_modify(struct nb_cb_modify_args *args)  		 * if zebra vrf already mapped to different vni id.  		 */  		pn_dnode = yang_dnode_get_parent(args->dnode, "vrf"); -		vrfname = yang_dnode_get_string(pn_dnode, "./name"); +		vrfname = yang_dnode_get_string(pn_dnode, "name");  		zvrf = zebra_vrf_lookup_by_name(vrfname);  		if (!zvrf) {  			snprintf(args->errmsg, args->errmsg_len,  | 
