]>
The Tcpdump Group git mirrors - tcpdump/blob - print-bxxp.c
2 * Copyright (C) 2000, Richard Sharpe
4 * This software may be distributed either under the terms of the
5 * BSD-style licence that accompanies tcpdump or under the GNU GPL
13 static const char rcsid
[] =
14 "@(#) $Header: /tcpdump/master/tcpdump/Attic/print-bxxp.c,v 1.3 2000-10-05 04:10:01 itojun Exp $";
21 #include <sys/param.h>
32 #include "interface.h"
35 /* Check for a string but not go beyond length
36 * Return TRUE on match, FALSE otherwise
38 * Looks at the first few chars up to tl1 ...
41 int l_strnstart(const u_char
*, u_int
, const u_char
*, u_int
);
44 l_strnstart(register const u_char
*tstr1
, register u_int tl1
,
45 register const u_char
*str2
, register u_int l2
)
51 return (strncmp(tstr1
, str2
, tl1
) == 0 ? 1 : 0);
56 bxxp_print(register const u_char
*bp
, register u_int length
)
59 if (l_strnstart("REQ ", 4, bp
, length
)) { /* A REQuest */
64 else if (l_strnstart("RSP ", 4, bp
, length
)) {
69 else if (l_strnstart("SEQ ", 4, bp
, length
)) {
74 else if (l_strnstart("END", 4, bp
, length
)) {
80 printf(" BXXP (payload or undecoded)");