Removed some debugging, improved MDP PING client output.

This commit is contained in:
gardners 2012-03-28 13:26:14 +10:30
parent 3a0a62b780
commit 942605d247
2 changed files with 7 additions and 7 deletions

View File

@ -387,11 +387,6 @@ int app_mdp_ping(int argc,char **argv,struct command_line_option *o)
} else {
if (mdp.packetTypeAndFlags!=MDP_ADDRLIST)
return WHY("MDP Server returned wrong frame type.");
fprintf(stderr,"Server returned list of %d local addresses.\n",
mdp.addrlist.frame_sid_count);
int i;
for(i=0;i<mdp.addrlist.frame_sid_count;i++)
fprintf(stderr," %s\n",overlay_render_sid(mdp.addrlist.sids[i]));
}
/* Bind to MDP socket and await confirmation */
@ -422,7 +417,8 @@ int app_mdp_ping(int argc,char **argv,struct command_line_option *o)
unsigned int sequence_number=firstSeq;
/* Get SID that we want to ping.
XXX - allow lookup of SID prefixes */
XXX - allow lookup of SID prefixes and telephone numbers
(that would require MDP lookup of phone numbers, which doesn't yet occur) */
int i;
unsigned char ping_sid[SID_SIZE];
if (strcasecmp(sid,"broadcast")) {
@ -431,6 +427,11 @@ int app_mdp_ping(int argc,char **argv,struct command_line_option *o)
for(i=0;i<SID_SIZE;i++) ping_sid[i]=0xff;
}
/* XXX Eventually we should try to resolve SID to phone number and vice versa */
printf("MDP PING %s (%s): 12 data bytes\n",
overlay_render_sid(ping_sid),
overlay_render_sid(ping_sid));
while(1) {
/* Now send the ping packets */
mdp.packetTypeAndFlags=MDP_TX|MDP_NOCRYPT|MDP_NOSIGN;

View File

@ -742,7 +742,6 @@ int overlay_mdp_send(overlay_mdp_frame *mdp,int flags,int timeout_ms)
int ttl=-1;
if (!overlay_mdp_recv(mdp,&ttl)) {
/* If all is well, examine result and return error code provided */
WHY("Got a reply from server");
if ((mdp->packetTypeAndFlags&MDP_TYPE_MASK)==MDP_ERROR)
return mdp->error.error;
else