- Timestamp:
- Sep 9, 2009 8:22:32 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/slirp.c
r22843 r22856 207 207 }; 208 208 209 210 209 #ifdef RT_OS_WINDOWS 211 210 static int get_dns_addr_domain(PNATState pData, bool fVerbose, … … 341 340 int found = 0; 342 341 struct in_addr tmp_addr; 343 int nameservers = 0;344 342 345 343 #ifdef RT_OS_OS2 … … 443 441 444 442 #endif 445 446 static void alias_init(PNATState pData, struct libalias **pla, int la_flags, struct in_addr addr)447 {448 int flags = 0;449 struct libalias *la;450 la = LibAliasInit(pData, NULL);451 if (la == NULL)452 {453 LogRel(("NAT: LibAlias default rule wasn't initialized\n"));454 AssertMsgFailed(("NAT: LibAlias default rule wasn't initialized\n"));455 }456 flags = LibAliasSetMode(la, 0, 0);457 #ifndef NO_FW_PUNCH458 flags |= PKT_ALIAS_PUNCH_FW;459 #endif460 #ifdef DEBUG461 flags |= PKT_ALIAS_LOG; /* set logging */462 #endif463 flags |= la_flags;464 flags = LibAliasSetMode(la, flags, ~0);465 LibAliasSetAddress(la, addr);466 *pla = la;467 }468 443 469 444 static int slirp_init_dns_list(PNATState pData) … … 564 539 565 540 /* set default addresses */ 566 loopback_addr.s_addr = INADDR_LOOPBACK;541 inet_aton("127.0.0.1", &loopback_addr); 567 542 if (slirp_init_dns_list(pData) < 0) 568 543 fNATfailed = 1; … … 572 547 getouraddr(pData); 573 548 { 549 int flags = 0; 574 550 struct in_addr proxy_addr; 551 pData->proxy_alias = LibAliasInit(pData, NULL); 552 if (pData->proxy_alias == NULL) 553 { 554 LogRel(("NAT: LibAlias default rule wasn't initialized\n")); 555 AssertMsgFailed(("NAT: LibAlias default rule wasn't initialized\n")); 556 } 557 flags = LibAliasSetMode(pData->proxy_alias, 0, 0); 558 #ifndef NO_FW_PUNCH 559 flags |= PKT_ALIAS_PUNCH_FW; 560 #endif 561 flags |= PKT_ALIAS_LOG; /* set logging */ 562 flags = LibAliasSetMode(pData->proxy_alias, flags, ~0); 575 563 proxy_addr.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_ALIAS); 576 alias_init(pData, &pData->proxy_alias, 0, proxy_addr); 577 578 #if 0 579 proxy_addr.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_DNS); 580 alias_init(pData, &pData->dns_alias, PKT_ALIAS_REVERSE, proxy_addr); 581 #endif 582 564 LibAliasSetAddress(pData->proxy_alias, proxy_addr); 583 565 ftp_alias_load(pData); 584 566 nbt_alias_load(pData); 585 dns_alias_load(pData);586 567 } 587 568 return fNATfailed ? VINF_NAT_DNS : VINF_SUCCESS; … … 662 643 ftp_alias_unload(pData); 663 644 nbt_alias_unload(pData); 664 dns_alias_unload(pData);665 645 while(!LIST_EMPTY(&instancehead)) 666 646 { … … 1657 1637 psin = (struct sockaddr_in *)&sa; 1658 1638 1639 lib = LibAliasInit(pData, NULL); 1640 flags = LibAliasSetMode(lib, 0, 0); 1641 flags |= PKT_ALIAS_LOG; /* set logging */ 1642 flags |= PKT_ALIAS_REVERSE; /* set logging */ 1643 flags = LibAliasSetMode(lib, flags, ~0); 1659 1644 1660 1645 alias.s_addr = htonl(ntohl(guest_addr) | CTL_ALIAS); 1661 alias_init(pData, &so->so_la, PKT_ALIAS_REVERSE, alias); 1662 link = LibAliasRedirectPort(so->so_la, psin->sin_addr, htons(rule->host_port), 1646 link = LibAliasRedirectPort(lib, psin->sin_addr, htons(rule->host_port), 1663 1647 alias, htons(rule->guest_port), 1664 1648 special_addr, -1, /* not very clear for now*/ … … 1670 1654 goto remove_port_forwarding; 1671 1655 } 1656 so->so_la = lib; 1672 1657 rule->activated = 1; 1673 1658 continue;
Note:
See TracChangeset
for help on using the changeset viewer.