Changeset 28365 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Apr 15, 2010 2:43:22 PM (15 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r28275 r28365 1181 1181 pDrvIns->iInstance, szNetwork); 1182 1182 1183 char szNetAddr[16];1184 RTStrPrintf(szNetAddr, sizeof(szNetAddr), "%d.%d.%d.%d",1185 (Network & 0xFF000000) >> 24, (Network & 0xFF0000) >> 16,1186 (Network & 0xFF00) >> 8, Network & 0xFF);1187 1188 1183 /* 1189 1184 * Initialize slirp. 1190 1185 */ 1191 rc = slirp_init(&pThis->pNATState, &szNetAddr[0], Netmask, fPassDomain, !!fUseHostResolver, pThis); 1186 rc = slirp_init(&pThis->pNATState, RT_H2N_U32(Network), Netmask, 1187 fPassDomain, !!fUseHostResolver, pThis); 1192 1188 if (RT_SUCCESS(rc)) 1193 1189 { -
trunk/src/VBox/Devices/Network/slirp/bootp.c
r27797 r28365 272 272 FILL_BOOTP_EXT(q, RFC1533_GATEWAY, 4, &saddr); 273 273 274 if (pData-> use_dns_proxy || pData->use_host_resolver)274 if (pData->fUseDnsProxy || pData->fUseHostResolver) 275 275 { 276 276 uint32_t addr = RT_H2N_U32(RT_N2H_U32(pData->special_addr.s_addr) | CTL_DNS); … … 300 300 FILL_BOOTP_EXT(q, RFC1533_DOMAINNAME, 1, " "); 301 301 } 302 if (pData->fPassDomain && !pData-> use_host_resolver)302 if (pData->fPassDomain && !pData->fUseHostResolver) 303 303 { 304 304 LIST_FOREACH(dd, &pData->pDomainList, dd_list) -
trunk/src/VBox/Devices/Network/slirp/libslirp.h
r28147 r28365 29 29 #endif 30 30 31 #ifndef VBOX_WITH_NAT_SERVICE32 int slirp_init(PNATState *, const char *, uint32_t, bool, bool, void *);33 #else34 31 int slirp_init(PNATState *, uint32_t, uint32_t, bool, bool, void *); 35 #endif36 32 void slirp_register_statistics(PNATState pData, PPDMDRVINS pDrvIns); 37 33 void slirp_deregister_statistics(PNATState pData, PPDMDRVINS pDrvIns); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r28346 r28365 523 523 } 524 524 525 #ifndef VBOX_WITH_NAT_SERVICE526 int slirp_init(PNATState *ppData, const char *pszNetAddr, uint32_t u32Netmask,527 bool fPassDomain, bool fUseHostResolver, void *pvUser)528 #else529 525 int slirp_init(PNATState *ppData, uint32_t u32NetAddr, uint32_t u32Netmask, 530 526 bool fPassDomain, bool fUseHostResolver, void *pvUser) 531 #endif532 527 { 533 528 int fNATfailed = 0; … … 541 536 return VERR_INVALID_PARAMETER; 542 537 pData->fPassDomain = !fUseHostResolver ? fPassDomain : false; 543 pData-> use_host_resolver = fUseHostResolver;538 pData->fUseHostResolver = fUseHostResolver; 544 539 pData->pvUser = pvUser; 545 540 pData->netmask = u32Netmask; … … 585 580 #endif 586 581 587 #ifndef VBOX_WITH_NAT_SERVICE588 inet_aton(pszNetAddr, &pData->special_addr);589 #else590 582 pData->special_addr.s_addr = u32NetAddr; 591 #endif592 583 pData->slirp_ethaddr = &special_ethaddr[0]; 593 584 alias_addr.s_addr = pData->special_addr.s_addr | RT_H2N_U32_C(CTL_ALIAS); … … 596 587 /* set default addresses */ 597 588 inet_aton("127.0.0.1", &loopback_addr); 598 if (!pData-> use_host_resolver)589 if (!pData->fUseHostResolver) 599 590 { 600 591 if (slirp_init_dns_list(pData) < 0) … … 625 616 ftp_alias_load(pData); 626 617 nbt_alias_load(pData); 627 if (pData-> use_host_resolver)618 if (pData->fUseHostResolver) 628 619 dns_alias_load(pData); 629 620 } … … 729 720 ftp_alias_unload(pData); 730 721 nbt_alias_unload(pData); 731 if (pData-> use_host_resolver)722 if (pData->fUseHostResolver) 732 723 dns_alias_unload(pData); 733 724 while (!LIST_EMPTY(&instancehead)) … … 1915 1906 void slirp_set_dhcp_dns_proxy(PNATState pData, bool fDNSProxy) 1916 1907 { 1917 if (!pData-> use_host_resolver)1908 if (!pData->fUseHostResolver) 1918 1909 { 1919 1910 Log2(("NAT: DNS proxy switched %s\n", (fDNSProxy ? "on" : "off"))); 1920 pData-> use_dns_proxy = fDNSProxy;1911 pData->fUseDnsProxy = fDNSProxy; 1921 1912 } 1922 1913 else -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r28142 r28365 281 281 uma_zone_t zone_ext_refcnt; 282 282 #endif 283 int use_host_resolver;283 bool fUseHostResolver; 284 284 /* from dnsproxy/dnsproxy.h*/ 285 285 unsigned int authoritative_port; … … 311 311 struct request *request_hash[1 << HASHSIZE]; 312 312 /* this field control behaviour of DHCP server */ 313 bool use_dns_proxy;313 bool fUseDnsProxy; 314 314 315 315 LIST_HEAD(RT_NOTHING, libalias) instancehead; -
trunk/src/VBox/Devices/Network/slirp/udp.c
r27765 r28365 162 162 } 163 163 164 if ( pData-> use_host_resolver164 if ( pData->fUseHostResolver 165 165 && uh->uh_dport == RT_H2N_U16_C(53) 166 166 && CTL_CHECK(RT_N2H_U32(ip->ip_dst.s_addr), CTL_DNS)) … … 256 256 * DNS proxy 257 257 */ 258 if ( pData-> use_dns_proxy258 if ( pData->fUseDnsProxy 259 259 && (ip->ip_dst.s_addr == RT_H2N_U32(RT_N2H_U32(pData->special_addr.s_addr) | CTL_DNS)) 260 260 && (uh->uh_dport == RT_H2N_U16_C(53)))
Note:
See TracChangeset
for help on using the changeset viewer.