- Timestamp:
- Mar 25, 2007 6:44:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath/ice_stream_transport.h
r1099 r1104 45 45 { 46 46 void (*on_rx_data)(pj_ice_st *ice_st, 47 unsigned comp_id, unsigned cand_id,47 unsigned comp_id, 48 48 void *pkt, pj_size_t size, 49 49 const pj_sockaddr_t *src_addr, … … 55 55 56 56 57 #ifndef PJ_ICE_ST_MAX_ALIASES 58 # define PJ_ICE_ST_MAX_ALIASES 8 59 #endif 60 61 enum pj_ice_st_option 62 { 63 PJ_ICE_ST_OPT_DISABLE_STUN = 1, 64 PJ_ICE_ST_OPT_DISABLE_RELAY = 2, 65 PJ_ICE_ST_OPT_NO_PORT_RETRY = 4, 66 }; 67 68 69 typedef struct pj_ice_st_cand 70 { 71 pj_ice_cand_type type; 72 pj_status_t status; 73 pj_sockaddr addr; 74 int cand_id; 75 pj_uint16_t local_pref; 76 pj_str_t foundation; 77 } pj_ice_st_cand; 78 79 57 80 typedef struct pj_ice_st_comp 58 81 { 82 pj_ice_st *ice_st; 59 83 unsigned comp_id; 60 } pj_ice_st_comp; 84 pj_uint32_t options; 85 pj_sock_t sock; 61 86 87 pj_stun_session *stun_sess; 62 88 63 typedef struct pj_ice_st_interface 64 { 65 pj_ice_st *ice_st; 66 pj_ice_cand_type type; 67 pj_status_t status; 68 unsigned comp_id; 69 int cand_id; 70 pj_str_t foundation; 71 pj_uint16_t local_pref; 72 pj_sock_t sock; 73 pj_sockaddr addr; 74 pj_sockaddr base_addr; 89 pj_sockaddr local_addr; 90 91 unsigned pending_cnt; 92 pj_status_t last_status; 93 94 unsigned cand_cnt; 95 pj_ice_st_cand cand_list[PJ_ICE_ST_MAX_ALIASES]; 96 int default_cand; 97 75 98 pj_ioqueue_key_t *key; 76 99 pj_uint8_t pkt[1500]; … … 79 102 pj_sockaddr src_addr; 80 103 int src_addr_len; 81 pj_stun_session *stun_sess; 82 } pj_ice_st_ interface;104 105 } pj_ice_st_comp; 83 106 84 107 … … 94 117 95 118 unsigned comp_cnt; 96 unsigned comps[PJ_ICE_MAX_COMP]; 97 98 unsigned itf_cnt; 99 pj_ice_st_interface *itfs[PJ_ICE_MAX_CAND]; 119 pj_ice_st_comp **comp; 100 120 101 121 pj_dns_resolver *resolver; 102 pj_bool_t relay_enabled; 103 pj_str_t stun_domain; 122 pj_bool_t has_resolver_job; 104 123 pj_sockaddr_in stun_srv; 124 pj_sockaddr_in turn_srv; 105 125 }; 106 126 … … 108 128 PJ_DECL(pj_status_t) pj_ice_st_create(pj_stun_config *stun_cfg, 109 129 const char *name, 130 unsigned comp_cnt, 110 131 void *user_data, 111 132 const pj_ice_st_cb *cb, … … 113 134 PJ_DECL(pj_status_t) pj_ice_st_destroy(pj_ice_st *ice_st); 114 135 115 PJ_DECL(pj_status_t) pj_ice_st_set_stun(pj_ice_st *ice_st, 116 pj_dns_resolver *resolver, 117 pj_bool_t enable_relay, 118 const pj_str_t *domain); 119 PJ_DECL(pj_status_t) pj_ice_st_set_stun_addr(pj_ice_st *ice_st, 120 pj_bool_t enable_relay, 121 const pj_sockaddr_in *srv_addr); 136 PJ_DECL(pj_status_t) pj_ice_st_set_stun_domain(pj_ice_st *ice_st, 137 pj_dns_resolver *resolver, 138 const pj_str_t *domain); 139 PJ_DECL(pj_status_t) pj_ice_st_set_stun_srv(pj_ice_st *ice_st, 140 const pj_sockaddr_in *stun_srv, 141 const pj_sockaddr_in *turn_srv); 122 142 123 PJ_DECL(pj_status_t) pj_ice_st_add_comp(pj_ice_st *ice_st, 124 unsigned comp_id); 143 PJ_DECL(pj_status_t) pj_ice_st_create_comp(pj_ice_st *ice_st, 144 unsigned comp_id, 145 pj_uint32_t options, 146 const pj_sockaddr_in *addr, 147 unsigned *p_itf_id); 125 148 126 PJ_DECL(pj_status_t) pj_ice_st_add_host_interface(pj_ice_st *ice_st, 127 unsigned comp_id, 128 pj_uint16_t local_pref, 129 const pj_sockaddr_in *addr, 130 unsigned *p_itf_id); 131 PJ_DECL(pj_status_t) pj_ice_st_add_all_host_interfaces(pj_ice_st *ice_st, 132 unsigned comp_id, 133 unsigned port); 134 PJ_DECL(pj_status_t) pj_ice_st_add_stun_interface(pj_ice_st *ice_st, 135 unsigned comp_id, 136 unsigned local_port, 137 unsigned *p_itf_id); 138 PJ_DECL(pj_status_t) pj_ice_st_add_relay_interface(pj_ice_st *ice_st, 139 unsigned comp_id, 140 unsigned local_port, 141 pj_bool_t notify, 142 void *notify_data); 143 PJ_DECL(pj_status_t) pj_ice_st_get_interfaces_status(pj_ice_st *ice_st); 149 PJ_DECL(pj_status_t) pj_ice_st_get_comps_status(pj_ice_st *ice_st); 144 150 145 151 PJ_DECL(pj_status_t) pj_ice_st_init_ice(pj_ice_st *ice_st, … … 157 163 PJ_DECL(pj_status_t) pj_ice_st_stop_ice(pj_ice_st *ice_st); 158 164 159 PJ_DECL(pj_status_t) pj_ice_st_send_data(pj_ice_st *ice_st,160 unsigned comp_id,161 const void *data,162 pj_size_t data_len);163 165 PJ_DECL(pj_status_t) pj_ice_st_sendto(pj_ice_st *ice_st, 164 166 unsigned comp_id, 165 unsigned itf_id,166 167 const void *data, 167 168 pj_size_t data_len,
Note: See TracChangeset
for help on using the changeset viewer.