VirtualBox

Changeset 20959 in vbox for trunk


Ignore:
Timestamp:
Jun 26, 2009 7:50:03 AM (16 years ago)
Author:
vboxsync
Message:

NAT: remove (and enable) VBOX_WITH_MULTI_DNS and VBOX_WITH_SLIRP_DNS_PROXY ifdefs as both were properly tested with VBox 2.2.x

Location:
trunk/src/VBox/Devices
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Makefile.kmk

    r20958 r20959  
    722722        Network/slirp/tcp_timer.c \
    723723        Network/slirp/tftp.c \
    724         Network/slirp/udp.c
     724        Network/slirp/udp.c \
     725        Network/slirp/dnsproxy/hash.c \
     726        Network/slirp/dnsproxy/dnsproxy.c
    725727
    726728VBOX_SLIRP_ALIAS_SOURCES = \
     
    733735        Network/slirp/libalias/alias_util.c
    734736
    735 
    736 VBOX_WITH_SLIRP_DNS_PROXY=1
    737 
    738 ifdef VBOX_WITH_SLIRP_DNS_PROXY
    739 VBOX_SLIRP_SOURCES += \
    740         Network/slirp/dnsproxy/hash.c \
    741         Network/slirp/dnsproxy/dnsproxy.c
    742 endif
    743 
    744737# some day will be deleted
    745 VBOX_WITH_MULTI_DNS=1
    746738VBOX_WITHOUT_SLIRP_CLIENT_ETHER=1
    747739
     
    753745      $(if $(VBOX_WITHOUT_SLIRP_CLIENT_ETHER),VBOX_WITHOUT_SLIRP_CLIENT_ETHER,) \
    754746      $(if $(VBOX_WITH_DEBUG_NAT_SOCKETS),VBOX_WITH_DEBUG_NAT_SOCKETS,) \
    755       $(if $(VBOX_WITH_MULTI_DNS),VBOX_WITH_MULTI_DNS,) \
    756       $(if $(VBOX_WITH_SLIRP_DNS_PROXY),VBOX_WITH_SLIRP_DNS_PROXY,)     \
    757747      $(if $(VBOX_WITH_SLIRP_MT),VBOX_WITH_SLIRP_MT,)
    758748 ifdef VBOX_WITH_SLIRP_ALIAS
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r20718 r20959  
    751751     * Validate the config.
    752752     */
    753     if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0"
    754 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    755         "DNSProxy\0"
    756 #endif
     753    if (!CFGMR3AreValuesValid(pCfgHandle, "PassDomain\0TFTPPrefix\0BootFile\0Network\0NextServer\0DNSProxy\0"
    757754        "SocketRcvBuf\0SocketSndBuf\0TcpRcvSpace\0TcpSndSpace\0"))
    758755        return PDMDRV_SET_ERROR(pDrvIns, VERR_PDM_DRVINS_UNKNOWN_CFG_VALUES,
     
    793790    if (RT_FAILURE(rc) && rc != VERR_CFGM_VALUE_NOT_FOUND)
    794791        return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS, N_("NAT#%d: configuration query for \"NextServer\" string failed"), pDrvIns->iInstance);
    795 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    796792    int fDNSProxy;
    797793    rc = CFGMR3QueryS32(pCfgHandle, "DNSProxy", &fDNSProxy);
    798794    if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    799795        fDNSProxy = 0;
    800 #endif
    801796
    802797    /*
     
    837832        slirp_set_dhcp_TFTP_bootfile(pThis->pNATState, pThis->pszBootFile);
    838833        slirp_set_dhcp_next_server(pThis->pNATState, pThis->pszNextServer);
    839 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    840834        slirp_set_dhcp_dns_proxy(pThis->pNATState, !!fDNSProxy);
    841 #endif
    842835#define SLIRP_SET_TUNING_VALUE(name, setter)            \
    843836            do                                                  \
  • trunk/src/VBox/Devices/Network/slirp/bootp.c

    r19981 r20959  
    144144    struct bootp_t *rbp;
    145145    struct sockaddr_in saddr, daddr;
    146 #ifndef VBOX_WITH_MULTI_DNS
    147     struct in_addr dns_addr_dhcp;
    148 #endif
    149146    int dhcp_msg_type, val;
    150147    uint8_t *q;
     
    305302         || dhcp_msg_type == DHCPREQUEST))
    306303    {
    307 #ifdef VBOX_WITH_MULTI_DNS
    308304        struct dns_entry *de = NULL;
    309305        struct dns_domain_entry *dd = NULL;
    310306        int added = 0;
    311307        uint8_t *q_dns_header = NULL;
    312 #endif
    313308        uint32_t lease_time = htonl(LEASE_TIME);
    314309        uint32_t netmask = htonl(pData->netmask);
     
    317312        FILL_BOOTP_EXT(q, RFC1533_GATEWAY, 4, &saddr.sin_addr);
    318313
    319 #ifndef VBOX_WITH_MULTI_DNS
    320         dns_addr_dhcp.s_addr = htonl(ntohl(special_addr.s_addr) | CTL_DNS);
    321         FILL_BOOTP_EXT(q, RFC1533_DNS, 4, &dns_addr_dhcp.s_addr);
    322 #else
    323 # ifdef VBOX_WITH_SLIRP_DNS_PROXY
    324314        if (pData->use_dns_proxy)
    325315        {
     
    328318            goto skip_dns_servers;
    329319        }
    330 # endif
    331 
    332320
    333321        if (!TAILQ_EMPTY(&pData->dns_list_head))
     
    345333        }
    346334
    347 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    348         skip_dns_servers:
    349 #endif
     335skip_dns_servers:
    350336        if (LIST_EMPTY(&pData->dns_domain_list_head))
    351337        {
     
    366352            FILL_BOOTP_EXT(q, RFC1533_DOMAINNAME, val, dd->dd_pszDomain);
    367353        }
    368 #endif
    369354
    370355        FILL_BOOTP_EXT(q, RFC2132_LEASE_TIME, 4, &lease_time);
     
    375360            FILL_BOOTP_EXT(q, RFC1533_HOSTNAME, val, slirp_hostname);
    376361        }
    377 
    378 #ifndef VBOX_WITH_MULTI_DNS
    379         if (pData->pszDomain && pData->fPassDomain)
    380         {
    381             val = (int)strlen(pData->pszDomain);
    382             FILL_BOOTP_EXT(q, RFC1533_DOMAINNAME, val, pData->pszDomain);
    383         }
    384 #endif
    385362    }
    386363    *q++ = RFC1533_END;
  • trunk/src/VBox/Devices/Network/slirp/ip_icmp.c

    r20257 r20959  
    103103        pData->pfIcmpCloseHandle = (BOOL (WINAPI *)(HANDLE))
    104104                                    GetProcAddress(pData->hmIcmpLibrary, "IcmpCloseHandle");
    105 # ifdef VBOX_WITH_MULTI_DNS
    106105        pData->pfGetAdaptersAddresses = (ULONG (WINAPI *)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG))
    107106                                    GetProcAddress(pData->hmIcmpLibrary, "GetAdaptersAddresses");
     
    110109            LogRel(("NAT: Can't find GetAdapterAddresses in Iphlpapi.dll"));
    111110        }
    112 # endif
    113111    }
    114112
    115113    if (pData->pfIcmpParseReplies == NULL)
    116114    {
    117 # ifdef VBOX_WITH_MULTI_DNS
    118115        if(pData->pfGetAdaptersAddresses == NULL)
    119116            FreeLibrary(pData->hmIcmpLibrary);
    120 # else
    121         FreeLibrary(pData->hmIcmpLibrary);
    122 # endif
    123117        pData->hmIcmpLibrary = LoadLibrary("Icmp.dll");
    124118        if (pData->hmIcmpLibrary == NULL)
     
    371365                    {
    372366                        case CTL_DNS:
    373 #ifndef VBOX_WITH_MULTI_DNS
    374                             addr.sin_addr = dns_addr;
    375                             break;
    376 #endif
    377367                        case CTL_ALIAS:
    378368                        default:
  • trunk/src/VBox/Devices/Network/slirp/libslirp.h

    r20712 r20959  
    6464void slirp_set_dhcp_TFTP_bootfile(PNATState pData, const char *bootFile);
    6565void slirp_set_dhcp_next_server(PNATState pData, const char *nextServer);
    66 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    6766void slirp_set_dhcp_dns_proxy(PNATState pData, bool fDNSProxy);
    68 #endif
    6967void slirp_set_rcvbuf(PNATState pData, int kilobytes);
    7068void slirp_set_sndbuf(PNATState pData, int kilobytes);
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r20782 r20959  
    22#ifdef RT_OS_OS2
    33# include <paths.h>
    4 #endif
    5 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    6 #include "dnsproxy/dnsproxy.h"
    74#endif
    85
     
    210207
    211208#ifdef RT_OS_WINDOWS
    212 # ifndef VBOX_WITH_MULTI_DNS
    213 static int get_dns_addr_domain(PNATState pData, bool fVerbose,
    214                                struct in_addr *pdns_addr,
    215                                const char **ppszDomain)
    216 {
    217     int  rc = 0;
    218     FIXED_INFO *FixedInfo = NULL;
    219     ULONG BufLen;
    220     DWORD ret;
    221     IP_ADDR_STRING *pIPAddr;
    222     struct in_addr tmp_addr;
    223 
    224     FixedInfo = (FIXED_INFO *)GlobalAlloc(GPTR, sizeof(FIXED_INFO));
    225     BufLen = sizeof(FIXED_INFO);
    226 
    227     /** @todo: this API returns all DNS servers, no matter whether the
    228      * corresponding network adapter is disabled or not. Maybe replace
    229      * this by GetAdapterAddresses(), which is XP/Vista only though. */
    230     if (ERROR_BUFFER_OVERFLOW == GetNetworkParams(FixedInfo, &BufLen))
    231     {
    232         if (FixedInfo)
    233         {
    234             GlobalFree(FixedInfo);
    235             FixedInfo = NULL;
    236         }
    237         FixedInfo = GlobalAlloc(GPTR, BufLen);
    238     }
    239 
    240     if ((ret = GetNetworkParams(FixedInfo, &BufLen)) != ERROR_SUCCESS)
    241     {
    242         Log(("GetNetworkParams failed. ret = %08x\n", (u_int)ret ));
    243         if (FixedInfo)
    244         {
    245             GlobalFree(FixedInfo);
    246             FixedInfo = NULL;
    247         }
    248         rc = -1;
    249         goto get_dns_prefix;
    250     }
    251 
    252     pIPAddr = &(FixedInfo->DnsServerList);
    253     inet_aton(pIPAddr->IpAddress.String, &tmp_addr);
    254     Log(("nat: DNS Servers:\n"));
    255     if (fVerbose || pdns_addr->s_addr != tmp_addr.s_addr)
    256         LogRel(("NAT: DNS address: %s\n", pIPAddr->IpAddress.String));
    257     *pdns_addr = tmp_addr;
    258 
    259     pIPAddr = FixedInfo -> DnsServerList.Next;
    260     while (pIPAddr)
    261     {
    262         if (fVerbose)
    263             LogRel(("NAT: ignored DNS address: %s\n", pIPAddr ->IpAddress.String));
    264         pIPAddr = pIPAddr ->Next;
    265     }
    266     if (FixedInfo)
    267     {
    268         GlobalFree(FixedInfo);
    269         FixedInfo = NULL;
    270     }
    271 
    272 get_dns_prefix:
    273     if (ppszDomain)
    274     {
    275         OSVERSIONINFO ver;
    276         char szDnsDomain[256];
    277         DWORD dwSize = sizeof(szDnsDomain);
    278 
    279         *ppszDomain = NULL;
    280         GetVersionEx(&ver);
    281         if (ver.dwMajorVersion >= 5)
    282         {
    283             /* GetComputerNameEx exists in Windows versions starting with 2000. */
    284             if (GetComputerNameEx(ComputerNameDnsDomain, szDnsDomain, &dwSize))
    285             {
    286                 if (szDnsDomain[0])
    287                 {
    288                     /* Just non-empty strings are valid. */
    289                     *ppszDomain = RTStrDup(szDnsDomain);
    290                     if (pData->fPassDomain)
    291                     {
    292                         if (fVerbose)
    293                             LogRel(("NAT: passing domain name %s\n", szDnsDomain));
    294                     }
    295                     else
    296                         Log(("nat: ignoring domain %s\n", szDnsDomain));
    297                 }
    298             }
    299             else
    300                 Log(("nat: GetComputerNameEx failed (%d)\n", GetLastError()));
    301         }
    302     }
    303     return rc;
    304 }
    305 # else /* !VBOX_WITH_MULTI_DNS */
    306209static int get_dns_addr_domain(PNATState pData, bool fVerbose,
    307210                               struct in_addr *pdns_addr,
     
    424327    return 0;
    425328}
    426 # endif /* VBOX_WITH_MULTI_DNS */
    427329
    428330#else /* !RT_OS_WINDOWS */
     
    482384    while (fgets(buff, 512, f) != NULL)
    483385    {
    484 #ifdef VBOX_WITH_MULTI_DNS
    485386        struct dns_entry *da = NULL;
    486 #endif
    487387        if (sscanf(buff, "nameserver%*[ \t]%256s", buff2) == 1)
    488388        {
    489389            if (!inet_aton(buff2, &tmp_addr))
    490390                continue;
    491 #ifndef VBOX_WITH_MULTI_DNS
    492             /* If it's the first one, set it to dns_addr */
    493             if (!found)
    494             {
    495                 if (fVerbose || pdns_addr->s_addr != tmp_addr.s_addr)
    496                     LogRel(("NAT: DNS address: %s\n", buff2));
    497                 *pdns_addr = tmp_addr;
    498             }
    499             else
    500             {
    501                 if (fVerbose)
    502                     LogRel(("NAT: ignored DNS address: %s\n", buff2));
    503             }
    504 #else
    505     /*localhost mask */
     391            /*localhost mask */
    506392            da = RTMemAllocZ(sizeof (struct dns_entry));
    507393            if (da == NULL)
     
    516402            }
    517403            TAILQ_INSERT_HEAD(&pData->dns_list_head, da, de_list);
    518 #endif
    519404            found++;
    520405        }
    521 #ifndef VBOX_WITH_MULTI_DNS
    522         if (   ppszDomain
    523             && (!strncmp(buff, "domain", 6) || !strncmp(buff, "search", 6)))
    524         {
    525             /* Domain name/search list present. Pick first entry */
    526             if (*ppszDomain == NULL)
    527             {
    528                 char *tok;
    529                 char *saveptr;
    530                 tok = strtok_r(&buff[6], " \t\n", &saveptr);
    531                 if (tok)
    532                 {
    533                     *ppszDomain = RTStrDup(tok);
    534                     if (pData->fPassDomain)
    535                     {
    536                         if (fVerbose)
    537                             LogRel(("NAT: passing domain name %s\n", tok));
    538                     }
    539                     else
    540                         Log(("nat: ignoring domain %s\n", tok));
    541                 }
    542             }
    543         }
    544 #else
    545406        if ((!strncmp(buff, "domain", 6) || !strncmp(buff, "search", 6)))
    546407        {
     
    571432            }
    572433        }
    573 #endif
    574434    }
    575435    fclose(f);
     
    580440
    581441#endif
    582 #ifdef VBOX_WITH_MULTI_DNS
     442
    583443static int slirp_init_dns_list(PNATState pData)
    584444{
     
    605465    }
    606466}
    607 #endif
    608467
    609468int get_dns_addr(PNATState pData, struct in_addr *pdns_addr)
     
    676535    /* set default addresses */
    677536    inet_aton("127.0.0.1", &loopback_addr);
    678 #ifndef VBOX_WITH_MULTI_DNS
    679     inet_aton("127.0.0.1", &dns_addr);
    680 
    681     if (get_dns_addr_domain(pData, true, &dns_addr, &pData->pszDomain) < 0)
    682 #else
    683537    if (slirp_init_dns_list(pData) < 0)
    684 #endif
    685538        fNATfailed = 1;
    686 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
     539
    687540    dnsproxy_init(pData);
    688 #endif
    689541
    690542    getouraddr(pData);
     
    795647void slirp_term(PNATState pData)
    796648{
    797 #ifndef VBOX_WITH_MULTI_DNS
    798     if (pData->pszDomain)
    799         RTStrFree((char *)(void *)pData->pszDomain);
    800 #endif
    801 
    802649#ifdef RT_OS_WINDOWS
    803650    pData->pfIcmpCloseHandle(pData->icmp_socket.sh);
     
    809656
    810657    slirp_link_down(pData);
    811 #ifdef VBOX_WITH_MULTI_DNS
    812658    slirp_release_dns_list(pData);
    813 #endif
    814659#ifdef RT_OS_WINDOWS
    815660    WSACleanup();
     
    1002847            if (so->so_expire <= curtime)
    1003848            {
    1004 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    1005849                Log2(("NAT: %R[natsock] expired\n", so));
    1006850                if (so->so_timeout != NULL)
     
    1008852                    so->so_timeout(pData, so, so->so_timeout_arg);
    1009853                }
    1010 #endif
    1011854#ifdef VBOX_WITH_SLIRP_MT
    1012855                    /* we need so_next for continue our cycle*/
     
    18631706        inet_aton(next_server, &pData->tftp_server);
    18641707}
    1865 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
     1708
    18661709void slirp_set_dhcp_dns_proxy(PNATState pData, bool fDNSProxy)
    18671710{
     
    18691712    pData->use_dns_proxy = fDNSProxy;
    18701713}
    1871 #endif
    18721714
    18731715#define CHECK_ARG(name, val, lim_min, lim_max)                                  \
  • trunk/src/VBox/Devices/Network/slirp/slirp.h

    r20712 r20959  
    253253#endif
    254254
    255 #if SIZEOF_CHAR_P == 4
    256 # define insque_32 insque
    257 # define remque_32 remque
    258 #else
    259 extern void insque_32 (PNATState, void *, void *);
    260 extern void remque_32 (PNATState, void *);
    261 #endif
    262 
    263255#ifndef RT_OS_WINDOWS
    264256#include <netdb.h>
    265257#endif
    266258
    267 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    268 # include "dnsproxy/dnsproxy.h"
    269 #endif
     259#include "dnsproxy/dnsproxy.h"
    270260
    271261#define DEFAULT_BAUD 115200
     
    337327# endif
    338328#endif
    339 
    340 #ifndef VBOX_WITH_MULTI_DNS
    341 #define DO_ALIAS(paddr)                                                     \
    342 do {                                                                        \
    343     if ((paddr)->s_addr == dns_addr.s_addr)                                 \
    344     {                                                                       \
    345         (paddr)->s_addr = htonl(ntohl(special_addr.s_addr) | CTL_DNS);      \
    346     }                                                                       \
    347 } while(0)
    348 #else
    349 #define DO_ALIAS(paddr) do {} while (0)
    350 #endif
    351 
    352329
    353330# ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r20712 r20959  
    2424#include <iprt/req.h>
    2525#include "ip_icmp.h"
    26 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    27 # include "dnsproxy/dnsproxy.h"
    28 #endif
     26#include "dnsproxy/dnsproxy.h"
    2927
    3028/** Number of DHCP clients supported by NAT. */
     
    6058};
    6159
    62 #ifdef VBOX_WITH_MULTI_DNS
    6360struct dns_domain_entry
    6461{
    65         char *dd_pszDomain;
    66         LIST_ENTRY(dns_domain_entry) dd_list;
     62    char *dd_pszDomain;
     63    LIST_ENTRY(dns_domain_entry) dd_list;
    6764};
    6865LIST_HEAD(dns_domain_list_head, dns_domain_entry);
     
    7067struct dns_entry
    7168{
    72         struct in_addr de_addr;
    73         TAILQ_ENTRY(dns_entry) de_list;
     69    struct in_addr de_addr;
     70    TAILQ_ENTRY(dns_entry) de_list;
    7471};
    7572TAILQ_HEAD(dns_list_head, dns_entry);
    76 #endif
    7773
    7874/** Main state/configuration structure for slirp NAT. */
     
    123119    PRTREQQUEUE pReqQueue;
    124120#endif
    125 #ifndef VBOX_WITH_MULTI_DNS
    126     struct in_addr dns_addr;
    127 #else
    128 # ifdef RT_OS_WINDOWS
     121#ifdef RT_OS_WINDOWS
    129122    ULONG (WINAPI * pfGetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
    130 # endif
     123#endif
    131124    struct dns_list_head dns_list_head;
    132125    struct dns_domain_list_head dns_domain_list_head;
    133 #endif
    134126    struct in_addr tftp_server;
    135127    struct in_addr loopback_addr;
     
    143135    char slirp_hostname[33];
    144136    bool fPassDomain;
    145 #ifndef VBOX_WITH_MULTI_DNS
    146     const char *pszDomain;
    147 #endif
    148137    /* Stuff from tcp_input.c */
    149138    struct socket tcb;
     
    204193    HANDLE phEvents[VBOX_EVENT_COUNT];
    205194#endif
    206 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
     195
    207196    /* from dnsproxy/dnsproxy.h*/
    208197    unsigned int authoritative_port;
     
    230219    int sock_answer;
    231220    /* dnsproxy/hash.c */
    232 # define HASHSIZE 10
    233 # define HASH(id) (id & ((1 << HASHSIZE) - 1))
     221#define HASHSIZE 10
     222#define HASH(id) (id & ((1 << HASHSIZE) - 1))
    234223    struct request *request_hash[1 << HASHSIZE];
    235224    /* this field control behaviour of DHCP server */
    236225    bool use_dns_proxy;
    237 #endif
     226
    238227#ifdef VBOX_WITH_SLIRP_ALIAS
    239228    LIST_HEAD(RT_NOTHING, libalias) instancehead;
     
    653642#define UDP_DETACH(data, so, so_next) DO_UDP_DETACH((data), (so), (so_next))
    654643
    655 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
    656644/* dnsproxy/dnsproxy.c */
    657 # define authoritative_port pData->authoritative_port
    658 # define authoritative_timeout pData->authoritative_timeout
    659 # define recursive_port pData->recursive_port
    660 # define recursive_timeout pData->recursive_timeout
    661 # define stats_timeout pData->stats_timeout
     645#define authoritative_port pData->authoritative_port
     646#define authoritative_timeout pData->authoritative_timeout
     647#define recursive_port pData->recursive_port
     648#define recursive_timeout pData->recursive_timeout
     649#define stats_timeout pData->stats_timeout
    662650/* dnsproxy/hash.c */
    663 # define dns_port pData->port
    664 # define request_hash pData->request_hash
    665 # define hash_collisions pData->hash_collisions
    666 # define active_queries pData->active_queries
    667 # define all_queries pData->all_queries
    668 # define authoritative_queries pData->authoritative_queries
    669 # define recursive_queries pData->recursive_queries
    670 # define removed_queries pData->removed_queries
    671 # define dropped_queries pData->dropped_queries
    672 # define answered_queries pData->answered_queries
    673 # define dropped_answers pData->dropped_answers
    674 # define late_answers pData->late_answers
     651#define dns_port pData->port
     652#define request_hash pData->request_hash
     653#define hash_collisions pData->hash_collisions
     654#define active_queries pData->active_queries
     655#define all_queries pData->all_queries
     656#define authoritative_queries pData->authoritative_queries
     657#define recursive_queries pData->recursive_queries
     658#define removed_queries pData->removed_queries
     659#define dropped_queries pData->dropped_queries
     660#define answered_queries pData->answered_queries
     661#define dropped_answers pData->dropped_answers
     662#define late_answers pData->late_answers
    675663
    676664/* dnsproxy/dnsproxy.c */
    677 # define queryid pData->queryid
    678 # define authoritative_addr pData->authoritative_addr
    679 # define recursive_addr pData->recursive_addr
    680 # define sock_query pData->sock_query
    681 # define sock_answer pData->sock_answer
    682 #endif
     665#define queryid pData->queryid
     666#define authoritative_addr pData->authoritative_addr
     667#define recursive_addr pData->recursive_addr
     668#define sock_query pData->sock_query
     669#define sock_answer pData->sock_answer
    683670
    684671#ifdef VBOX_WITH_SLIRP_ALIAS
     
    687674
    688675#endif /* !___slirp_state_h */
    689 
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r20712 r20959  
    621621             * out much quicker (10 seconds  for now...)
    622622             */
    623 #ifndef VBOX_WITH_SLIRP_DNS_PROXY
    624             if (so->so_expire)
    625             {
    626                 if (so->so_fport == htons(53))
    627                     so->so_expire = curtime + SO_EXPIREFAST;
    628                 else
    629                     so->so_expire = curtime + SO_EXPIRE;
    630             }
    631 #else
    632623            if (so->so_expire)
    633624            {
     
    641632            if (so->so_fport == htons(53))
    642633                dnsproxy_answer(pData, so, m);
    643 #endif
    644634
    645635#if 0
     
    701691#endif
    702692            case CTL_DNS:
    703 #ifndef VBOX_WITH_MULTI_DNS
    704                 if (!get_dns_addr(pData, &dns_addr))
    705                     addr.sin_addr = dns_addr;
    706                 else
    707                     addr.sin_addr = loopback_addr;
    708                 break;
    709 #endif
    710693            case CTL_ALIAS:
    711694            default:
     
    980963    {
    981964        ip = &icp->icmp_ip;
    982         DO_ALIAS(&ip->ip_dst);
    983     }
    984     else
    985     {
    986         DO_ALIAS(&ip->ip_src);
    987965    }
    988966
     
    11101088                ip = mtod(m, struct ip *);
    11111089                ip->ip_src.s_addr = icr[i].Address;
    1112                 DO_ALIAS(&ip->ip_src);
    11131090                ip->ip_p = IPPROTO_ICMP;
    11141091                ip->ip_dst.s_addr = so->so_laddr.s_addr; /*XXX: still the hack*/
  • trunk/src/VBox/Devices/Network/slirp/socket.h

    r20306 r20959  
    7979    int so_close;
    8080#endif /* RT_OS_WINDOWS */
    81 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
     81
    8282    void (* so_timeout)(PNATState pData, struct socket *so, void *arg);
    8383    void *so_timeout_arg;
    84 #endif
     84
    8585#ifdef VBOX_WITH_NAT_SERVICE
    8686    /* storage of source ether address */
  • trunk/src/VBox/Devices/Network/slirp/tcp_subr.c

    r20650 r20959  
    404404            {
    405405                case CTL_DNS:
    406 #ifndef VBOX_WITH_MULTI_DNS
    407                     if (!get_dns_addr(pData, &dns_addr))
    408                         addr.sin_addr = dns_addr;
    409                     else
    410                         addr.sin_addr = loopback_addr;
    411                     break;
    412 #endif
    413406                case CTL_ALIAS:
    414407                default:
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r20245 r20959  
    231231    so->so_fport = uh->uh_dport; /* XXX */
    232232
    233 #ifdef VBOX_WITH_SLIRP_DNS_PROXY
     233    /*
     234     * DNS proxy
     235     */
    234236    if (   (ip->ip_dst.s_addr == htonl(ntohl(special_addr.s_addr) | CTL_DNS))
    235237        && (ntohs(uh->uh_dport) == 53))
     
    238240        goto bad; /* it isn't bad, probably better to add additional label done for boot/tftf :)  */
    239241    }
    240 #endif
    241242
    242243    iphlen += sizeof(struct udphdr);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette