* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.231 2004-06-06 19:20:05 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.232 2004-07-21 22:00:10 guy Exp $ (LBL)
*/
#ifndef tcpdump_interface_h
#include <pcap.h>
extern int print_unknown_data(const u_char *, const char *,int);
-extern void ascii_print_with_offset(const u_char *, const u_char *, u_int, u_int);
-extern void ascii_print(const u_char *, const u_char *, u_int);
-extern void hex_print_with_offset(const u_char *, const u_char *, u_int, u_int);
+extern void ascii_print_with_offset(const char *, const u_char *, u_int, u_int);
+extern void ascii_print(const char *, const u_char *, u_int);
+extern void hex_print_with_offset(const char *, const u_char *, u_int, u_int);
extern void telnet_print(const u_char *, u_int);
-extern void hex_print(const u_char *, const u_char *, u_int);
+extern void hex_print(const char *, const u_char *, u_int);
extern int ether_encap_print(u_short, const u_char *, u_int, u_int, u_short *);
extern int llc_print(const u_char *, u_int, u_int, const u_char *,
const u_char *, u_short *);
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.9 2004-07-16 14:06:00 hannes Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.10 2004-07-21 22:00:10 guy Exp $ (LBL)
*/
#ifndef netdissect_h
extern char *strdup (const char *str);
#endif
+#ifndef HAVE_STRSEP
+extern char *strsep(char **, const char *);
+#endif
+
struct tok {
int v; /* value */
const char *s; /* string */
#define HTONS(x) (x) = htons(x)
#endif
-/* True if "l" bytes of "var" were captured */
-#define ND_TTEST2(var, l) ((u_char *)&(var) <= ndo->ndo_snapend - (l))
+/*
+ * True if "l" bytes of "var" were captured.
+ *
+ * The "ndo->ndo_snapend - (l) <= ndo->ndo_snapend" checks to make sure
+ * "l" isn't so large that "ndo->ndo_snapend - (l)" underflows.
+ *
+ * The check is for <= rather than < because "l" might be 0.
+ */
+#define ND_TTEST2(var, l) (ndo->ndo_snapend - (l) <= ndo->ndo_snapend && \
+ (const u_char *)&(var) <= ndo->ndo_snapend - (l))
/* True if "var" was captured */
#define ND_TTEST(var) ND_TTEST2(var, sizeof(var))
extern void arp_print(netdissect_options *,const u_char *, u_int, u_int);
#if 0
-extern void ascii_print_with_offset(netdissect_options *, const u_char *,
+extern void ascii_print_with_offset(netdissect_options *, const char *,
u_int, u_int);
-extern void ascii_print(netdissect_options *,const u_char *, u_int);
-extern void hex_print_with_offset(netdissect_options *,const u_char *,
+extern void ascii_print(netdissect_options *,const char *, u_int);
+extern void hex_print_with_offset(netdissect_options *,const char *,
u_int, u_int);
extern void telnet_print(netdissect_options *,const u_char *, u_int);
-extern void hex_print(netdissect_options *,const u_char *, u_int);
+extern void hex_print(netdissect_options *,const char *, u_int);
extern int ether_encap_print(netdissect_options *,u_short, const u_char *,
u_int, u_int, u_short *);
extern int llc_print(netdissect_options *,
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.15 2003-12-29 11:05:10 hannes Exp $";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-ascii.c,v 1.16 2004-07-21 22:00:10 guy Exp $";
#endif
#include <tcpdump-stdinc.h>
#include <stdio.h>
(HEXDUMP_HEXSTUFF_PER_SHORT * HEXDUMP_SHORTS_PER_LINE)
void
-ascii_print_with_offset(register const u_char *ident, register const u_char *cp, register u_int length,
+ascii_print_with_offset(register const char *ident, register const u_char *cp, register u_int length,
register u_int oset)
{
register u_int i;
}
void
-ascii_print(register const u_char *ident, register const u_char *cp, register u_int length)
+ascii_print(register const char *ident, register const u_char *cp, register u_int length)
{
ascii_print_with_offset(ident, cp, length, 0);
}
* telnet_print() wants this. It is essentially default_print_unaligned()
*/
void
-hex_print_with_offset(register const u_char *ident, register const u_char *cp, register u_int length,
+hex_print_with_offset(register const char *ident, register const u_char *cp, register u_int length,
register u_int oset)
{
register u_int i, s;
* just for completeness
*/
void
-hex_print(register const u_char *ident, register const u_char *cp, register u_int length)
+hex_print(register const char *ident, register const u_char *cp, register u_int length)
{
hex_print_with_offset(ident, cp, length, 0);
}
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.54 2004-07-21 21:42:32 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-esp.c,v 1.55 2004-07-21 22:00:11 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
#include "ip6.h"
#endif
-#include "interface.h"
#include "netdissect.h"
#include "addrtoname.h"
#include "extract.h"