I executed following CLI table,
user@host> show arpentries arpe
IP IFNAME HWADDR PERMANENT PUBLISHED
--------------------------------------------------------------
172.16.1.1 eth0 fa:16:3e:5b:ad:2c false false
172.16.1.10 eth0 fa:16:3e:ff:c6:24 false false
[ok][2019-04-25 07:40:18]
Following is trace:
TRACE CALL data get_next(thandle=7, /arpentries/arpe, -1) --> CONFD_OK TRACE CALL data get_next_object(thandle=7, /arpentries/arpe, -1) --> CONFD_OK TRACE CALL data get_next_object(thandle=7, /arpentries/arpe, 0) --> CONFD_OK
I have registered both get_next and get_next_object
data.get_elem = get_elem;
data.get_next = get_next;
data.get_next_object = get_next_object;
strcpy(data.callpoint, arpe__callpointid_arpe);
Question is:
Why both get_next and get_next_object is being called when table is queried?
All data required to be displayed for operational CLI can be obtained from get_next_object.
So why get_next is being called?
Is there any way I can suppress first get_next being called?
Reason for asking,
We are doing some cleanup/allocation when we get “-1” as “next” value. Since “-1” is passed twice, double cleanup/allocation happens.