Changeset 37724 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jul 1, 2011 9:45:11 AM (13 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r33676 r37724 256 256 /* Address/port of the DHCP server. */ 257 257 rbp->bp_yiaddr = bc->addr; /* Client IP address */ 258 Log(("NAT: DHCP: bp_yiaddr:%R[ IP4]\n", &rbp->bp_yiaddr));258 Log(("NAT: DHCP: bp_yiaddr:%R[naipv4]\n", &rbp->bp_yiaddr)); 259 259 rbp->bp_siaddr = pData->tftp_server; /* Next Server IP address, i.e. TFTP */ 260 Log(("NAT: DHCP: bp_siaddr:%R[ IP4]\n", &rbp->bp_siaddr));260 Log(("NAT: DHCP: bp_siaddr:%R[naipv4]\n", &rbp->bp_siaddr)); 261 261 if (fDhcpRequest) 262 262 { … … 268 268 saddr.s_addr = pData->special_addr.s_addr; 269 269 #endif 270 Log(("NAT: DHCP: s_addr:%R[ IP4]\n", &saddr));270 Log(("NAT: DHCP: s_addr:%R[naipv4]\n", &saddr)); 271 271 272 272 #define FILL_BOOTP_EXT(q, tag, len, pvalue) \ … … 455 455 if ((bp->bp_ciaddr.s_addr & RT_H2N_U32(pData->netmask)) != pData->special_addr.s_addr) 456 456 { 457 LogRel(("NAT: Client %R[ IP4] requested IP -- sending NAK\n", &bp->bp_ciaddr));457 LogRel(("NAT: Client %R[naipv4] requested IP -- sending NAK\n", &bp->bp_ciaddr)); 458 458 offReply = dhcp_send_nack(pData, bp, bc, m); 459 459 return offReply; … … 479 479 if ((ui32 & RT_H2N_U32(pData->netmask)) != pData->special_addr.s_addr) 480 480 { 481 LogRel(("NAT: address %R[ IP4] has been requested -- sending NAK\n", &ui32));481 LogRel(("NAT: address %R[naipv4] has been requested -- sending NAK\n", &ui32)); 482 482 offReply = dhcp_send_nack(pData, bp, bc, m); 483 483 return offReply; … … 503 503 } 504 504 505 LogRel(("NAT: DHCP offered IP address %R[ IP4]\n", &bc->addr));505 LogRel(("NAT: DHCP offered IP address %R[naipv4]\n", &bc->addr)); 506 506 offReply = dhcp_send_ack(pData, bp, bc, m, /* fDhcpRequest=*/ 1); 507 507 return offReply; … … 530 530 531 531 bc->xid = bp->bp_xid; 532 LogRel(("NAT: DHCP offered IP address %R[ IP4]\n", &bc->addr));532 LogRel(("NAT: DHCP offered IP address %R[naipv4]\n", &bc->addr)); 533 533 offReply = dhcp_send_offer(pData, bp, bc, m); 534 534 return offReply; … … 543 543 } 544 544 545 LogRel(("NAT: DHCP offered IP address %R[ IP4]\n", &bc->addr));545 LogRel(("NAT: DHCP offered IP address %R[naipv4]\n", &bc->addr)); 546 546 offReply = dhcp_send_ack(pData, bp, bc, m, /* fDhcpRequest=*/ 0); 547 547 return offReply; … … 554 554 { 555 555 int rc = release_addr(pData, &bp->bp_ciaddr); 556 LogRel(("NAT: %s %R[ IP4]\n",556 LogRel(("NAT: %s %R[naipv4]\n", 557 557 RT_SUCCESS(rc) ? "DHCP released IP address" : "Ignored DHCP release for IP address", 558 558 &bp->bp_ciaddr)); … … 710 710 bc->addr.s_addr = req_ip.s_addr; 711 711 slirp_arp_who_has(pData, bc->addr.s_addr); 712 LogRel(("NAT: %R[ IP4] has been already registered\n", &req_ip));712 LogRel(("NAT: %R[naipv4] has been already registered\n", &req_ip)); 713 713 } 714 714 /* no response required */ -
trunk/src/VBox/Devices/Network/slirp/debug.c
r36410 r37724 35 35 #endif 36 36 37 #define IP4_ADDR_PRINTF_DECOMP(ip) ((ip) >> 24), ((ip) >> 16) & 0xff, ((ip) >> 8) & 0xff, (ip) & 0xff38 #define IP4_ADDR_PRINTF_FORMAT "%u.%u.%u.%u"39 37 /* 40 38 * Dump a packet in the same format as tcpdump -x … … 228 226 229 227 static DECLCALLBACK(size_t) 230 print_ipv4_address(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,231 const char *pszType, void const *pvValue,232 int cchWidth, int cchPrecision, unsigned fFlags,233 void *pvUser)234 {235 uint32_t ip;236 237 AssertReturn(strcmp(pszType, "IP4") == 0, 0);238 239 ip = RT_N2H_U32(*(uint32_t*)pvValue);240 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, IP4_ADDR_PRINTF_FORMAT,241 IP4_ADDR_PRINTF_DECOMP(ip));242 }243 244 static DECLCALLBACK(size_t)245 228 print_socket(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, 246 229 const char *pszType, void const *pvValue, … … 273 256 ip = RT_N2H_U32(so->so_faddr.s_addr); 274 257 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket %d:(proto:%u) " 275 "state=%04x ip= " IP4_ADDR_PRINTF_FORMAT ":%d "276 "name= " IP4_ADDR_PRINTF_FORMAT ":%d",277 so->s, so->so_type, so->so_state, IP4_ADDR_PRINTF_DECOMP(ip),258 "state=%04x ip=%RTnaipv4 :%d " 259 "name=%RTnaipv4:%d", 260 so->s, so->so_type, so->so_state, ip, 278 261 RT_N2H_U16(so->so_fport), 279 IP4_ADDR_PRINTF_DECOMP(RT_N2H_U32(in_addr->sin_addr.s_addr)),262 in_addr->sin_addr.s_addr, 280 263 RT_N2H_U16(in_addr->sin_port)); 281 264 } … … 372 355 if (!g_fFormatRegistered) 373 356 { 374 /** @todo r=frank: XXX Move this to IPRT using RTNETADDRIPV4.375 * Use the specifier %RTnaipv4 (tip: takes an "uint32_t" instead of an376 * address).377 */378 rc = RTStrFormatTypeRegister("IP4", print_ipv4_address, NULL);379 AssertRC(rc);380 357 381 358 rc = RTStrFormatTypeRegister("natsock", print_socket, NULL); -
trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c
r36901 r37724 358 358 so->so_expire = curtime + recursive_timeout * 1000; /* let's slirp to care about expiration */ 359 359 /* send it to our authoritative server */ 360 Log2(("NAT: request will be sent to %R[ IP4] on %R[natsock]\n", &addr.sin_addr, so));360 Log2(("NAT: request will be sent to %R[naipv4] on %R[natsock]\n", &addr.sin_addr, so)); 361 361 if ((byte = sendto(so->s, buf, (unsigned int)byte, 0, 362 362 (struct sockaddr *)&addr, … … 367 367 } 368 368 so->so_state = SS_ISFCONNECTED; /* now it's selected */ 369 Log2(("NAT: request was sent to %R[ IP4] on %R[natsock]\n", &addr.sin_addr, so));369 Log2(("NAT: request was sent to %R[naipv4] on %R[natsock]\n", &addr.sin_addr, so)); 370 370 #endif 371 371 ++authoritative_queries; -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r35925 r37724 263 263 { 264 264 /* Should be reaplaced by hash here */ 265 Log(("trying:%R[natsock] against %R[ IP4]:%d lport=%d hlport=%d\n", so, &faddr, fport, lport, so->so_hlport));265 Log(("trying:%R[natsock] against %R[naipv4]:%d lport=%d hlport=%d\n", so, &faddr, fport, lport, so->so_hlport)); 266 266 if ( so->so_faddr.s_addr == faddr.s_addr 267 267 && so->so_fport == fport -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r35923 r37724 113 113 LogFlow(("ip_input: m = %lx\n", (long)m)); 114 114 ip = mtod(m, struct ip *); 115 Log2(("ip_dst=%R[ IP4](len:%d) m_len = %d\n", &ip->ip_dst, RT_N2H_U16(ip->ip_len), m->m_len));115 Log2(("ip_dst=%R[naipv4](len:%d) m_len = %d\n", &ip->ip_dst, RT_N2H_U16(ip->ip_len), m->m_len)); 116 116 117 117 ipstat.ips_total++; … … 238 238 239 239 bad_free_m: 240 Log2(("NAT: IP datagram to %R[ IP4] with size(%d) claimed as bad\n",240 Log2(("NAT: IP datagram to %R[naipv4] with size(%d) claimed as bad\n", 241 241 &ip->ip_dst, ip->ip_len)); 242 242 m_freem(pData, m); -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c
r33957 r37724 79 79 return -1; 80 80 81 Log(("NAT:%s: ah(dport: %hd, sport: %hd) oaddr:%R[ IP4] aaddr:%R[IP4]\n",81 Log(("NAT:%s: ah(dport: %hd, sport: %hd) oaddr:%R[naipv4] aaddr:%R[naipv4]\n", 82 82 __FUNCTION__, ntohs(*ah->dport), ntohs(*ah->sport), 83 83 &ah->oaddr, &ah->aaddr)); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r36943 r37724 335 335 } 336 336 337 Log(("NAT: adding %R[ IP4] to DNS server list\n", &InAddr));337 Log(("NAT: adding %R[naipv4] to DNS server list\n", &InAddr)); 338 338 if ((InAddr.s_addr & RT_H2N_U32_C(IN_CLASSA_NET)) == RT_N2H_U32_C(INADDR_LOOPBACK & IN_CLASSA_NET)) 339 339 pDns->de_addr.s_addr = RT_H2N_U32(RT_N2H_U32(pData->special_addr.s_addr) | CTL_ALIAS); … … 1470 1470 if (!fGratuitousArpReported) 1471 1471 { 1472 LogRel(("NAT: Gratuitous ARP [IP:%R[ IP4], ether:%RTmac]\n",1472 LogRel(("NAT: Gratuitous ARP [IP:%R[naipv4], ether:%RTmac]\n", 1473 1473 ah->ar_sip, ah->ar_sha)); 1474 1474 fGratuitousArpReported = true; … … 1686 1686 #endif 1687 1687 1688 LogRel(("NAT: set redirect %s host port %d => guest port %d @ %R[ IP4]\n",1688 LogRel(("NAT: set redirect %s host port %d => guest port %d @ %R[naipv4]\n", 1689 1689 rule->proto == IPPROTO_UDP ? "UDP" : "TCP", rule->host_port, rule->guest_port, &guest_addr)); 1690 1690 … … 1800 1800 && rule->activated) 1801 1801 { 1802 LogRel(("NAT: remove redirect %s host port %d => guest port %d @ %R[ IP4]\n",1802 LogRel(("NAT: remove redirect %s host port %d => guest port %d @ %R[naipv4]\n", 1803 1803 rule->proto == IPPROTO_UDP ? "UDP" : "TCP", rule->host_port, rule->guest_port, &guest_addr)); 1804 1804 … … 2095 2095 if (!fBroadcastEtherAddReported) 2096 2096 { 2097 LogRel(("NAT: Attempt to add pair [%RTmac:%R[ IP4]] in ARP cache was ignored\n",2097 LogRel(("NAT: Attempt to add pair [%RTmac:%R[naipv4]] in ARP cache was ignored\n", 2098 2098 mac, &dst)); 2099 2099 fBroadcastEtherAddReported = true; … … 2145 2145 LIST_FOREACH(ac, &pData->arp_cache, list) 2146 2146 { 2147 pHlp->pfnPrintf(pHlp, " %R[ IP4] %RTmac\n", &ac->ip, &ac->ether);2147 pHlp->pfnPrintf(pHlp, " %R[naipv4] %RTmac\n", &ac->ip, &ac->ether); 2148 2148 } 2149 2149 … … 2151 2151 LIST_FOREACH(rule, &pData->port_forward_rule_head, list) 2152 2152 { 2153 pHlp->pfnPrintf(pHlp, " %s %d => %R[ IP4]:%d %c\n",2153 pHlp->pfnPrintf(pHlp, " %s %d => %R[naipv4]:%d %c\n", 2154 2154 rule->proto == IPPROTO_UDP ? "UDP" : "TCP", 2155 2155 rule->host_port, &rule->guest_addr.s_addr, rule->guest_port, -
trunk/src/VBox/Devices/Network/slirp/udp.c
r36901 r37724 97 97 LogFlow(("udp_input: m = %lx, iphlen = %d\n", (long)m, iphlen)); 98 98 ip = mtod(m, struct ip *); 99 Log2(("%R[ IP4] iphlen = %d\n", &ip->ip_dst, iphlen));99 Log2(("%R[naipv4] iphlen = %d\n", &ip->ip_dst, iphlen)); 100 100 101 101 udpstat.udps_ipackets++; … … 296 296 m->m_data -= iphlen; 297 297 *ip = save_ip; 298 Log2(("NAT: UDP tx errno = %d (%s) on sent to %R[ IP4]\n",298 Log2(("NAT: UDP tx errno = %d (%s) on sent to %R[naipv4]\n", 299 299 errno, strerror(errno), &ip->ip_dst)); 300 300 icmp_error(pData, m, ICMP_UNREACH, ICMP_UNREACH_NET, 0, strerror(errno)); … … 314 314 315 315 bad_free_mbuf: 316 Log2(("NAT: UDP(id: %hd) datagram to %R[ IP4] with size(%d) claimed as bad\n",316 Log2(("NAT: UDP(id: %hd) datagram to %R[naipv4] with size(%d) claimed as bad\n", 317 317 ip->ip_id, &ip->ip_dst, ip->ip_len)); 318 318 … … 518 518 if (bind(so->s,(struct sockaddr *)&addr, addrlen) < 0) 519 519 { 520 LogRel(("NAT: bind to %R[ IP4] has been failed\n", &addr.sin_addr));520 LogRel(("NAT: bind to %R[naipv4] has been failed\n", &addr.sin_addr)); 521 521 udp_detach(pData, so); 522 522 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.