Changeset 1040 for pjproject/trunk/pjlib-util/src/pjlib-util/stun_msg.c
- Timestamp:
- Mar 5, 2007 12:58:24 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/stun_msg.c
r1039 r1040 527 527 addr_len == sizeof(pj_sockaddr_in6), PJ_EINVAL); 528 528 529 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_ip_addr_attr);529 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_ip_addr_attr); 530 530 INIT_ATTR(attr, attr_type, STUN_GENERIC_IP_ADDR_LEN); 531 531 … … 581 581 582 582 /* Create the attribute */ 583 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_ip_addr_attr);583 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_ip_addr_attr); 584 584 pj_memcpy(attr, buf, ATTR_HDR_LEN); 585 585 … … 674 674 PJ_ASSERT_RETURN(pool && value && p_attr, PJ_EINVAL); 675 675 676 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_string_attr);676 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_string_attr); 677 677 INIT_ATTR(attr, attr_type, value->slen); 678 678 pj_strdup(pool, &attr->value, value); … … 713 713 714 714 /* Create the attribute */ 715 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_string_attr);715 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_string_attr); 716 716 717 717 /* Copy the header */ … … 787 787 PJ_ASSERT_RETURN(pool && p_attr, PJ_EINVAL); 788 788 789 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_empty_attr);789 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_empty_attr); 790 790 INIT_ATTR(attr, attr_type, sizeof(pj_stun_empty_attr)); 791 791 … … 806 806 807 807 /* Create the attribute */ 808 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_empty_attr);808 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_empty_attr); 809 809 pj_memcpy(attr, buf, ATTR_HDR_LEN); 810 810 … … 865 865 PJ_ASSERT_RETURN(pool && p_attr, PJ_EINVAL); 866 866 867 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_uint_attr);867 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_uint_attr); 868 868 INIT_ATTR(attr, attr_type, STUN_UINT_LEN); 869 869 attr->value = value; … … 905 905 906 906 /* Create the attribute */ 907 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_uint_attr);907 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_uint_attr); 908 908 pj_memcpy(attr, buf, ATTR_LEN); 909 909 … … 968 968 PJ_ASSERT_RETURN(pool && p_attr, PJ_EINVAL); 969 969 970 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_msgint_attr);970 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_msgint_attr); 971 971 INIT_ATTR(attr, PJ_STUN_ATTR_MESSAGE_INTEGRITY, STUN_MSG_INTEGRITY_LEN); 972 972 … … 1004 1004 1005 1005 /* Create attribute */ 1006 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_msgint_attr);1006 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_msgint_attr); 1007 1007 pj_memcpy(attr, buf, sizeof(pj_stun_msgint_attr)); 1008 1008 attr->hdr.type = pj_ntohs(attr->hdr.type); … … 1074 1074 } 1075 1075 1076 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_errcode_attr);1076 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_errcode_attr); 1077 1077 INIT_ATTR(attr, PJ_STUN_ATTR_ERROR_CODE, 4+err_reason->slen); 1078 1078 attr->err_class = (pj_uint8_t)(err_code / 100); … … 1110 1110 1111 1111 /* Create the attribute */ 1112 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_errcode_attr);1112 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_errcode_attr); 1113 1113 1114 1114 /* Copy the header */ … … 1187 1187 PJ_ASSERT_RETURN(pool && attr_cnt < PJ_STUN_MAX_ATTR && p_attr, PJ_EINVAL); 1188 1188 1189 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_unknown_attr);1189 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_unknown_attr); 1190 1190 INIT_ATTR(attr, PJ_STUN_ATTR_UNKNOWN_ATTRIBUTES, attr_cnt * 2); 1191 1191 … … 1233 1233 unsigned i; 1234 1234 1235 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_unknown_attr);1235 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_unknown_attr); 1236 1236 pj_memcpy(attr, buf, ATTR_HDR_LEN); 1237 1237 … … 1310 1310 PJ_ASSERT_RETURN(pool && attr_type && p_attr, PJ_EINVAL); 1311 1311 1312 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_binary_attr);1312 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_binary_attr); 1313 1313 INIT_ATTR(attr, attr_type, sizeof(pj_stun_binary_attr)); 1314 1314 … … 1352 1352 1353 1353 /* Create the attribute */ 1354 attr = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_binary_attr);1354 attr = PJ_POOL_ZALLOC_T(pool, pj_stun_binary_attr); 1355 1355 1356 1356 /* Copy the header */ … … 1419 1419 PJ_ASSERT_RETURN(pool && msg_type && p_msg, PJ_EINVAL); 1420 1420 1421 msg = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_msg);1421 msg = PJ_POOL_ZALLOC_T(pool, pj_stun_msg); 1422 1422 msg->hdr.type = (pj_uint16_t) msg_type; 1423 1423 msg->hdr.magic = magic; … … 1606 1606 1607 1607 /* Create the message, copy the header, and convert to host byte order */ 1608 msg = PJ_POOL_ZALLOC_T YPE(pool, pj_stun_msg);1608 msg = PJ_POOL_ZALLOC_T(pool, pj_stun_msg); 1609 1609 pj_memcpy(&msg->hdr, pdu, sizeof(pj_stun_msg_hdr)); 1610 1610 msg->hdr.type = pj_ntohs(msg->hdr.type);
Note: See TracChangeset
for help on using the changeset viewer.