2022-05-08 22:09:04 +03:00
/*
2002-01-30 09:08:46 +03:00
Unix SMB / CIFS implementation .
2000-02-03 07:47:50 +03:00
SMB debug stuff
Copyright ( C ) Andrew Tridgell 1992 - 1998
Copyright ( C ) John H Terpstra 1996 - 1998
Copyright ( C ) Luke Kenneth Casson Leighton 1996 - 1998
Copyright ( C ) Paul Ashton 1998
2010-03-14 16:06:45 +03:00
2000-02-03 07:47:50 +03:00
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
2007-07-09 23:25:36 +04:00
the Free Software Foundation ; either version 3 of the License , or
2000-02-03 07:47:50 +03:00
( at your option ) any later version .
2010-03-14 16:06:45 +03:00
2000-02-03 07:47:50 +03:00
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
2010-03-14 16:06:45 +03:00
2000-02-03 07:47:50 +03:00
You should have received a copy of the GNU General Public License
2007-07-10 04:52:41 +04:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2000-02-03 07:47:50 +03:00
*/
2015-01-08 12:24:36 +03:00
# ifndef _SAMBA_DEBUG_H
# define _SAMBA_DEBUG_H
2000-02-03 07:47:50 +03:00
2022-05-08 22:06:13 +03:00
# include <stdint.h>
2014-09-08 10:32:46 +04:00
# include <stdbool.h>
# include <stddef.h>
2015-07-09 09:16:56 +03:00
# include <stdarg.h>
2014-09-08 10:32:46 +04:00
# include "attr.h"
2000-02-03 07:47:50 +03:00
/* -------------------------------------------------------------------------- **
* Debugging code . See also debug . c
*/
2010-10-24 21:44:21 +04:00
/* the maximum debug level to compile into the code. This assumes a good
optimising compiler that can remove unused code
for embedded or low - memory systems set this to a value like 2 to get
only important messages . This gives * much * smaller binaries
*/
# ifndef MAX_DEBUG_LEVEL
# define MAX_DEBUG_LEVEL 1000
# endif
2014-12-16 13:30:53 +03:00
bool dbgtext_va ( const char * , va_list ap ) PRINTF_ATTRIBUTE ( 1 , 0 ) ;
2007-10-19 04:40:25 +04:00
bool dbgtext ( const char * , . . . ) PRINTF_ATTRIBUTE ( 1 , 2 ) ;
2008-10-11 22:44:19 +04:00
bool dbghdrclass ( int level , int cls , const char * location , const char * func ) ;
2019-04-26 14:40:58 +03:00
bool dbgsetclass ( int level , int cls ) ;
2000-02-03 07:47:50 +03:00
2001-02-12 19:18:02 +03:00
/*
* Define all new debug classes here . A class is represented by an entry in
2023-04-13 14:29:32 +03:00
* the DEBUGLEVEL_CLASS array . Index zero of this array is equivalent to the
2001-02-12 19:18:02 +03:00
* old DEBUGLEVEL . Any source file that does NOT add the following lines :
*
* # undef DBGC_CLASS
* # define DBGC_CLASS DBGC_ < your class name here >
*
* at the start of the file ( after # include " includes.h " ) will default to
2023-08-01 06:47:18 +03:00
* using index zero , so it will behave just like it always has .
2001-02-12 19:18:02 +03:00
*/
2002-07-15 14:35:28 +04:00
# define DBGC_ALL 0 /* index equivalent to DEBUGLEVEL */
# define DBGC_TDB 1
# define DBGC_PRINTDRIVERS 2
# define DBGC_LANMAN 3
# define DBGC_SMB 4
# define DBGC_RPC_PARSE 5
# define DBGC_RPC_SRV 6
# define DBGC_RPC_CLI 7
# define DBGC_PASSDB 8
2002-09-25 19:19:00 +04:00
# define DBGC_SAM 9
# define DBGC_AUTH 10
# define DBGC_WINBIND 11
# define DBGC_VFS 12
2003-05-12 22:12:31 +04:00
# define DBGC_IDMAP 13
2004-01-15 11:49:30 +03:00
# define DBGC_QUOTA 14
2004-04-30 18:28:38 +04:00
# define DBGC_ACLS 15
2005-07-13 18:44:12 +04:00
# define DBGC_LOCKING 16
# define DBGC_MSDFS 17
2006-03-23 02:49:09 +03:00
# define DBGC_DMAPI 18
2007-09-29 03:03:08 +04:00
# define DBGC_REGISTRY 19
2013-02-07 18:26:37 +04:00
# define DBGC_SCAVENGER 20
2013-01-14 04:13:47 +04:00
# define DBGC_DNS 21
2013-07-09 15:55:44 +04:00
# define DBGC_LDB 22
2015-06-28 21:44:37 +03:00
# define DBGC_TEVENT 23
2017-02-20 01:39:17 +03:00
# define DBGC_AUTH_AUDIT 24
2017-03-06 06:16:51 +03:00
# define DBGC_AUTH_AUDIT_JSON 25
2017-05-15 23:32:03 +03:00
# define DBGC_KERBEROS 26
2017-09-06 07:37:34 +03:00
# define DBGC_DRS_REPL 27
2018-03-21 22:01:05 +03:00
# define DBGC_SMB2 28
2018-03-21 22:52:49 +03:00
# define DBGC_SMB2_CREDITS 29
2018-04-04 02:56:30 +03:00
# define DBGC_DSDB_AUDIT 30
# define DBGC_DSDB_AUDIT_JSON 31
# define DBGC_DSDB_PWD_AUDIT 32
# define DBGC_DSDB_PWD_AUDIT_JSON 33
# define DBGC_DSDB_TXN_AUDIT 34
# define DBGC_DSDB_TXN_AUDIT_JSON 35
2018-04-23 03:24:34 +03:00
# define DBGC_DSDB_GROUP_AUDIT 36
# define DBGC_DSDB_GROUP_AUDIT_JSON 37
2017-05-15 23:32:03 +03:00
2002-07-15 14:35:28 +04:00
/* So you can define DBGC_CLASS before including debug.h */
# ifndef DBGC_CLASS
2001-02-12 19:18:02 +03:00
# define DBGC_CLASS 0 /* override as shown above */
2002-07-15 14:35:28 +04:00
# endif
2001-02-12 19:18:02 +03:00
2018-11-07 16:14:05 +03:00
# define DEBUGLEVEL debuglevel_get()
# define debuglevel_get() debuglevel_get_class(DBGC_ALL)
# define debuglevel_set(lvl) debuglevel_set_class(DBGC_ALL, (lvl))
2001-02-12 19:18:02 +03:00
/* Debugging macros
*
* DEBUGLVL ( )
2011-02-24 08:14:03 +03:00
* If the ' file specific ' debug class level > = level OR the system - wide
2023-04-13 14:29:32 +03:00
* DEBUGLEVEL ( synonym for DEBUGLEVEL_CLASS [ DBGC_ALL ] ) > = level then
2011-02-24 08:14:03 +03:00
* generate a header using the default macros for file , line , and
2001-02-12 19:18:02 +03:00
* function name . Returns True if the debug level was < = DEBUGLEVEL .
*
2011-02-24 08:14:03 +03:00
* Example : if ( DEBUGLVL ( 2 ) ) dbgtext ( " Some text. \n " ) ;
2001-02-12 19:18:02 +03:00
*
* DEBUG ( )
2011-02-24 08:14:03 +03:00
* If the ' file specific ' debug class level > = level OR the system - wide
2023-04-13 14:29:32 +03:00
* DEBUGLEVEL ( synonym for DEBUGLEVEL_CLASS [ DBGC_ALL ] ) > = level then
2011-02-24 08:14:03 +03:00
* generate a header using the default macros for file , line , and
* function name . Each call to DEBUG ( ) generates a new header * unless * the
2001-02-12 19:18:02 +03:00
* previous debug output was unterminated ( i . e . no ' \n ' ) .
* See debug . c : dbghdr ( ) for more info .
*
2001-06-01 16:04:44 +04:00
* Example : DEBUG ( 2 , ( " Some text and a value %d. \n " , value ) ) ;
2001-02-12 19:18:02 +03:00
*
* DEBUGC ( )
2011-02-24 08:14:03 +03:00
* If the ' macro specified ' debug class level > = level OR the system - wide
2023-04-13 14:29:32 +03:00
* DEBUGLEVEL ( synonym for DEBUGLEVEL_CLASS [ DBGC_ALL ] ) > = level then
2011-02-24 08:14:03 +03:00
* generate a header using the default macros for file , line , and
* function name . Each call to DEBUG ( ) generates a new header * unless * the
2001-02-12 19:18:02 +03:00
* previous debug output was unterminated ( i . e . no ' \n ' ) .
* See debug . c : dbghdr ( ) for more info .
*
2001-06-01 16:04:44 +04:00
* Example : DEBUGC ( DBGC_TDB , 2 , ( " Some text and a value %d. \n " , value ) ) ;
2001-02-12 19:18:02 +03:00
*
2022-07-12 11:36:30 +03:00
* DEBUGADD ( ) , DEBUGADDC ( )
2001-02-12 19:18:02 +03:00
* Same as DEBUG ( ) and DEBUGC ( ) except the text is appended to the previous
2011-02-24 08:14:03 +03:00
* DEBUG ( ) , DEBUGC ( ) , DEBUGADD ( ) , DEBUGADDC ( ) with out another interviening
2001-02-12 19:18:02 +03:00
* header .
*
2001-06-01 16:04:44 +04:00
* Example : DEBUGADD ( 2 , ( " Some text and a value %d. \n " , value ) ) ;
* DEBUGADDC ( DBGC_TDB , 2 , ( " Some text and a value %d. \n " , value ) ) ;
2001-02-12 19:18:02 +03:00
*
2022-07-12 11:36:30 +03:00
* Note : If the debug class has not be redefined ( see above ) then the optimizer
2001-02-12 19:18:02 +03:00
* will remove the extra conditional test .
2000-02-03 07:47:50 +03:00
*/
2001-02-12 19:18:02 +03:00
2007-12-27 19:41:19 +03:00
/*
* From talloc . c :
*/
/* these macros gain us a few percent of speed on gcc */
# if (__GNUC__ >= 3)
/* the strange !! is to ensure that __builtin_expect() takes either 0 or 1
as its first argument */
2008-06-27 17:51:35 +04:00
# ifndef likely
2007-12-27 19:41:19 +03:00
# define likely(x) __builtin_expect(!!(x), 1)
2008-06-27 17:51:35 +04:00
# endif
# ifndef unlikely
2007-12-27 19:41:19 +03:00
# define unlikely(x) __builtin_expect(!!(x), 0)
2008-06-27 17:51:35 +04:00
# endif
2007-12-27 19:41:19 +03:00
# else
2008-06-27 17:51:35 +04:00
# ifndef likely
2007-12-28 02:12:14 +03:00
# define likely(x) (x)
2008-06-27 17:51:35 +04:00
# endif
# ifndef unlikely
2007-12-28 02:12:14 +03:00
# define unlikely(x) (x)
2007-12-27 19:41:19 +03:00
# endif
2008-06-27 17:51:35 +04:00
# endif
2007-12-27 19:41:19 +03:00
2018-11-07 16:14:05 +03:00
int debuglevel_get_class ( size_t idx ) ;
void debuglevel_set_class ( size_t idx , int level ) ;
2008-01-23 02:30:28 +03:00
# define CHECK_DEBUGLVL( level ) \
2001-12-06 10:17:25 +03:00
( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2018-11-07 16:14:05 +03:00
unlikely ( debuglevel_get_class ( DBGC_CLASS ) > = ( level ) ) )
2008-01-23 02:30:28 +03:00
2013-01-18 12:44:02 +04:00
# define CHECK_DEBUGLVLC( dbgc_class, level ) \
( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2018-11-07 16:14:05 +03:00
unlikely ( debuglevel_get_class ( dbgc_class ) > = ( level ) ) )
2013-01-18 12:44:02 +04:00
2008-01-23 02:30:28 +03:00
# define DEBUGLVL( level ) \
( CHECK_DEBUGLVL ( level ) \
2011-02-24 08:14:03 +03:00
& & dbghdrclass ( level , DBGC_CLASS , __location__ , __FUNCTION__ ) )
2000-02-03 07:47:50 +03:00
2013-01-18 12:44:02 +04:00
# define DEBUGLVLC( dbgc_class, level ) \
( CHECK_DEBUGLVLC ( dbgc_class , level ) \
& & dbghdrclass ( level , dbgc_class , __location__ , __FUNCTION__ ) )
2001-02-12 19:18:02 +03:00
2000-02-03 07:47:50 +03:00
# define DEBUG( level, body ) \
2001-12-06 10:17:25 +03:00
( void ) ( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2018-11-07 16:14:05 +03:00
unlikely ( debuglevel_get_class ( DBGC_CLASS ) > = ( level ) ) \
2011-02-24 08:14:03 +03:00
& & ( dbghdrclass ( level , DBGC_CLASS , __location__ , __FUNCTION__ ) ) \
2001-02-12 19:18:02 +03:00
& & ( dbgtext body ) )
2022-06-19 16:40:37 +03:00
/**
* @ brief DEBUGLF is same as DEBUG with explicit location and function arguments
*
2023-08-01 06:47:18 +03:00
* To be used when passing location and function of a caller appearing earlier in
2022-06-19 16:40:37 +03:00
* the call stack instead of some helper function .
*
* @ code
* DEBUGLF ( 2 , ( " Some text. \n " ) , " foo.c:1 " , " foo " ) ;
* DEBUGLF ( 5 , ( " Some text. \n " ) , location , function ) ;
* @ endcode
*
* @ return void .
*/
# define DEBUGLF( level, body, location, function ) \
( void ) ( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
unlikely ( debuglevel_get_class ( DBGC_CLASS ) > = ( level ) ) \
& & ( dbghdrclass ( level , DBGC_CLASS , location , function ) ) \
& & ( dbgtext body ) )
2001-02-12 19:18:02 +03:00
# define DEBUGC( dbgc_class, level, body ) \
2001-12-06 10:17:25 +03:00
( void ) ( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2018-11-07 16:14:05 +03:00
unlikely ( debuglevel_get_class ( dbgc_class ) > = ( level ) ) \
2019-04-26 14:21:15 +03:00
& & ( dbghdrclass ( level , dbgc_class , __location__ , __FUNCTION__ ) ) \
2000-02-03 07:47:50 +03:00
& & ( dbgtext body ) )
# define DEBUGADD( level, body ) \
2001-12-06 10:17:25 +03:00
( void ) ( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2019-04-26 14:40:58 +03:00
unlikely ( debuglevel_get_class ( DBGC_CLASS ) > = ( level ) ) \
& & ( dbgsetclass ( level , DBGC_CLASS ) ) \
2001-02-12 19:18:02 +03:00
& & ( dbgtext body ) )
2000-02-03 07:47:50 +03:00
2001-02-12 19:18:02 +03:00
# define DEBUGADDC( dbgc_class, level, body ) \
2001-12-06 10:17:25 +03:00
( void ) ( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2019-04-26 14:40:58 +03:00
unlikely ( ( debuglevel_get_class ( dbgc_class ) > = ( level ) ) ) \
& & ( dbgsetclass ( level , dbgc_class ) ) \
2001-02-12 19:18:02 +03:00
& & ( dbgtext body ) )
2000-02-03 07:47:50 +03:00
2006-04-04 04:27:50 +04:00
/* Print a separator to the debug log. */
# define DEBUGSEP(level)\
DEBUG ( ( level ) , ( " =============================================================== \n " ) )
2015-10-21 21:07:35 +03:00
/* Prefix messages with the function name */
# define DBG_PREFIX(level, body ) \
( void ) ( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2018-11-07 16:14:05 +03:00
unlikely ( debuglevel_get_class ( DBGC_CLASS ) > = ( level ) ) \
2015-10-21 21:07:35 +03:00
& & ( dbghdrclass ( level , DBGC_CLASS , __location__ , __func__ ) ) \
& & ( dbgtext ( " %s: " , __func__ ) ) \
& & ( dbgtext body ) )
2018-03-21 22:40:50 +03:00
/* Prefix messages with the function name - class specific */
# define DBGC_PREFIX(dbgc_class, level, body ) \
( void ) ( ( ( level ) < = MAX_DEBUG_LEVEL ) & & \
2018-11-07 16:14:05 +03:00
unlikely ( debuglevel_get_class ( dbgc_class ) > = ( level ) ) \
2018-03-21 22:40:50 +03:00
& & ( dbghdrclass ( level , dbgc_class , __location__ , __func__ ) ) \
& & ( dbgtext ( " %s: " , __func__ ) ) \
& & ( dbgtext body ) )
2022-05-26 06:55:12 +03:00
# ifdef DEVELOPER
# define DBG_DEV(...) \
( void ) ( ( debug_developer_enabled ( ) ) \
& & ( dbgtext ( " %s:DEV:%d: " , __func__ , getpid ( ) ) ) \
& & ( dbgtext ( __VA_ARGS__ ) ) )
# else
# define DBG_DEV(...) /* DBG_DEV was here */
# endif
2015-06-06 00:45:22 +03:00
/*
* Debug levels matching RFC 3164
*/
2023-09-18 14:48:06 +03:00
# define DBGLVL_STARTUP_NOTICE -1 /* startup notice */
2015-06-06 00:45:22 +03:00
# define DBGLVL_ERR 0 /* error conditions */
# define DBGLVL_WARNING 1 /* warning conditions */
# define DBGLVL_NOTICE 3 /* normal, but significant, condition */
# define DBGLVL_INFO 5 /* informational message */
# define DBGLVL_DEBUG 10 /* debug-level message */
2023-09-18 14:48:06 +03:00
# define DBG_STARTUP_NOTICE(...) DBG_PREFIX(DBGLVL_STARTUP_NOTICE, (__VA_ARGS__))
2015-10-21 21:07:35 +03:00
# define DBG_ERR(...) DBG_PREFIX(DBGLVL_ERR, (__VA_ARGS__))
# define DBG_WARNING(...) DBG_PREFIX(DBGLVL_WARNING, (__VA_ARGS__))
2015-11-06 02:30:18 +03:00
# define DBG_NOTICE(...) DBG_PREFIX(DBGLVL_NOTICE, (__VA_ARGS__))
# define DBG_INFO(...) DBG_PREFIX(DBGLVL_INFO, (__VA_ARGS__))
2015-10-21 21:07:35 +03:00
# define DBG_DEBUG(...) DBG_PREFIX(DBGLVL_DEBUG, (__VA_ARGS__))
2015-06-06 00:45:22 +03:00
2018-03-21 22:40:50 +03:00
# define DBGC_ERR(dbgc_class, ...) DBGC_PREFIX(dbgc_class, \
DBGLVL_ERR , ( __VA_ARGS__ ) )
# define DBGC_WARNING(dbgc_class, ...) DBGC_PREFIX(dbgc_class, \
DBGLVL_WARNING , ( __VA_ARGS__ ) )
# define DBGC_NOTICE(dbgc_class, ...) DBGC_PREFIX(dbgc_class, \
DBGLVL_NOTICE , ( __VA_ARGS__ ) )
# define DBGC_INFO(dbgc_class, ...) DBGC_PREFIX(dbgc_class, \
DBGLVL_INFO , ( __VA_ARGS__ ) )
# define DBGC_DEBUG(dbgc_class, ...) DBGC_PREFIX(dbgc_class, \
DBGLVL_DEBUG , ( __VA_ARGS__ ) )
2016-11-24 06:48:04 +03:00
# define D_ERR(...) DEBUG(DBGLVL_ERR, (__VA_ARGS__))
# define D_WARNING(...) DEBUG(DBGLVL_WARNING, (__VA_ARGS__))
# define D_NOTICE(...) DEBUG(DBGLVL_NOTICE, (__VA_ARGS__))
# define D_INFO(...) DEBUG(DBGLVL_INFO, (__VA_ARGS__))
# define D_DEBUG(...) DEBUG(DBGLVL_DEBUG, (__VA_ARGS__))
2018-03-21 22:40:50 +03:00
# define DC_ERR(...) DEBUGC(dbgc_class, \
DBGLVL_ERR , ( __VA_ARGS__ ) )
# define DC_WARNING(...) DEBUGC(dbgc_class, \
DBGLVL_WARNING , ( __VA_ARGS__ ) )
# define DC_NOTICE(...) DEBUGC(dbgc_class, \
DBGLVL_NOTICE , ( __VA_ARGS__ ) )
# define DC_INFO(...) DEBUGC(dbgc_class, \
DBGLVL_INFO , ( __VA_ARGS__ ) )
# define DC_DEBUG(...) DEBUGC(dbgc_class, \
DBGLVL_DEBUG , ( __VA_ARGS__ ) )
2010-10-24 22:25:18 +04:00
/* The following definitions come from lib/debug.c */
2022-05-26 06:50:23 +03:00
/**
* Possible destinations for the debug log .
*
* Set via setup_logging ( ) ; higher values have precedence .
*/
2014-07-29 15:20:27 +04:00
enum debug_logtype {
DEBUG_DEFAULT_STDERR = 0 ,
DEBUG_DEFAULT_STDOUT = 1 ,
DEBUG_FILE = 2 ,
DEBUG_STDOUT = 3 ,
DEBUG_STDERR = 4 ,
DEBUG_CALLBACK = 5
} ;
2010-10-29 07:19:32 +04:00
2023-04-06 03:26:11 +03:00
enum debug_syslog_format {
DEBUG_SYSLOG_FORMAT_NO = 0 ,
DEBUG_SYSLOG_FORMAT_IN_LOGS = 1 ,
DEBUG_SYSLOG_FORMAT_ALWAYS = 2 ,
} ;
2011-02-24 08:14:03 +03:00
struct debug_settings {
size_t max_log_size ;
bool timestamp_logs ;
bool debug_prefix_timestamp ;
bool debug_hires_timestamp ;
2023-04-06 03:26:11 +03:00
enum debug_syslog_format debug_syslog_format ;
2011-02-24 08:14:03 +03:00
bool debug_pid ;
bool debug_uid ;
bool debug_class ;
2022-06-07 06:54:20 +03:00
bool debug_no_stderr_redirect ;
2011-02-24 08:14:03 +03:00
} ;
2010-10-29 07:19:32 +04:00
void setup_logging ( const char * prog_name , enum debug_logtype new_logtype ) ;
2010-10-24 22:25:18 +04:00
void gfree_debugsyms ( void ) ;
int debug_add_class ( const char * classname ) ;
bool debug_parse_levels ( const char * params_str ) ;
2011-02-24 08:14:03 +03:00
void debug_setup_talloc_log ( void ) ;
2010-10-24 22:25:18 +04:00
void debug_set_logfile ( const char * name ) ;
2015-01-10 00:46:32 +03:00
void debug_set_settings ( struct debug_settings * settings ,
const char * logging_param ,
int syslog_level , bool syslog_only ) ;
2021-10-28 11:05:19 +03:00
void debug_set_hostname ( const char * name ) ;
2011-02-24 08:14:03 +03:00
bool reopen_logs_internal ( void ) ;
2010-10-24 22:25:18 +04:00
void force_check_log_size ( void ) ;
bool need_to_check_log_size ( void ) ;
void check_log_size ( void ) ;
void dbgflush ( void ) ;
2021-01-08 10:31:24 +03:00
enum debug_logtype debug_get_log_type ( void ) ;
2010-11-01 12:55:04 +03:00
bool debug_get_output_is_stderr ( void ) ;
2011-07-18 11:07:25 +04:00
bool debug_get_output_is_stdout ( void ) ;
2011-02-24 08:14:03 +03:00
void debug_schedule_reopen_logs ( void ) ;
char * debug_list_class_names_and_levels ( void ) ;
2022-05-26 06:55:12 +03:00
bool debug_developer_enabled ( void ) ;
void debug_developer_enable ( void ) ;
void debug_developer_disable ( void ) ;
2011-02-24 08:14:03 +03:00
2012-03-08 05:21:26 +04:00
typedef void ( * debug_callback_fn ) ( void * private_ptr , int level , const char * msg ) ;
/**
Set a callback for all debug messages . Use in dlz_bind9 to push output to the bind logs
*/
void debug_set_callback ( void * private_ptr , debug_callback_fn fn ) ;
2017-01-07 16:36:24 +03:00
char * debug_get_ringbuf ( void ) ;
size_t debug_get_ringbuf_size ( void ) ;
2022-05-08 22:06:13 +03:00
/* Explicitly set new traceid. The old id is returned. */
uint64_t debug_traceid_set ( uint64_t id ) ;
/* Get the current traceid. */
uint64_t debug_traceid_get ( void ) ;
2022-08-26 12:41:44 +03:00
size_t * debug_call_depth_addr ( void ) ;
2015-01-08 12:24:36 +03:00
# endif /* _SAMBA_DEBUG_H */