summaryrefslogtreecommitdiff
path: root/pjnath/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-03-26 13:25:07 +0000
committerBenny Prijono <bennylp@teluu.com>2007-03-26 13:25:07 +0000
commit63bbc72f8536347656ac59dea7fb9576c82ac55d (patch)
tree4a8b7fbb7b357b82cdeb49c44672439843155785 /pjnath/include
parent84b0defcf6903a8b014ab1ba38d8923282f230ed (diff)
ICE: implement RTCP component and cancelling check in progress
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1106 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/include')
-rw-r--r--pjnath/include/pjnath/ice.h12
-rw-r--r--pjnath/include/pjnath/ice_stream_transport.h16
-rw-r--r--pjnath/include/pjnath/stun_session.h20
3 files changed, 38 insertions, 10 deletions
diff --git a/pjnath/include/pjnath/ice.h b/pjnath/include/pjnath/ice.h
index cd3a4e7f..cc8b7918 100644
--- a/pjnath/include/pjnath/ice.h
+++ b/pjnath/include/pjnath/ice.h
@@ -68,7 +68,7 @@ enum pj_ice_type_pref
};
typedef struct pj_ice pj_ice;
-
+typedef struct pj_ice_check pj_ice_check;
#define PJ_ICE_MAX_CAND 16
#define PJ_ICE_MAX_COMP 8
@@ -80,8 +80,7 @@ typedef struct pj_ice pj_ice;
*/
typedef struct pj_ice_comp
{
- unsigned comp_id;
- int nominated_check_id;
+ pj_ice_check *valid_check;
} pj_ice_comp;
@@ -110,16 +109,17 @@ typedef enum pj_ice_check_state
} pj_ice_check_state;
-typedef struct pj_ice_check
+struct pj_ice_check
{
pj_ice_cand *lcand;
pj_ice_cand *rcand;
pj_uint64_t prio;
pj_ice_check_state state;
+ pj_stun_tx_data *tdata;
pj_bool_t nominated;
pj_status_t err_code;
-} pj_ice_check;
+};
typedef enum pj_ice_checklist_state
@@ -206,6 +206,8 @@ struct pj_ice
pj_ice_checklist valid_list;
};
+PJ_DECL(const char*) pj_ice_get_cand_type_name(pj_ice_cand_type type);
+
PJ_DECL(pj_status_t) pj_ice_create(pj_stun_config *stun_cfg,
const char *name,
diff --git a/pjnath/include/pjnath/ice_stream_transport.h b/pjnath/include/pjnath/ice_stream_transport.h
index fbdd9b43..c42476b4 100644
--- a/pjnath/include/pjnath/ice_stream_transport.h
+++ b/pjnath/include/pjnath/ice_stream_transport.h
@@ -60,9 +60,10 @@ typedef struct pj_ice_st_cb
enum pj_ice_st_option
{
- PJ_ICE_ST_OPT_DISABLE_STUN = 1,
- PJ_ICE_ST_OPT_DISABLE_RELAY = 2,
- PJ_ICE_ST_OPT_NO_PORT_RETRY = 4,
+ PJ_ICE_ST_OPT_DONT_ADD_CAND = 1,
+ PJ_ICE_ST_OPT_DISABLE_STUN = 2,
+ PJ_ICE_ST_OPT_DISABLE_RELAY = 4,
+ PJ_ICE_ST_OPT_NO_PORT_RETRY = 8,
};
@@ -143,8 +144,13 @@ PJ_DECL(pj_status_t) pj_ice_st_set_stun_srv(pj_ice_st *ice_st,
PJ_DECL(pj_status_t) pj_ice_st_create_comp(pj_ice_st *ice_st,
unsigned comp_id,
pj_uint32_t options,
- const pj_sockaddr_in *addr,
- unsigned *p_itf_id);
+ const pj_sockaddr_in *addr);
+PJ_DECL(pj_status_t) pj_ice_st_add_cand(pj_ice_st *ice_st,
+ unsigned comp_id,
+ pj_ice_cand_type type,
+ pj_uint16_t local_pref,
+ const pj_sockaddr_in *addr,
+ pj_bool_t set_default);
PJ_DECL(pj_status_t) pj_ice_st_get_comps_status(pj_ice_st *ice_st);
diff --git a/pjnath/include/pjnath/stun_session.h b/pjnath/include/pjnath/stun_session.h
index 3c5daee7..18d07c0f 100644
--- a/pjnath/include/pjnath/stun_session.h
+++ b/pjnath/include/pjnath/stun_session.h
@@ -318,6 +318,26 @@ PJ_DECL(pj_status_t) pj_stun_session_send_msg(pj_stun_session *sess,
pj_stun_tx_data *tdata);
/**
+ * Cancel outgoing STUN transaction. This operation is only valid for outgoing
+ * STUN request, to cease retransmission of the request and destroy the
+ * STUN client transaction that is used to send the request.
+ *
+ * @param sess The STUN session instance.
+ * @param tdata The request message previously sent.
+ * @param notify Specify whether \a on_request_complete() callback should
+ * be called.
+ * @param status If \a on_request_complete() callback is to be called,
+ * specify the error status to be given when calling the
+ * callback. This error status MUST NOT be PJ_SUCCESS.
+ *
+ * @return PJ_SUCCESS if transaction is successfully cancelled.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_cancel_req(pj_stun_session *sess,
+ pj_stun_tx_data *tdata,
+ pj_bool_t notify,
+ pj_status_t status);
+
+/**
* Application must call this function to notify the STUN session about
* the arrival of STUN packet. The STUN packet MUST have been checked
* first with #pj_stun_msg_check() to verify that this is indeed a valid