Changeset 48376 in vbox
- Timestamp:
- Sep 9, 2013 6:52:41 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/NetworkServices/NAT/VBoxNetLwipNAT.cpp
r48374 r48376 120 120 typedef VECNATSERVICEPF::const_iterator CITERATORNATSERVICEPF; 121 121 122 struct ip4address2off123 {124 struct sockaddr_in addr;125 uint32_t off;126 };127 128 122 class PortForwardListener; 129 123 … … 144 138 struct sockaddr_in m_src4; 145 139 struct sockaddr_in6 m_src6; 146 /**147 * place for registered local interfaces.148 */149 ip4address2off m_lo2off[10];150 140 151 141 uint16_t m_u16Mtu; … … 900 890 m_vecPortForwardRule6.push_back(Rule); 901 891 } 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 ( !pszTerm926 && (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 #endif944 892 } /* if (!fDontLoadRulesOnStartup) */ 945 893
Note:
See TracChangeset
for help on using the changeset viewer.