Ignore:
Timestamp:
Mar 21, 2007 10:05:58 PM (17 years ago)
Author:
bennylp
Message:

Added pjnath-test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/src/pjnath/ice.c

    r1092 r1093  
    137137                                  pj_ice_role role, 
    138138                                  const pj_ice_cb *cb, 
    139                                   int af, 
    140                                   int sock_type, 
    141139                                  pj_ice **p_ice) 
    142140{ 
     
    147145 
    148146    PJ_ASSERT_RETURN(stun_cfg && cb && p_ice, PJ_EINVAL); 
    149     PJ_ASSERT_RETURN(sock_type==PJ_SOCK_DGRAM || sock_type==PJ_SOCK_STREAM, 
    150                      PJ_EINVAL); 
    151147 
    152148    if (!name) 
     
    156152    ice = PJ_POOL_ZALLOC_T(pool, pj_ice); 
    157153    ice->pool = pool; 
    158     ice->af = af; 
    159     ice->sock_type = sock_type; 
    160154    ice->role = role; 
    161155 
     
    436430 
    437431    pj_strdup(ice->pool, &ice->tx_uname, &username); 
     432    pj_strdup(ice->pool, &ice->tx_ufrag, remote_ufrag); 
    438433    pj_strdup(ice->pool, &ice->tx_pass, remote_pass); 
    439434 
     
    443438 
    444439    pj_strdup(ice->pool, &ice->rx_uname, &username); 
     440    pj_strdup(ice->pool, &ice->rx_ufrag, local_ufrag); 
    445441    pj_strdup(ice->pool, &ice->rx_pass, local_pass); 
    446442 
     
    482478    char tmp[128]; 
    483479 
    484     PJ_ASSERT_RETURN(ice && comp_id && type && local_pref && 
     480    PJ_ASSERT_RETURN(ice && comp_id && local_pref && 
    485481                     foundation && addr && base_addr && addr_len, 
    486482                     PJ_EINVAL); 
     
    704700    for (i=0; i<clist->count; ++i) { 
    705701        const pj_ice_check *c = &clist->checks[i]; 
    706         LOG((ice->obj_name, " %d: %s (prio=%u, state=%s)", 
     702        LOG((ice->obj_name, " %d: %s (prio=0x%"PJ_INT64_FMT"x, state=%s)", 
    707703             i, dump_check(buffer, sizeof(buffer), c), 
    708704             c->prio, check_state_name[c->state])); 
     
    11021098    lcand = check->lcand; 
    11031099    rcand = check->rcand; 
    1104     comp = &ice->comp[lcand->comp_id]; 
     1100    comp = find_comp(ice, lcand->comp_id); 
    11051101 
    11061102    LOG((ice->obj_name,  
     
    17341730    pj_status_t status = PJ_SUCCESS; 
    17351731    pj_ice_comp *comp; 
    1736     pj_bool_t is_stun; 
     1732    pj_status_t stun_status; 
    17371733 
    17381734    PJ_ASSERT_RETURN(ice, PJ_EINVAL); 
     
    17461742    } 
    17471743 
    1748     is_stun = pj_stun_msg_check(pkt, pkt_size, PJ_STUN_IS_DATAGRAM); 
    1749     if (is_stun) { 
     1744    stun_status = pj_stun_msg_check(pkt, pkt_size, PJ_STUN_IS_DATAGRAM); 
     1745    if (stun_status == PJ_SUCCESS) { 
    17501746        status = pj_stun_session_on_rx_pkt(comp->stun_sess, pkt, pkt_size, 
    17511747                                           PJ_STUN_IS_DATAGRAM, 
Note: See TracChangeset for help on using the changeset viewer.