Changeset 1093


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

Added pjnath-test

Location:
pjproject/trunk/pjnath
Files:
9 added
6 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjnath/build/pjnath.dsp

    r1091 r1093  
    9696# Begin Source File 
    9797 
     98SOURCE=..\src\pjnath\ice_mt.c 
     99# End Source File 
     100# Begin Source File 
     101 
    98102SOURCE=..\src\pjnath\stun_auth.c 
    99103# End Source File 
     
    129133 
    130134SOURCE=..\include\pjnath\ice.h 
     135# End Source File 
     136# Begin Source File 
     137 
     138SOURCE=..\include\pjnath\ice_mt.h 
    131139# End Source File 
    132140# Begin Source File 
  • pjproject/trunk/pjnath/build/pjnath.dsw

    r1080 r1093  
    3636Package=<4> 
    3737{{{ 
     38}}} 
     39 
     40############################################################################### 
     41 
     42Project: "pjnath_test"=.\pjnath_test.dsp - Package Owner=<4> 
     43 
     44Package=<5> 
     45{{{ 
     46}}} 
     47 
     48Package=<4> 
     49{{{ 
     50    Begin Project Dependency 
     51    Project_Dep_Name pjlib 
     52    End Project Dependency 
     53    Begin Project Dependency 
     54    Project_Dep_Name pjlib_util 
     55    End Project Dependency 
     56    Begin Project Dependency 
     57    Project_Dep_Name pjnath 
     58    End Project Dependency 
    3859}}} 
    3960 
  • pjproject/trunk/pjnath/include/pjnath.h

    r1091 r1093  
    2020#include <pjnath/config.h> 
    2121#include <pjnath/errno.h> 
     22#include <pjnath/ice.h> 
     23#include <pjnath/ice_mt.h> 
    2224#include <pjnath/stun_auth.h> 
    2325#include <pjnath/stun_config.h> 
  • pjproject/trunk/pjnath/include/pjnath/ice.h

    r1092 r1093  
    2121 
    2222/** 
    23  * @file ice_sock.h 
    24  * @brief ICE socket. 
     23 * @file ice.h 
     24 * @brief ICE. 
    2525 */ 
    2626#include <pjnath/types.h> 
     
    2929#include <pj/timer.h> 
    3030 
     31/** 
     32 * @defgroup PJNATH_ICE Interactive Connectivity Establishment (ICE) 
     33 * @brief Interactive Connectivity Establishment (ICE) 
     34 * @ingroup PJNATH 
     35 */ 
     36 
    3137 
    3238PJ_BEGIN_DECL 
    3339 
    3440 
    35 /* **************************************************************************/ 
    36 /** 
    37  * @defgroup PJNATH_ICE_SOCK ICE Socket 
    38  * @brief High level ICE socket abstraction. 
    39  * @ingroup PJNATH 
     41/** 
     42 * @defgroup PJNATH_ICE_STREAM Transport Independent ICE Media Stream 
     43 * @brief Transport Independent ICE Media Stream 
     44 * @ingroup PJNATH_ICE 
    4045 * @{ 
    4146 */ 
     
    166171 
    167172    pj_pool_t           *pool; 
     173    void                *user_data; 
    168174    pj_mutex_t          *mutex; 
    169     int                  af; 
    170     int                  sock_type; 
    171175    pj_ice_role          role; 
    172176    pj_bool_t            is_complete; 
     
    177181 
    178182    /* STUN credentials */ 
     183    pj_str_t             tx_ufrag; 
    179184    pj_str_t             tx_uname; 
    180185    pj_str_t             tx_pass; 
     186    pj_str_t             rx_ufrag; 
    181187    pj_str_t             rx_uname; 
    182188    pj_str_t             rx_pass; 
     
    207213                                   pj_ice_role role, 
    208214                                   const pj_ice_cb *cb, 
    209                                    int af, 
    210                                    int sock_type, 
    211215                                   pj_ice **p_ice); 
    212216PJ_DECL(pj_status_t) pj_ice_destroy(pj_ice *ice); 
     
    215219                                     const pj_sockaddr_t *local_addr, 
    216220                                     unsigned addr_len); 
    217 PJ_DECL(pj_status_t) pj_ice_add_sock_comp(pj_ice *ice, 
    218                                           unsigned comp_id, 
    219                                           pj_sock_t sock); 
    220221PJ_DECL(pj_status_t) pj_ice_set_credentials(pj_ice *ice, 
    221222                                            const pj_str_t *local_ufrag, 
  • 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, 
  • pjproject/trunk/pjnath/src/pjnath/stun_msg.c

    r1085 r1093  
    482482              PJ_STUN_ATTR_END_EXTENDED_ATTR-PJ_STUN_ATTR_START_EXTENDED_ATTR); 
    483483 
    484     if (attr_type < PJ_STUN_ATTR_START_EXTENDED_ATTR) 
     484    if (attr_type < PJ_STUN_ATTR_END_MANDATORY_ATTR) 
    485485        desc = &mandatory_attr_desc[attr_type]; 
    486486    else if (attr_type >= PJ_STUN_ATTR_START_EXTENDED_ATTR && 
Note: See TracChangeset for help on using the changeset viewer.