Index: include/freeDiameter/libfdcore.h
===================================================================
--- include/freeDiameter/libfdcore.h	(revision 1077)
+++ include/freeDiameter/libfdcore.h	(revision 1069)
@@ -861,6 +861,6 @@
 /*============================================================*/
 
-/* These functions allow an extension to collect state information about the
- * framework, as well as being hooked at some key checkpoints in the processing
+/* These functions allows an extension to collect state information about the
+ * framework state, as well as hooks at some key checkpoints in the processing
  * for logging / statistics purpose.
  */
@@ -1097,6 +1097,6 @@
  *  stat	  : Which queue is being queried
  *  peer	  : (depending on the stat parameter) which peer is being queried
- *  current_count : (out) The number of items in the queue currently
- *  limit_count   : (out) The max number of items the queue accepts before becoming blocking -- 0 means no max.
+ *  len	  	  : (out) The number of items in the queue currently
+ *  max	  	  : (out) The max number of items the queue accepts before becoming blocking -- 0 means no max.
  *  highest_count : (out) The highest count the queue has reached since startup
  *  total_count	  : (out) Total number of items that this queue has processed (always growing, use deltas for monitoring)
@@ -1114,5 +1114,5 @@
  */
 int fd_stat_getstats(enum fd_stat_type stat, struct peer_hdr * peer, 
-			int * current_count, int * limit_count, int * highest_count, long long * total_count,
+			int * len, int * max, int * highest_count, long long * total_count, 
 			struct timespec * total, struct timespec * blocking, struct timespec * last);
 
Index: include/freeDiameter/libfdproto.h
===================================================================
--- include/freeDiameter/libfdproto.h	(revision 1071)
+++ include/freeDiameter/libfdproto.h	(revision 1078)
@@ -2340,41 +2340,20 @@
 void fd_msg_dump_walk ( int level, msg_or_avp *obj );
 void fd_msg_dump_one  ( int level, msg_or_avp *obj );
-/* Dump full message to log */
-void fd_msg_dump_full ( int level, struct dictionary *dict, const char *prefix, msg_or_avp *obj );
-
-/*
- * FUNCTION:	fd_msg_log
- *
- * PARAMETERS:
- *  cause	 : Context for calling this function. This allows the log facility to be configured precisely.
- *  msg		 : The message to log.
- *  prefix_format: Printf-style format message that is printed ahead of the message. Might be reason for drop or so.
- *
- * DESCRIPTION: 
- *   This function is called when a Diameter message reaches some particular points in the fD framework.
- * The actual effect is configurable: log in a separate file, dump in the debug log, etc.
- *
- * RETURN VALUE:
- *   -
- */
-enum fd_msg_log_cause {
-	FD_MSG_LOG_DROPPED = 1,  /* message has been dropped by the framework */ 
-	FD_MSG_LOG_RECEIVED,     /* message received from the network */ 
-	FD_MSG_LOG_SENT,         /* message sent to another peer */ 
-	FD_MSG_LOG_NODELIVER,    /* message could not be delivered to any peer */
-	FD_MSG_LOG_TIMING	 /* profiling messages */
-};
-#define FD_MSG_LOG_MAX FD_MSG_LOG_TIMING
-void fd_msg_log( enum fd_msg_log_cause cause, struct msg * msg, const char * prefix_format, ... ) _ATTRIBUTE_PRINTFLIKE_(3,4);
-
-/* configure the msg_log facility */
-enum fd_msg_log_method {
-	FD_MSG_LOGTO_NONE = 0, /* The message is not dumped. This is the default. */
-	FD_MSG_LOGTO_DEBUGONLY, /* Simply log the message with other debug information, at the INFO level. */
-	FD_MSG_LOGTO_FILE,    /* Messages are dumped in a single file, defined in arg */
-	FD_MSG_LOGTO_DIR    /* Messages are dumped in different files within one directory defined in arg. */
-};
-int fd_msg_log_config(enum fd_msg_log_cause cause, enum fd_msg_log_method method, const char * arg);
-void fd_msg_log_init(struct dictionary *dict);
+
+/* Helper functions to get a dump of an object in the logs. Several formats are available.
+ *  buf   : a buffer that can be reallocated if needed. *buf==NULL is also accepted for first allocation
+ *  buflen: the length of the buffer buf.
+ *  dict  : optional, the dictionary to use for resolving objects, if force_parsing != 0
+ *  obj   : the message or AVP to dump.
+ *
+ * After use, the buf pointer should be freed.
+ */
+/* one-line dump with only short information */
+void fd_msg_dump_summary( char ** buf, size_t buflen, struct dictionary *dict, msg_or_avp *obj, int force_parsing);
+/* one-line dump with all the contents of the message */
+void fd_msg_dump_full( char ** buf, size_t buflen, struct dictionary *dict, msg_or_avp *obj, int force_parsing);
+/* multi-line human-readable dump similar to wireshark output */
+void fd_msg_dump_treeview( char ** buf, size_t buflen, struct dictionary *dict, msg_or_avp *obj, int force_parsing);
+
 
 /*********************************************/
@@ -2528,26 +2507,4 @@
 int fd_msg_source_set( struct msg * msg, DiamId_t diamid, size_t diamidlen, int add_rr, struct dictionary * dict );
 int fd_msg_source_get( struct msg * msg, DiamId_t *diamid, size_t * diamidlen );
-
-/*
- * FUNCTION:	fd_msg_ts_*
- *
- * PARAMETERS:
- *  msg		: A msg object.
- *  ts		: A struct timespec pointer, indexed on CLOCK_REALTIME
- *
- * DESCRIPTION: 
- *   Associate or retrieve timestamps meaningful for the message.
- *  A timestamp with a value of { 0, 0 } means: not set.
- *
- * RETURN VALUE:
- *  0      	: Operation complete.
- *  !0      	: an error occurred.
- */
-/* when msg was received from network */
-int fd_msg_ts_set_recv( struct msg * msg, struct timespec * ts );
-int fd_msg_ts_get_recv( struct msg * msg, struct timespec * ts );
-int fd_msg_ts_set_sent( struct msg * msg, struct timespec * ts );
-int fd_msg_ts_get_sent( struct msg * msg, struct timespec * ts );
-
 
 /*
@@ -3032,15 +2989,30 @@
 
 /*
+ * FUNCTION:	fd_fifo_length
+ *
+ * PARAMETERS:
+ *  queue	: The queue from which to retrieve the number of elements.
+ *  length	: Upon success, the current number of elements in the queue is stored here.
+ *  max		: the maximum number of elements as specified during creation. Can be NULL.
+ *
+ * DESCRIPTION: 
+ *  Retrieve the number of elements in a queue.
+ *
+ * RETURN VALUE:
+ *  0		: The length of the queue has been written.
+ *  EINVAL 	: A parameter is invalid.
+ */
+int fd_fifo_length ( struct fifo * queue, int * length, int * max);
+int fd_fifo_length_noerr ( struct fifo * queue ); /* no error checking version */
+
+/*
  * FUNCTION:	fd_fifo_getstats
  *
  * PARAMETERS:
- *  queue	  : The queue from which to retrieve the information.
- *  current_count : How many items in the queue at the time of execution. This changes each time an item is pushed or poped.
- *  limit_count   : The maximum number of items allowed in this queue. This is specified during queue creation.
- *  highest_count : The maximum number of items this queue has contained. This enables to see if limit_count count was reached.
- *  total_count   : the total number of items that went through the queue (already pop'd). Always increasing.
- *  total	  : Cumulated time all items spent in this queue, including blocking time (always growing, use deltas for monitoring)
- *  blocking      : Cumulated time threads trying to post new items were blocked (queue full).
- *  last          : For the last element retrieved from the queue, how long it take between posting (including blocking) and poping
+ *  queue	: The queue from which to retrieve the timings information.
+ *  items       : the total number of items that went through the queue (already pop'd). Always increasing.
+ *  total	: Cumulated time all items spent in this queue, including blocking time (always growing, use deltas for monitoring)
+ *  blocking    : Cumulated time threads trying to post new items were blocked (queue full).
+ *  last        : For the last element retrieved from the queue, how long it take between posting (including blocking) and poping
  *  
  * DESCRIPTION: 
@@ -3051,20 +3023,6 @@
  *  EINVAL 	: A parameter is invalid.
  */
-int fd_fifo_getstats( struct fifo * queue, int * current_count, int * limit_count, int * highest_count, long long * total_count, 
-				           struct timespec * total, struct timespec * blocking, struct timespec * last);
-
-/*
- * FUNCTION:	fd_fifo_length
- *
- * PARAMETERS:
- *  queue	: The queue from which to retrieve the number of elements.
- *
- * DESCRIPTION: 
- *  Retrieve the number of elements in a queue, without error checking.
- *
- * RETURN VALUE:
- *  The number of items currently queued.
- */
-int fd_fifo_length ( struct fifo * queue );
+int fd_fifo_getstats( struct fifo * queue, long long *items, struct timespec * total, struct timespec * blocking, struct timespec * last);
+
 
 /*
