Index: include/freeDiameter/freeDiameter.h
===================================================================
--- include/freeDiameter/freeDiameter.h	(revision 25)
+++ include/freeDiameter/freeDiameter.h	(revision 20)
@@ -118,20 +118,14 @@
 struct fd_endpoint {
 	struct fd_list  chain;	/* link in cnf_endpoints list */
-	
-	union {
-		sSS		ss;	/* the socket information. List is always ordered by ss value (memcmp) -- see fd_ep_add_merge */
-		sSA4		sin;
-		sSA6		sin6;
-		sSA		sa;
-	};
-	
-#define	EP_FL_CONF	(1 << 0)	/* This endpoint is statically configured in a configuration file */
-#define	EP_FL_DISC	(1 << 1)	/* This endpoint was resolved from the Diameter Identity or other DNS query */
-#define	EP_FL_ADV	(1 << 2)	/* This endpoint was advertized in Diameter CER/CEA exchange */
-#define	EP_FL_LL	(1 << 3)	/* Lower layer mechanism provided this endpoint */
-#define	EP_FL_PRIMARY	(1 << 4)	/* This endpoint is primary in a multihomed SCTP association */
-	uint32_t	flags;		/* Additional information about the endpoint */
-		
-	/* To add: a validity timestamp for DNS records ? How do we retrieve this lifetime from DNS ? */
+	sSS		ss;	/* the socket information. List is always ordered by ss value (memcmp) */
+	struct {
+		unsigned conf : 1; /* This endpoint is statically configured in a configuration file */
+		unsigned disc : 1; /* This endpoint was resolved from the Diameter Identity or other DNS query */
+		unsigned adv  : 1; /* This endpoint was advertized in Diameter CER/CEA exchange */
+		unsigned ll   : 1; /* Lower layer mechanism provided this endpoint */
+		
+		/* To add: a validity timestamp for DNS records ? How do we retrieve this lifetime from DNS ? */
+
+	}		meta;	/* Additional information about the endpoint */
 };
 
@@ -152,11 +146,31 @@
 struct fd_event {
 	int	 code; /* codespace depends on the queue */
-	size_t 	 size;
 	void    *data;
 };
 
-/* Daemon's codespace: 1000->1999 */
+static __inline__ int fd_event_send(struct fifo *queue, int code, void * data)
+{
+	struct fd_event * ev;
+	CHECK_MALLOC( ev = malloc(sizeof(struct fd_event)) );
+	ev->code = code;
+	ev->data = data;
+	CHECK_FCT( fd_fifo_post(queue, &ev) );
+	return 0;
+}
+static __inline__ int fd_event_get(struct fifo *queue, int *code, void ** data)
+{
+	struct fd_event * ev;
+	CHECK_FCT( fd_fifo_get(queue, &ev) );
+	if (code)
+		*code = ev->code;
+	if (data)
+		*data = ev->data;
+	free(ev);
+	return 0;
+}
+
+/* Events codespace for fd_g_config->cnf_main_ev */
 enum {
-	 FDEV_TERMINATE	= 1000	/* request to terminate */
+	 FDEV_TERMINATE = 1000	/* request to terminate */
 	,FDEV_DUMP_DICT		/* Dump the content of the dictionary */
 	,FDEV_DUMP_EXT		/* Dump state of extensions */
@@ -166,63 +180,4 @@
 	,FDEV_DUMP_PEERS	/* Dump the list of peers */
 };
-
-static __inline__ int fd_event_send(struct fifo *queue, int code, size_t datasz, void * data)
-{
-	struct fd_event * ev;
-	CHECK_MALLOC( ev = malloc(sizeof(struct fd_event)) );
-	ev->code = code;
-	ev->size = datasz;
-	ev->data = data;
-	CHECK_FCT( fd_fifo_post(queue, &ev) );
-	return 0;
-}
-static __inline__ int fd_event_get(struct fifo *queue, int *code, size_t *datasz, void ** data)
-{
-	struct fd_event * ev;
-	CHECK_FCT( fd_fifo_get(queue, &ev) );
-	if (code)
-		*code = ev->code;
-	if (datasz)
-		*datasz = ev->size;
-	if (data)
-		*data = ev->data;
-	free(ev);
-	return 0;
-}
-static __inline__ int fd_event_timedget(struct fifo *queue, struct timespec * timeout, int timeoutcode, int *code, size_t *datasz, void ** data)
-{
-	struct fd_event * ev;
-	int ret = 0;
-	ret = fd_fifo_timedget(queue, &ev, timeout);
-	if (ret == ETIMEDOUT) {
-		if (code)
-			*code = timeoutcode;
-		if (datasz)
-			*datasz = 0;
-		if (data)
-			*data = NULL;
-	} else {
-		CHECK_FCT( ret );
-		if (code)
-			*code = ev->code;
-		if (datasz)
-			*datasz = ev->size;
-		if (data)
-			*data = ev->data;
-		free(ev);
-	}
-	return 0;
-}
-static __inline__ void fd_event_destroy(struct fifo **queue, void (*free_cb)(void * data))
-{
-	struct fd_event * ev;
-	/* Purge all events, and free the associated data if any */
-	while (fd_fifo_tryget( *queue, &ev ) == 0) {
-		(*free_cb)(ev->data);
-		free(ev);
-	}
-	CHECK_FCT_DO( fd_fifo_del(queue), /* continue */ );
-	return ;
-}  
 const char * fd_ev_str(int event); /* defined in freeDiameter/main.c */
 
@@ -301,4 +256,5 @@
 	/* Additional parameters */
 	uint32_t 	pi_lft;		/* lifetime of this peer when inactive (see pi_flags.exp definition) */
+	uint16_t	pi_streams; 	/* number of streams for SCTP. 0 = default */
 	uint16_t	pi_port; 	/* port to connect to. 0: default. */
 	int		pi_tctimer; 	/* use this value for TcTimer instead of global, if != 0 */
@@ -315,5 +271,4 @@
 	struct fd_list	pi_apps;	/* applications advertised by the remote peer, except relay (pi_flags.relay) */
 	struct {
-		char			*priority;	/* In case the default priority is not appropriate */
 		/* This is inspired from http://www.gnu.org/software/gnutls/manual/gnutls.html#ex_003ax509_002dinfo */
 		const gnutls_datum_t 	*cert_list; 	/* The (valid) credentials that the peer has presented */
@@ -505,13 +460,3 @@
 
 
-/***************************************/
-/*   Endpoints lists helpers           */
-/***************************************/
-
-int fd_ep_add_merge( struct fd_list * list, sSA * sa, socklen_t sl, uint32_t flags );
-int fd_ep_filter( struct fd_list * list, uint32_t flags );
-int fd_ep_clearflags( struct fd_list * list, uint32_t flags );
-
-
-
 #endif /* _FREEDIAMETER_H */
