Changeset 2714


Ignore:
Timestamp:
May 18, 2009 11:49:46 PM (15 years ago)
Author:
bennylp
Message:

Ticket #856: Put back the ICE candidate priority values according to the default values in the draft-mmusic-ice

Location:
pjproject/branches/projects/sipit24/pjnath
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/sipit24/pjnath/include/pjnath/config.h

    r2705 r2714  
    260260#define PJ_ICE_MAX_COMP             (2<<PJ_ICE_COMP_BITS) 
    261261 
     262/** 
     263 * Use the priority value according to the ice-draft. 
     264 */ 
     265#ifndef PJNATH_ICE_PRIO_STD 
     266#   define PJNATH_ICE_PRIO_STD                      1 
     267#endif 
     268 
    262269 
    263270/** 
     
    265272 */ 
    266273#ifndef PJ_ICE_CAND_TYPE_PREF_BITS 
    267 #   define PJ_ICE_CAND_TYPE_PREF_BITS               2 
     274#   if PJNATH_ICE_PRIO_STD 
     275#       define PJ_ICE_CAND_TYPE_PREF_BITS           8 
     276#   else 
     277#       define PJ_ICE_CAND_TYPE_PREF_BITS           2 
     278#   endif 
    268279#endif 
    269280 
  • pjproject/branches/projects/sipit24/pjnath/src/pjnath/ice_session.c

    r2708 r2714  
    3030#include <pj/string.h> 
    3131 
    32  
    3332/* String names for candidate types */ 
    3433static const char *cand_type_names[] = 
     
    243242                                    const pj_sockaddr *base_addr) 
    244243{ 
    245 #if 0 
     244#if PJNATH_ICE_PRIO_STD 
    246245    char buf[64]; 
    247246    pj_uint32_t val; 
     
    659658                                  pj_uint32_t comp_id) 
    660659{ 
    661 #if 0 
     660#if PJNATH_ICE_PRIO_STD 
    662661    return ((ice->prefs[type] & 0xFF) << 24) +  
    663662           ((local_pref & 0xFFFF)    << 8) + 
     
    16381637 
    16391638    /* Add PRIORITY */ 
     1639#if PJNATH_ICE_PRIO_STD 
     1640    prio = CALC_CAND_PRIO(ice, PJ_ICE_CAND_TYPE_PRFLX, 65535,  
     1641                          lcand->comp_id); 
     1642#else 
    16401643    prio = CALC_CAND_PRIO(ice, PJ_ICE_CAND_TYPE_PRFLX, 0,  
    16411644                          lcand->comp_id); 
     1645#endif 
    16421646    pj_stun_msg_add_uint_attr(check->tdata->pool, check->tdata->msg,  
    16431647                              PJ_STUN_ATTR_PRIORITY, prio); 
  • pjproject/branches/projects/sipit24/pjnath/src/pjnath/ice_strans.c

    r2707 r2714  
    5151 * specify preference among candidates with the same type. Since 
    5252 * we don't have the facility to specify that, we'll just set it 
    53  * all to zero. 
    54  */ 
    55 #define SRFLX_PREF  0 
    56 #define HOST_PREF   0 
    57 #define RELAY_PREF  0 
     53 * all to the same value. 
     54 */ 
     55#if PJNATH_ICE_PRIO_STD 
     56#   define SRFLX_PREF  65535 
     57#   define HOST_PREF   65535 
     58#   define RELAY_PREF  65535 
     59#else 
     60#   define SRFLX_PREF  0 
     61#   define HOST_PREF   0 
     62#   define RELAY_PREF  0 
     63#endif 
     64 
    5865 
    5966/* The candidate type preference when STUN candidate is used */ 
    6067static pj_uint8_t srflx_pref_table[4] =  
    6168{ 
     69#if PJNATH_ICE_PRIO_STD 
     70    100,    /**< PJ_ICE_HOST_PREF           */ 
     71    126,    /**< PJ_ICE_SRFLX_PREF          */ 
     72    110,    /**< PJ_ICE_PRFLX_PREF          */ 
     73    0       /**< PJ_ICE_RELAYED_PREF    */ 
     74#else 
    6275    /* Keep it to 2 bits */ 
    6376    1,  /**< PJ_ICE_HOST_PREF       */ 
     
    6578    3,  /**< PJ_ICE_PRFLX_PREF      */ 
    6679    0   /**< PJ_ICE_RELAYED_PREF    */ 
     80#endif 
    6781}; 
    6882 
Note: See TracChangeset for help on using the changeset viewer.