mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-03 03:46:47 +00:00
node info now understands new dna response packet format.
This commit is contained in:
parent
8ea37af64d
commit
30e254560a
@ -1680,16 +1680,19 @@ int app_node_info(int argc, const char *const *argv, struct command_line_option
|
|||||||
|
|
||||||
{
|
{
|
||||||
int bytes=m2.in.payload_length;
|
int bytes=m2.in.payload_length;
|
||||||
|
char did[512];
|
||||||
if ((bytes+1)>=sizeof(mdp.nodeinfo.did)+sizeof(mdp.nodeinfo.name)){
|
char name[512];
|
||||||
WHYF("Result is too large");
|
char uri[512];
|
||||||
continue;
|
bzero(did,32); bzero(name,64);
|
||||||
|
/* Check if reply is validly formatted */
|
||||||
|
if (sscanf((char *)m2.in.payload,"%[^\n]\n%[^\n]\n%400s",
|
||||||
|
did,name,uri)==3) {
|
||||||
|
did[31]=0;
|
||||||
|
bcopy(&did[0],&mdp.nodeinfo.did[0],32);
|
||||||
|
bcopy(&name[0],&mdp.nodeinfo.name[0],64);
|
||||||
|
mdp.nodeinfo.resolve_did=1;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
bcopy(&m2.in.payload[0],&mdp.nodeinfo.did[0],32);
|
|
||||||
bcopy(&m2.in.payload[32],&mdp.nodeinfo.name[0],64);
|
|
||||||
mdp.nodeinfo.did[bytes]=0;
|
|
||||||
mdp.nodeinfo.resolve_did=1;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user