|
HOME
SIP/media Features
High Performance SIP
Small Footprint SIP
Symbian Port
FAQ
Documentation
Licensing
Download
Development (Trac)
Projects using pjsip
Mailing List
Open Source Links
About: PJLIB, PJLIB-UTIL, PJSIP, and PJMEDIA are created by: Benny Prijono <bennylp pjsip.org>
|
|
Home --> Documentations --> PJNATH Reference
ice_strans.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __PJNATH_ICE_STRANS_H__
00020 #define __PJNATH_ICE_STRANS_H__
00021
00022
00027 #include <pjnath/ice_session.h>
00028 #include <pjnath/stun_sock.h>
00029 #include <pjnath/turn_sock.h>
00030 #include <pjlib-util/resolver.h>
00031 #include <pj/ioqueue.h>
00032 #include <pj/timer.h>
00033
00034
00035 PJ_BEGIN_DECL
00036
00037
00058 typedef struct pj_ice_strans pj_ice_strans;
00059
00061 typedef enum pj_ice_strans_op
00062 {
00064 PJ_ICE_STRANS_OP_INIT,
00065
00067 PJ_ICE_STRANS_OP_NEGOTIATION
00068
00069 } pj_ice_strans_op;
00070
00075 typedef struct pj_ice_strans_cb
00076 {
00089 void (*on_rx_data)(pj_ice_strans *ice_st,
00090 unsigned comp_id,
00091 void *pkt, pj_size_t size,
00092 const pj_sockaddr_t *src_addr,
00093 unsigned src_addr_len);
00094
00102 void (*on_ice_complete)(pj_ice_strans *ice_st,
00103 pj_ice_strans_op op,
00104 pj_status_t status);
00105
00106 } pj_ice_strans_cb;
00107
00108
00114 typedef struct pj_ice_strans_cfg
00115 {
00120 int af;
00121
00130 pj_stun_config stun_cfg;
00131
00138 pj_dns_resolver *resolver;
00139
00145 struct {
00150 pj_stun_sock_cfg cfg;
00151
00158 pj_bool_t no_host_cands;
00159
00165 pj_bool_t loop_addr;
00166
00187 pj_str_t server;
00188
00199 pj_uint16_t port;
00200
00201 } stun;
00202
00206 struct {
00224 pj_str_t server;
00225
00236 pj_uint16_t port;
00237
00243 pj_turn_tp_type conn_type;
00244
00251 pj_stun_auth_cred auth_cred;
00252
00257 pj_turn_alloc_param alloc_param;
00258
00259 } turn;
00260
00261 } pj_ice_strans_cfg;
00262
00263
00269 PJ_DECL(void) pj_ice_strans_cfg_default(pj_ice_strans_cfg *cfg);
00270
00271
00279 PJ_DECL(void) pj_ice_strans_cfg_copy(pj_pool_t *pool,
00280 pj_ice_strans_cfg *dst,
00281 const pj_ice_strans_cfg *src);
00282
00283
00300 PJ_DECL(pj_status_t) pj_ice_strans_create(const char *name,
00301 const pj_ice_strans_cfg *cfg,
00302 unsigned comp_cnt,
00303 void *user_data,
00304 const pj_ice_strans_cb *cb,
00305 pj_ice_strans **p_ice_st);
00306
00316 PJ_DECL(pj_status_t) pj_ice_strans_destroy(pj_ice_strans *ice_st);
00317
00318
00326 PJ_DECL(void*) pj_ice_strans_get_user_data(pj_ice_strans *ice_st);
00327
00328
00346 PJ_DECL(pj_status_t) pj_ice_strans_init_ice(pj_ice_strans *ice_st,
00347 pj_ice_sess_role role,
00348 const pj_str_t *local_ufrag,
00349 const pj_str_t *local_passwd);
00350
00360 PJ_DECL(pj_bool_t) pj_ice_strans_has_sess(pj_ice_strans *ice_st);
00361
00362
00371 PJ_DECL(pj_bool_t) pj_ice_strans_sess_is_running(pj_ice_strans *ice_st);
00372
00373
00382 PJ_DECL(pj_bool_t) pj_ice_strans_sess_is_complete(pj_ice_strans *ice_st);
00383
00384
00396 PJ_DECL(unsigned) pj_ice_strans_get_running_comp_cnt(pj_ice_strans *ice_st);
00397
00398
00425 PJ_DECL(pj_status_t) pj_ice_strans_get_ufrag_pwd(pj_ice_strans *ice_st,
00426 pj_str_t *loc_ufrag,
00427 pj_str_t *loc_pwd,
00428 pj_str_t *rem_ufrag,
00429 pj_str_t *rem_pwd);
00430
00431
00445 PJ_DECL(pj_status_t) pj_ice_strans_enum_cands(pj_ice_strans *ice_st,
00446 unsigned comp_id,
00447 unsigned *count,
00448 pj_ice_sess_cand cand[]);
00449
00462 PJ_DECL(pj_status_t) pj_ice_strans_get_def_cand(pj_ice_strans *ice_st,
00463 unsigned comp_id,
00464 pj_ice_sess_cand *cand);
00465
00474 PJ_DECL(pj_ice_sess_role) pj_ice_strans_get_role(pj_ice_strans *ice_st);
00475
00476
00489 PJ_DECL(pj_status_t) pj_ice_strans_change_role(pj_ice_strans *ice_st,
00490 pj_ice_sess_role new_role);
00491
00492
00515 PJ_DECL(pj_status_t) pj_ice_strans_start_ice(pj_ice_strans *ice_st,
00516 const pj_str_t *rem_ufrag,
00517 const pj_str_t *rem_passwd,
00518 unsigned rcand_cnt,
00519 const pj_ice_sess_cand rcand[]);
00520
00532 PJ_DECL(const pj_ice_sess_check*)
00533 pj_ice_strans_get_valid_pair(const pj_ice_strans *ice_st,
00534 unsigned comp_id);
00535
00558 PJ_DECL(pj_status_t) pj_ice_strans_stop_ice(pj_ice_strans *ice_st);
00559
00560
00582 PJ_DECL(pj_status_t) pj_ice_strans_sendto(pj_ice_strans *ice_st,
00583 unsigned comp_id,
00584 const void *data,
00585 pj_size_t data_len,
00586 const pj_sockaddr_t *dst_addr,
00587 int dst_addr_len);
00588
00589
00595 PJ_END_DECL
00596
00597
00598
00599 #endif
00600
PJNATH - Open Source NAT traversal helper library supporting STUN, TURN, and ICE
(C)2001-2008 Benny Prijono
|
|