]> The Tcpdump Group git mirrors - tcpdump/blobdiff - interface.h
Declare vxlan_print() and otv_print() in interface.h, and fix its definition.
[tcpdump] / interface.h
index b8acc7d9b5cb78459835d6e09aa9e2f921c324f7..5703f3d5c63be9cd2322e9cad34ecd5e868cdfe5 100644 (file)
 #include "os-proto.h"
 #endif
 
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif
-
-/*
- * Used to declare a structure unaligned, so that the C compiler,
- * if necessary, generates code that doesn't assume alignment.
- * This is required because there is no guarantee that the packet
- * data we get from libpcap/WinPcap is properly aligned.
- *
- * This assumes that, for all compilers that support __attribute__:
- *
- *     1) they support __attribute__((packed));
- *
- *     2) for all instruction set architectures requiring strict
- *        alignment, declaring a structure with that attribute
- *        causes the compiler to generate code that handles
- *        misaligned 2-byte, 4-byte, and 8-byte integral
- *        quantities.
- *
- * It does not (yet) handle compilers where you can get the compiler
- * to generate code of that sort by some other means.
- *
- * This is required in order to, for example, keep the compiler from
- * generating, for
- *
- *     if (bp->bp_htype == 1 && bp->bp_hlen == 6 && bp->bp_op == BOOTPREQUEST) {
- *
- * in print-bootp.c, code that loads the first 4-byte word of a
- * "struct bootp", masking out the bp_hops field, and comparing the result
- * against 0x01010600.
- *
- * Note: this also requires that padding be put into the structure,
- * at least for compilers where it's implemented as __attribute__((packed)).
- */
-#define UNALIGNED      __attribute__((packed))
-
 /* snprintf et al */
 
 #include <stdarg.h>
@@ -107,6 +70,10 @@ extern char *strsep(char **, const char *);
 #define PT_CNFP                7       /* Cisco NetFlow protocol */
 #define PT_TFTP                8       /* trivial file transfer protocol */
 #define PT_AODV                9       /* Ad-hoc On-demand Distance Vector Protocol */
+#define PT_CARP                10      /* Common Address Redundancy Protocol */
+#define PT_RADIUS      11      /* RADIUS authentication Protocol */
+#define PT_ZMTP1       12      /* ZeroMQ Message Transport Protocol 1.0 */
+#define PT_VXLAN       13      /* Virtual eXtensible Local Area Network */
 
 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
@@ -199,7 +166,6 @@ extern void hex_and_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 hex_print(const char *, const u_char *, u_int);
 extern void telnet_print(const u_char *, u_int);
-extern int ethertype_print(u_short, const u_char *, u_int, u_int);
 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, u_int);
@@ -222,9 +188,6 @@ extern u_int enc_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int pflog_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int arcnet_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int arcnet_linux_if_print(const struct pcap_pkthdr *, const u_char *);
-extern void ether_print(const u_char *, u_int, u_int,
-    void (*)(const u_char *), const u_char *);
-extern u_int ether_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int token_print(const u_char *, u_int, u_int);
 extern u_int token_if_print(const struct pcap_pkthdr *, const u_char *);
 extern void fddi_print(const u_char *, u_int, u_int);
@@ -255,6 +218,7 @@ extern void msdp_print(const unsigned char *, u_int);
 extern void nfsreply_print(const u_char *, u_int, const u_char *);
 extern void nfsreq_print(const u_char *, u_int, const u_char *);
 extern void ns_print(const u_char *, u_int, int);
+extern const u_char * ns_nprint (register const u_char *, register const u_char *);
 extern void ntp_print(const u_char *, u_int);
 extern u_int null_if_print(const struct pcap_pkthdr *, const u_char *);
 extern void ospf_print(const u_char *, u_int, const u_char *);
@@ -264,6 +228,7 @@ extern void cisco_autorp_print(const u_char *, u_int);
 extern void rsvp_print(const u_char *, u_int);
 extern void ldp_print(const u_char *, u_int);
 extern void lldp_print(const u_char *, u_int);
+extern void rpki_rtr_print(const u_char *, u_int);
 extern void lmp_print(const u_char *, u_int);
 extern void lspping_print(const u_char *, u_int);
 extern void lwapp_control_print(const u_char *, u_int, int);
@@ -330,6 +295,7 @@ extern const char *nt_errstr(u_int32_t);
 extern void print_data(const unsigned char *, int);
 extern void l2tp_print(const u_char *, u_int);
 extern void vrrp_print(const u_char *, u_int, int);
+extern void carp_print(const u_char *, u_int, int);
 extern void slow_print(const u_char *, u_int);
 extern void sflow_print(const u_char *, u_int);
 extern void mpcp_print(const u_char *, u_int);
@@ -347,6 +313,7 @@ extern void forces_print(const u_char *, u_int);
 extern void mpls_print(const u_char *, u_int);
 extern void mpls_lsp_ping_print(const u_char *, u_int);
 extern void zephyr_print(const u_char *, int);
+extern void zmtp1_print(const u_char *, u_int);
 extern void hsrp_print(const u_char *, u_int);
 extern void bfd_print(const u_char *, u_int, u_int);
 extern void sip_print(const u_char *, u_int);
@@ -354,11 +321,12 @@ extern void syslog_print(const u_char *, u_int);
 extern u_int bt_if_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int usb_linux_48_byte_print(const struct pcap_pkthdr *, const u_char *);
 extern u_int usb_linux_64_byte_print(const struct pcap_pkthdr *, const u_char *);
+extern void vxlan_print(const u_char *, u_int);
+extern void otv_print(const u_char *, u_int);
+
 
 #ifdef INET6
-extern void ip6_print(const u_char *, u_int);
 extern void ip6_opt_print(const u_char *, int);
-extern int nextproto6_cksum(const struct ip6_hdr *, const u_short *, u_int, u_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 *);
@@ -367,9 +335,15 @@ extern void ripng_print(const u_char *, unsigned int);
 extern int rt6_print(const u_char *, const u_char *);
 extern void ospf6_print(const u_char *, u_int);
 extern void dhcp6_print(const u_char *, u_int);
+extern void babel_print(const u_char *, u_int);
 extern int mask62plen(const u_char *);
 #endif /*INET6*/
-extern u_short in_cksum(const u_short *, register u_int, int);
+
+struct cksum_vec {
+       const u_int8_t  *ptr;
+       int             len;
+};
+extern u_int16_t in_cksum(const struct cksum_vec *, int);
 extern u_int16_t in_cksum_shouldbe(u_int16_t, u_int16_t);
 
 #ifndef HAVE_BPF_DUMP
@@ -418,7 +392,7 @@ extern netdissect_options *gndo;
 #define Cflag_count gndo->ndo_Cflag_count
 #define Gflag_count gndo->ndo_Gflag_count
 #define Gflag_time gndo->ndo_Gflag_time 
-#define hflag gndo->ndo_hflag
+#define Hflag gndo->ndo_Hflag
 #define snaplen     gndo->ndo_snaplen
 #define snapend     gndo->ndo_snapend