mirror of
https://github.com/asterisk/asterisk.git
synced 2026-01-07 10:31:16 +00:00
Cleanup dundi-parser.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4053 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -22,9 +22,10 @@
|
|||||||
#include <asterisk/dundi.h>
|
#include <asterisk/dundi.h>
|
||||||
#include "dundi-parser.h"
|
#include "dundi-parser.h"
|
||||||
#include <asterisk/dundi.h>
|
#include <asterisk/dundi.h>
|
||||||
|
|
||||||
static void internaloutput(const char *str)
|
static void internaloutput(const char *str)
|
||||||
{
|
{
|
||||||
printf(str);
|
fputs(str, stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void internalerror(const char *str)
|
static void internalerror(const char *str)
|
||||||
@@ -91,6 +92,7 @@ int dundi_str_short_to_eid(dundi_eid *eid, char *s)
|
|||||||
eid->eid[x] = eid_int[x];
|
eid->eid[x] = eid_int[x];
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int dundi_eid_zero(dundi_eid *eid)
|
int dundi_eid_zero(dundi_eid *eid)
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
@@ -223,7 +225,6 @@ static void dump_byte(char *output, int maxlen, void *value, int len)
|
|||||||
|
|
||||||
static char *proto2str(int proto, char *buf, int bufsiz)
|
static char *proto2str(int proto, char *buf, int bufsiz)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch(proto) {
|
switch(proto) {
|
||||||
case DUNDI_PROTO_NONE:
|
case DUNDI_PROTO_NONE:
|
||||||
strncpy(buf, "None", bufsiz - 1);
|
strncpy(buf, "None", bufsiz - 1);
|
||||||
@@ -464,14 +465,14 @@ void dundi_showframe(struct dundi_hdr *fhi, int rx, struct sockaddr_in *sin, int
|
|||||||
}
|
}
|
||||||
snprintf(subclass2, (int)sizeof(subclass2), "%02x", fhi->cmdflags);
|
snprintf(subclass2, (int)sizeof(subclass2), "%02x", fhi->cmdflags);
|
||||||
subclass = subclass2;
|
subclass = subclass2;
|
||||||
snprintf(tmp, (int)sizeof(tmp),
|
snprintf(tmp, (int)sizeof(tmp),
|
||||||
"%s-Frame Retry[%s] -- OSeqno: %3.3d ISeqno: %3.3d Type: %s (%s)\n",
|
"%s-Frame Retry[%s] -- OSeqno: %3.3d ISeqno: %3.3d Type: %s (%s)\n",
|
||||||
pref[rx],
|
pref[rx],
|
||||||
retries, fhi->oseqno, fhi->iseqno, class, fhi->cmdresp & 0x40 ? "Response" : "Command");
|
retries, fhi->oseqno, fhi->iseqno, class, fhi->cmdresp & 0x40 ? "Response" : "Command");
|
||||||
outputf(tmp);
|
outputf(tmp);
|
||||||
snprintf(tmp, (int)sizeof(tmp),
|
snprintf(tmp, (int)sizeof(tmp),
|
||||||
"%s Flags: %s STrans: %5.5d DTrans: %5.5d [%s:%d]%s\n", (rx > 1) ? " " : "",
|
"%s Flags: %s STrans: %5.5d DTrans: %5.5d [%s:%d]%s\n", (rx > 1) ? " " : "",
|
||||||
subclass, ntohs(fhi->strans) & ~DUNDI_FLAG_RESERVED, ntohs(fhi->dtrans) & ~DUNDI_FLAG_RETRANS,
|
subclass, ntohs(fhi->strans) & ~DUNDI_FLAG_RESERVED, ntohs(fhi->dtrans) & ~DUNDI_FLAG_RETRANS,
|
||||||
ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), ntohs(sin->sin_port),
|
ast_inet_ntoa(iabuf, sizeof(iabuf), sin->sin_addr), ntohs(sin->sin_port),
|
||||||
fhi->cmdresp & 0x80 ? " (Final)" : "");
|
fhi->cmdresp & 0x80 ? " (Final)" : "");
|
||||||
outputf(tmp);
|
outputf(tmp);
|
||||||
|
|||||||
Reference in New Issue
Block a user