Changeset 48093 in vbox for trunk/src/VBox
- Timestamp:
- Aug 27, 2013 4:39:15 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r47991 r48093 837 837 } 838 838 839 void ConfigFileBase::readNATLoopbacks(const xml::ElementNode &elmParent, NATLoopbackOffsetList &llLoopbacks) 840 { 841 xml::ElementNodesList plstLoopbacks; 842 elmParent.getChildElements(plstLoopbacks, "Loopback4"); 843 for (xml::ElementNodesList::iterator lo = plstLoopbacks.begin(); 844 lo != plstLoopbacks.end(); ++lo) 845 { 846 NATHostLoopbackOffset loopback; 847 (*lo)->getAttributeValue("address", loopback.strLoopbackHostAddress); 848 (*lo)->getAttributeValue("offset", (uint32_t&)loopback.u32Offset); 849 llLoopbacks.push_back(loopback); 850 } 851 } 852 853 839 854 /** 840 855 * Adds a "version" attribute to the given XML element with the … … 1192 1207 } 1193 1208 1209 1210 void ConfigFileBase::buildNATLoopbacks(xml::ElementNode &elmParent, const NATLoopbackOffsetList &natLoopbackOffsetList) 1211 { 1212 for (NATLoopbackOffsetList::const_iterator lo = natLoopbackOffsetList.begin(); 1213 lo != natLoopbackOffsetList.end(); ++lo) 1214 { 1215 xml::ElementNode *pelmLo; 1216 pelmLo = elmParent.createChild("Loopback4"); 1217 pelmLo->setAttribute("address", (*lo).strLoopbackHostAddress); 1218 pelmLo->setAttribute("offset", (*lo).u32Offset); 1219 } 1220 } 1221 1194 1222 /** 1195 1223 * Cleans up memory allocated by the internal XML parser. To be called by … … 1379 1407 ) 1380 1408 { 1409 pelmNet->getAttributeValue("loopback6", net.u32HostLoopback6Offset); 1410 const xml::ElementNode *pelmMappings; 1411 if ((pelmMappings = pelmNet->findChildElement("Mappings"))) 1412 readNATLoopbacks(*pelmMappings, net.llHostLoopbackOffsetList); 1413 1381 1414 const xml::ElementNode *pelmPortForwardRules4; 1382 1415 if ((pelmPortForwardRules4 = pelmNet->findChildElement("PortForwarding4"))) … … 1633 1666 xml::ElementNode *pelmPf6 = pelmThis->createChild("PortForwarding6"); 1634 1667 buildNATForwardRuleList(*pelmPf6, n.llPortForwardRules6); 1668 } 1669 1670 if (n.llHostLoopbackOffsetList.size()) 1671 { 1672 xml::ElementNode *pelmMappings = pelmThis->createChild("Mappings"); 1673 buildNATLoopbacks(*pelmMappings, n.llHostLoopbackOffsetList); 1674 1635 1675 } 1636 1676 }
Note:
See TracChangeset
for help on using the changeset viewer.