summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/print-netbios.c
diff options
context:
space:
mode:
authorbitblt <bitblt@cvs.openbsd.org>1996-12-12 16:23:06 +0000
committerbitblt <bitblt@cvs.openbsd.org>1996-12-12 16:23:06 +0000
commit60909394a7629154d32d662f864cc3dd5c52ee64 (patch)
tree0c1671db4b72cc060eed235adfc04454f88e0163 /usr.sbin/tcpdump/print-netbios.c
parent2da72263fb9852691068f6bd411c3026a8fd34d4 (diff)
*** empty log message ***
Diffstat (limited to 'usr.sbin/tcpdump/print-netbios.c')
-rw-r--r--usr.sbin/tcpdump/print-netbios.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/usr.sbin/tcpdump/print-netbios.c b/usr.sbin/tcpdump/print-netbios.c
index f384170c801..ec7f219e1bc 100644
--- a/usr.sbin/tcpdump/print-netbios.c
+++ b/usr.sbin/tcpdump/print-netbios.c
@@ -1,5 +1,3 @@
-/* $OpenBSD: print-netbios.c,v 1.1 1996/11/12 07:54:55 mickey Exp $ */
-
/*
* Copyright (c) 1994, 1995, 1996
* The Regents of the University of California. All rights reserved.
@@ -19,25 +17,19 @@
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/*
+ *
* Format and print NETBIOS packets.
* Contributed by Brad Parker (brad@fcr.com).
*/
-#ifndef lint
-static char rcsid[] =
- "@(#)Header: print-netbios.c,v 1.5 96/06/03 02:53:36 leres Exp";
-#endif
-#ifdef __STDC__
-#include <stdlib.h>
+#ifndef lint
+static const char rcsid[] =
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-netbios.c,v 1.2 1996/12/12 16:22:32 bitblt Exp $";
#endif
-#include <stdio.h>
#include <sys/param.h>
-#include <sys/types.h>
#include <sys/socket.h>
+
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
@@ -47,6 +39,10 @@ static char rcsid[] =
#include <netinet/tcp.h>
#include <netinet/tcpip.h>
+#ifdef __STDC__
+#include <stdlib.h>
+#endif
+#include <stdio.h>
#include <string.h>
#include "interface.h"
@@ -58,10 +54,8 @@ static char rcsid[] =
* Print NETBIOS packets.
*/
void
-netbios_print(const u_char *p, int length)
+netbios_print(struct p8022Hdr *nb, u_int length)
{
- struct p8022Hdr *nb = (struct p8022Hdr *)p;
-
if (length < p8022Size) {
(void)printf(" truncated-netbios %d", length);
return;
@@ -85,12 +79,12 @@ netbios_print(const u_char *p, int length)
#ifdef never
(void)printf("%s.%d > ",
- ipxaddr_string(EXTRACT_LONG(ipx->srcNet), ipx->srcNode),
- EXTRACT_SHORT(ipx->srcSkt));
+ ipxaddr_string(EXTRACT_32BITS(ipx->srcNet), ipx->srcNode),
+ EXTRACT_16BITS(ipx->srcSkt));
(void)printf("%s.%d:",
- ipxaddr_string(EXTRACT_LONG(ipx->dstNet), ipx->dstNode),
- EXTRACT_SHORT(ipx->dstSkt));
+ ipxaddr_string(EXTRACT_32BITS(ipx->dstNet), ipx->dstNode),
+ EXTRACT_16BITS(ipx->dstSkt));
if ((u_char *)(ipx + 1) > snapend) {
printf(" [|ipx]");
@@ -98,7 +92,7 @@ netbios_print(const u_char *p, int length)
}
/* take length from ipx header */
- length = EXTRACT_SHORT(&ipx->length);
+ length = EXTRACT_16BITS(&ipx->length);
ipx_decode(ipx, (u_char *)ipx + ipxSize, length - ipxSize);
#endif