Changeset 1289 for pjproject/trunk
- Timestamp:
- May 22, 2007 9:55:31 PM (18 years ago)
- Location:
- pjproject/trunk/pjnath/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath/stun_msg.c
r1275 r1289 1657 1657 1658 1658 /* Check if FINGERPRINT attribute is present */ 1659 if (GETVAL16H(pdu, msg_len + 20 ) == PJ_STUN_ATTR_FINGERPRINT) {1660 pj_uint16_t attr_len = GETVAL16H(pdu, msg_len + 2 2);1661 pj_uint32_t fingerprint = GETVAL32H(pdu, msg_len + 2 4);1659 if (GETVAL16H(pdu, msg_len + 20 - 8) == PJ_STUN_ATTR_FINGERPRINT) { 1660 pj_uint16_t attr_len = GETVAL16H(pdu, msg_len + 20 - 8 + 2); 1661 pj_uint32_t fingerprint = GETVAL32H(pdu, msg_len + 20 - 8 + 4); 1662 1662 pj_uint32_t crc; 1663 1663 … … 1665 1665 return PJNATH_ESTUNINATTRLEN; 1666 1666 1667 crc = pj_crc32_calc(pdu, msg_len + 20 );1667 crc = pj_crc32_calc(pdu, msg_len + 20 - 8); 1668 1668 crc ^= STUN_XOR_FINGERPRINT; 1669 1669 -
pjproject/trunk/pjnath/src/pjnath/stun_msg_dump.c
r1152 r1289 97 97 ", INVALID ADDRESS FAMILY!\n"); 98 98 } 99 APPLY(); 99 100 } 100 101 break; … … 118 119 (pj_uint32_t)attr->value, 119 120 (pj_uint32_t)attr->value); 121 APPLY(); 120 122 } 121 123 break; … … 134 136 (int)attr->value.slen, 135 137 attr->value.ptr); 138 APPLY(); 136 139 } 137 140 break; … … 147 150 (int)attr->reason.slen, 148 151 attr->reason.ptr); 152 APPLY(); 149 153 } 150 154 break; … … 192 196 default: 193 197 len = pj_ansi_snprintf(p, end-p, "\n"); 194 198 APPLY(); 195 199 break; 196 200 } 197 198 APPLY();199 201 200 202 return (p-buffer); -
pjproject/trunk/pjnath/src/pjstun-srv-test/main.c
r1275 r1289 133 133 134 134 status = pj_stun_turn_usage_create(srv, PJ_SOCK_DGRAM, NULL, 135 3478, &turn);135 3478, o.use_fingerprint, &turn); 136 136 if (status != PJ_SUCCESS) { 137 137 pj_stun_perror(THIS_FILE, "Unable to create bind usage", status); -
pjproject/trunk/pjnath/src/pjstun-srv-test/server.h
r1275 r1289 123 123 const pj_str_t *ip_addr, 124 124 unsigned port, 125 pj_bool_t use_fingerprint, 125 126 pj_stun_usage **p_bu); 126 127 -
pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
r1275 r1289 80 80 pj_hash_table_t *client_htable; 81 81 pj_stun_auth_cred *cred; 82 pj_bool_t use_fingerprint; 82 83 83 84 unsigned max_bw_kbps; … … 147 148 const pj_str_t *ip_addr, 148 149 unsigned port, 150 pj_bool_t use_fingerprint, 149 151 pj_stun_usage **p_bu) 150 152 { … … 173 175 tu->max_bw_kbps = 64; 174 176 tu->max_lifetime = 10 * 60; 177 tu->use_fingerprint = use_fingerprint; 175 178 176 179 status = pj_sockaddr_in_init(&local_addr, ip_addr, (pj_uint16_t)port); … … 200 203 sess_cb.on_rx_request = &tu_sess_on_rx_request; 201 204 status = pj_stun_session_create(&si->stun_cfg, "turns%p", &sess_cb, 202 PJ_FALSE, &tu->default_session);205 use_fingerprint, &tu->default_session); 203 206 if (status != PJ_SUCCESS) { 204 207 pj_stun_usage_destroy(tu->usage); … … 638 641 sess_cb.on_rx_indication = &client_sess_on_rx_msg; 639 642 status = pj_stun_session_create(tu->cfg, client->obj_name, 640 &sess_cb, PJ_FALSE,643 &sess_cb, tu->use_fingerprint, 641 644 &client->session); 642 645 if (status != PJ_SUCCESS) {
Note: See TracChangeset
for help on using the changeset viewer.