X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/19fb01819f284061bd4390e846410b95b4a27464..3ece7fe0f6601c846a38d4098e438ef720ddd108:/interface.h diff --git a/interface.h b/interface.h index c290d576..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.178 2002-01-21 11:39:58 mcr 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) @@ -79,10 +77,8 @@ extern int uflag; /* Print undecoded NFS handles */ extern int vflag; /* verbose */ extern int xflag; /* print packet in hex */ extern int Xflag; /* print packet in hex/ascii */ - +extern int Aflag; /* print packet only in ascii observing TAB, LF, CR and SPACE as graphical chars */ extern char *espsecret; -extern struct esp_algorithm *espsecret_xform; /* cache of decoded alg. */ -extern char *espsecret_key; extern int packettype; /* as specified by -T */ #define PT_VAT 1 /* Visual Audio Tool */ @@ -135,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)) @@ -183,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); @@ -204,13 +214,19 @@ extern void default_print(const u_char *, u_int); extern void default_print_unaligned(const u_char *, u_int); extern void dvmrp_print(const u_char *, u_int); extern void egp_print(const u_char *, u_int, const u_char *); +extern void pflog_if_print(u_char *, const struct pcap_pkthdr *, + const u_char *); extern void arcnet_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); +extern void ether_print(const u_char *, u_int, u_int); extern void ether_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); +extern u_int token_print(const u_char *, u_int, u_int); 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); @@ -237,8 +253,8 @@ extern void pimv1_print(const u_char *, u_int); extern void cisco_autorp_print(const u_char *, u_int); extern void mobile_print(const u_char *, u_int); extern void pim_print(const u_char *, u_int); -extern void pppoe_print(const u_char *, u_int); -extern void ppp_print(register const u_char *, u_int); +extern u_int pppoe_print(const u_char *, u_int); +extern u_int ppp_print(register const u_char *, u_int); extern void ppp_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); extern void ppp_hdlc_if_print(u_char *, const struct pcap_pkthdr *, const u_char *); @@ -250,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 *, @@ -297,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 *); @@ -304,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 + + + + + + + + + +