Ignore:
Timestamp:
Dec 2, 2007 3:40:52 PM (17 years ago)
Author:
bennylp
Message:

More ticket #421: fixed SIP messaging components to support IPv6 format

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/test-pjsip/uri_test.c

    r1373 r1610  
    7777static pjsip_uri *create_uri33( pj_pool_t *pool ); 
    7878static pjsip_uri *create_uri34( pj_pool_t *pool ); 
    79 //static pjsip_uri *create_uri35( pj_pool_t *pool ); 
     79static pjsip_uri *create_uri35( pj_pool_t *pool ); 
     80static pjsip_uri *create_uri36( pj_pool_t *pool ); 
    8081static pjsip_uri *create_dummy( pj_pool_t *pool ); 
    8182 
     
    319320        "tel:911;p1=p1;p2=p2" 
    320321    }, 
    321      
     322    { 
     323        /* 35: IPv6 in host and maddr parameter */ 
     324        PJ_SUCCESS, 
     325        "sip:user@[::1];maddr=[::01]", 
     326        &create_uri35, 
     327        "sip:user@[::1];maddr=[::01]" 
     328    }, 
     329    { 
     330        /* 36: IPv6 in host and maddr, without username */ 
     331        PJ_SUCCESS, 
     332        "sip:[::1];maddr=[::01]", 
     333        &create_uri36, 
     334        "sip:[::1];maddr=[::01]" 
     335    } 
     336 
    322337}; 
    323338 
     
    670685} 
    671686 
     687/* "sip:user@[::1];maddr=[::01]" */ 
     688static pjsip_uri *create_uri35( pj_pool_t *pool ) 
     689{ 
     690    pjsip_sip_uri *url; 
     691    url = pjsip_sip_uri_create(pool, 0); 
     692    url->user = pj_str("user"); 
     693    url->host = pj_str("::1"); 
     694    url->maddr_param = pj_str("::01"); 
     695    return (pjsip_uri*)url; 
     696} 
     697 
     698/* "sip:[::1];maddr=[::01]" */ 
     699static pjsip_uri *create_uri36( pj_pool_t *pool ) 
     700{ 
     701    pjsip_sip_uri *url; 
     702    url = pjsip_sip_uri_create(pool, 0); 
     703    url->host = pj_str("::1"); 
     704    url->maddr_param = pj_str("::01"); 
     705    return (pjsip_uri*)url; 
     706 
     707} 
    672708 
    673709static pjsip_uri *create_dummy(pj_pool_t *pool) 
     
    825861} 
    826862 
     863#if INCLUDE_BENCHMARKS 
    827864static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp) 
    828865{ 
     
    910947    return status; 
    911948} 
    912  
     949#endif  /* INCLUDE_BENCHMARKS */ 
    913950 
    914951/*****************************************************************************/ 
     
    930967        return status; 
    931968 
     969#if INCLUDE_BENCHMARKS 
    932970    for (i=0; i<COUNT; ++i) { 
    933971        PJ_LOG(3,(THIS_FILE, "  benchmarking (%d of %d)...", i+1, COUNT)); 
     
    9941032    report_ival("uri-cmp-per-sec", max, "URI/sec", desc); 
    9951033 
     1034#endif  /* INCLUDE_BENCHMARKS */ 
     1035 
    9961036    return PJ_SUCCESS; 
    9971037} 
Note: See TracChangeset for help on using the changeset viewer.