X-Git-Url: https://git.tcpdump.org/libpcap/blobdiff_plain/182ff86d03a88e6d1b330b4055002daec8743baf..131f5a8b1cb158788f41b5726a5f58e62ae74823:/pcap.c diff --git a/pcap.c b/pcap.c index 3974c1fc..d26f77e6 100644 --- 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