diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-04-05 11:32:47 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-04-05 11:32:47 +0000 |
commit | d3fc99a7187535ad1b9c015e9e9a4c0d7f4fa0c0 (patch) | |
tree | 757c8ffe9f868f2d9665f96498aac1c80e219a8a /pjnath/include | |
parent | 3881047a905d1da151fd84ae6c67ab20a45b0583 (diff) |
ICE (work in progress): handle early check that is received before answer
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1152 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/include')
-rw-r--r-- | pjnath/include/pjnath/config.h | 20 | ||||
-rw-r--r-- | pjnath/include/pjnath/ice_session.h | 28 | ||||
-rw-r--r-- | pjnath/include/pjnath/stun_session.h | 14 | ||||
-rw-r--r-- | pjnath/include/pjnath/stun_transaction.h | 10 |
4 files changed, 71 insertions, 1 deletions
diff --git a/pjnath/include/pjnath/config.h b/pjnath/include/pjnath/config.h index 50db9420..27c0f6b1 100644 --- a/pjnath/include/pjnath/config.h +++ b/pjnath/include/pjnath/config.h @@ -165,6 +165,25 @@ /** + * According to ICE Section 8.2. Updating States, if an In-Progress pair in + * the check list is for the same component as a nominated pair, the agent + * SHOULD cease retransmissions for its check if its pair priority is lower + * than the lowest priority nominated pair for that component. + * + * If a higher priority check is In Progress, this rule would cause that + * check to be performed even when it most likely will fail. + * + * The macro here controls if ICE session should cancel all In Progress + * checks for the same component regardless of its priority. + * + * Default: 1 (yes, cancel all) + */ +#ifndef PJ_ICE_CANCEL_ALL +# define PJ_ICE_CANCEL_ALL 1 +#endif + + +/** * Minimum interval value to be used for sending STUN keep-alive on the ICE * stream transport, in seconds. This minimum interval, plus a random value * which maximum is PJ_ICE_ST_KEEP_ALIVE_MAX_RAND, specify the actual interval @@ -195,7 +214,6 @@ - /** * @} */ diff --git a/pjnath/include/pjnath/ice_session.h b/pjnath/include/pjnath/ice_session.h index 42bcff4a..aaa07ae6 100644 --- a/pjnath/include/pjnath/ice_session.h +++ b/pjnath/include/pjnath/ice_session.h @@ -419,6 +419,31 @@ typedef enum pj_ice_sess_role /** + * This structure represents an incoming check (an incoming Binding + * request message), and is mainly used to keep early checks in the + * list in the ICE session. An early check is a request received + * from remote when we haven't received SDP answer yet, therefore we + * can't perform triggered check. For such cases, keep the incoming + * request in a list, and we'll do triggered checks (simultaneously) + * as soon as we receive answer. + */ +typedef struct pj_ice_rx_check +{ + PJ_DECL_LIST_MEMBER(struct pj_ice_rx_check); + + unsigned comp_id; /**< Component ID. */ + + pj_sockaddr src_addr; /**< Source address of request */ + unsigned src_addr_len; /**< Length of src address. */ + + pj_bool_t use_candidate; /**< USE-CANDIDATE is present? */ + pj_uint32_t priority; /**< PRIORITY value in the req. */ + pj_stun_uint64_attr *role_attr; /**< ICE-CONTROLLING/CONTROLLED */ + +} pj_ice_rx_check; + + +/** * This structure describes the ICE session. For this version of PJNATH, * an ICE session corresponds to a single media stream (unlike the ICE * session described in the ICE standard where an ICE session covers the @@ -463,6 +488,9 @@ struct pj_ice_sess unsigned rcand_cnt; /**< # of remote cand. */ pj_ice_sess_cand rcand[PJ_ICE_MAX_CAND]; /**< Array of cand. */ + /* List of eearly checks */ + pj_ice_rx_check early_check; /**< Early checks. */ + /* Checklist */ pj_ice_sess_checklist clist; /**< Active checklist */ diff --git a/pjnath/include/pjnath/stun_session.h b/pjnath/include/pjnath/stun_session.h index 0cd81f98..dfbf61c0 100644 --- a/pjnath/include/pjnath/stun_session.h +++ b/pjnath/include/pjnath/stun_session.h @@ -358,6 +358,20 @@ PJ_DECL(pj_status_t) pj_stun_session_cancel_req(pj_stun_session *sess, pj_status_t status); /** + * Explicitly request retransmission of the request. Normally application + * doesn't need to do this, but this functionality is needed by ICE to + * speed up connectivity check completion. + * + * @param sess The STUN session instance. + * @param tdata The request message previously sent. + * + * @return PJ_SUCCESS on success, or the appropriate error. + */ +PJ_DECL(pj_status_t) pj_stun_session_retransmit_req(pj_stun_session *sess, + pj_stun_tx_data *tdata); + + +/** * 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 diff --git a/pjnath/include/pjnath/stun_transaction.h b/pjnath/include/pjnath/stun_transaction.h index 32dd0c41..05e8b444 100644 --- a/pjnath/include/pjnath/stun_transaction.h +++ b/pjnath/include/pjnath/stun_transaction.h @@ -221,6 +221,16 @@ PJ_DECL(pj_status_t) pj_stun_client_tsx_send_msg(pj_stun_client_tsx *tsx, void *pkt, unsigned pkt_len); +/** + * Request to retransmit the request. Normally application should not need + * to call this function since retransmission would be handled internally, + * but this functionality is needed by ICE. + * + * @param tsx The STUN client transaction instance. + * + * @return PJ_SUCCESS on success or the appropriate error code. + */ +PJ_DECL(pj_status_t) pj_stun_client_tsx_retransmit(pj_stun_client_tsx *tsx); /** |