s/DEBUG/LIBALIAS_DEBUG/, since DEBUG is defined in LINT and
not supported for kernel build.
This commit is contained in:
parent
f305634ad3
commit
3eab4ba5cc
@ -601,7 +601,7 @@ GetNewPort(struct libalias *la, struct alias_link *lnk, int alias_port_param)
|
||||
lnk->alias_port = (u_short) alias_port_param;
|
||||
return (0);
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/GetNewPort(): ");
|
||||
fprintf(stderr, "input parameter error\n");
|
||||
#endif
|
||||
@ -649,7 +649,7 @@ GetNewPort(struct libalias *la, struct alias_link *lnk, int alias_port_param)
|
||||
port_net = htons(port_sys);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/GetnewPort(): ");
|
||||
fprintf(stderr, "could not find free port\n");
|
||||
#endif
|
||||
@ -670,7 +670,7 @@ GetSocket(struct libalias *la, u_short port_net, int *sockfd, int link_type)
|
||||
else if (link_type == LINK_UDP)
|
||||
sock = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/GetSocket(): ");
|
||||
fprintf(stderr, "incorrect link type\n");
|
||||
#endif
|
||||
@ -678,7 +678,7 @@ GetSocket(struct libalias *la, u_short port_net, int *sockfd, int link_type)
|
||||
}
|
||||
|
||||
if (sock < 0) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/GetSocket(): ");
|
||||
fprintf(stderr, "socket() error %d\n", *sockfd);
|
||||
#endif
|
||||
@ -788,7 +788,7 @@ FindNewPortGroup(struct libalias *la,
|
||||
port_sys += ALIAS_PORT_BASE;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/FindNewPortGroup(): ");
|
||||
fprintf(stderr, "could not find free port(s)\n");
|
||||
#endif
|
||||
@ -1034,7 +1034,7 @@ AddLink(struct libalias *la, struct in_addr src_addr,
|
||||
aux_tcp->fwhole = -1;
|
||||
lnk->data.tcp = aux_tcp;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/AddLink: ");
|
||||
fprintf(stderr, " cannot allocate auxiliary TCP data\n");
|
||||
#endif
|
||||
@ -1067,7 +1067,7 @@ AddLink(struct libalias *la, struct in_addr src_addr,
|
||||
start_point = StartPointIn(alias_addr, lnk->alias_port, link_type);
|
||||
LIST_INSERT_HEAD(&la->linkTableIn[start_point], lnk, list_in);
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/AddLink(): ");
|
||||
fprintf(stderr, "malloc() call failed.\n");
|
||||
#endif
|
||||
@ -2096,7 +2096,7 @@ SetExpire(struct alias_link *lnk, int expire)
|
||||
} else if (expire > 0) {
|
||||
lnk->expire_time = expire;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/SetExpire(): ");
|
||||
fprintf(stderr, "error in expire parameter\n");
|
||||
#endif
|
||||
@ -2194,7 +2194,7 @@ HouseKeeping(struct libalias *la)
|
||||
for (i = 0; i < n; i++)
|
||||
IncrementalCleanup(la);
|
||||
} else if (n < 0) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAlias/HouseKeeping(): ");
|
||||
fprintf(stderr, "something unexpected in time values\n");
|
||||
#endif
|
||||
@ -2265,7 +2265,7 @@ LibAliasRedirectPort(struct libalias *la, struct in_addr src_addr, u_short src_p
|
||||
link_type = LINK_TCP;
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "PacketAliasRedirectPort(): ");
|
||||
fprintf(stderr, "only TCP and UDP protocols allowed\n");
|
||||
#endif
|
||||
@ -2279,7 +2279,7 @@ LibAliasRedirectPort(struct libalias *la, struct in_addr src_addr, u_short src_p
|
||||
if (lnk != NULL) {
|
||||
lnk->flags |= LINK_PERMANENT;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
else {
|
||||
fprintf(stderr, "PacketAliasRedirectPort(): "
|
||||
"call to AddLink() failed\n");
|
||||
@ -2338,7 +2338,7 @@ LibAliasRedirectProto(struct libalias *la, struct in_addr src_addr,
|
||||
if (lnk != NULL) {
|
||||
lnk->flags |= LINK_PERMANENT;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
else {
|
||||
fprintf(stderr, "PacketAliasRedirectProto(): "
|
||||
"call to AddLink() failed\n");
|
||||
@ -2362,7 +2362,7 @@ LibAliasRedirectAddr(struct libalias *la, struct in_addr src_addr,
|
||||
if (lnk != NULL) {
|
||||
lnk->flags |= LINK_PERMANENT;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
else {
|
||||
fprintf(stderr, "PacketAliasRedirectAddr(): "
|
||||
"call to AddLink() failed\n");
|
||||
@ -2711,7 +2711,7 @@ PunchFWHole(struct alias_link *lnk)
|
||||
if (fwhole == la->fireWallActiveNum) {
|
||||
/* No rule point empty - we can't punch more holes. */
|
||||
la->fireWallActiveNum = la->fireWallBaseNum;
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr, "libalias: Unable to create firewall hole!\n");
|
||||
#endif
|
||||
return;
|
||||
|
@ -679,7 +679,7 @@ NewFtpMessage(struct libalias *la, struct ip *pip,
|
||||
tc->th_sum = 0;
|
||||
tc->th_sum = TcpChecksum(pip);
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/HandleFtpOut: Cannot allocate FTP data port\n");
|
||||
#endif
|
||||
|
@ -107,7 +107,7 @@ typedef struct {
|
||||
#define CFT_ERR 0x7
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
static void
|
||||
PrintRcode(u_char rcode)
|
||||
{
|
||||
@ -167,13 +167,13 @@ AliasHandleName(u_char * p, char *pmax)
|
||||
p = NULL;
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf(":");
|
||||
#endif
|
||||
while (s < p) {
|
||||
if (compress == 1) {
|
||||
c = (u_char) (((((*s & 0x0f) << 4) | (*(s + 1) & 0x0f)) - 0x11));
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
if (isprint(c))
|
||||
printf("%c", c);
|
||||
else
|
||||
@ -181,13 +181,13 @@ AliasHandleName(u_char * p, char *pmax)
|
||||
#endif
|
||||
s += 2;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("%c", *s);
|
||||
#endif
|
||||
s++;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf(":");
|
||||
fflush(stdout);
|
||||
#endif
|
||||
@ -236,7 +236,7 @@ AliasHandleUdpNbt(
|
||||
ndh = (NbtDataHeader *)udp_next(uh);
|
||||
if ((char *)(ndh + 1) > pmax)
|
||||
return (-1);
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("\nType=%02x,", ndh->type);
|
||||
#endif
|
||||
switch (ndh->type) {
|
||||
@ -259,7 +259,7 @@ AliasHandleUdpNbt(
|
||||
}
|
||||
if (p == NULL || (char *)p > pmax)
|
||||
p = NULL;
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("%s:%d-->", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port));
|
||||
#endif
|
||||
/* Doing an IP address and Port number Translation */
|
||||
@ -279,7 +279,7 @@ AliasHandleUdpNbt(
|
||||
}
|
||||
ndh->source_ip = *alias_address;
|
||||
ndh->source_port = alias_port;
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("%s:%d\n", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port));
|
||||
fflush(stdout);
|
||||
#endif
|
||||
@ -320,7 +320,7 @@ AliasHandleQuestion(
|
||||
q = q + 1;
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("\nUnknown Type on Question %0x\n", ntohs(q->type));
|
||||
#endif
|
||||
break;
|
||||
@ -371,7 +371,7 @@ AliasHandleResourceNB(
|
||||
nb = (NBTNsRNB *) ((u_char *) q + SizeOfNsResource);
|
||||
|
||||
/* Processing all in_addr array */
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("NB rec[%s", inet_ntoa(nbtarg->oldaddr));
|
||||
printf("->%s, %dbytes] ", inet_ntoa(nbtarg->newaddr), bcount);
|
||||
#endif
|
||||
@ -380,7 +380,7 @@ AliasHandleResourceNB(
|
||||
nb = NULL;
|
||||
break;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("<%s>", inet_ntoa(nb->addr));
|
||||
#endif
|
||||
if (!bcmp(&nbtarg->oldaddr, &nb->addr, sizeof(struct in_addr))) {
|
||||
@ -397,11 +397,11 @@ AliasHandleResourceNB(
|
||||
ADJUST_CHECKSUM(acc, *nbtarg->uh_sum);
|
||||
}
|
||||
nb->addr = nbtarg->newaddr;
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("O");
|
||||
#endif
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
else {
|
||||
printf(".");
|
||||
}
|
||||
@ -439,14 +439,14 @@ AliasHandleResourceA(
|
||||
bcount = ntohs(q->rdlen);
|
||||
|
||||
/* Processing all in_addr array */
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("Arec [%s", inet_ntoa(nbtarg->oldaddr));
|
||||
printf("->%s]", inet_ntoa(nbtarg->newaddr));
|
||||
#endif
|
||||
while (bcount != 0) {
|
||||
if (a == NULL || (char *)(a + 1) > pmax)
|
||||
return (NULL);
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("..%s", inet_ntoa(a->addr));
|
||||
#endif
|
||||
if (!bcmp(&nbtarg->oldaddr, &a->addr, sizeof(struct in_addr))) {
|
||||
@ -584,7 +584,7 @@ AliasHandleResource(
|
||||
|
||||
if (q == NULL || (char *)(q + 1) > pmax)
|
||||
break;
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf("type=%02x, count=%d\n", ntohs(q->type), count);
|
||||
#endif
|
||||
|
||||
@ -626,7 +626,7 @@ AliasHandleResource(
|
||||
);
|
||||
break;
|
||||
default:
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf(
|
||||
"\nUnknown Type of Resource %0x\n",
|
||||
ntohs(q->type)
|
||||
@ -675,7 +675,7 @@ AliasHandleUdpNbtNS(
|
||||
if ((char *)(nsh + 1) > pmax)
|
||||
return (-1);
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
printf(" [%s] ID=%02x, op=%01x, flag=%02x, rcode=%01x, qd=%04x"
|
||||
", an=%04x, ns=%04x, ar=%04x, [%d]-->",
|
||||
nsh->dir ? "Response" : "Request",
|
||||
@ -727,7 +727,7 @@ AliasHandleUdpNbtNS(
|
||||
&nbtarg
|
||||
);
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
PrintRcode(nsh->rcode);
|
||||
#endif
|
||||
return ((p == NULL) ? -1 : 0);
|
||||
|
@ -483,7 +483,7 @@ ProxyEncodeIpHeader(struct ip *pip,
|
||||
#define OPTION_LEN_INT32 2
|
||||
u_char option[OPTION_LEN_BYTES];
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stdout, " ip cksum 1 = %x\n", (u_int) IpChecksum(pip));
|
||||
fprintf(stdout, "tcp cksum 1 = %x\n", (u_int) TcpChecksum(pip));
|
||||
#endif
|
||||
@ -539,7 +539,7 @@ ProxyEncodeIpHeader(struct ip *pip,
|
||||
#undef OPTION_LEN_BYTES
|
||||
#undef OPTION_LEN_INT16
|
||||
#undef OPTION_LEN_INT32
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stdout, " ip cksum 2 = %x\n", (u_int) IpChecksum(pip));
|
||||
fprintf(stdout, "tcp cksum 2 = %x\n", (u_int) TcpChecksum(pip));
|
||||
#endif
|
||||
|
@ -82,7 +82,7 @@
|
||||
* Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
/* #define DEBUG 1 */
|
||||
/* #define LIBALIAS_DEBUG 1 */
|
||||
|
||||
/* Message types that need translating */
|
||||
#define REG_MSG 0x00000001
|
||||
@ -250,7 +250,7 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk)
|
||||
} else if (ntohs(tc->th_sport) == la->skinnyPort) {
|
||||
direction = ServerToClient;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Invalid port number, not a Skinny packet\n");
|
||||
#endif
|
||||
@ -271,7 +271,7 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk)
|
||||
t = len;
|
||||
|
||||
if (t > orig_len || t > dlen) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Not a skinny packet, invalid length \n");
|
||||
#endif
|
||||
@ -282,14 +282,14 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk)
|
||||
struct RegisterMessage *reg_mesg;
|
||||
|
||||
if (len < (int)sizeof(struct RegisterMessage)) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Not a skinny packet, bad registration message\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
reg_mesg = (struct RegisterMessage *)&sd->msgId;
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Received a register message");
|
||||
#endif
|
||||
@ -300,13 +300,13 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk)
|
||||
struct IpPortMessage *port_mesg;
|
||||
|
||||
if (len < (int)sizeof(struct IpPortMessage)) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Not a skinny packet, port message\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Received ipport message\n");
|
||||
#endif
|
||||
@ -318,13 +318,13 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk)
|
||||
struct OpenReceiveChannelAck *opnrcvchn_ack;
|
||||
|
||||
if (len < (int)sizeof(struct OpenReceiveChannelAck)) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Not a skinny packet, packet,OpnRcvChnAckMsg\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Received open rcv channel msg\n");
|
||||
#endif
|
||||
@ -336,13 +336,13 @@ AliasHandleSkinny(struct libalias *la, struct ip *pip, struct alias_link *lnk)
|
||||
struct StartMediaTransmission *startmedia_tx;
|
||||
|
||||
if (len < (int)sizeof(struct StartMediaTransmission)) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Not a skinny packet,StartMediaTx Message\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/Skinny: Received start media trans msg\n");
|
||||
#endif
|
||||
|
@ -240,7 +240,7 @@ alias_rtsp_out(struct libalias *la, struct ip *pip,
|
||||
sport, 0,
|
||||
RTSP_PORT_GROUP,
|
||||
IPPROTO_UDP, 1))) {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/RTSP: Cannot find contiguous RTSP data ports\n");
|
||||
#endif
|
||||
@ -266,7 +266,7 @@ alias_rtsp_out(struct libalias *la, struct ip *pip,
|
||||
PunchFWHole(rtsp_lnk);
|
||||
#endif
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
#ifdef LIBALIAS_DEBUG
|
||||
fprintf(stderr,
|
||||
"PacketAlias/RTSP: Cannot allocate RTSP data ports\n");
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user