Navigation


Changeset 1085:7d7266115a34 in freeDiameter for include/freeDiameter/libfdcore.h


Ignore:
Timestamp:
May 3, 2013, 8:20:56 PM (11 years ago)
Author:
Sebastien Decugis <sdecugis@freediameter.net>
Branch:
default
Phase:
public
Message:

Cleaning of the traces in progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/libfdcore.h

    r1077 r1085  
    5858
    5959/* Check the return value of a GNUTLS function, log and propagate */
    60 #define CHECK_GNUTLS_DO( __call__, __fallback__ ) {                                             \
    61         int __ret__;                                                                            \
    62         TRACE_DEBUG(GNUTLS_DBG_LEVEL, "GNUTLS call: %s", #__call__ );                           \
    63         __ret__ = (__call__);                                                                   \
    64         if (__ret__ < 0) {                                                                      \
    65                 TRACE_DEBUG(INFO, "Error in '%s':\t%s", #__call__ , gnutls_strerror(__ret__));  \
    66                 __fallback__;                                                                   \
    67         }                                                                                       \
     60#define CHECK_GNUTLS_GEN( faillevel, __call__, __fallback__  ) {                                        \
     61                CHECK_PRELUDE(__call__);                                                                \
     62                if (__ret__ < 0) {                                                                      \
     63                        __ret__ = errno;                                                                \
     64                        LOG(faillevel, "ERROR: in '%s' :\t%s",  #__call__ ,  gnutls_strerror(__ret__)); \
     65                        __fallback__;                                                                   \
     66                }                                                                                       \
    6867}
    6968
    70 /* For GNUTLS routines that do not return a value */
     69/* we use this macro to help debugging gnutls usage issues -- just change the content to display what you need */
    7170#define GNUTLS_TRACE( __call__) {                                       \
    72         TRACE_DEBUG(GNUTLS_DBG_LEVEL, "GNUTLS call: " #__call__ );      \
     71        TRACE_CALL("Check: %s", #__call__ );                            \
    7372        (__call__);                                                     \
    7473}
     74
     75
     76#ifndef EXCLUDE_DEPRECATED
     77/* Macro for transition, replace with CHECK_GNUTLS_GEN */
     78#define CHECK_GNUTLS_DO( __call__, __fallback__ ) {                                                     \
     79                CHECK_PRELUDE(__call__);                                                                \
     80                if (__ret__ < 0) {                                                                      \
     81                        __ret__ = errno;                                                                \
     82                        TRACE_ERROR("ERROR: in '%s' :\t%s",  #__call__ ,  gnutls_strerror(__ret__));    \
     83                        __fallback__;                                                                   \
     84                }                                                                                       \
     85}
     86
     87#endif /* EXCLUDE_DEPRECATED */
    7588
    7689
     
    778791enum {
    779792         FDEV_TERMINATE = 1000  /* request to terminate */
    780         ,FDEV_DUMP_DICT         /* Dump the content of the dictionary */
    781         ,FDEV_DUMP_EXT          /* Dump state of extensions */
    782         ,FDEV_DUMP_SERV         /* Dump the server socket status */
    783         ,FDEV_DUMP_QUEUES       /* Dump the message queues */
    784         ,FDEV_DUMP_CONFIG       /* Dump the configuration */
    785         ,FDEV_DUMP_PEERS        /* Dump the list of peers */
    786793        ,FDEV_TRIGGER           /* Trigger available for extensions. size is sizeof(int), data is int * */
    787794};
     
    795802/* for extensions */
    796803int fd_event_trig_regcb(int trigger_val, const char * module, void (*cb)(void));
    797 void fd_event_trig_dump();
    798 
     804
     805DECLARE_FD_DUMP_PROTOTYPE(fd_event_trig_dump);
     806
     807/* The "old" FD_EV_DUMP_* events are replaced with direct calls to the following dump functions */
     808DECLARE_FD_DUMP_PROTOTYPE(fd_conf_dump);
     809DECLARE_FD_DUMP_PROTOTYPE(fd_ext_dump);
     810DECLARE_FD_DUMP_PROTOTYPE(fd_peer_dump_list, int details);
     811DECLARE_FD_DUMP_PROTOTYPE(fd_peer_dump, struct peer_hdr * p, int details);
     812DECLARE_FD_DUMP_PROTOTYPE(fd_servers_dump);
    799813
    800814/*============================================================*/
     
    832846int fd_ep_filter_list( struct fd_list * list, struct fd_list * exclude_list );
    833847int fd_ep_clearflags( struct fd_list * list, uint32_t flags );
    834 void fd_ep_dump_one( char * prefix, struct fd_endpoint * ep );
    835 void fd_ep_dump( int indent, struct fd_list * eps );
     848DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump_one, struct fd_endpoint * ep );
     849DECLARE_FD_DUMP_PROTOTYPE(fd_ep_dump, int indent, struct fd_list * eps );
    836850
    837851
Note: See TracChangeset for help on using the changeset viewer.