diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-04-03 19:15:10 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-04-03 19:15:10 +0000 |
commit | 10c62612cd3b742a3cf78be53214a2906b687921 (patch) | |
tree | 919467f99844794b456eeafa029b3d24a2879e62 /pjnath/include | |
parent | 89c220218ff5245488bf78514c79dfaf86b13743 (diff) |
Added ICE-CONTROLLED and ICE-CONTROLLING attribute, handle ICE 487 error, and add response source address checking
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1141 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/include')
-rw-r--r-- | pjnath/include/pjnath/errno.h | 7 | ||||
-rw-r--r-- | pjnath/include/pjnath/ice_session.h | 5 | ||||
-rw-r--r-- | pjnath/include/pjnath/stun_session.h | 16 | ||||
-rw-r--r-- | pjnath/include/pjnath/stun_transaction.h | 13 |
4 files changed, 37 insertions, 4 deletions
diff --git a/pjnath/include/pjnath/errno.h b/pjnath/include/pjnath/errno.h index cb470747..4327cd46 100644 --- a/pjnath/include/pjnath/errno.h +++ b/pjnath/include/pjnath/errno.h @@ -144,6 +144,13 @@ #define PJNATH_EICEINCANDID (PJNATH_ERRNO_START+87) /* 370087 */ /** * @hideinitializer + * Source address mismatch. This error occurs if the source address + * of the response for ICE connectivity check is different than + * the destination address of the request. + */ +#define PJNATH_EICEINSRCADDR (PJNATH_ERRNO_START+88) /* 370088 */ +/** + * @hideinitializer * Missing ICE SDP attribute */ #define PJNATH_EICEMISSINGSDP (PJNATH_ERRNO_START+90) /* 370090 */ diff --git a/pjnath/include/pjnath/ice_session.h b/pjnath/include/pjnath/ice_session.h index 761153d8..42bcff4a 100644 --- a/pjnath/include/pjnath/ice_session.h +++ b/pjnath/include/pjnath/ice_session.h @@ -403,6 +403,11 @@ typedef enum pj_ice_sess_role /** * The ICE agent is in controlled role. */ + PJ_ICE_SESS_ROLE_UNKNOWN, + + /** + * The ICE agent is in controlled role. + */ PJ_ICE_SESS_ROLE_CONTROLLED, /** diff --git a/pjnath/include/pjnath/stun_session.h b/pjnath/include/pjnath/stun_session.h index 6b45adf2..0cd81f98 100644 --- a/pjnath/include/pjnath/stun_session.h +++ b/pjnath/include/pjnath/stun_session.h @@ -109,13 +109,25 @@ typedef struct pj_stun_session_cb * PJ_SUCCESS, the transaction has timed-out * or other error has occurred, and the response * argument may be NULL. + * Note that when the status is not success, the + * response may contain non-NULL value if the + * response contains STUN ERROR-CODE attribute. * @param request The original STUN request. - * @param response The response message, on successful transaction. + * @param response The response message, on successful transaction, + * or otherwise MAY BE NULL if status is not success. + * Note that when the status is not success, this + * argument may contain non-NULL value if the + * response contains STUN ERROR-CODE attribute. + * @param src_addr The source address where the response was + * received, or NULL if the response is NULL. + * @param src_addr_len The length of the source address. */ void (*on_request_complete)(pj_stun_session *sess, pj_status_t status, pj_stun_tx_data *tdata, - const pj_stun_msg *response); + const pj_stun_msg *response, + const pj_sockaddr_t *src_addr, + unsigned src_addr_len); /** diff --git a/pjnath/include/pjnath/stun_transaction.h b/pjnath/include/pjnath/stun_transaction.h index 23f63771..32dd0c41 100644 --- a/pjnath/include/pjnath/stun_transaction.h +++ b/pjnath/include/pjnath/stun_transaction.h @@ -70,10 +70,15 @@ typedef struct pj_stun_tsx_cb * response. * @param response The STUN response, which value may be NULL if * \a status is not PJ_SUCCESS. + * @param src_addr The source address of the response, if response + * is not NULL. + * @param src_addr_len The length of the source address. */ void (*on_complete)(pj_stun_client_tsx *tsx, pj_status_t status, - const pj_stun_msg *response); + const pj_stun_msg *response, + const pj_sockaddr_t *src_addr, + unsigned src_addr_len); /** * This callback is called by the STUN transaction when it wants to send @@ -228,11 +233,15 @@ PJ_DECL(pj_status_t) pj_stun_client_tsx_send_msg(pj_stun_client_tsx *tsx, * * @param tsx The STUN client transaction instance. * @param msg The incoming STUN message. + * @param src_addr The source address of the packet. + * @param src_addr_len The length of the source address. * * @return PJ_SUCCESS on success or the appropriate error code. */ PJ_DECL(pj_status_t) pj_stun_client_tsx_on_rx_msg(pj_stun_client_tsx *tsx, - const pj_stun_msg *msg); + const pj_stun_msg *msg, + const pj_sockaddr_t*src_addr, + unsigned src_addr_len); /** |