VirtualBox

Changeset 54267 in vbox


Ignore:
Timestamp:
Feb 18, 2015 3:41:30 PM (10 years ago)
Author:
vboxsync
Message:

Frontends/VBoxManage: collect DHCP options specified on the command
line into a vector instead of a map so that we pass all duplicates to
the API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp

    r54263 r54267  
    5454} OPCODE;
    5555
    56 typedef std::map<DhcpOpt_T, std::string> DhcpOptMap;
    57 typedef DhcpOptMap::iterator DhcpOptIterator;
    58 typedef DhcpOptMap::value_type DhcpOptValuePair;
     56typedef std::pair<DhcpOpt_T, std::string> DhcpOptSpec;
     57typedef std::vector<DhcpOptSpec> DhcpOpts;
     58typedef DhcpOpts::iterator DhcpOptIterator;
    5959
    6060struct VmNameSlotKey
     
    7676};
    7777
    78 typedef std::map<VmNameSlotKey, DhcpOptMap> VmSlot2OptionsM;
     78typedef std::map<VmNameSlotKey, DhcpOpts> VmSlot2OptionsM;
    7979typedef VmSlot2OptionsM::iterator VmSlot2OptionsIterator;
    8080typedef VmSlot2OptionsM::value_type VmSlot2OptionsPair;
     
    136136    int enable = -1;
    137137
    138     DhcpOptMap GlobalDhcpOptions;
     138    DhcpOpts        GlobalDhcpOptions;
    139139    VmSlot2OptionsM VmSlot2Options;
    140140    VmConfigs       VmConfigs2Delete;
     
    289289                                           "--slot wasn't found");
    290290
    291                     DhcpOptMap& map = fVmOptionRead ? VmSlot2Options[VmNameSlotKey(pszVmName, u8Slot)]
     291                    DhcpOpts &opts = fVmOptionRead ? VmSlot2Options[VmNameSlotKey(pszVmName, u8Slot)]
    292292                                                    : GlobalDhcpOptions;
    293293                    std::string strVal = ValueUnion.psz;
    294                     map.insert(DhcpOptValuePair((DhcpOpt_T)u8OptId, strVal));
     294                    opts.push_back(DhcpOptSpec((DhcpOpt_T)u8OptId, strVal));
    295295
    296296                }
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