]> The Tcpdump Group git mirrors - tcpdump/commitdiff
BXXP support, from Richard Sharpe <[email protected]>.
authorguy <guy>
Sat, 30 Sep 2000 03:35:55 +0000 (03:35 +0000)
committerguy <guy>
Sat, 30 Sep 2000 03:35:55 +0000 (03:35 +0000)
CREDITS
FILES
Makefile.in
interface.h
print-bxxp.c [new file with mode: 0644]
print-tcp.c

diff --git a/CREDITS b/CREDITS
index d7422f43a661654ed024b508b23044a37dc89316..cea3ddbfebd25f64929eba020de3386112ac7667 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -31,6 +31,7 @@ Additional people who have contributed patches:
        Motonori Shindo                 <[email protected]>
        Onno van der Linden             <[email protected]>
        Rafal Maszkowski                <[email protected]>
+       Richard Sharpe                  <[email protected]>
        Rick Jones                      <[email protected]>
 
 The original LBL crew:
diff --git a/FILES b/FILES
index 9608558ce29d0526475602aebd03bc533d030803..76091e5fde31615254db6d4b541d28c910b69659 100644 (file)
--- a/FILES
+++ b/FILES
@@ -91,6 +91,7 @@ print-atalk.c
 print-atm.c
 print-bgp.c
 print-bootp.c
+print-bxxp.c
 print-cdp.c
 print-chdlc.c
 print-cip.c
index f8bfa13ec54b5e60aba3a51bb742520041187e48..c08689b77bfb68cad702e589cc22c6109c463ebd 100644 (file)
@@ -17,7 +17,7 @@
 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 #
-# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.239 2000-09-19 14:57:27 guy Exp $ (LBL)
+# @(#) $Header: /tcpdump/master/tcpdump/Makefile.in,v 1.240 2000-09-30 03:35:55 guy Exp $ (LBL)
 
 #
 # Various configurable paths (remember to edit Makefile.in, not Makefile)
@@ -79,7 +79,7 @@ CSRC =        tcpdump.c \
        print-ipcomp.c print-mobile.c print-l2tp.c print-bgp.c print-rx.c \
        print-lane.c print-cip.c print-pppoe.c print-lcp.c \
        print-smb.c smbutil.c print-ascii.c print-telnet.c print-cnfp.c \
-       print-vrrp.c print-cdp.c print-token.c
+       print-vrrp.c print-cdp.c print-token.c print-bxxp.c
 
 LOCALSRC = @LOCALSRC@
 GENSRC = version.c
index 6358faaf8a0c32873576a2968cadff09e62923c5..3092926d7eaab72fdeb304ad7ac795f2b67ae49d 100644 (file)
@@ -18,7 +18,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.136 2000-09-23 08:03:30 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.137 2000-09-30 03:35:56 guy Exp $ (LBL)
  */
 
 #ifndef tcpdump_interface_h
@@ -209,6 +209,7 @@ extern void atalk_print(const u_char *, u_int);
 extern void atm_if_print(u_char *, const struct pcap_pkthdr *, const u_char *);
 extern void bootp_print(const u_char *, u_int, u_short, u_short);
 extern void bgp_print(const u_char *, int);
+extern void bxxp_print(const u_char *, u_int);
 extern void cnfp_print(const u_char *cp, u_int len, const u_char *bp);
 extern void decnet_print(const u_char *, u_int, u_int);
 extern void default_print(const u_char *, u_int);
diff --git a/print-bxxp.c b/print-bxxp.c
new file mode 100644 (file)
index 0000000..fd99964
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2000, Richard Sharpe
+ *
+ * This software may be distributed either under the terms of the 
+ * BSD-style licence that accompanies tcpdump or under the GNU GPL 
+ * version 2 or later.
+ *
+ * print-bxxp.c
+ *
+ */
+
+#ifndef lint
+static const char rcsid[] =
+  "@(#) $Header: /tcpdump/master/tcpdump/Attic/print-bxxp.c,v 1.1 2000-09-30 03:35:56 guy Exp $";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/param.h>
+#include <sys/time.h>
+
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "extract.h"
+
+/* Check for a string but not go beyond length
+ * Return TRUE on match, FALSE otherwise
+ * 
+ * Looks at the first few chars up to tl1 ...
+ */
+int
+l_strnstart(register const u_char *tstr1, register u_int tl1,
+         register const u_char *str2, register u_int l2)
+{
+
+  if (tl1 > l2)
+    return 0;
+  
+  return (strncmp(tstr1, str2, tl1) == 0 ? 1 : 0);
+
+}
+
+void
+bxxp_print(register const u_char *bp, register u_int length)
+{
+
+  if (l_strnstart("REQ ", 4, bp, length)) { /* A REQuest */
+
+    printf(" BXXP REQ");
+
+  } 
+  else if (l_strnstart("RSP ", 4, bp, length)) {
+
+    printf(" BXXP RSP");
+
+  }
+  else if (l_strnstart("SEQ ", 4, bp, length)) {
+
+    printf(" BXXP SEQ");
+
+  }
+  else if (l_strnstart("END", 4, bp, length)) {
+
+    printf(" BXXP END");
+
+  }
+  else 
+    printf(" BXXP (payload or undecoded)");
+
+}
index 441c44d87918a43d3b2b0ceb5b463a4ebf7d3528..e70ffa35db7a5053ee47ca190b44721b9365ae7d 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.75 2000-09-29 04:58:51 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.76 2000-09-30 03:35:56 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -130,6 +130,7 @@ static struct tcp_seq_hash tcp_seq_hash[TSEQ_HASHSIZE];
 #define BGP_PORT       179
 #endif
 #define NETBIOS_SSN_PORT 139
+#define BXXP_PORT        10288
 #ifndef NFS_PORT
 #define NFS_PORT       2049
 #endif
@@ -651,6 +652,8 @@ tcp_print(register const u_char *bp, register u_int length,
                        bgp_print(bp, length);
                else if (sport == NETBIOS_SSN_PORT || dport == NETBIOS_SSN_PORT)
                        nbt_tcp_print(bp, length);
+               else if (sport == BXXP_PORT || dport == BXXP_PORT)
+                       bxxp_print(bp, length);
        }
        return;
 bad: