mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-22 06:27:51 +00:00
"id self" now correctly does multi-packet lists for when we have
lots of identities.
This commit is contained in:
parent
3f81911e6f
commit
cf2216fecf
@ -1128,12 +1128,15 @@ int app_id_self(int argc, const char *const *argv, struct command_line_option *o
|
||||
{
|
||||
/* List my own identities */
|
||||
overlay_mdp_frame a;
|
||||
int result;
|
||||
|
||||
a.packetTypeAndFlags=MDP_GETADDRS;
|
||||
a.addrlist.first_sid=-1;
|
||||
a.addrlist.last_sid=0x7fffffff;
|
||||
a.addrlist.frame_sid_count=MDP_MAX_SID_REQUEST;
|
||||
int result=overlay_mdp_send(&a,MDP_AWAITREPLY,5000);
|
||||
|
||||
while(a.addrlist.frame_sid_count==MDP_MAX_SID_REQUEST) {
|
||||
result=overlay_mdp_send(&a,MDP_AWAITREPLY,5000);
|
||||
if (result) {
|
||||
if (a.packetTypeAndFlags==MDP_ERROR)
|
||||
{
|
||||
@ -1147,10 +1150,14 @@ int app_id_self(int argc, const char *const *argv, struct command_line_option *o
|
||||
if ((a.packetTypeAndFlags&MDP_TYPE_MASK)!=MDP_ADDRLIST)
|
||||
return WHY("MDP Server returned something other than an address list");
|
||||
int i;
|
||||
WHYF("first_sid=%d, last_sid=%d",a.addrlist.first_sid,a.addrlist.last_sid);
|
||||
for(i=0;i<a.addrlist.frame_sid_count;i++) {
|
||||
cli_printf("%s\n",overlay_render_sid(a.addrlist.sids[i]));
|
||||
}
|
||||
/* XXX Only displays the first MDP_MAX_SID_REQUEST (currently 59) SIDs */
|
||||
/* get ready to ask for next block of SIDs */
|
||||
a.packetTypeAndFlags=MDP_GETADDRS;
|
||||
a.addrlist.first_sid=a.addrlist.last_sid+1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user