Changeset 1450


Ignore:
Timestamp:
Sep 24, 2007 7:46:41 PM (17 years ago)
Author:
bennylp
Message:

Ticket #382: Updated ICE from draft-ietf-mmusic-ice-14 to ice-18 specification, and also done some other tweaks as well

Location:
pjproject/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/include/pj/doxygen.h

    r974 r1450  
    5656 * @subsection doc_ver_subsec Version 
    5757 * 
    58  * This document corresponds to PJLIB version 0.5.10. 
     58 * This document corresponds to PJLIB version 0.7.0-trunk. 
    5959 * 
    6060 * 
  • pjproject/trunk/pjlib/src/pj/ip_helper_win32.c

    r1419 r1450  
    3535#include <pj/string.h> 
    3636 
     37#ifndef PJ_IP_HELPER_IGNORE_LOOPBACK_IF 
     38#   define PJ_IP_HELPER_IGNORE_LOOPBACK_IF      1 
     39#endif 
     40 
    3741typedef DWORD (WINAPI *PFN_GetIpAddrTable)(PMIB_IPADDRTABLE pIpAddrTable,  
    3842                                           PULONG pdwSize,  
     
    4145                                              PULONG pdwSize,  
    4246                                              BOOL bOrder); 
     47typedef DWORD (WINAPI *PFN_GetIfEntry)(PMIB_IFROW pIfRow); 
    4348 
    4449static HANDLE s_hDLL; 
    4550static PFN_GetIpAddrTable s_pfnGetIpAddrTable; 
    4651static PFN_GetIpForwardTable s_pfnGetIpForwardTable; 
     52static PFN_GetIfEntry s_pfnGetIfEntry; 
    4753 
    4854static void unload_iphlp_module(void) 
     
    8490    return ERROR_NOT_SUPPORTED; 
    8591} 
     92 
     93 
     94#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF 
     95static DWORD MyGetIfEntry(MIB_IFROW *pIfRow) 
     96{ 
     97    if(NULL == s_pfnGetIfEntry) { 
     98        s_pfnGetIfEntry = (PFN_GetIfEntry)  
     99            GetIpHlpApiProc(PJ_T("GetIfEntry")); 
     100    } 
     101     
     102    if(NULL != s_pfnGetIfEntry) { 
     103        return s_pfnGetIfEntry(pIfRow); 
     104    } 
     105     
     106    return ERROR_NOT_SUPPORTED; 
     107} 
     108#endif 
    86109 
    87110 
     
    135158    *p_cnt = 0; 
    136159    for (i=0; i<count; ++i) { 
     160        MIB_IFROW ifRow; 
     161 
    137162        /* Some Windows returns 0.0.0.0! */ 
    138163        if (pTab->table[i].dwAddr == 0) 
    139164            continue; 
     165 
     166#if PJ_IP_HELPER_IGNORE_LOOPBACK_IF 
     167        /* Investigate the type of this interface */ 
     168        pj_bzero(&ifRow, sizeof(ifRow)); 
     169        ifRow.dwIndex = pTab->table[i].dwIndex; 
     170        if (MyGetIfEntry(&ifRow) != 0) 
     171            continue; 
     172 
     173        if (ifRow.dwType == MIB_IF_TYPE_LOOPBACK) 
     174            continue; 
     175#endif 
     176 
    140177        ifs[*p_cnt].s_addr = pTab->table[i].dwAddr; 
    141178        (*p_cnt)++; 
  • pjproject/trunk/pjmedia/include/pjmedia/doxygen.h

    r974 r1450  
    9292 * @ref plc_codec,  
    9393 * @ref PJMEDIA_CONF,  
    94  * @ref PJMED_G711 "G711/G.711 (PCMA/PCMU) codec with PLC", 
    95  * @ref PJMED_GSM "GSM codec with PLC",  
     94 * @ref PJMED_G711 "G711/G.711 (PCMA/PCMU) codec", 
     95 * @ref PJMED_GSM "GSM codec",  
    9696 * @ref PJMED_L16 "linear codecs (multiple clockrate, stereo support, etc)", 
    9797 * @ref PJMED_SPEEX "Speex codec (narrowband, wideband, ultra-wideband)", 
  • pjproject/trunk/pjnath/include/pjnath/config.h

    r1439 r1450  
    235235 
    236236 
     237/** 
     238 * This constant specifies the length of random string generated for ICE 
     239 * ufrag and password. 
     240 * 
     241 * Default: 8 (characters) 
     242 */ 
     243#ifndef PJ_ICE_UFRAG_LEN 
     244#   define PJ_ICE_UFRAG_LEN                         8 
     245#endif 
     246 
    237247 
    238248/** 
  • pjproject/trunk/pjnath/include/pjnath/types.h

    r1439 r1450  
    158158 * methodology for traversing Network Address Translator (NAT), and 
    159159 * is described in  
    160  * <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-mmusic-ice-14.txt"> 
    161  * <B>draft-ietf-mmusic-ice-14.txt</B></A> draft. The PJNATH ICE 
     160 * <A HREF="http://www.ietf.org/internet-drafts/draft-ietf-mmusic-ice-18.txt"> 
     161 * <B>draft-ietf-mmusic-ice-18.txt</B></A> draft. The PJNATH ICE 
    162162 * implementation is aimed to provide a usable and generic ICE transports 
    163163 * for different types of application, including but not limited to 
  • pjproject/trunk/pjnath/src/pjnath/ice_session.c

    r1439 r1450  
    215215    /* Create STUN session for this candidate */ 
    216216    status = pj_stun_session_create(&ice->stun_cfg, NULL,  
    217                                     &sess_cb, PJ_FALSE, 
     217                                    &sess_cb, PJ_TRUE, 
    218218                                    &comp->stun_sess); 
    219219    if (status != PJ_SUCCESS) 
     
    297297 
    298298    if (local_ufrag == NULL) { 
    299         ice->rx_ufrag.ptr = (char*) pj_pool_alloc(ice->pool, 16); 
    300         pj_create_random_string(ice->rx_ufrag.ptr, 16); 
    301         ice->rx_ufrag.slen = 16; 
     299        ice->rx_ufrag.ptr = (char*) pj_pool_alloc(ice->pool, PJ_ICE_UFRAG_LEN); 
     300        pj_create_random_string(ice->rx_ufrag.ptr, PJ_ICE_UFRAG_LEN); 
     301        ice->rx_ufrag.slen = PJ_ICE_UFRAG_LEN; 
    302302    } else { 
    303303        pj_strdup(ice->pool, &ice->rx_ufrag, local_ufrag); 
     
    305305 
    306306    if (local_passwd == NULL) { 
    307         ice->rx_pass.ptr = (char*) pj_pool_alloc(ice->pool, 16); 
    308         pj_create_random_string(ice->rx_pass.ptr, 16); 
    309         ice->rx_pass.slen = 16; 
     307        ice->rx_pass.ptr = (char*) pj_pool_alloc(ice->pool, PJ_ICE_UFRAG_LEN); 
     308        pj_create_random_string(ice->rx_pass.ptr, PJ_ICE_UFRAG_LEN); 
     309        ice->rx_pass.slen = PJ_ICE_UFRAG_LEN; 
    310310    } else { 
    311311        pj_strdup(ice->pool, &ice->rx_pass, local_passwd); 
  • pjproject/trunk/pjnath/src/pjnath/ice_strans.c

    r1434 r1450  
    591591 
    592592        /* Send STUN binding request */ 
    593         PJ_LOG(5,(ice_st->obj_name, "Sending STUN keep-alive")); 
     593        PJ_LOG(5,(ice_st->obj_name, "Sending STUN keep-alive from %s;%d", 
     594                  pj_inet_ntoa(comp->local_addr.ipv4.sin_addr), 
     595                  pj_ntohs(comp->local_addr.ipv4.sin_port))); 
    594596        status = pj_stun_session_send_msg(comp->stun_sess, PJ_FALSE,  
    595597                                          &ice_st->stun_srv,  
     
    11381140    } 
    11391141 
     1142    /* Save IP address for logging */ 
     1143    pj_ansi_strcpy(ip, pj_inet_ntoa(comp->local_addr.ipv4.sin_addr)); 
     1144 
    11401145    /* Ignore response if it reports the same address */ 
    1141     if (cand->addr.ipv4.sin_addr.s_addr == mapped_addr->ipv4.sin_addr.s_addr && 
    1142         cand->addr.ipv4.sin_port == mapped_addr->ipv4.sin_port) 
     1146    if (comp->local_addr.ipv4.sin_addr.s_addr == mapped_addr->ipv4.sin_addr.s_addr && 
     1147        comp->local_addr.ipv4.sin_port == mapped_addr->ipv4.sin_port) 
    11431148    { 
     1149        PJ_LOG(4,(comp->ice_st->obj_name,  
     1150                  "Candidate %s:%d is directly connected to Internet, " 
     1151                  "STUN mapped address is ignored", 
     1152                  ip, pj_ntohs(comp->local_addr.ipv4.sin_port))); 
    11441153        return; 
    11451154    } 
    1146  
    1147     pj_ansi_strcpy(ip, pj_inet_ntoa(comp->local_addr.ipv4.sin_addr)); 
    11481155 
    11491156    PJ_LOG(4,(comp->ice_st->obj_name,  
  • pjproject/trunk/pjnath/src/pjnath/stun_msg_dump.c

    r1439 r1450  
    116116            attr = (const pj_stun_uint_attr*)ahdr; 
    117117            len = pj_ansi_snprintf(p, end-p, 
    118                                    ", value=%d (0x%x)\n", 
     118                                   ", value=%u (0x%x)\n", 
    119119                                   (pj_uint32_t)attr->value, 
    120120                                   (pj_uint32_t)attr->value); 
Note: See TracChangeset for help on using the changeset viewer.