]> The Tcpdump Group git mirrors - tcpdump/blobdiff - netdissect.h
When checking for pcap_if_t, add $V_INCLS to CFLAGS, so we look at the
[tcpdump] / netdissect.h
index 7533cfad3c5d29f0ea619a4cbdd31c455c2dd5be..e471ace44b4603b2b67ca8e12efc10af61aaa717 100644 (file)
@@ -21,7 +21,7 @@
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.3 2004-04-02 06:52:06 guy Exp $ (LBL)
+ * @(#) $Header: /tcpdump/master/tcpdump/netdissect.h,v 1.8 2004-04-30 16:42:14 mcr Exp $ (LBL)
  */
 
 #ifndef netdissect_h
@@ -67,6 +67,11 @@ struct tok {
        const char *s;          /* string */
 };
 
+#define TOKBUFSIZE 128
+extern const char *tok2strbuf(const struct tok *, const char *, int,
+                             char *buf, size_t bufsize);
+
+/* tok2str is deprecated */
 extern const char *tok2str(const struct tok *, const char *, int);
 extern char *bittok2str(const struct tok *, const char *, int);
 
@@ -104,6 +109,9 @@ struct netdissect_options {
   const char *ndo_dltname;
 
   char *ndo_espsecret;
+  struct sa_list *ndo_sa_list_head;  /* used by print-esp.c */
+  struct sa_list *ndo_sa_default;
+
   char *ndo_tcpmd5secret;      /* TCP-MD5 secret key */
 
   struct esp_algorithm *ndo_espsecret_xform;   /* cache of decoded  */
@@ -133,6 +141,10 @@ struct netdissect_options {
 
   int  (*ndo_printf)(netdissect_options *,
                     const char *fmt, ...);
+  void (*ndo_error)(netdissect_options *,
+                   const char *fmt, ...);
+  void (*ndo_warning)(netdissect_options *,
+                     const char *fmt, ...);
 };
 
 #define PT_VAT         1       /* Visual Audio Tool */
@@ -189,7 +201,8 @@ struct netdissect_options {
 /* Bail if "var" was not captured */
 #define ND_TCHECK(var) ND_TCHECK2(var, sizeof(var))
 
-#define ND_PRINT(fmt, args...) (*ndo->ndo_printf)(ndo, fmt, ##args)
+#define ND_PRINT(STUFF) (*ndo->ndo_printf)STUFF
+#define ND_DEFAULTPRINT(ap, length) (*ndo->ndo_default_print)(ndo, ap, length)
 
 #if 0  
 extern void ts_print(netdissect_options *ipdo,
@@ -204,11 +217,6 @@ extern const char *tok2str(const struct tok *, const char *, int);
 extern void wrapup(int);
 
 #if 0
-extern void error(netdissect_options *, const char *, ...)
-     __attribute__((noreturn, format (printf, 2, 3)));
-extern void warning(netdissect_options *, const char *, ...)
-     __attribute__ ((format (printf, 2, 3)));
-
 extern char *read_infile(netdissect_options *, char *);
 extern char *copy_argv(netdissect_options *, char **);
 #endif
@@ -230,6 +238,10 @@ extern const char *dnnum_string(netdissect_options *, u_short);
 
 
 extern void eap_print(netdissect_options *,const u_char *, u_int);    
+extern int esp_print(netdissect_options *,
+                    register const u_char *bp, register const u_char *bp2,
+                    int *nhdr, int *padlen);
+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 *,
@@ -245,7 +257,6 @@ extern int llc_print(netdissect_options *,
                     const u_char *, u_int, u_int, const u_char *,
                     const u_char *, u_short *);
 extern void aarp_print(netdissect_options *,const u_char *, u_int);
-extern void arp_print(netdissect_options *,const u_char *, u_int, u_int);
 extern void atalk_print(netdissect_options *,const u_char *, u_int);
 extern void atm_if_print(u_char *,const struct pcap_pkthdr *, const u_char *);
 extern void bootp_print(netdissect_options *,const u_char *,
@@ -356,9 +367,6 @@ extern void udp_print(netdissect_options *,const u_char *, u_int,
 extern void wb_print(netdissect_options *,const void *, u_int);
 extern int ah_print(netdissect_options *,register const u_char *,
                    register const u_char *);
-extern int esp_print(netdissect_options *,
-                    register const u_char *bp, register const u_char *bp2,
-                    int *nhdr, int *padlen);
 extern void esp_print_decodesecret(netdissect_options *ndo);
 extern void isakmp_print(netdissect_options *,const u_char *,
                         u_int, const u_char *);
@@ -412,4 +420,3 @@ extern u_short in_cksum(const u_short *,
 #endif
 
 #endif  /* netdissect_h */
-\