I have extended your yang model described in How to implement get_object for a container inside of a list
to use another augment model to describe my new question.
Please see below.
module arpe {
namespace "http://tail-f.com/ns/example/arpe";
prefix arpe;
import ietf-inet-types {
prefix inet;
}
import tailf-common {
prefix tailf;
}
container arpentries {
config false;
tailf:callpoint arpe;
list arpe {
key "ip ifname";
max-elements 1024;
leaf ip {
type inet:ip-address;
}
leaf ifname {
type string;
}
container stat {
leaf hwaddr {
type string;
mandatory true;
}
leaf permanent {
type boolean;
mandatory true;
}
leaf published {
type boolean;
mandatory true;
}
}
}
}
}
module augment_arpe_test {
namespace "http://tail-f.com/ns/example/augment_arpe_test";
prefix "augment_arpe_test";
augment "/arpe:arpentries/arpe:arpe"
container arpe_stats_test {
description "";
leaf arp_up_time {
type uint32;
config false;
description "xxxx";
}
leaf arp_down_time {
type uint32;
config false;
description "xxxx";
}
}
}
Hi, I have extended your yang model described in How to implement get_object for a container inside of a list
to use another augment model to describe my new question.
In the arp list, there is an augment container called augment_arpe_test.
In this case, I implemented the get_object like this:
static int get_object(struct confd_trans_ctx *tctx,
confd_hkeypath_t *keypath)
{
confd_value_t v[10];
struct aentry *ae = find_ae(keypath, tctx->t_opaque, 0);
if (ae == NULL) {
confd_data_reply_not_found(tctx);
return CONFD_OK;
}
CONFD_SET_IPV4(&v[0], ae->ip4);
CONFD_SET_STR(&v[1], ae->iface);
CONFD_SET_XMLTAG(&v[2], arpe_stat, arpe__ns);
if (ae->hwaddr == NULL) {
CONFD_SET_NOEXISTS(&v[3]);
} else {
CONFD_SET_STR(&v[3], ae->hwaddr);
}
CONFD_SET_BOOL(&v[4], ae->perm);
CONFD_SET_BOOL(&v[5], ae->pub);
CONFD_SET_XMLTAG(&v[6], arpe_stats_test, augment_arpe_test__ns);
CONFD_SET_UINT32(&v[7], 20);
CONFD_SET_UINT32(&v[8], 20);
confd_data_reply_value_array(tctx, v, 9);
return CONFD_OK;
}
And I have made similar change for get_next_object.
But when triggering [show arpentries arpe], following “Bad tag value” for arpe_stats_test is reported.
Is it because arpe_stats_test is an augment?
I tried to not use augment but to add the container arpe_stats_test directly to the arpe list, the issue is gone.
It is a known issue that when using augment inside a list?
R1# show arpentries arpe ?
TRACE New user session: 11 for user:root ctx:cli --> CONFD_OK
TRACE CALL trans init(thandle=6,mode=“r”,db=running)
–> CONFD_OK
TRACE CALL data get_next_object(thandle=6, /arpentries/arpe, -1)
–> CONFD_OK
?
Possible completions:
displaylevel Depth to show
| Output modifiers
2-Sep-2016::00:08:39.651
R1 confd[4189]: devel-c bad get_next_object() return value: /arpe:arpentries/arpe{192.168.0.1 eth0}/arpe_stats_test: Bad tag value 260382441