Changeset 1111 for pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
- Timestamp:
- Mar 28, 2007 3:49:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r1108 r1111 25 25 { 26 26 pjmedia_transport base; 27 pj_ice_st *ice_st;27 pj_ice_strans *ice_st; 28 28 29 29 pj_time_val start_ice; … … 70 70 * And these are ICE callbacks. 71 71 */ 72 static void ice_on_rx_data(pj_ice_st *ice_st, unsigned comp_id,72 static void ice_on_rx_data(pj_ice_strans *ice_st, unsigned comp_id, 73 73 void *pkt, pj_size_t size, 74 74 const pj_sockaddr_t *src_addr, 75 75 unsigned src_addr_len); 76 static void ice_on_ice_complete(pj_ice_st *ice_st,76 static void ice_on_ice_complete(pj_ice_strans *ice_st, 77 77 pj_status_t status); 78 78 … … 96 96 pjmedia_transport **p_tp) 97 97 { 98 pj_ice_st *ice_st;99 pj_ice_st _cb ice_st_cb;98 pj_ice_strans *ice_st; 99 pj_ice_strans_cb ice_st_cb; 100 100 struct transport_ice *tp_ice; 101 101 pj_status_t status; … … 109 109 110 110 /* Create ICE */ 111 status = pj_ice_st _create(stun_cfg, name, comp_cnt, NULL,111 status = pj_ice_strans_create(stun_cfg, name, comp_cnt, NULL, 112 112 &ice_st_cb, &ice_st); 113 113 if (status != PJ_SUCCESS) … … 137 137 138 138 if (tp_ice->ice_st) { 139 pj_ice_st _destroy(tp_ice->ice_st);139 pj_ice_strans_destroy(tp_ice->ice_st); 140 140 //Must not touch tp_ice after ice_st is destroyed! 141 141 //(it has the pool) … … 156 156 pj_status_t status; 157 157 158 status = pj_ice_st _set_stun_srv(tp_ice->ice_st, stun_srv, turn_srv);158 status = pj_ice_strans_set_stun_srv(tp_ice->ice_st, stun_srv, turn_srv); 159 159 if (status != PJ_SUCCESS) 160 160 return status; 161 161 162 status = pj_ice_st _create_comp(tp_ice->ice_st, 1, options, start_addr);162 status = pj_ice_strans_create_comp(tp_ice->ice_st, 1, options, start_addr); 163 163 if (status != PJ_SUCCESS) 164 164 return status; … … 178 178 ++port; 179 179 addr.sin_port = pj_htons(port); 180 status = pj_ice_st _create_comp(tp_ice->ice_st, 2, options, &addr);180 status = pj_ice_strans_create_comp(tp_ice->ice_st, 2, options, &addr); 181 181 if (status != PJ_SUCCESS) 182 182 return status; … … 189 189 { 190 190 struct transport_ice *tp_ice = (struct transport_ice*)tp; 191 return pj_ice_st _get_comps_status(tp_ice->ice_st);191 return pj_ice_strans_get_comps_status(tp_ice->ice_st); 192 192 } 193 193 … … 195 195 PJ_DEF(pj_status_t) pjmedia_ice_get_comp( pjmedia_transport *tp, 196 196 unsigned comp_id, 197 pj_ice_st _comp *comp)197 pj_ice_strans_comp *comp) 198 198 { 199 199 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 201 201 comp, PJ_EINVAL); 202 202 203 pj_memcpy(comp, tp_ice->ice_st->comp[comp_id-1], sizeof(pj_ice_st _comp));203 pj_memcpy(comp, tp_ice->ice_st->comp[comp_id-1], sizeof(pj_ice_strans_comp)); 204 204 return PJ_SUCCESS; 205 205 } 206 206 207 PJ_DEF(pj_ice_st *) pjmedia_ice_get_ice_st(pjmedia_transport *tp)207 PJ_DEF(pj_ice_strans*) pjmedia_ice_get_ice_st(pjmedia_transport *tp) 208 208 { 209 209 struct transport_ice *tp_ice = (struct transport_ice*)tp; … … 213 213 214 214 PJ_DEF(pj_status_t) pjmedia_ice_init_ice(pjmedia_transport *tp, 215 pj_ice_ role role,215 pj_ice_sess_role role, 216 216 const pj_str_t *local_ufrag, 217 217 const pj_str_t *local_passwd) 218 218 { 219 219 struct transport_ice *tp_ice = (struct transport_ice*)tp; 220 return pj_ice_st _init_ice(tp_ice->ice_st, role, local_ufrag, local_passwd);220 return pj_ice_strans_init_ice(tp_ice->ice_st, role, local_ufrag, local_passwd); 221 221 } 222 222 … … 247 247 cand_cnt = tp_ice->ice_st->ice->lcand_cnt; 248 248 for (i=0; i<cand_cnt; ++i) { 249 pj_ice_ cand *cand;249 pj_ice_sess_cand *cand; 250 250 pj_str_t value; 251 251 int len; … … 308 308 static pj_status_t parse_cand(pj_pool_t *pool, 309 309 const pj_str_t *orig_input, 310 pj_ice_ cand *cand)310 pj_ice_sess_cand *cand) 311 311 { 312 312 pj_str_t input; … … 407 407 pjmedia_sdp_attr *attr; 408 408 unsigned i, cand_cnt; 409 pj_ice_ cand cand[PJ_ICE_MAX_CAND];409 pj_ice_sess_cand cand[PJ_ICE_MAX_CAND]; 410 410 pjmedia_sdp_media *sdp_med; 411 411 pj_str_t uname, pass; … … 465 465 466 466 /* Start ICE */ 467 return pj_ice_st _start_ice(tp_ice->ice_st, &uname, &pass, cand_cnt, cand);467 return pj_ice_strans_start_ice(tp_ice->ice_st, &uname, &pass, cand_cnt, cand); 468 468 } 469 469 … … 472 472 { 473 473 struct transport_ice *tp_ice = (struct transport_ice*)tp; 474 return pj_ice_st _stop_ice(tp_ice->ice_st);474 return pj_ice_strans_stop_ice(tp_ice->ice_st); 475 475 } 476 476 … … 480 480 { 481 481 struct transport_ice *tp_ice = (struct transport_ice*)tp; 482 pj_ice_st *ice_st = tp_ice->ice_st;483 pj_ice_st _comp *comp;482 pj_ice_strans *ice_st = tp_ice->ice_st; 483 pj_ice_strans_comp *comp; 484 484 485 485 pj_bzero(info, sizeof(*info)); … … 552 552 { 553 553 struct transport_ice *tp_ice = (struct transport_ice*)tp; 554 return pj_ice_st _sendto(tp_ice->ice_st, 1,554 return pj_ice_strans_sendto(tp_ice->ice_st, 1, 555 555 pkt, size, &tp_ice->remote_rtp, 556 556 sizeof(pj_sockaddr_in)); … … 564 564 struct transport_ice *tp_ice = (struct transport_ice*)tp; 565 565 if (tp_ice->ice_st->comp_cnt > 1) { 566 return pj_ice_st _sendto(tp_ice->ice_st, 2,566 return pj_ice_strans_sendto(tp_ice->ice_st, 2, 567 567 pkt, size, &tp_ice->remote_rtp, 568 568 sizeof(pj_sockaddr_in)); … … 573 573 574 574 575 static void ice_on_rx_data(pj_ice_st *ice_st, unsigned comp_id,575 static void ice_on_rx_data(pj_ice_strans *ice_st, unsigned comp_id, 576 576 void *pkt, pj_size_t size, 577 577 const pj_sockaddr_t *src_addr, … … 592 592 593 593 594 static void ice_on_ice_complete(pj_ice_st *ice_st,594 static void ice_on_ice_complete(pj_ice_strans *ice_st, 595 595 pj_status_t status) 596 596 { 597 597 struct transport_ice *tp_ice = (struct transport_ice*) ice_st->user_data; 598 598 pj_time_val end_ice; 599 pj_ice_ cand *lcand, *rcand;600 pj_ice_ check *check;599 pj_ice_sess_cand *lcand, *rcand; 600 pj_ice_sess_check *check; 601 601 char src_addr[32]; 602 602 char dst_addr[32];
Note: See TracChangeset
for help on using the changeset viewer.