Deleted Added
full compact
32c32
< __FBSDID("$FreeBSD: head/sys/netinet/libalias/alias_nbt.c 124621 2004-01-17 10:52:21Z phk $");
---
> __FBSDID("$FreeBSD: head/sys/netinet/libalias/alias_nbt.c 127094 2004-03-16 21:30:41Z des $");
58,63c58,63
< struct in_addr oldaddr;
< u_short oldport;
< struct in_addr newaddr;
< u_short newport;
< u_short *uh_sum;
< } NBTArguments;
---
> struct in_addr oldaddr;
> u_short oldport;
> struct in_addr newaddr;
> u_short newport;
> u_short *uh_sum;
> } NBTArguments;
66,73c66,73
< unsigned char type;
< unsigned char flags;
< u_short id;
< struct in_addr source_ip;
< u_short source_port;
< u_short len;
< u_short offset;
< } NbtDataHeader;
---
> unsigned char type;
> unsigned char flags;
> u_short id;
> struct in_addr source_ip;
> u_short source_port;
> u_short len;
> u_short offset;
> } NbtDataHeader;
82,88c82,88
< u_short nametrid;
< u_short dir:1, opcode:4, nmflags:7, rcode:4;
< u_short qdcount;
< u_short ancount;
< u_short nscount;
< u_short arcount;
< } NbtNSHeader;
---
> u_short nametrid;
> u_short dir: 1, opcode:4, nmflags:7, rcode:4;
> u_short qdcount;
> u_short ancount;
> u_short nscount;
> u_short arcount;
> } NbtNSHeader;
99c99,101
< static void PrintRcode( u_char rcode ) {
---
> static void
> PrintRcode(u_char rcode)
> {
103,115c105,117
< printf("\nFormat Error.");
< case SRV_ERR:
< printf("\nSever failure.");
< case IMP_ERR:
< printf("\nUnsupported request error.\n");
< case RFS_ERR:
< printf("\nRefused error.\n");
< case ACT_ERR:
< printf("\nActive error.\n");
< case CFT_ERR:
< printf("\nName in conflict error.\n");
< default:
< printf("\n?%c?=%0x\n", '?', rcode );
---
> printf("\nFormat Error.");
> case SRV_ERR:
> printf("\nSever failure.");
> case IMP_ERR:
> printf("\nUnsupported request error.\n");
> case RFS_ERR:
> printf("\nRefused error.\n");
> case ACT_ERR:
> printf("\nActive error.\n");
> case CFT_ERR:
> printf("\nName in conflict error.\n");
> default:
> printf("\n?%c?=%0x\n", '?', rcode);
118a121
>
123c126,128
< static u_char *AliasHandleName ( u_char *p, char *pmax ) {
---
> static u_char *
> AliasHandleName(u_char * p, char *pmax)
> {
127c132
< int compress;
---
> int compress;
132c137
< return(NULL);
---
> return (NULL);
134c139
< if (*p & 0xc0 ) {
---
> if (*p & 0xc0) {
137,138c142,143
< return(NULL);
< return ((u_char *)p);
---
> return (NULL);
> return ((u_char *) p);
140c145
< while ( ( *p & 0x3f) != 0x00 ) {
---
> while ((*p & 0x3f) != 0x00) {
142c147
< if ( *p == 0x20 )
---
> if (*p == 0x20)
147,148c152,153
< /* Get next length field */
< p = (u_char *)(p + (*p & 0x3f) + 1);
---
> /* Get next length field */
> p = (u_char *) (p + (*p & 0x3f) + 1);
157,158c162,163
< if ( compress == 1 ) {
< c = (u_char )(((((*s & 0x0f) << 4) | (*(s+1) & 0x0f)) - 0x11));
---
> if (compress == 1) {
> c = (u_char) (((((*s & 0x0f) << 4) | (*(s + 1) & 0x0f)) - 0x11));
160,161c165,166
< if (isprint( c ) )
< printf("%c", c );
---
> if (isprint(c))
> printf("%c", c);
163c168
< printf("<0x%02x>", c );
---
> printf("<0x%02x>", c);
165c170
< s +=2;
---
> s += 2;
177c182
< }
---
> }
181c186
< p = NULL;
---
> p = NULL;
183,184c188,189
< p++;
< return ((u_char *)p);
---
> p++;
> return ((u_char *) p);
198,208c203,215
< int AliasHandleUdpNbt(
< struct libalias *la,
< struct ip *pip, /* IP packet to examine/patch */
< struct alias_link *link,
< struct in_addr *alias_address,
< u_short alias_port
< ) {
< struct udphdr * uh;
< NbtDataHeader *ndh;
< u_char *p = NULL;
< char *pmax;
---
> int
> AliasHandleUdpNbt(
> struct libalias *la,
> struct ip *pip, /* IP packet to examine/patch */
> struct alias_link *link,
> struct in_addr *alias_address,
> u_short alias_port
> )
> {
> struct udphdr *uh;
> NbtDataHeader *ndh;
> u_char *p = NULL;
> char *pmax;
210,212c217,219
< /* Calculate data length of UDP packet */
< uh = (struct udphdr *) ((char *) pip + (pip->ip_hl << 2));
< pmax = (char *)uh + ntohs( uh->uh_ulen );
---
> /* Calculate data length of UDP packet */
> uh = (struct udphdr *)((char *)pip + (pip->ip_hl << 2));
> pmax = (char *)uh + ntohs(uh->uh_ulen);
214,216c221,223
< ndh = (NbtDataHeader *)((char *)uh + (sizeof (struct udphdr)));
< if ((char *)(ndh + 1) > pmax)
< return(-1);
---
> ndh = (NbtDataHeader *) ((char *)uh + (sizeof(struct udphdr)));
> if ((char *)(ndh + 1) > pmax)
> return (-1);
218c225
< printf("\nType=%02x,", ndh->type );
---
> printf("\nType=%02x,", ndh->type);
220,236c227,243
< switch ( ndh->type ) {
< case DGM_DIRECT_UNIQ:
< case DGM_DIRECT_GROUP:
< case DGM_BROADCAST:
< p = (u_char *)ndh + 14;
< p = AliasHandleName ( p, pmax ); /* Source Name */
< p = AliasHandleName ( p, pmax ); /* Destination Name */
< break;
< case DGM_ERROR:
< p = (u_char *)ndh + 11;
< break;
< case DGM_QUERY:
< case DGM_POSITIVE_RES:
< case DGM_NEGATIVE_RES:
< p = (u_char *)ndh + 10;
< p = AliasHandleName ( p, pmax ); /* Destination Name */
< break;
---
> switch (ndh->type) {
> case DGM_DIRECT_UNIQ:
> case DGM_DIRECT_GROUP:
> case DGM_BROADCAST:
> p = (u_char *) ndh + 14;
> p = AliasHandleName(p, pmax); /* Source Name */
> p = AliasHandleName(p, pmax); /* Destination Name */
> break;
> case DGM_ERROR:
> p = (u_char *) ndh + 11;
> break;
> case DGM_QUERY:
> case DGM_POSITIVE_RES:
> case DGM_NEGATIVE_RES:
> p = (u_char *) ndh + 10;
> p = AliasHandleName(p, pmax); /* Destination Name */
> break;
238,239c245,246
< if (p == NULL || (char *)p > pmax)
< p = NULL;
---
> if (p == NULL || (char *)p > pmax)
> p = NULL;
241c248
< printf("%s:%d-->", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port) );
---
> printf("%s:%d-->", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port));
244,247c251,255
< if ( uh->uh_sum != 0 ) {
< int acc;
< u_short *sptr;
< acc = ndh->source_port;
---
> if (uh->uh_sum != 0) {
> int acc;
> u_short *sptr;
>
> acc = ndh->source_port;
249c257
< sptr = (u_short *) &(ndh->source_ip);
---
> sptr = (u_short *) & (ndh->source_ip);
257,258c265,266
< ndh->source_ip = *alias_address;
< ndh->source_port = alias_port;
---
> ndh->source_ip = *alias_address;
> ndh->source_port = alias_port;
260c268
< printf("%s:%d\n", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port) );
---
> printf("%s:%d\n", inet_ntoa(ndh->source_ip), ntohs(ndh->source_port));
263c271
< return((p == NULL) ? -1 : 0);
---
> return ((p == NULL) ? -1 : 0);
264a273
>
270,272c279,281
< u_short type; /* The type of Request */
< u_short class; /* The class of Request */
< } NBTNsQuestion;
---
> u_short type; /* The type of Request */
> u_short class; /* The class of Request */
> } NBTNsQuestion;
274c283
< static u_char *
---
> static u_char *
277c286
< NBTNsQuestion *q,
---
> NBTNsQuestion * q,
279c288
< NBTArguments *nbtarg)
---
> NBTArguments * nbtarg)
282c291
< while ( count != 0 ) {
---
> while (count != 0) {
284c293
< q = (NBTNsQuestion *)AliasHandleName((u_char *)q, pmax);
---
> q = (NBTNsQuestion *) AliasHandleName((u_char *) q, pmax);
290d298
<
292,295c300,303
< switch ( ntohs(q->type) ) {
< case QS_TYPE_NB:
< case QS_TYPE_NBSTAT:
< q= q+1;
---
> switch (ntohs(q->type)) {
> case QS_TYPE_NB:
> case QS_TYPE_NBSTAT:
> q = q + 1;
297c305
< default:
---
> default:
299c307
< printf("\nUnknown Type on Question %0x\n", ntohs(q->type) );
---
> printf("\nUnknown Type on Question %0x\n", ntohs(q->type));
307c315
< return ((u_char *)q);
---
> return ((u_char *) q);
319,323c327,331
< u_short type;
< u_short class;
< unsigned int ttl;
< u_short rdlen;
< } NBTNsResource;
---
> u_short type;
> u_short class;
> unsigned int ttl;
> u_short rdlen;
> } NBTNsResource;
327,329c335,337
< u_short g:1, ont:2, resv:13;
< struct in_addr addr;
< } NBTNsRNB;
---
> u_short g: 1 , ont:2, resv:13;
> struct in_addr addr;
> } NBTNsRNB;
331c339
< static u_char *
---
> static u_char *
333c341
< NBTNsResource *q,
---
> NBTNsResource * q,
335c343
< NBTArguments *nbtarg)
---
> NBTArguments * nbtarg)
337c345
< NBTNsRNB *nb;
---
> NBTNsRNB *nb;
341c349
< return(NULL);
---
> return (NULL);
346c354
< nb = (NBTNsRNB *)((u_char *)q + SizeOfNsResource);
---
> nb = (NBTNsRNB *) ((u_char *) q + SizeOfNsResource);
351c359
< printf("->%s, %dbytes] ",inet_ntoa(nbtarg->newaddr ), bcount);
---
> printf("->%s, %dbytes] ", inet_ntoa(nbtarg->newaddr), bcount);
353c361
< while ( nb != NULL && bcount != 0 ) {
---
> while (nb != NULL && bcount != 0) {
359c367
< printf("<%s>", inet_ntoa(nb->addr) );
---
> printf("<%s>", inet_ntoa(nb->addr));
361,364c369,372
< if (!bcmp(&nbtarg->oldaddr,&nb->addr, sizeof(struct in_addr) ) ) {
< if ( *nbtarg->uh_sum != 0 ) {
< int acc;
< u_short *sptr;
---
> if (!bcmp(&nbtarg->oldaddr, &nb->addr, sizeof(struct in_addr))) {
> if (*nbtarg->uh_sum != 0) {
> int acc;
> u_short *sptr;
366,372c374,380
< sptr = (u_short *) &(nb->addr);
< acc = *sptr++;
< acc += *sptr;
< sptr = (u_short *) &(nbtarg->newaddr);
< acc -= *sptr++;
< acc -= *sptr;
< ADJUST_CHECKSUM(acc, *nbtarg->uh_sum);
---
> sptr = (u_short *) & (nb->addr);
> acc = *sptr++;
> acc += *sptr;
> sptr = (u_short *) & (nbtarg->newaddr);
> acc -= *sptr++;
> acc -= *sptr;
> ADJUST_CHECKSUM(acc, *nbtarg->uh_sum);
374d381
<
381c388
< else {
---
> else {
385,386c392,393
< nb=(NBTNsRNB *)((u_char *)nb + SizeOfNsRNB);
< bcount -= SizeOfNsRNB;
---
> nb = (NBTNsRNB *) ((u_char *) nb + SizeOfNsRNB);
> bcount -= SizeOfNsRNB;
391,392c398
<
< return ((u_char *)nb);
---
> return ((u_char *) nb);
397,398c403,404
< struct in_addr addr;
< } NBTNsResourceA;
---
> struct in_addr addr;
> } NBTNsResourceA;
400c406
< static u_char *
---
> static u_char *
402c408
< NBTNsResource *q,
---
> NBTNsResource * q,
404c410
< NBTArguments *nbtarg)
---
> NBTArguments * nbtarg)
406c412
< NBTNsResourceA *a;
---
> NBTNsResourceA *a;
410c416
< return(NULL);
---
> return (NULL);
413c419
< a = (NBTNsResourceA *)( (u_char *)q + sizeof(NBTNsResource) );
---
> a = (NBTNsResourceA *) ((u_char *) q + sizeof(NBTNsResource));
421c427
< printf("->%s]",inet_ntoa(nbtarg->newaddr ));
---
> printf("->%s]", inet_ntoa(nbtarg->newaddr));
423c429
< while ( bcount != 0 ) {
---
> while (bcount != 0) {
425c431
< return(NULL);
---
> return (NULL);
427c433
< printf("..%s", inet_ntoa(a->addr) );
---
> printf("..%s", inet_ntoa(a->addr));
429,432c435,438
< if ( !bcmp(&nbtarg->oldaddr, &a->addr, sizeof(struct in_addr) ) ) {
< if ( *nbtarg->uh_sum != 0 ) {
< int acc;
< u_short *sptr;
---
> if (!bcmp(&nbtarg->oldaddr, &a->addr, sizeof(struct in_addr))) {
> if (*nbtarg->uh_sum != 0) {
> int acc;
> u_short *sptr;
434,440c440,446
< sptr = (u_short *) &(a->addr); /* Old */
< acc = *sptr++;
< acc += *sptr;
< sptr = (u_short *) &nbtarg->newaddr; /* New */
< acc -= *sptr++;
< acc -= *sptr;
< ADJUST_CHECKSUM(acc, *nbtarg->uh_sum);
---
> sptr = (u_short *) & (a->addr); /* Old */
> acc = *sptr++;
> acc += *sptr;
> sptr = (u_short *) & nbtarg->newaddr; /* New */
> acc -= *sptr++;
> acc -= *sptr;
> ADJUST_CHECKSUM(acc, *nbtarg->uh_sum);
442d447
<
445c450
< a++; /*XXXX*/
---
> a++; /* XXXX */
449,450c454,455
< a = NULL;
< return ((u_char *)a);
---
> a = NULL;
> return ((u_char *) a);
454,455c459,460
< u_short opcode:4, flags:8, resv:4;
< } NBTNsResourceNULL;
---
> u_short opcode:4, flags:8, resv:4;
> } NBTNsResourceNULL;
457c462
< static u_char *
---
> static u_char *
459c464
< NBTNsResource *q,
---
> NBTNsResource * q,
461c466
< NBTArguments *nbtarg)
---
> NBTArguments * nbtarg)
463c468
< NBTNsResourceNULL *n;
---
> NBTNsResourceNULL *n;
467c472
< return(NULL);
---
> return (NULL);
470c475
< n = (NBTNsResourceNULL *)( (u_char *)q + sizeof(NBTNsResource) );
---
> n = (NBTNsResourceNULL *) ((u_char *) q + sizeof(NBTNsResource));
476c481
< while ( bcount != 0 ) {
---
> while (bcount != 0) {
487c492
< return ((u_char *)n);
---
> return ((u_char *) n);
490c495
< static u_char *
---
> static u_char *
492c497
< NBTNsResource *q,
---
> NBTNsResource * q,
494c499
< NBTArguments *nbtarg)
---
> NBTArguments * nbtarg)
496c501
< NBTNsResourceNULL *n;
---
> NBTNsResourceNULL *n;
500c505
< return(NULL);
---
> return (NULL);
503c508
< n = (NBTNsResourceNULL *)( (u_char *)q + sizeof(NBTNsResource) );
---
> n = (NBTNsResourceNULL *) ((u_char *) q + sizeof(NBTNsResource));
509c514
< q = (NBTNsResource *)AliasHandleName( (u_char *)n, pmax ); /* XXX */
---
> q = (NBTNsResource *) AliasHandleName((u_char *) n, pmax); /* XXX */
511,512c516,517
< if (q == NULL || (char *)((u_char *)n + bcount) > pmax)
< return(NULL);
---
> if (q == NULL || (char *)((u_char *) n + bcount) > pmax)
> return (NULL);
514c519
< return ((u_char *)n + bcount);
---
> return ((u_char *) n + bcount);
518,519c523,524
< u_short numnames;
< } NBTNsResourceNBSTAT;
---
> u_short numnames;
> } NBTNsResourceNBSTAT;
521c526
< static u_char *
---
> static u_char *
523c528
< NBTNsResource *q,
---
> NBTNsResource * q,
525c530
< NBTArguments *nbtarg)
---
> NBTArguments * nbtarg)
527c532
< NBTNsResourceNBSTAT *n;
---
> NBTNsResourceNBSTAT *n;
531c536
< return(NULL);
---
> return (NULL);
534c539
< n = (NBTNsResourceNBSTAT *)( (u_char *)q + sizeof(NBTNsResource) );
---
> n = (NBTNsResourceNBSTAT *) ((u_char *) q + sizeof(NBTNsResource));
539,540c544,545
< if (q == NULL || (char *)((u_char *)n + bcount) > pmax)
< return(NULL);
---
> if (q == NULL || (char *)((u_char *) n + bcount) > pmax)
> return (NULL);
542c547
< return ((u_char *)n + bcount);
---
> return ((u_char *) n + bcount);
545c550
< static u_char *
---
> static u_char *
548c553
< NBTNsResource *q,
---
> NBTNsResource * q,
551c556
< *nbtarg)
---
> * nbtarg)
553c558
< while ( count != 0 ) {
---
> while (count != 0) {
555c560
< q = (NBTNsResource *)AliasHandleName( (u_char *)q, pmax );
---
> q = (NBTNsResource *) AliasHandleName((u_char *) q, pmax);
560c565
< printf("type=%02x, count=%d\n", ntohs(q->type), count );
---
> printf("type=%02x, count=%d\n", ntohs(q->type), count);
564,600c569,605
< switch ( ntohs(q->type) ) {
< case RR_TYPE_NB:
< q = (NBTNsResource *)AliasHandleResourceNB(
< q,
< pmax,
< nbtarg
< );
< break;
< case RR_TYPE_A:
< q = (NBTNsResource *)AliasHandleResourceA(
< q,
< pmax,
< nbtarg
< );
< break;
< case RR_TYPE_NS:
< q = (NBTNsResource *)AliasHandleResourceNS(
< q,
< pmax,
< nbtarg
< );
< break;
< case RR_TYPE_NULL:
< q = (NBTNsResource *)AliasHandleResourceNULL(
< q,
< pmax,
< nbtarg
< );
< break;
< case RR_TYPE_NBSTAT:
< q = (NBTNsResource *)AliasHandleResourceNBSTAT(
< q,
< pmax,
< nbtarg
< );
< break;
< default:
---
> switch (ntohs(q->type)) {
> case RR_TYPE_NB:
> q = (NBTNsResource *) AliasHandleResourceNB(
> q,
> pmax,
> nbtarg
> );
> break;
> case RR_TYPE_A:
> q = (NBTNsResource *) AliasHandleResourceA(
> q,
> pmax,
> nbtarg
> );
> break;
> case RR_TYPE_NS:
> q = (NBTNsResource *) AliasHandleResourceNS(
> q,
> pmax,
> nbtarg
> );
> break;
> case RR_TYPE_NULL:
> q = (NBTNsResource *) AliasHandleResourceNULL(
> q,
> pmax,
> nbtarg
> );
> break;
> case RR_TYPE_NBSTAT:
> q = (NBTNsResource *) AliasHandleResourceNBSTAT(
> q,
> pmax,
> nbtarg
> );
> break;
> default:
602,605c607,610
< printf(
< "\nUnknown Type of Resource %0x\n",
< ntohs(q->type)
< );
---
> printf(
> "\nUnknown Type of Resource %0x\n",
> ntohs(q->type)
> );
607c612
< break;
---
> break;
612c617
< return ((u_char *)q);
---
> return ((u_char *) q);
615,622c620,628
< int AliasHandleUdpNbtNS(
< struct libalias *la,
< struct ip *pip, /* IP packet to examine/patch */
< struct alias_link *link,
< struct in_addr *alias_address,
< u_short *alias_port,
< struct in_addr *original_address,
< u_short *original_port )
---
> int
> AliasHandleUdpNbtNS(
> struct libalias *la,
> struct ip *pip, /* IP packet to examine/patch */
> struct alias_link *link,
> struct in_addr *alias_address,
> u_short * alias_port,
> struct in_addr *original_address,
> u_short * original_port)
624,628c630,634
< struct udphdr * uh;
< NbtNSHeader * nsh;
< u_char * p;
< char *pmax;
< NBTArguments nbtarg;
---
> struct udphdr *uh;
> NbtNSHeader *nsh;
> u_char *p;
> char *pmax;
> NBTArguments nbtarg;
631,634c637,640
< nbtarg.oldaddr = *alias_address;
< nbtarg.oldport = *alias_port;
< nbtarg.newaddr = *original_address;
< nbtarg.newport = *original_port;
---
> nbtarg.oldaddr = *alias_address;
> nbtarg.oldport = *alias_port;
> nbtarg.newaddr = *original_address;
> nbtarg.newport = *original_port;
636,641c642,647
< /* Calculate data length of UDP packet */
< uh = (struct udphdr *) ((char *) pip + (pip->ip_hl << 2));
< nbtarg.uh_sum = &(uh->uh_sum);
< nsh = (NbtNSHeader *)((char *)uh + (sizeof(struct udphdr)));
< p = (u_char *)(nsh + 1);
< pmax = (char *)uh + ntohs( uh->uh_ulen );
---
> /* Calculate data length of UDP packet */
> uh = (struct udphdr *)((char *)pip + (pip->ip_hl << 2));
> nbtarg.uh_sum = &(uh->uh_sum);
> nsh = (NbtNSHeader *) ((char *)uh + (sizeof(struct udphdr)));
> p = (u_char *) (nsh + 1);
> pmax = (char *)uh + ntohs(uh->uh_ulen);
643,644c649,650
< if ((char *)(nsh + 1) > pmax)
< return(-1);
---
> if ((char *)(nsh + 1) > pmax)
> return (-1);
647,659c653,665
< printf(" [%s] ID=%02x, op=%01x, flag=%02x, rcode=%01x, qd=%04x"
< ", an=%04x, ns=%04x, ar=%04x, [%d]-->",
< nsh->dir ? "Response": "Request",
< nsh->nametrid,
< nsh->opcode,
< nsh->nmflags,
< nsh->rcode,
< ntohs(nsh->qdcount),
< ntohs(nsh->ancount),
< ntohs(nsh->nscount),
< ntohs(nsh->arcount),
< (u_char *)p -(u_char *)nsh
< );
---
> printf(" [%s] ID=%02x, op=%01x, flag=%02x, rcode=%01x, qd=%04x"
> ", an=%04x, ns=%04x, ar=%04x, [%d]-->",
> nsh->dir ? "Response" : "Request",
> nsh->nametrid,
> nsh->opcode,
> nsh->nmflags,
> nsh->rcode,
> ntohs(nsh->qdcount),
> ntohs(nsh->ancount),
> ntohs(nsh->nscount),
> ntohs(nsh->arcount),
> (u_char *) p - (u_char *) nsh
> );
663,669c669,675
< if (ntohs(nsh->qdcount) !=0 ) {
< p = AliasHandleQuestion(
< ntohs(nsh->qdcount),
< (NBTNsQuestion *)p,
< pmax,
< &nbtarg
< );
---
> if (ntohs(nsh->qdcount) != 0) {
> p = AliasHandleQuestion(
> ntohs(nsh->qdcount),
> (NBTNsQuestion *) p,
> pmax,
> &nbtarg
> );
671d676
<
673,679c678,684
< if (ntohs(nsh->ancount) !=0 ) {
< p = AliasHandleResource(
< ntohs(nsh->ancount),
< (NBTNsResource *)p,
< pmax,
< &nbtarg
< );
---
> if (ntohs(nsh->ancount) != 0) {
> p = AliasHandleResource(
> ntohs(nsh->ancount),
> (NBTNsResource *) p,
> pmax,
> &nbtarg
> );
681d685
<
683,689c687,693
< if (ntohs(nsh->nscount) !=0 ) {
< p = AliasHandleResource(
< ntohs(nsh->nscount),
< (NBTNsResource *)p,
< pmax,
< &nbtarg
< );
---
> if (ntohs(nsh->nscount) != 0) {
> p = AliasHandleResource(
> ntohs(nsh->nscount),
> (NBTNsResource *) p,
> pmax,
> &nbtarg
> );
691d694
<
693,699c696,702
< if (ntohs(nsh->arcount) !=0 ) {
< p = AliasHandleResource(
< ntohs(nsh->arcount),
< (NBTNsResource *)p,
< pmax,
< &nbtarg
< );
---
> if (ntohs(nsh->arcount) != 0) {
> p = AliasHandleResource(
> ntohs(nsh->arcount),
> (NBTNsResource *) p,
> pmax,
> &nbtarg
> );
701d703
<
703c705
< PrintRcode(nsh->rcode);
---
> PrintRcode(nsh->rcode);
705c707
< return ((p == NULL) ? -1 : 0);
---
> return ((p == NULL) ? -1 : 0);