- Timestamp:
- Dec 3, 2007 12:40:58 AM (17 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/compat/socket.h
r1608 r1611 68 68 # endif 69 69 70 # undef s_addr71 70 # define PJ_SOCK_HAS_GETADDRINFO 1 72 71 #endif /* _MSC_VER */ … … 147 146 148 147 /* 149 * And undefine th is..148 * And undefine these.. 150 149 */ 151 150 #undef s_addr 151 #undef s6_addr 152 152 153 153 /* -
pjproject/trunk/pjlib/src/pj/ip_helper_generic.c
r1601 r1611 83 83 for (i=0; i<count; ++i) { 84 84 struct ifreq *itf = &ifr[i]; 85 struct sockaddr *ad = itf->ifr_addr;85 struct sockaddr *ad = &itf->ifr_addr; 86 86 87 87 ifs[i].addr.sa_family = ad->sa_family; -
pjproject/trunk/pjnath/src/pjstun-client/client_main.c
r1498 r1611 232 232 static int init() 233 233 { 234 pj_sockaddr _inaddr;234 pj_sockaddr addr; 235 235 pj_stun_session_cb stun_cb; 236 236 int len; … … 283 283 pj_assert(status == PJ_SUCCESS); 284 284 285 status = pj_sockaddr_in_init(&addr , NULL, 0);285 status = pj_sockaddr_in_init(&addr.ipv4, NULL, 0); 286 286 pj_assert(status == PJ_SUCCESS); 287 287 288 addr. sin_port = pj_htons((pj_uint16_t)LOCAL_PORT);288 addr.ipv4.sin_port = pj_htons((pj_uint16_t)LOCAL_PORT); 289 289 status = pj_sock_bind(g.sock, &addr, sizeof(addr)); 290 290 pj_assert(status == PJ_SUCCESS); … … 294 294 pj_assert(status == PJ_SUCCESS); 295 295 296 PJ_LOG(3,(THIS_FILE, "Listening on port %d", (int)pj_ntohs(addr. sin_port)));296 PJ_LOG(3,(THIS_FILE, "Listening on port %d", (int)pj_ntohs(addr.ipv4.sin_port))); 297 297 298 298 len = sizeof(g.peer_addr); 299 299 status = pj_sock_getsockname(g.peer_sock, &g.peer_addr, &len); 300 300 if (g.peer_addr.sin_addr.s_addr == 0) 301 pj_gethostip( &g.peer_addr.sin_addr);301 pj_gethostip(pj_AF_INET(), (pj_sockaddr*)&g.peer_addr.sin_addr); 302 302 303 303 PJ_LOG(3,(THIS_FILE, "Peer is on port %d", (int)pj_ntohs(g.peer_addr.sin_port))); … … 550 550 pj_str_t ip; 551 551 pj_uint16_t port; 552 pj_sockaddr _intmp_addr;552 pj_sockaddr tmp_addr; 553 553 554 554 pos = pj_ansi_strchr(input, ':'); … … 567 567 } 568 568 569 if (pj_sockaddr_in_init(&tmp_addr , &ip, port)!=PJ_SUCCESS) {569 if (pj_sockaddr_in_init(&tmp_addr.ipv4, &ip, port)!=PJ_SUCCESS) { 570 570 puts("Invalid address"); 571 571 return -1; 572 572 } 573 573 574 pj_memcpy(addr, &tmp_addr, sizeof( tmp_addr));574 pj_memcpy(addr, &tmp_addr, sizeof(pj_sockaddr_in)); 575 575 576 576 return PJ_SUCCESS; -
pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
r1485 r1611 770 770 771 771 if (client->alloc_addr.sin_addr.s_addr == 0) { 772 status = pj_gethostip( &client->alloc_addr.sin_addr);772 status = pj_gethostip(pj_AF_INET(), (pj_sockaddr*)&client->alloc_addr.sin_addr); 773 773 if (status != PJ_SUCCESS) { 774 774 pj_sock_close(client->sock); -
pjproject/trunk/pjsip/src/pjsip/sip_transport.c
r1610 r1611 39 39 #if 0 40 40 # define TRACE_(x) PJ_LOG(5,x) 41 42 static const char *addr_string(const pj_sockaddr_t *addr) 43 { 44 static char str[PJ_INET6_ADDRSTRLEN]; 45 pj_inet_ntop(((const pj_sockaddr*)addr)->addr.sa_family, 46 pj_sockaddr_get_addr(addr), 47 str, sizeof(str)); 48 return str; 49 } 41 50 #else 42 51 # define TRACE_(x) … … 179 188 180 189 181 /*182 * Tools to get address string.183 */184 static const char *addr_string(const pj_sockaddr_t *addr)185 {186 static char str[PJ_INET6_ADDRSTRLEN];187 pj_inet_ntop(((const pj_sockaddr*)addr)->addr.sa_family,188 pj_sockaddr_get_addr(addr),189 str, sizeof(str));190 return str;191 }192 193 190 194 191 /* -
pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c
r1552 r1611 992 992 */ 993 993 if (listener_addr->sin_addr.s_addr == 0) { 994 pj_ in_addr hostip;995 996 status = pj_gethostip( &hostip);994 pj_sockaddr hostip; 995 996 status = pj_gethostip(pj_AF_INET(), &hostip); 997 997 if (status != PJ_SUCCESS) 998 998 goto on_error; 999 999 1000 listener_addr->sin_addr = hostip ;1000 listener_addr->sin_addr = hostip.ipv4.sin_addr; 1001 1001 } 1002 1002
Note: See TracChangeset
for help on using the changeset viewer.