Deleted Added
full compact
23c23
< * $FreeBSD: head/contrib/tcpdump/print-atalk.c 66644 2000-10-05 02:49:49Z kris $
---
> * $FreeBSD: head/contrib/tcpdump/print-atalk.c 75118 2001-04-03 07:50:46Z fenner $
28c28
< "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.51 1999/11/21 09:36:48 fenner Exp $ (LBL)";
---
> "@(#) $Header: /tcpdump/master/tcpdump/print-atalk.c,v 1.64 2000/10/30 06:22:14 guy Exp $ (LBL)";
39,44d38
< #if __STDC__
< struct mbuf;
< struct rtentry;
< #endif
< #include <net/if.h>
<
46,52d39
< #include <netinet/in_systm.h>
< #include <netinet/ip.h>
< #include <netinet/ip_var.h>
< #include <net/ethernet.h>
< #include <netinet/udp.h>
< #include <netinet/udp_var.h>
< #include <netinet/tcp.h>
56a44
> #include <netdb.h> /* for MAXHOSTNAMELEN on some platforms */
76,82c64,70
< u_short htype, ptype;
< u_char halen, palen;
< u_short op;
< u_char hsaddr[6];
< u_char psaddr[4];
< u_char hdaddr[6];
< u_char pdaddr[4];
---
> u_int16_t htype, ptype;
> u_int8_t halen, palen;
> u_int16_t op;
> u_int8_t hsaddr[6];
> u_int8_t psaddr[4];
> u_int8_t hdaddr[6];
> u_int8_t pdaddr[4];
101c89
< * Print AppleTalk Datagram Delivery Protocol packets.
---
> * Print AppleTalk LLAP packets.
104c92
< atalk_print(register const u_char *bp, u_int length)
---
> llap_print(register const u_char *bp, u_int length)
167a156,182
> /*
> * Print EtherTalk/TokenTalk packets (or FDDITalk, or whatever it's called
> * when it runs over FDDI; yes, I've seen FDDI captures with AppleTalk
> * packets in them).
> */
> void
> atalk_print(register const u_char *bp, u_int length)
> {
> register const struct atDDP *dp;
> u_short snet;
>
> if (length < ddpSize) {
> (void)printf(" [|ddp %d]", length);
> return;
> }
> dp = (const struct atDDP *)bp;
> snet = EXTRACT_16BITS(&dp->srcNet);
> printf("%s.%s", ataddr_string(snet, dp->srcNode),
> ddpskt_string(dp->srcSkt));
> printf(" > %s.%s:",
> ataddr_string(EXTRACT_16BITS(&dp->dstNet), dp->dstNode),
> ddpskt_string(dp->dstSkt));
> bp += ddpSize;
> length -= ddpSize;
> ddp_print(bp, length, dp->type, snet, dp->srcNode, dp->srcSkt);
> }
>
197,198c212,214
< (void)printf("len %d op %d htype %d ptype %#x halen %d palen %d",
< length, ap->op, ap->htype, ap->ptype, ap->halen, ap->palen );
---
> (void)printf("len %u op %u htype %u ptype %#x halen %u palen %u",
> length, ntohs(ap->op), ntohs(ap->htype), ntohs(ap->ptype),
> ap->halen, ap->palen);
200a217,219
> /*
> * Print AppleTalk Datagram Delivery Protocol packets.
> */
514c533
< int i1, i2;
---
> int i1, i2, i3;
519c538,539
< if (sscanf(line, "%d.%d %s", &i1, &i2, nambuf) == 3)
---
> if (sscanf(line, "%d.%d.%d %256s", &i1, &i2, &i3,
> nambuf) == 4)
521,522c541,543
< i2 |= (i1 << 8);
< else if (sscanf(line, "%d %s", &i1, nambuf) == 2)
---
> i3 |= ((i1 << 8) | i2) << 8;
> else if (sscanf(line, "%d.%d %256s", &i1, &i2,
> nambuf) == 3)
524c545
< i2 = (i1 << 8) | 255;
---
> i3 = (((i1 << 8) | i2) << 8) | 255;
548c569,570
< (void)snprintf(nambuf, sizeof(nambuf), "%s.%d", tp2->name, athost);
---
> (void)snprintf(nambuf, sizeof(nambuf), "%s.%d",
> tp2->name, athost);
556c578,579
< (void)sprintf(nambuf, "%d.%d", atnet, athost);
---
> (void)snprintf(nambuf, sizeof(nambuf), "%d.%d.%d",
> atnet >> 8, atnet & 0xff, athost);
558c581,582
< (void)sprintf(nambuf, "%d", atnet);
---
> (void)snprintf(nambuf, sizeof(nambuf), "%d.%d", atnet >> 8,
> atnet & 0xff);
578c602
< (void)sprintf(buf, "%d", skt);
---
> (void)snprintf(buf, sizeof(buf), "%d", skt);