Changeset 687:026802543f57 in freeDiameter for include/freeDiameter/libfdproto.h
- Timestamp:
- Jan 19, 2011, 5:08:21 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/libfdproto.h
r658 r687 95 95 96 96 /* 97 * FUNCTION: fd_log_debug 98 * 99 * PARAMETERS: 97 * FUNCTION: fd_log_debug_fstr 98 * MACRO: fd_log_debug 99 * 100 * PARAMETERS: 101 * fstr : Stream where the text will be sent (default: stdout) 100 102 * format : Same format string as in the printf function 101 103 * ... : Same list as printf … … 112 114 * None. 113 115 */ 114 void fd_log_debug ( const char * format, ... ); 116 void fd_log_debug_fstr ( FILE * fstr, const char * format, ... ); 117 #define fd_log_debug(format,args...) fd_log_debug_fstr(NULL, format, ## args) 118 115 119 extern pthread_mutex_t fd_log_lock; 116 120 extern char * fd_debug_one_function; … … 1010 1014 dict_avpdata_interpret type_interpret;/* cb to convert the AVP value in more comprehensive format (or NULL) */ 1011 1015 dict_avpdata_encode type_encode; /* cb to convert formatted data into an AVP value (or NULL) */ 1012 void (*type_dump)(union avp_value * val ); /* cb called by fd_msg_dump_one for this type of data (if != NULL), to dump the AVP value in debug*/1016 void (*type_dump)(union avp_value * val, FILE * fstr); /* cb called by fd_msg_dump_one for this type of data (if != NULL), to dump the AVP value in fstr */ 1013 1017 }; 1014 1018 … … 2033 2037 void fd_msg_dump_one ( int level, msg_or_avp *obj ); 2034 2038 2039 /* 2040 * FUNCTION: fd_msg_log 2041 * 2042 * PARAMETERS: 2043 * cause : Context for calling this function. This allows the log facility to be configured precisely. 2044 * msg : The message to log. 2045 * prefix_format: Printf-style format message that is printed ahead of the message. Might be reason for drop or so. 2046 * 2047 * DESCRIPTION: 2048 * This function is called when a Diameter message reaches some particular points in the fD framework. 2049 * The actual effect is configurable: log in a separate file, dump in the debug log, etc. 2050 * 2051 * RETURN VALUE: 2052 * - 2053 */ 2054 enum fd_msg_log_cause { 2055 FD_MSG_LOG_DROPPED = 0, /* message has been dropped by the framework */ 2056 FD_MSG_LOG_RECEIVED, /* message received from the network */ 2057 FD_MSG_LOG_SENT /* message sent to another peer */ 2058 }; 2059 #define FD_MSG_LOG_MAX FD_MSG_LOG_SENT 2060 void fd_msg_log( enum fd_msg_log_cause cause, struct msg * msg, const char * prefix_format, ... ); 2061 2062 /* configure the msg_log facility */ 2063 enum fd_msg_log_method { 2064 FD_MSG_LOGTO_DEBUGONLY = 0, /* Simply log the message with other debug information, at the INFO level. This is default */ 2065 FD_MSG_LOGTO_FILE, /* Messages are dumped in a single file, defined in arg */ 2066 FD_MSG_LOGTO_DIR /* Messages are dumped in different files within one directory defined in arg. */ 2067 }; 2068 int fd_msg_log_config(enum fd_msg_log_cause cause, enum fd_msg_log_method method, const char * arg); 2035 2069 2036 2070 /*********************************************/
Note: See TracChangeset
for help on using the changeset viewer.