Ignore:
Timestamp:
Mar 5, 2007 12:58:24 AM (13 years ago)
Author:
bennylp
Message:

Implemented new STUN server framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/src/pjlib-util/stun_msg.c

    r1039 r1040  
    527527                     addr_len == sizeof(pj_sockaddr_in6), PJ_EINVAL); 
    528528 
    529     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_ip_addr_attr); 
     529    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_ip_addr_attr); 
    530530    INIT_ATTR(attr, attr_type, STUN_GENERIC_IP_ADDR_LEN); 
    531531 
     
    581581 
    582582    /* Create the attribute */ 
    583     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_ip_addr_attr); 
     583    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_ip_addr_attr); 
    584584    pj_memcpy(attr, buf, ATTR_HDR_LEN); 
    585585 
     
    674674    PJ_ASSERT_RETURN(pool && value && p_attr, PJ_EINVAL); 
    675675 
    676     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_string_attr); 
     676    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_string_attr); 
    677677    INIT_ATTR(attr, attr_type, value->slen); 
    678678    pj_strdup(pool, &attr->value, value); 
     
    713713 
    714714    /* Create the attribute */ 
    715     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_string_attr); 
     715    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_string_attr); 
    716716 
    717717    /* Copy the header */ 
     
    787787    PJ_ASSERT_RETURN(pool && p_attr, PJ_EINVAL); 
    788788 
    789     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_empty_attr); 
     789    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_empty_attr); 
    790790    INIT_ATTR(attr, attr_type, sizeof(pj_stun_empty_attr)); 
    791791 
     
    806806 
    807807    /* Create the attribute */ 
    808     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_empty_attr); 
     808    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_empty_attr); 
    809809    pj_memcpy(attr, buf, ATTR_HDR_LEN); 
    810810 
     
    865865    PJ_ASSERT_RETURN(pool && p_attr, PJ_EINVAL); 
    866866 
    867     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_uint_attr); 
     867    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_uint_attr); 
    868868    INIT_ATTR(attr, attr_type, STUN_UINT_LEN); 
    869869    attr->value = value; 
     
    905905 
    906906    /* Create the attribute */ 
    907     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_uint_attr); 
     907    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_uint_attr); 
    908908    pj_memcpy(attr, buf, ATTR_LEN); 
    909909 
     
    968968    PJ_ASSERT_RETURN(pool && p_attr, PJ_EINVAL); 
    969969 
    970     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_msgint_attr); 
     970    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_msgint_attr); 
    971971    INIT_ATTR(attr, PJ_STUN_ATTR_MESSAGE_INTEGRITY, STUN_MSG_INTEGRITY_LEN); 
    972972 
     
    10041004 
    10051005    /* Create attribute */ 
    1006     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_msgint_attr); 
     1006    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_msgint_attr); 
    10071007    pj_memcpy(attr, buf, sizeof(pj_stun_msgint_attr)); 
    10081008    attr->hdr.type = pj_ntohs(attr->hdr.type); 
     
    10741074    } 
    10751075 
    1076     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_errcode_attr); 
     1076    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_errcode_attr); 
    10771077    INIT_ATTR(attr, PJ_STUN_ATTR_ERROR_CODE, 4+err_reason->slen); 
    10781078    attr->err_class = (pj_uint8_t)(err_code / 100); 
     
    11101110 
    11111111    /* Create the attribute */ 
    1112     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_errcode_attr); 
     1112    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_errcode_attr); 
    11131113 
    11141114    /* Copy the header */ 
     
    11871187    PJ_ASSERT_RETURN(pool && attr_cnt < PJ_STUN_MAX_ATTR && p_attr, PJ_EINVAL); 
    11881188 
    1189     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_unknown_attr); 
     1189    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_unknown_attr); 
    11901190    INIT_ATTR(attr, PJ_STUN_ATTR_UNKNOWN_ATTRIBUTES, attr_cnt * 2); 
    11911191 
     
    12331233    unsigned i; 
    12341234 
    1235     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_unknown_attr); 
     1235    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_unknown_attr); 
    12361236    pj_memcpy(attr, buf, ATTR_HDR_LEN); 
    12371237 
     
    13101310    PJ_ASSERT_RETURN(pool && attr_type && p_attr, PJ_EINVAL); 
    13111311 
    1312     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_binary_attr); 
     1312    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_binary_attr); 
    13131313    INIT_ATTR(attr, attr_type, sizeof(pj_stun_binary_attr)); 
    13141314 
     
    13521352 
    13531353    /* Create the attribute */ 
    1354     attr = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_binary_attr); 
     1354    attr = PJ_POOL_ZALLOC_T(pool, pj_stun_binary_attr); 
    13551355 
    13561356    /* Copy the header */ 
     
    14191419    PJ_ASSERT_RETURN(pool && msg_type && p_msg, PJ_EINVAL); 
    14201420 
    1421     msg = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_msg); 
     1421    msg = PJ_POOL_ZALLOC_T(pool, pj_stun_msg); 
    14221422    msg->hdr.type = (pj_uint16_t) msg_type; 
    14231423    msg->hdr.magic = magic; 
     
    16061606 
    16071607    /* Create the message, copy the header, and convert to host byte order */ 
    1608     msg = PJ_POOL_ZALLOC_TYPE(pool, pj_stun_msg); 
     1608    msg = PJ_POOL_ZALLOC_T(pool, pj_stun_msg); 
    16091609    pj_memcpy(&msg->hdr, pdu, sizeof(pj_stun_msg_hdr)); 
    16101610    msg->hdr.type = pj_ntohs(msg->hdr.type); 
Note: See TracChangeset for help on using the changeset viewer.