diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-03-21 09:12:22 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-03-21 09:12:22 +0000 |
commit | 6d9b32c4a8e1dfdb5809c6e1035ddfdda848a128 (patch) | |
tree | e1983ffcfb60b59d33615bb8bcfd972757fbe07d /pjnath/include | |
parent | 54037d38631be9cb082b61bbfd3cc6c218283ea1 (diff) |
s/stun_endpoint/stun_setting
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1090 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath/include')
-rw-r--r-- | pjnath/include/pjnath.h | 2 | ||||
-rw-r--r-- | pjnath/include/pjnath/ice.h | 20 | ||||
-rw-r--r-- | pjnath/include/pjnath/stun_setting.h (renamed from pjnath/include/pjnath/stun_endpoint.h) | 35 |
3 files changed, 26 insertions, 31 deletions
diff --git a/pjnath/include/pjnath.h b/pjnath/include/pjnath.h index 7562120a..42fc3ca3 100644 --- a/pjnath/include/pjnath.h +++ b/pjnath/include/pjnath.h @@ -20,7 +20,7 @@ #include <pjnath/config.h> #include <pjnath/errno.h> #include <pjnath/stun_auth.h> -#include <pjnath/stun_endpoint.h> +#include <pjnath/stun_setting.h> #include <pjnath/stun_msg.h> #include <pjnath/stun_session.h> #include <pjnath/stun_transaction.h> diff --git a/pjnath/include/pjnath/ice.h b/pjnath/include/pjnath/ice.h index 9f86894f..3b3325d3 100644 --- a/pjnath/include/pjnath/ice.h +++ b/pjnath/include/pjnath/ice.h @@ -147,16 +147,6 @@ typedef struct pj_ice_cb } pj_ice_cb; -typedef enum pj_ice_state -{ - PJ_ICE_STATE_INIT, - PJ_ICE_STATE_GATHERING, - PJ_ICE_STATE_CAND_COMPLETE, - PJ_ICE_STATE_CHECKING, - PJ_ICE_STATE_COMPLETE, - PJ_ICE_STATE_RESV_ERROR -} pj_ice_state; - typedef enum pj_ice_role { PJ_ICE_ROLE_CONTROLLED, @@ -175,7 +165,6 @@ struct pj_ice int af; int sock_type; pj_ice_role role; - pj_ice_state state; pj_ice_cb cb; pj_stun_config stun_cfg; @@ -198,9 +187,12 @@ struct pj_ice unsigned rcand_cnt; pj_ice_cand rcand[PJ_ICE_MAX_CAND]; - /* Checklists */ - pj_ice_checklist cklist; - pj_ice_checklist valid_list; + /* Checklist */ + pj_ice_checklist clist; + + /* Valid list */ + unsigned valid_cnt; + unsigned valid_list[PJ_ICE_MAX_CHECKS]; /* STUN servers */ pj_dns_resolver *resv; diff --git a/pjnath/include/pjnath/stun_endpoint.h b/pjnath/include/pjnath/stun_setting.h index d9a32b5c..66a5f7aa 100644 --- a/pjnath/include/pjnath/stun_endpoint.h +++ b/pjnath/include/pjnath/stun_setting.h @@ -32,16 +32,14 @@ PJ_BEGIN_DECL /* **************************************************************************/ /** - * @defgroup PJNATH_STUN_ENDPOINT STUN Endpoint - * @brief Management of incoming and outgoing STUN transactions. + * @defgroup PJNATH_STUN_SETTING STUN Settings + * @brief STUN settings. * @ingroup PJNATH_STUN * @{ */ /** - * Opaque declaration for STUN endpoint. STUN endpoint manages client and - * server STUN transactions, and it needs to be initialized before application - * can send or receive STUN messages. + * Opaque declaration for STUN setting. */ typedef struct pj_stun_config { @@ -91,18 +89,23 @@ typedef struct pj_stun_config /** - * Create a STUN endpoint instance. + * Initialize STUN config. */ -PJ_DECL(pj_status_t) pj_stun_config_create(pj_pool_factory *factory, - unsigned options, - pj_ioqueue_t *ioqueue, - pj_timer_heap_t *timer_heap, - pj_stun_config **p_endpt); - -/** - * Destroy STUN endpoint instance. - */ -PJ_DECL(pj_status_t) pj_stun_config_destroy(pj_stun_config *endpt); +PJ_INLINE(void) pj_stun_config_init(pj_stun_config *cfg, + pj_pool_factory *factory, + unsigned options, + pj_ioqueue_t *ioqueue, + pj_timer_heap_t *timer_heap) +{ + pj_bzero(cfg, sizeof(*cfg)); + + cfg->pf = factory; + cfg->options = options; + cfg->ioqueue = ioqueue; + cfg->timer_heap = timer_heap; + cfg->rto_msec = PJ_STUN_RTO_VALUE; + cfg->res_cache_msec = 10000; +} /** |