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