X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=lib%2Fdebug.h;h=f25cd426913f8a0bb518df0e77b6e1933c6d060c;hb=f94ed830df98218447f00b97f856de811bfcc4a2;hp=d0fa27d3fe74f80693e66f79be56b594e2077e1a;hpb=f22ab4c3fc4e23c3b06fbfd46784f1a83f12aec7;p=mirror_frr.git diff --git a/lib/debug.h b/lib/debug.h index d0fa27d3f..f25cd4269 100644 --- a/lib/debug.h +++ b/lib/debug.h @@ -24,6 +24,10 @@ #include "command.h" #include "frratomic.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * Debugging modes. * @@ -76,10 +80,11 @@ * Human-readable description of this debugging record. */ struct debug { - _Atomic uint32_t flags; + atomic_uint_fast32_t flags; const char *desc; }; +PREDECL_LIST(debug_cb_list) /* * Callback set for debugging code. * @@ -88,6 +93,11 @@ struct debug { * mode set. */ struct debug_callbacks { + /* + * Linked list of Callbacks to call + */ + struct debug_cb_list_item item; + /* * flags * flags to set on debug flag fields @@ -229,6 +239,16 @@ struct debug_callbacks { * * MT-Safe */ -void debug_init(const struct debug_callbacks *cb); +void debug_init(struct debug_callbacks *cb); + +/* + * Turn on the cli to turn on/off debugs. + * Should only be called by libfrr + */ +void debug_init_cli(void); + +#ifdef __cplusplus +} +#endif #endif /* _FRRDEBUG_H */