Index: pjproject/trunk/pjnath/include/pjnath/ice_session.h
===================================================================
--- pjproject/trunk/pjnath/include/pjnath/ice_session.h	(revision 1654)
+++ pjproject/trunk/pjnath/include/pjnath/ice_session.h	(revision 1988)
@@ -130,4 +130,9 @@
 
 /**
+ * Forward declaration for checklist.
+ */
+typedef struct pj_ice_sess_checklist pj_ice_sess_checklist;
+
+/**
  * This enumeration describes the type of an ICE candidate.
  */
@@ -192,4 +197,22 @@
 
 } pj_ice_sess_comp;
+
+
+/**
+ * Data structure to be attached to internal message processing.
+ */
+typedef struct pj_ice_msg_data
+{
+    unsigned	transport_id;
+    pj_bool_t	has_req_data;
+
+    union data {
+	struct request_data {
+	    pj_ice_sess		    *ice;
+	    pj_ice_sess_checklist   *clist;
+	    unsigned		     ckid;
+	} req;
+    } data;
+} pj_ice_msg_data;
 
 
@@ -205,14 +228,32 @@
 {
     /**
+     * The candidate type, as described in #pj_ice_cand_type enumeration.
+     */
+    pj_ice_cand_type	 type;
+
+    /** 
+     * Status of this candidate. The value will be PJ_SUCCESS if candidate
+     * address has been resolved successfully, PJ_EPENDING when the address
+     * resolution process is in progress, or other value when the address 
+     * resolution has completed with failure.
+     */
+    pj_status_t		 status;
+
+    /**
      * The component ID of this candidate. Note that component IDs starts
      * with one for RTP and two for RTCP. In other words, it's not zero
      * based.
      */
-    pj_uint32_t		 comp_id;
-
-    /**
-     * The candidate type, as described in #pj_ice_cand_type enumeration.
-     */
-    pj_ice_cand_type	 type;
+    pj_uint8_t		 comp_id;
+
+    /**
+     * Transport ID to be used to send packets for this candidate.
+     */
+    pj_uint8_t		 transport_id;
+
+    /**
+     * Local preference value, which typically is 65535.
+     */
+    pj_uint16_t		 local_pref;
 
     /**
@@ -384,5 +425,5 @@
  * candidate pairs that an agent will use to generate checks.
  */
-typedef struct pj_ice_sess_checklist
+struct pj_ice_sess_checklist
 {
     /**
@@ -406,5 +447,5 @@
     pj_timer_entry	     timer;
 
-} pj_ice_sess_checklist;
+};
 
 
@@ -431,4 +472,5 @@
      * @param ice	    The ICE session.
      * @param comp_id	    ICE component ID.
+     * @param transport_id  Transport ID.
      * @param pkt	    The STUN packet.
      * @param size	    The size of the packet.
@@ -437,4 +479,5 @@
      */
     pj_status_t (*on_tx_pkt)(pj_ice_sess *ice, unsigned comp_id, 
+			     unsigned transport_id,
 			     const void *pkt, pj_size_t size,
 			     const pj_sockaddr_t *dst_addr,
@@ -447,4 +490,5 @@
      * @param ice	    The ICE session.
      * @param comp_id	    ICE component ID.
+     * @param transport_id  Transport ID.
      * @param pkt	    The whole packet.
      * @param size	    Size of the packet.
@@ -454,4 +498,5 @@
      */
     void	(*on_rx_data)(pj_ice_sess *ice, unsigned comp_id,
+			      unsigned transport_id, 
 			      void *pkt, pj_size_t size,
 			      const pj_sockaddr_t *src_addr,
@@ -497,4 +542,5 @@
 
     unsigned		 comp_id;	/**< Component ID.		*/
+    unsigned		 transport_id;	/**< Transport ID.		*/
 
     pj_sockaddr		 src_addr;	/**< Source address of request	*/
@@ -553,4 +599,7 @@
     unsigned		 rcand_cnt;		    /**< # of remote cand.  */
     pj_ice_sess_cand	 rcand[PJ_ICE_MAX_CAND];    /**< Array of cand.	    */
+
+    /* Array of transport datas */
+    pj_ice_msg_data	 tp_data[4];
 
     /* List of eearly checks */
@@ -580,4 +629,15 @@
  */
 PJ_DECL(const char*) pj_ice_get_cand_type_name(pj_ice_cand_type type);
+
+
+/**
+ * This is a utility function to retrieve the string name for the
+ * particular role type.
+ *
+ * @param role		Role type.
+ *
+ * @return		The string representation of the role.
+ */
+PJ_DECL(const char*) pj_ice_sess_role_name(pj_ice_sess_role role);
 
 
@@ -686,4 +746,6 @@
  * @param ice		ICE session instance.
  * @param comp_id	Component ID of this candidate.
+ * @param transport_id	Transport ID to be used to send packets for this
+ *			candidate.
  * @param type		Candidate type.
  * @param local_pref	Local preference for this candidate, which
@@ -700,4 +762,5 @@
 PJ_DECL(pj_status_t) pj_ice_sess_add_cand(pj_ice_sess *ice,
 					  unsigned comp_id,
+					  unsigned transport_id,
 					  pj_ice_cand_type type,
 					  pj_uint16_t local_pref,
@@ -798,4 +861,7 @@
  * @param ice		The ICE session.
  * @param comp_id	Component ID.
+ * @param transport_id	Number to identify where this packet was received
+ *			from. This parameter will be returned back to
+ *			application in \a on_tx_pkt() callback.
  * @param pkt		Incoming packet.
  * @param pkt_size	Size of incoming packet.
@@ -807,4 +873,5 @@
 PJ_DECL(pj_status_t) pj_ice_sess_on_rx_pkt(pj_ice_sess *ice,
 					   unsigned comp_id,
+					   unsigned transport_id,
 					   void *pkt,
 					   pj_size_t pkt_size,
