VirtualBox

Changeset 48373 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 8, 2013 6:24:00 AM (11 years ago)
Author:
vboxsync
Message:

lwip-nat: fetching local bindings. (disabled).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp

    r48372 r48373  
    120120typedef VECNATSERVICEPF::const_iterator CITERATORNATSERVICEPF;
    121121
     122struct ip4address2off
     123{
     124    struct sockaddr_in addr;
     125    uint32_t off;
     126};
     127
    122128class PortForwardListener;
    123129
     
    138144    struct sockaddr_in m_src4;
    139145    struct sockaddr_in6 m_src6;
     146    /**
     147     * place for registered local interfaces.
     148     */
     149    ip4address2off m_lo2off[10];
    140150
    141151    uint16_t m_u16Mtu;
     
    890900            m_vecPortForwardRule6.push_back(Rule);
    891901        }
     902
     903#if 0 /* fetching local mappings */
     904        com::SafeArray<BSTR> strs;
     905        int count_strs;
     906        hrc = net->COMGETTER(LocalMappings)(ComSafeArrayAsOutParam(strs));
     907        if (   SUCCEEDED(hrc)
     908            && (count_strs = strs.size()))
     909        {
     910            unsigned int j = 0;
     911            int i;
     912
     913            for (i = 0; i < count_strs && j < RT_ELEMENTS(m_lo2off); ++i)
     914            {
     915                char aszAddr[17];
     916                RTNETADDRIPV4 ip4addr;
     917                char *pszTerm;
     918                uint32_t u32Off;
     919                const char *pszLo2Off = com::Utf8Str(strs[i]).c_str();
     920       
     921                RT_ZERO(aszAddr);
     922               
     923                pszTerm = RTStrStr(pszLo2Off, ";");
     924
     925                if (   !pszTerm
     926                    && (pszTerm - pszLo2Off) >= 17)
     927                    continue;
     928               
     929                memcpy(aszAddr, pszLo2Off, (pszTerm - pszLo2Off));
     930                rc = RTNetStrToIPv4Addr(aszAddr, &ip4addr);
     931                if (RT_FAILURE(rc))
     932                    continue;
     933
     934                u32Off = RTStrToUInt32(pszTerm + 1);
     935                if (u32Off == 0)
     936                    continue;
     937
     938                m_lo2off[j].addr.sin_addr.s_addr = ip4addr.u;
     939                m_lo2off[j].off = u32Off;
     940                ++j;
     941            }
     942        }
     943#endif
    892944    } /* if (!fDontLoadRulesOnStartup) */
    893945
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