Changeset 5311
- Timestamp:
- May 20, 2016 4:17:00 AM (8 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib-util/src/pjlib-util/cli_telnet.c
r5258 r5311 1929 1929 return status; 1930 1930 1931 pj_strcpy2(&info->ip_address, pj_inet_ntoa(hostip.ipv4.sin_addr)); 1931 pj_sockaddr_print(&hostip, info->buf_, sizeof(info->buf_), 0); 1932 pj_strset2(&info->ip_address, info->buf_); 1932 1933 1933 1934 info->port = tfe->cfg.port; -
pjproject/trunk/pjlib-util/src/pjlib-util/dns_dump.c
r5228 r5311 91 91 const pj_str_t *name = &rr->name; 92 92 char ttl_words[32]; 93 char addr[PJ_INET6_ADDRSTRLEN]; 93 94 94 95 if (name->slen == 0) … … 118 119 } else if (rr->type == PJ_DNS_TYPE_A) { 119 120 PJ_LOG(3,(THIS_FILE, " IP address: %s", 120 pj_inet_ntoa(rr->rdata.a.ip_addr))); 121 pj_inet_ntop2(pj_AF_INET(), &rr->rdata.a.ip_addr, 122 addr, sizeof(addr)))); 121 123 } else if (rr->type == PJ_DNS_TYPE_AAAA) { 122 char addr[PJ_INET6_ADDRSTRLEN];123 124 PJ_LOG(3,(THIS_FILE, " IPv6 address: %s", 124 125 pj_inet_ntop2(pj_AF_INET6(), &rr->rdata.aaaa.ip_addr, -
pjproject/trunk/pjlib-util/src/pjlib-util/pcap.c
r4537 r5311 230 230 pj_ssize_t sz; 231 231 pj_size_t sz_read = 0; 232 char addr[PJ_INET_ADDRSTRLEN]; 232 233 pj_status_t status; 233 234 234 235 TRACE_((file->obj_name, "Reading packet..")); 236 pj_bzero(&addr, sizeof(addr)); 235 237 236 238 /* Read PCAP packet header */ … … 283 285 if (file->filter.ip_src && tmp.ip.ip_src != file->filter.ip_src) { 284 286 TRACE_((file->obj_name, "IP source %s mismatch, skipping", 285 pj_inet_ntoa(*(pj_in_addr*)&tmp.ip.ip_src))); 287 pj_inet_ntop2(pj_AF_INET(), (pj_in_addr*)&tmp.ip.ip_src, 288 addr, sizeof(addr)))); 286 289 SKIP_PKT(); 287 290 continue; … … 291 294 if (file->filter.ip_dst && tmp.ip.ip_dst != file->filter.ip_dst) { 292 295 TRACE_((file->obj_name, "IP detination %s mismatch, skipping", 293 pj_inet_ntoa(*(pj_in_addr*)&tmp.ip.ip_dst))); 296 pj_inet_ntop2(pj_AF_INET(), (pj_in_addr*)&tmp.ip.ip_dst, 297 addr, sizeof(addr)))); 294 298 SKIP_PKT(); 295 299 continue; -
pjproject/trunk/pjlib-util/src/pjlib-util/resolver.c
r5170 r5311 639 639 /* Send the packet to name servers */ 640 640 for (i=0; i<server_cnt; ++i) { 641 char addr[PJ_INET6_ADDRSTRLEN]; 641 642 pj_ssize_t sent = (pj_ssize_t) pkt_size; 642 643 struct nameserver *ns = &resolver->ns[servers[i]]; … … 652 653 (q->transmit_cnt==0? "Transmitting":"Re-transmitting"), 653 654 (int)pkt_size, servers[i], 654 pj_inet_ntoa(ns->addr.sin_addr), 655 pj_inet_ntop2(pj_AF_INET(), &ns->addr.sin_addr, addr, 656 sizeof(addr)), 655 657 (int)pj_ntohs(ns->addr.sin_port), 656 658 pj_dns_get_type_name(q->key.qtype), … … 1035 1037 struct nameserver *ns = &resolver->ns[index]; 1036 1038 enum ns_state old_state = ns->state; 1039 char addr[PJ_INET_ADDRSTRLEN]; 1037 1040 1038 1041 ns->state = state; … … 1048 1051 1049 1052 PJ_LOG(5, (resolver->name.ptr, "Nameserver %s:%d state changed %s --> %s", 1050 pj_inet_ntoa(ns->addr.sin_addr), 1053 pj_inet_ntop2(pj_AF_INET(), &ns->addr.sin_addr, addr, 1054 sizeof(addr)), 1051 1055 (int)pj_ntohs(ns->addr.sin_port), 1052 1056 state_names[old_state], state_names[state])); … … 1391 1395 pj_dns_parsed_packet *dns_pkt; 1392 1396 pj_dns_async_query *q; 1397 char addr[PJ_INET_ADDRSTRLEN]; 1393 1398 pj_status_t status; 1394 1399 PJ_USE_EXCEPTION; … … 1407 1412 PJ_LOG(4,(resolver->name.ptr, 1408 1413 "DNS resolver read error from %s:%d: %s", 1409 pj_inet_ntoa(resolver->udp_src_addr.sin_addr), 1414 pj_inet_ntop2(pj_AF_INET(), &resolver->udp_src_addr.sin_addr, 1415 addr, sizeof(addr)), 1410 1416 pj_ntohs(resolver->udp_src_addr.sin_port), 1411 1417 errmsg)); … … 1417 1423 "Received %d bytes DNS response from %s:%d", 1418 1424 (int)bytes_read, 1419 pj_inet_ntoa(resolver->udp_src_addr.sin_addr), 1425 pj_inet_ntop2(pj_AF_INET(), &resolver->udp_src_addr.sin_addr, 1426 addr, sizeof(addr)), 1420 1427 pj_ntohs(resolver->udp_src_addr.sin_port))); 1421 1428 … … 1451 1458 PJ_LOG(3,(resolver->name.ptr, 1452 1459 "Error parsing DNS response from %s:%d: %s", 1453 pj_inet_ntoa(resolver->udp_src_addr.sin_addr), 1460 pj_inet_ntop2(pj_AF_INET(), &resolver->udp_src_addr.sin_addr, 1461 addr, sizeof(addr)), 1454 1462 pj_ntohs(resolver->udp_src_addr.sin_port), 1455 1463 errmsg)); … … 1464 1472 PJ_LOG(5,(resolver->name.ptr, 1465 1473 "DNS response from %s:%d id=%d discarded", 1466 pj_inet_ntoa(resolver->udp_src_addr.sin_addr), 1474 pj_inet_ntop2(pj_AF_INET(), &resolver->udp_src_addr.sin_addr, 1475 addr, sizeof(addr)), 1467 1476 pj_ntohs(resolver->udp_src_addr.sin_port), 1468 1477 (unsigned)dns_pkt->hdr.id)); … … 1634 1643 PJ_LOG(3,(resolver->name.ptr, " Name servers:")); 1635 1644 for (i=0; i<resolver->ns_count; ++i) { 1645 char addr[PJ_INET_ADDRSTRLEN]; 1636 1646 struct nameserver *ns = &resolver->ns[i]; 1637 1647 1638 1648 PJ_LOG(3,(resolver->name.ptr, 1639 1649 " NS %d: %s:%d (state=%s until %ds, rtt=%d ms)", 1640 i, pj_inet_ntoa(ns->addr.sin_addr), 1650 i, pj_inet_ntop2(pj_AF_INET(), &ns->addr.sin_addr, addr, 1651 sizeof(addr)), 1641 1652 pj_ntohs(ns->addr.sin_port), 1642 1653 state_names[ns->state], -
pjproject/trunk/pjlib-util/src/pjlib-util/srv_resolver.c
r5170 r5311 369 369 } 370 370 371 if (pj_inet_aton(&query_job->srv[i].target_name, &addr) != 0) { 371 if (pj_inet_pton(pj_AF_INET(), &query_job->srv[i].target_name, 372 &addr) == PJ_SUCCESS) 373 { 372 374 query_job->srv[i].addr[query_job->srv[i].addr_cnt++] = addr; 373 375 ++query_job->host_resolved; … … 386 388 387 389 for (i=0; i<query_job->srv_cnt; ++i) { 388 const char *addr; 389 390 if (query_job->srv[i].addr_cnt != 0) 391 addr = pj_inet_ntoa(query_job->srv[i].addr[0]); 392 else 393 addr = "-"; 390 char addr[PJ_INET_ADDRSTRLEN]; 391 392 if (query_job->srv[i].addr_cnt != 0) { 393 pj_inet_ntop(pj_AF_INET(), &query_job->srv[i].addr[0], 394 addr, sizeof(addr)); 395 } else 396 pj_ansi_strcpy(addr, "-"); 394 397 395 398 PJ_LOG(5,(query_job->objname, … … 548 551 /* Check that we really have answer */ 549 552 if (status==PJ_SUCCESS && pkt->hdr.anscount != 0) { 553 char addr[PJ_INET_ADDRSTRLEN]; 550 554 pj_dns_a_record rec; 551 555 … … 574 578 (int)srv->target_name.slen, 575 579 srv->target_name.ptr, 576 pj_inet_ntoa(rec.addr[0]))); 580 pj_inet_ntop2(pj_AF_INET(), &rec.addr[0], 581 addr, sizeof(addr)))); 577 582 } 578 583 … … 586 591 (int)srv->target_name.slen, 587 592 srv->target_name.ptr, 588 pj_inet_ntoa(rec.addr[i]))); 593 pj_inet_ntop2(pj_AF_INET(), &rec.addr[i], 594 addr, sizeof(addr)))); 589 595 } 590 596 -
pjproject/trunk/pjlib-util/src/pjlib-util/stun_simple_client.c
r4961 r5311 34 34 35 35 #define THIS_FILE "stun_client.c" 36 #define LOG_ADDR(addr) pj_inet_ntoa(addr.sin_addr), pj_ntohs(addr.sin_port)37 36 38 37 #define TRACE_(x) PJ_LOG(6,x) -
pjproject/trunk/pjlib/src/pjlib-test/echo_clt.c
r3553 r5311 58 58 char send_buf[BUF_SIZE]; 59 59 char recv_buf[BUF_SIZE]; 60 char addr[PJ_INET_ADDRSTRLEN]; 60 61 pj_sockaddr_in addr; 61 62 pj_str_t s; … … 88 89 89 90 PJ_LOG(3,("", "...socket connected to %s:%d", 90 pj_inet_ntoa(addr.sin_addr), 91 pj_inet_ntop2(pj_AF_INET(), &addr.sin_addr, 92 addr, sizeof(addr)), 91 93 pj_ntohs(addr.sin_port))); 92 94 -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r5255 r5311 765 765 pjmedia_sdp_session **p_sdp) 766 766 { 767 char tmp_addr[PJ_INET6_ADDRSTRLEN]; 767 768 pj_time_val tv; 768 769 pjmedia_sdp_session *sdp; … … 780 781 if (origin->addr.sa_family == pj_AF_INET()) { 781 782 sdp->origin.addr_type = STR_IP4; 782 pj_strdup2(pool, &sdp->origin.addr,783 pj_inet_ntoa(origin->ipv4.sin_addr));784 783 } else if (origin->addr.sa_family == pj_AF_INET6()) { 785 char tmp_addr[PJ_INET6_ADDRSTRLEN];786 787 784 sdp->origin.addr_type = STR_IP6; 788 pj_strdup2(pool, &sdp->origin.addr,789 pj_sockaddr_print(origin, tmp_addr, sizeof(tmp_addr), 0));790 791 785 } else { 792 786 pj_assert(!"Invalid address family"); 793 787 return PJ_EAFNOTSUP; 794 788 } 789 790 pj_strdup2(pool, &sdp->origin.addr, 791 pj_sockaddr_print(origin, tmp_addr, sizeof(tmp_addr), 0)); 795 792 796 793 if (sess_name) -
pjproject/trunk/pjmedia/src/pjmedia/sdp.c
r5193 r5311 432 432 ATTR_LEN = PJ_INET6_ADDRSTRLEN+16 433 433 }; 434 char tmp_addr[PJ_INET6_ADDRSTRLEN]; 434 435 pjmedia_sdp_attr *attr; 435 436 … … 441 442 pj_ansi_snprintf(attr->value.ptr, ATTR_LEN, 442 443 "%u IN IP4 %s", 443 pj_ntohs(a->ipv4.sin_port), 444 pj_inet_ntoa(a->ipv4.sin_addr)); 444 pj_sockaddr_get_port(a), 445 pj_sockaddr_print(a, tmp_addr, 446 sizeof(tmp_addr), 0)); 445 447 } else if (a->addr.sa_family == pj_AF_INET6()) { 446 char tmp_addr[PJ_INET6_ADDRSTRLEN];447 448 attr->value.slen = 448 449 pj_ansi_snprintf(attr->value.ptr, ATTR_LEN, -
pjproject/trunk/pjnath/src/pjnath/nat_detect.c
r4573 r5311 215 215 pj_ioqueue_callback ioqueue_cb; 216 216 int addr_len; 217 char addr[PJ_INET_ADDRSTRLEN]; 217 218 pj_status_t status; 218 219 … … 287 288 288 289 PJ_LOG(5,(sess->pool->obj_name, "Local address is %s:%d", 289 pj_inet_ntoa(sess->local_addr.sin_addr), 290 pj_inet_ntop2(pj_AF_INET(), &sess->local_addr.sin_addr, 291 addr, sizeof(addr)), 290 292 pj_ntohs(sess->local_addr.sin_port))); 291 293 292 294 PJ_LOG(5,(sess->pool->obj_name, "Server set to %s:%d", 293 pj_inet_ntoa(server->sin_addr), 295 pj_inet_ntop2(pj_AF_INET(), &server->sin_addr, addr, 296 sizeof(addr)), 294 297 pj_ntohs(server->sin_port))); 295 298 … … 815 818 { 816 819 pj_uint32_t magic, tsx_id[3]; 820 char addr[PJ_INET_ADDRSTRLEN]; 817 821 pj_status_t status; 818 822 … … 853 857 "Performing %s to %s:%d", 854 858 test_names[test_id], 855 pj_inet_ntoa(sess->cur_server->sin_addr), 859 pj_inet_ntop2(pj_AF_INET(), &sess->cur_server->sin_addr, 860 addr, sizeof(addr)), 856 861 pj_ntohs(sess->cur_server->sin_port))); 857 862 -
pjproject/trunk/pjnath/src/pjnath/stun_msg_dump.c
r4537 r5311 87 87 case PJ_STUN_ATTR_ALTERNATE_SERVER: 88 88 { 89 char addr[PJ_INET6_ADDRSTRLEN]; 89 90 const pj_stun_sockaddr_attr *attr; 90 91 … … 94 95 len = pj_ansi_snprintf(p, end-p, 95 96 ", IPv4 addr=%s:%d\n", 96 pj_inet_ntoa(attr->sockaddr.ipv4.sin_addr), 97 pj_ntohs(attr->sockaddr.ipv4.sin_port)); 97 pj_sockaddr_print(&attr->sockaddr, 98 addr, sizeof(addr),0), 99 pj_sockaddr_get_port(&attr->sockaddr)); 98 100 99 101 } else if (attr->sockaddr.addr.sa_family == pj_AF_INET6()) { -
pjproject/trunk/pjsip-apps/src/samples/proxy.h
r4370 r5311 253 253 */ 254 254 if (pj_gethostip(pj_AF_INET(), &pri_addr)==PJ_SUCCESS) { 255 pj_strdup2(global.pool, &global.name[global.name_cnt].host, 256 pj_inet_ntoa(pri_addr.ipv4.sin_addr)); 255 char addr[PJ_INET_ADDRSTRLEN]; 256 pj_inet_ntop(pj_AF_INET(), &pri_addr.ipv4.sin_addr, addr, 257 sizeof(addr)); 258 pj_strdup2(global.pool, &global.name[global.name_cnt].host, addr); 257 259 global.name[global.name_cnt].port = global.port; 258 260 global.name_cnt++; … … 260 262 261 263 /* Get the rest of IP interfaces */ 262 if (pj_enum_ip_interface(pj_AF_INET(), &addr_cnt, addr_list) == PJ_SUCCESS) { 264 if (pj_enum_ip_interface(pj_AF_INET(), &addr_cnt, addr_list) == PJ_SUCCESS) 265 { 263 266 for (i=0; i<addr_cnt; ++i) { 264 267 char addr[PJ_INET_ADDRSTRLEN]; 268 265 269 if (addr_list[i].ipv4.sin_addr.s_addr == pri_addr.ipv4.sin_addr.s_addr) 266 270 continue; 267 271 272 pj_inet_ntop(pj_AF_INET(), &addr_list[i].ipv4.sin_addr, addr, 273 sizeof(addr)); 268 274 pj_strdup2(global.pool, &global.name[global.name_cnt].host, 269 pj_inet_ntoa(addr_list[i].ipv4.sin_addr));275 addr); 270 276 global.name[global.name_cnt].port = global.port; 271 277 global.name_cnt++; -
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r5277 r5311 848 848 static pj_status_t init_options(int argc, char *argv[]) 849 849 { 850 static char ip_addr[ 32];850 static char ip_addr[PJ_INET_ADDRSTRLEN]; 851 851 static char local_uri[64]; 852 852 … … 893 893 hostname = pj_gethostname(); 894 894 pj_sockaddr_in_init(&tmp_addr, hostname, 0); 895 addr = pj_inet_ntoa(tmp_addr.sin_addr);896 pj_ansi_strcpy(ip_addr, addr);895 pj_inet_ntop(pj_AF_INET(), &tmp_addr.sin_addr, ip_addr, 896 sizeof(ip_addr)); 897 897 } 898 898 -
pjproject/trunk/pjsip-apps/src/samples/streamutil.c
r5095 r5311 231 231 pjmedia_port *stream_port; 232 232 char tmp[10]; 233 char addr[PJ_INET_ADDRSTRLEN]; 233 234 pj_status_t status; 234 235 … … 578 579 else if (dir == PJMEDIA_DIR_ENCODING) 579 580 printf("Stream is active, dir is send-only, sending to %s:%d\n", 580 pj_inet_ntoa(remote_addr.sin_addr), 581 pj_inet_ntop2(pj_AF_INET(), &remote_addr.sin_addr, addr, 582 sizeof(addr)), 581 583 pj_ntohs(remote_addr.sin_port)); 582 584 else … … 584 586 "sending to %s:%d\n", 585 587 local_port, 586 pj_inet_ntoa(remote_addr.sin_addr), 588 pj_inet_ntop2(pj_AF_INET(), &remote_addr.sin_addr, addr, 589 sizeof(addr)), 587 590 pj_ntohs(remote_addr.sin_port)); 588 591 -
pjproject/trunk/pjsip-apps/src/samples/vid_streamutil.c
r4815 r5311 348 348 pjmedia_vid_stream *stream = NULL; 349 349 pjmedia_port *enc_port, *dec_port; 350 char addr[PJ_INET_ADDRSTRLEN]; 350 351 pj_status_t status; 351 352 … … 860 861 else if (dir == PJMEDIA_DIR_ENCODING) 861 862 printf("Stream is active, dir is send-only, sending to %s:%d\n", 862 pj_inet_ntoa(remote_addr.sin_addr), 863 pj_inet_ntop2(pj_AF_INET(), &remote_addr.sin_addr, addr, 864 sizeof(addr)), 863 865 pj_ntohs(remote_addr.sin_port)); 864 866 else … … 866 868 "sending to %s:%d\n", 867 869 local_port, 868 pj_inet_ntoa(remote_addr.sin_addr), 870 pj_inet_ntop2(pj_AF_INET(), &remote_addr.sin_addr, addr, 871 sizeof(addr)), 869 872 pj_ntohs(remote_addr.sin_port)); 870 873 -
pjproject/trunk/pjsip/src/pjsip/sip_resolve.c
r5055 r5311 169 169 pj_in6_addr dummy6; 170 170 171 /* First check with inet_aton()*/172 if (pj_inet_ aton(host, &dummy) > 0)171 /* First check if this is an IPv4 address */ 172 if (pj_inet_pton(pj_AF_INET(), host, &dummy) == PJ_SUCCESS) 173 173 return 4; 174 174 … … 261 261 pj_sockaddr_init(pj_AF_INET(), &svr_addr.entry[0].addr, 262 262 NULL, 0); 263 pj_inet_ aton(&target->addr.host,263 pj_inet_pton(pj_AF_INET(), &target->addr.host, 264 264 &svr_addr.entry[0].addr.ipv4.sin_addr); 265 265 } else { -
pjproject/trunk/pjsip/src/pjsip/sip_transport_udp.c
r5284 r5311 161 161 rdata->pkt_info.zero = 0; 162 162 pj_gettimeofday(&rdata->pkt_info.timestamp); 163 if (src_addr->addr.sa_family == pj_AF_INET()) { 164 pj_ansi_strcpy(rdata->pkt_info.src_name, 165 pj_inet_ntoa(src_addr->ipv4.sin_addr)); 166 rdata->pkt_info.src_port = pj_ntohs(src_addr->ipv4.sin_port); 167 } else { 168 pj_inet_ntop(pj_AF_INET6(), 169 pj_sockaddr_get_addr(&rdata->pkt_info.src_addr), 170 rdata->pkt_info.src_name, 171 sizeof(rdata->pkt_info.src_name)); 172 rdata->pkt_info.src_port = pj_ntohs(src_addr->ipv6.sin6_port); 173 } 163 pj_sockaddr_print(src_addr, rdata->pkt_info.src_name, 164 sizeof(rdata->pkt_info.src_name), 0); 165 rdata->pkt_info.src_port = pj_sockaddr_get_port(src_addr); 174 166 175 167 size_eaten = … … 518 510 return status; 519 511 520 pj_strcpy2(&bound_name->host, pj_inet_ntoa(hostip.ipv4.sin_addr)); 512 status = pj_inet_ntop(pj_AF_INET(), &hostip.ipv4.sin_addr, 513 hostbuf, hostbufsz); 521 514 } else { 522 515 /* Otherwise use bound address. */ 523 pj_strcpy2(&bound_name->host, 524 pj_inet_ntoa(tmp_addr.ipv4.sin_addr)); 525 status = PJ_SUCCESS; 516 status = pj_inet_ntop(pj_AF_INET(), &tmp_addr.ipv4.sin_addr, 517 hostbuf, hostbufsz); 526 518 } 527 519 … … 543 535 pj_sockaddr_get_addr(&tmp_addr), 544 536 hostbuf, hostbufsz); 545 if (status == PJ_SUCCESS) { 546 bound_name->host.slen = pj_ansi_strlen(hostbuf); 547 }537 } 538 if (status == PJ_SUCCESS) { 539 bound_name->host.slen = pj_ansi_strlen(hostbuf); 548 540 } 549 541 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r5308 r5311 3032 3032 pj_in6_addr dummy6; 3033 3033 3034 /* First check with inet_aton()*/3035 if (pj_inet_ aton(host, &dummy) > 0)3034 /* First check if this is an IPv4 address */ 3035 if (pj_inet_pton(pj_AF_INET(), host, &dummy) == PJ_SUCCESS) 3036 3036 return 4; 3037 3037 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r5308 r5311 2057 2057 2058 2058 if (pjsua_var.stun_srv.addr.sa_family != 0) { 2059 pj_ansi_strcpy(stun_ip_addr,pj_inet_ntoa(pjsua_var.stun_srv.ipv4.sin_addr)); 2059 pj_sockaddr_print(&pjsua_var.stun_srv, 2060 stun_ip_addr, sizeof(stun_ip_addr), 0); 2060 2061 stun_srv = pj_str(stun_ip_addr); 2061 2062 } else { -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r5307 r5311 360 360 pjstun_setting stun_opt; 361 361 362 pj_ansi_strcpy(ip_addr, 363 pj_inet_ntoa(pjsua_var.stun_srv.ipv4.sin_addr)); 362 pj_sockaddr_print(&pjsua_var.stun_srv, ip_addr,sizeof(ip_addr),0); 364 363 stun_srv = pj_str(ip_addr); 365 364 … … 427 426 if (status == PJ_SUCCESS) { 428 427 if (pjsua_var.stun_srv.addr.sa_family != 0) { 429 pj_ansi_strcpy(ip_addr,430 pj_inet_ntoa(pjsua_var.stun_srv.ipv4.sin_addr));428 pj_sockaddr_print(&pjsua_var.stun_srv, 429 ip_addr, sizeof(ip_addr), 0); 431 430 stun_srv = pj_str(ip_addr); 432 431 } else { -
pjproject/trunk/pjsip/src/test/transport_tcp_test.c
r3553 r5311 38 38 pj_status_t status; 39 39 char url[PJSIP_MAX_URL_SIZE]; 40 char addr[PJ_INET_ADDRSTRLEN]; 40 41 int rtt[SEND_RECV_LOOP], min_rtt; 41 42 int i, pkt_lost; … … 58 59 59 60 pj_ansi_sprintf(url, "sip:alice@%s:%d;transport=tcp", 60 pj_inet_ntoa(rem_addr.sin_addr), 61 pj_inet_ntop2(pj_AF_INET(), &rem_addr.sin_addr, addr, 62 sizeof(addr)), 61 63 pj_ntohs(rem_addr.sin_port)); 62 64 -
pjproject/trunk/pjsip/src/test/transport_test.c
r4537 r5311 38 38 struct pj_in_addr addr; 39 39 40 /* Note: inet_aton() returns non-zero if addr is valid! */ 41 if (pj_inet_aton(&tp->local_name.host, &addr) != 0) { 40 if (pj_inet_pton(pj_AF_INET(), &tp->local_name.host, 41 &addr) == PJ_SUCCESS) 42 { 42 43 if (addr.s_addr==PJ_INADDR_ANY || addr.s_addr==PJ_INADDR_NONE) { 43 44 PJ_LOG(3,(THIS_FILE, " Error: invalid address name"));
Note: See TracChangeset
for help on using the changeset viewer.