From: guy Date: Sat, 30 Sep 2000 03:35:55 +0000 (+0000) Subject: BXXP support, from Richard Sharpe . X-Git-Tag: tcpdump-3.5.1~143 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/674302314e631cf5d461ced8d99a3054567e4f2f BXXP support, from Richard Sharpe . --- diff --git a/CREDITS b/CREDITS index d7422f43..cea3ddbf 100644 --- a/CREDITS +++ b/CREDITS @@ -31,6 +31,7 @@ Additional people who have contributed patches: Motonori Shindo Onno van der Linden Rafal Maszkowski + Richard Sharpe Rick Jones The original LBL crew: diff --git a/FILES b/FILES index 9608558c..76091e5f 100644 --- 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 diff --git a/Makefile.in b/Makefile.in index f8bfa13e..c08689b7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/interface.h b/interface.h index 6358faaf..3092926d 100644 --- a/interface.h +++ b/interface.h @@ -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 index 00000000..fd99964c --- /dev/null +++ b/print-bxxp.c @@ -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 +#include + +#ifdef HAVE_MEMORY_H +#include +#endif +#include +#include +#include +#include + +#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)"); + +} diff --git a/print-tcp.c b/print-tcp.c index 441c44d8..e70ffa35 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -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: