X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b58cddb15484ab7abbdd8d12e38a8ab768923f29..3ece7fe0f6601c846a38d4098e438ef720ddd108:/interface.h diff --git a/interface.h b/interface.h index 8242c958..9620ec21 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.184 2002-05-29 10:32:01 guy Exp $ (LBL) + * @(#) $Header: /tcpdump/master/tcpdump/interface.h,v 1.193 2002-08-01 08:52:57 risso Exp $ (LBL) */ #ifndef tcpdump_interface_h @@ -27,8 +27,6 @@ #ifdef HAVE_OS_PROTO_H #include "os-proto.h" #endif -#include -#include #ifndef HAVE___ATTRIBUTE__ #define __attribute__(x) @@ -133,8 +131,16 @@ extern int snaplen; extern const u_char *packetp; extern const u_char *snapend; -/* True if "l" bytes of "var" were captured */ -#define TTEST2(var, l) ((const u_char *)&(var) <= snapend - (l)) +/* + * True if "l" bytes of "var" were captured. + * + * The "snapend - (l) <= snapend" checks to make sure "l" isn't so large + * that "snapend - (l)" underflows. + * + * The check is for <= rather than < because "l" might be 0. + */ +#define TTEST2(var, l) (snapend - (l) <= snapend && \ + (const u_char *)&(var) <= snapend - (l)) /* True if "var" was captured */ #define TTEST(var) TTEST2(var, sizeof(var)) @@ -181,18 +187,24 @@ extern const char *dnnum_string(u_short); #include -extern void ascii_print_with_offset(const u_char *, u_int, u_int); -extern void ascii_print(const u_char *, u_int); -extern void hex_print_with_offset(const u_char *, u_int, u_int); -extern void telnet_print(const u_char *, u_int); -extern void hex_print(const u_char *, u_int); +extern int print_unknown_data(const u_char *,const char *,int); +extern void ascii_print_with_offset(const u_char *, u_int, u_int); +extern void ascii_print(const u_char *, u_int); +extern void hex_print_with_offset(const u_char *, u_int, u_int); +extern void telnet_print(const u_char *, u_int); +extern void hex_print(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 *); +extern int snap_print(const u_char *, u_int, u_int, const u_char *, + const u_char *, u_short *, u_int32_t, u_short, u_int); extern void aarp_print(const u_char *, u_int); extern void arp_print(const u_char *, u_int, u_int); extern void atalk_print(const u_char *, u_int); +extern void atm_print(u_int, u_int, u_int, const u_char *, u_int, u_int); extern void atm_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); +extern void bpfatm_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); +extern void sunatm_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 beep_print(const u_char *, u_int); @@ -214,6 +226,7 @@ extern void token_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void fddi_print(const u_char *, u_int, u_int); extern void fddi_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); +extern void fr_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void ieee802_11_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void gre_print(const u_char *, u_int); @@ -253,6 +266,7 @@ extern int vjc_print(register const char *, register u_int, u_short); extern void raw_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void rip_print(const u_char *, u_int); extern void sl_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); +extern void lane_print(const u_char *, u_int, u_int); extern void lane_if_print(u_char *, const struct pcap_pkthdr *,const u_char *); extern void cip_if_print(u_char *, const struct pcap_pkthdr *,const u_char *); extern void sl_bsdos_if_print(u_char *, const struct pcap_pkthdr *, @@ -300,6 +314,7 @@ extern void ip6_opt_print(const u_char *, int); extern int hbhopt_print(const u_char *); extern int dstopt_print(const u_char *); extern int frag6_print(const u_char *, const u_char *); +extern int mobility_print(const u_char *, const u_char *); extern void icmp6_print(const u_char *, const u_char *); extern void ripng_print(const u_char *, unsigned int); extern int rt6_print(const u_char *, const u_char *); @@ -307,9 +322,20 @@ extern void ospf6_print(const u_char *, u_int); extern void dhcp6_print(const u_char *, u_int, u_int16_t, u_int16_t); #endif /*INET6*/ extern u_short in_cksum(const u_short *, register u_int, int); +extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t); #ifndef HAVE_BPF_DUMP struct bpf_program; extern void bpf_dump(struct bpf_program *, int); #endif + + + + + + + + + +