VirtualBox

Changeset 79732 in vbox for trunk/include


Ignore:
Timestamp:
Jul 12, 2019 12:40:09 PM (6 years ago)
Author:
vboxsync
Message:

Main: Redoing the IDHCPServer interface, part I. bugref:9288

Location:
trunk/include/VBox
Files:
2 edited

Legend:

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

    r79524 r79732  
    371371    /** Main group, IDataStream. */
    372372    LOG_GROUP_MAIN_DATASTREAM,
     373    /** Main group, IDHCPConfig. */
     374    LOG_GROUP_MAIN_DHCPCONFIG,
     375    /** Main group, IDHCPGlobalConfig. */
     376    LOG_GROUP_MAIN_DHCPGLOBALCONFIG,
     377    /** Main group, IDHCPGroupCondition. */
     378    LOG_GROUP_MAIN_DHCPGROUPCONDITION,
     379    /** Main group, IDHCPGroupConfig. */
     380    LOG_GROUP_MAIN_DHCPGROUPCONFIG,
     381    /** Main group, IDHCPIndividualConfig. */
     382    LOG_GROUP_MAIN_DHCPINDIVIDUALCONFIG,
    373383    /** Main group, IDHCPServer. */
    374384    LOG_GROUP_MAIN_DHCPSERVER,
     
    892902    "MAIN_DATAMODEL", \
    893903    "MAIN_DATASTREAM", \
     904    "MAIN_DHCPCONFIG", \
     905    "MAIN_DHCPGLOBALCONFIG", \
     906    "MAIN_DHCPGROUPCONDITION", \
     907    "MAIN_DHCPGROUPCONFIG", \
     908    "MAIN_DHCPINDIVIDUALCONFIG", \
    894909    "MAIN_DHCPSERVER", \
    895910    "MAIN_DIRECTORY", \
  • trunk/include/VBox/settings.h

    r78632 r79732  
    338338{
    339339    DhcpOptValue();
    340     DhcpOptValue(const com::Utf8Str &aText, DhcpOptEncoding_T aEncoding = DhcpOptEncoding_Legacy);
    341 
    342     com::Utf8Str text;
    343     DhcpOptEncoding_T encoding;
     340    DhcpOptValue(const com::Utf8Str &aText, DHCPOptionEncoding_T aEncoding = DHCPOptionEncoding_Legacy);
     341
     342    com::Utf8Str            strValue;
     343    DHCPOptionEncoding_T    enmEncoding;
    344344};
    345345
     
    349349typedef DhcpOptionMap::const_iterator DhcpOptConstIterator;
    350350
    351 typedef struct VmNameSlotKey
    352 {
    353     VmNameSlotKey(const com::Utf8Str& aVmName, LONG aSlot);
    354 
    355     bool operator<(const VmNameSlotKey& that) const;
    356 
    357     const com::Utf8Str VmName;
    358     LONG      Slot;
    359 } VmNameSlotKey;
    360 
    361 typedef std::map<VmNameSlotKey, DhcpOptionMap> VmSlot2OptionsMap;
    362 typedef VmSlot2OptionsMap::value_type VmSlot2OptionsPair;
    363 typedef VmSlot2OptionsMap::iterator VmSlot2OptionsIterator;
    364 typedef VmSlot2OptionsMap::const_iterator VmSlot2OptionsConstIterator;
     351struct DHCPConfig
     352{
     353    DHCPConfig();
     354
     355    DhcpOptionMap           OptionMap;
     356    uint32_t                secMinLeaseTime;
     357    uint32_t                secDefaultLeaseTime;
     358    uint32_t                secMaxLeaseTime;
     359};
     360
     361struct DHCPIndividualConfig : DHCPConfig
     362{
     363    DHCPIndividualConfig();
     364
     365    com::Utf8Str            strMACAddress;
     366    com::Utf8Str            strVMName;
     367    ULONG                   uSlot;
     368    com::Utf8Str            strFixedAddress;
     369};
     370
     371typedef std::map<com::Utf8Str, DHCPIndividualConfig> DHCPIndividualConfigMap;
    365372
    366373struct DHCPServer
     
    368375    DHCPServer();
    369376
    370     com::Utf8Str    strNetworkName,
    371                     strIPAddress,
    372                     strIPLower,
    373                     strIPUpper;
    374     bool            fEnabled;
    375     DhcpOptionMap   GlobalDhcpOptions;
    376     VmSlot2OptionsMap VmSlot2OptionsM;
     377    com::Utf8Str            strNetworkName;
     378    com::Utf8Str            strIPAddress;
     379    com::Utf8Str            strIPLower;
     380    com::Utf8Str            strIPUpper;
     381    bool                    fEnabled;
     382    DHCPConfig              GlobalConfig;
     383    DHCPIndividualConfigMap IndividualConfigs;
    377384};
    378385
     
    409416
    410417    void readMachineRegistry(const xml::ElementNode &elmMachineRegistry);
    411     void readDHCPServers(const xml::ElementNode &elmDHCPServers);
    412     void readDhcpOptions(DhcpOptionMap& map, const xml::ElementNode& options);
    413418    void readNATNetworks(const xml::ElementNode &elmNATNetworks);
    414419
     
    427432    void buildUSBDeviceSources(xml::ElementNode &elmParent, const USBDeviceSourcesList &ll);
    428433    void readUSBDeviceSources(const xml::ElementNode &elmDeviceSources, USBDeviceSourcesList &ll);
     434    void buildDHCPServers(xml::ElementNode &elmDHCPServers, DHCPServersList const &ll);
     435    void buildDHCPOptions(xml::ElementNode &elmOptions, DHCPConfig const &rConfig, bool fIgnoreSubnetMask);
     436    void readDHCPServers(const xml::ElementNode &elmDHCPServers);
     437    void readDHCPOptions(DHCPConfig &rConfig, const xml::ElementNode &elmOptions, bool fIgnoreSubnetMask);
    429438    bool convertGuiProxySettings(const com::Utf8Str &strUIProxySettings);
    430439};
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