]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap.c
Have routines to set various internal debugging flags.
[libpcap] / pcap.c
diff --git a/pcap.c b/pcap.c
index 3974c1fc19f8b95645c5cc98c783fee3a319731a..d26f77e638e77f4ab491d5676cb91e1b6834b07a 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -2231,3 +2231,51 @@ pcap_lib_version(void)
        return (pcap_version_string);
 }
 #endif
+
+#ifdef YYDEBUG
+/*
+ * Set the internal "debug printout" flag for the filter expression parser.
+ * The code to print that stuff is present only if YYDEBUG is defined, so
+ * the flag, and the routine to set it, are defined only if YYDEBUG is
+ * defined.
+ *
+ * This is intended for libpcap developers, not for general use.
+ * If you want to set these in a program, you'll have to declare this
+ * routine yourself, with the appropriate DLL import attribute on Windows;
+ * it's not declared in any header file, and won't be declared in any
+ * header file provided by libpcap.
+ */
+PCAP_API void pcap_set_parser_debug(int value);
+
+PCAP_API_DEF void
+pcap_set_parser_debug(int value)
+{
+       extern int pcap_debug;
+
+       pcap_debug = value;
+}
+#endif
+
+#ifdef BDEBUG
+/*
+ * Set the internal "debug printout" flag for the filter expression optimizer.
+ * The code to print that stuff is present only if BDEBUG is defined, so
+ * the flag, and the routine to set it, are defined only if BDEBUG is
+ * defined.
+ *
+ * This is intended for libpcap developers, not for general use.
+ * If you want to set these in a program, you'll have to declare this
+ * routine yourself, with the appropriate DLL import attribute on Windows;
+ * it's not declared in any header file, and won't be declared in any
+ * header file provided by libpcap.
+ */
+PCAP_API void pcap_set_optimizer_debug(int value);
+
+PCAP_API_DEF void
+pcap_set_optimizer_debug(int value)
+{
+       extern int pcap_optimizer_debug;
+
+       pcap_optimizer_debug = value;
+}
+#endif