VirtualBox

Changeset 47018 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Jul 6, 2013 5:31:11 PM (11 years ago)
Author:
vboxsync
Message:

Main: re-commit r86967
Main/Network: DHCP server has got the ear in Main, and we able create/describe more complex infrostructures. DHCP server together with Lwip NAT can handle per vm/slot configuration and store them in xml settings.
place-holder: Host interface nameserver list, domain name and search strings, I suppose that this functions should be used on initialization stage and then on host configuration change even or directly from event.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r46969 r47018  
    286286typedef std::list<MachineRegistryEntry> MachinesRegistry;
    287287
     288typedef std::map<DhcpOpt_T, com::Utf8Str> DhcpOptionMap;
     289typedef DhcpOptionMap::value_type DhcpOptValuePair;
     290typedef DhcpOptionMap::iterator DhcpOptIterator;
     291typedef DhcpOptionMap::const_iterator DhcpOptConstIterator;
     292
     293typedef struct VmNameSlotKey
     294{
     295    VmNameSlotKey(const com::Utf8Str& aVmName, LONG aSlot): VmName(aVmName),
     296      Slot(aSlot){}
     297    const com::Utf8Str VmName;
     298    LONG      Slot;
     299    bool operator< (const VmNameSlotKey& that) const
     300    {
     301        if (VmName == that.VmName)
     302            return Slot < that.Slot;
     303        else return VmName < that.VmName;
     304    }
     305} VmNameSlotKey;
     306typedef std::map<VmNameSlotKey, DhcpOptionMap> VmSlot2OptionsMap;
     307typedef VmSlot2OptionsMap::value_type VmSlot2OptionsPair;
     308typedef VmSlot2OptionsMap::iterator VmSlot2OptionsIterator;
     309typedef VmSlot2OptionsMap::const_iterator VmSlot2OptionsConstIterator;
     310
    288311struct DHCPServer
    289312{
     
    294317    com::Utf8Str    strNetworkName,
    295318                    strIPAddress,
    296                     strIPNetworkMask,
    297319                    strIPLower,
    298320                    strIPUpper;
    299321    bool            fEnabled;
     322    std::map<DhcpOpt_T, com::Utf8Str>  GlobalDhcpOptions;
     323    VmSlot2OptionsMap VmSlot2OptionsM;
    300324};
    301325typedef std::list<DHCPServer> DHCPServersList;
     
    337361    void readMachineRegistry(const xml::ElementNode &elmMachineRegistry);
    338362    void readDHCPServers(const xml::ElementNode &elmDHCPServers);
     363    void readDhcpOptions(DhcpOptionMap& map, const xml::ElementNode& options);
    339364    void readNATNetworks(const xml::ElementNode &elmNATNetworks);
    340365
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