VirtualBox

Changeset 79845 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Jul 17, 2019 9:12:50 PM (6 years ago)
Author:
vboxsync
Message:

Main/DHCPServer,VBoxManage,Dhcpd: Created a new DHCPOption enum that replaced the incorrectly cased DhcpOpt enum in new APIs. Adjusted and documented each and every option and its format as best as I could. Also added two new attributes to IDHCPConfig, one for supressing options (from higher up the configuration scope) and one for forcing unsolicited options on a client. These attributes have not yet been pushed down to Dhcpd. bugref:9288

Location:
trunk/src/VBox/Main/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/DHCPConfigImpl.h

    r79822 r79845  
    4545protected:
    4646    /** Config scope (global, group, vm+nic, mac).  */
    47     DHCPConfigScope_T const m_enmScope;
     47    DHCPConfigScope_T const     m_enmScope;
    4848    /** Minimum lease time. */
    49     ULONG                   m_secMinLeaseTime;
     49    ULONG                       m_secMinLeaseTime;
    5050    /** Default lease time. */
    51     ULONG                   m_secDefaultLeaseTime;
     51    ULONG                       m_secDefaultLeaseTime;
    5252    /** Maximum lease time. */
    53     ULONG                   m_secMaxLeaseTime;
     53    ULONG                       m_secMaxLeaseTime;
     54    /** List of options which are forced upon the client when available, whether
     55     * requested by it or not.  */
     56    std::vector<DHCPOption_T>   m_vecForcedOptions;
     57    /** List of options which should be suppressed and not returned the the client
     58     * when available and requested. */
     59    std::vector<DHCPOption_T>   m_vecSuppressedOptions;
    5460    /** DHCP option map. */
    55     settings::DhcpOptionMap m_OptionMap;
     61    settings::DhcpOptionMap     m_OptionMap;
    5662    /** The DHCP server parent (weak).   */
    57     DHCPServer * const      m_pParent;
     63    DHCPServer * const          m_pParent;
    5864    /** The DHCP server parent (weak).   */
    59     VirtualBox * const      m_pVirtualBox;
     65    VirtualBox * const          m_pVirtualBox;
    6066private:
    6167    /** For setError and such. */
    62     VirtualBoxBase * const  m_pHack;
     68    VirtualBoxBase * const      m_pHack;
    6369
    6470protected:
     
    8591    HRESULT i_getMaxLeaseTime(ULONG *aMaxLeaseTime);
    8692    HRESULT i_setMaxLeaseTime(ULONG aMaxLeaseTime);
     93    HRESULT i_getForcedOptions(std::vector<DHCPOption_T> &aOptions);
     94    HRESULT i_setForcedOptions(const std::vector<DHCPOption_T> &aOptions);
     95    HRESULT i_getSuppressedOptions(std::vector<DHCPOption_T> &aOptions);
     96    HRESULT i_setSuppressedOptions(const std::vector<DHCPOption_T> &aOptions);
    8797    /** @} */
    8898
     
    92102     * @todo Make protected again when IDHCPServer is cleaned up.
    93103     * @{ */
    94     virtual HRESULT i_setOption(DhcpOpt_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue);
    95 
    96     virtual HRESULT i_removeOption(DhcpOpt_T aOption);
     104    virtual HRESULT i_setOption(DHCPOption_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue);
     105
     106    virtual HRESULT i_removeOption(DHCPOption_T aOption);
    97107    virtual HRESULT i_removeAllOptions();
    98     HRESULT         i_getOption(DhcpOpt_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue);
    99     HRESULT         i_getAllOptions(std::vector<DhcpOpt_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
     108    HRESULT         i_getOption(DHCPOption_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue);
     109    HRESULT         i_getAllOptions(std::vector<DHCPOption_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
    100110                                    std::vector<com::Utf8Str> &aValues);
    101111    virtual HRESULT i_remove();
     
    150160    HRESULT getMaxLeaseTime(ULONG *aMaxLeaseTime) RT_OVERRIDE           { return i_getMaxLeaseTime(aMaxLeaseTime); }
    151161    HRESULT setMaxLeaseTime(ULONG aMaxLeaseTime) RT_OVERRIDE            { return i_setMaxLeaseTime(aMaxLeaseTime); }
     162    HRESULT getForcedOptions(std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE       { return i_getForcedOptions(aOptions); }
     163    HRESULT setForcedOptions(const std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE { return i_setForcedOptions(aOptions); }
     164    HRESULT getSuppressedOptions(std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE   { return i_getSuppressedOptions(aOptions); }
     165    HRESULT setSuppressedOptions(const std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE  { return i_setSuppressedOptions(aOptions); }
    152166    /** @} */
    153167
    154168    /** @name wrapped IDHCPConfig methods
    155169     * @{ */
    156     HRESULT setOption(DhcpOpt_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE
     170    HRESULT setOption(DHCPOption_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE
    157171    {
    158172        return i_setOption(aOption, aEncoding, aValue);
    159173    }
    160174
    161     HRESULT removeOption(DhcpOpt_T aOption) RT_OVERRIDE
     175    HRESULT removeOption(DHCPOption_T aOption) RT_OVERRIDE
    162176    {
    163177        return i_removeOption(aOption);
     
    169183    }
    170184
    171     HRESULT getOption(DhcpOpt_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue) RT_OVERRIDE
     185    HRESULT getOption(DHCPOption_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue) RT_OVERRIDE
    172186    {
    173187        return i_getOption(aOption, aEncoding, aValue);
    174188    }
    175189
    176     HRESULT getAllOptions(std::vector<DhcpOpt_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
     190    HRESULT getAllOptions(std::vector<DHCPOption_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
    177191                          std::vector<com::Utf8Str> &aValues) RT_OVERRIDE
    178192    {
     
    187201
    188202public:
    189     HRESULT i_setOption(DhcpOpt_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE;
    190     HRESULT i_removeOption(DhcpOpt_T aOption) RT_OVERRIDE;
     203    HRESULT i_setOption(DHCPOption_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE;
     204    HRESULT i_removeOption(DHCPOption_T aOption) RT_OVERRIDE;
    191205    HRESULT i_removeAllOptions() RT_OVERRIDE;
    192206    HRESULT i_remove() RT_OVERRIDE;
     
    307321    HRESULT getMaxLeaseTime(ULONG *aMaxLeaseTime) RT_OVERRIDE           { return i_getMaxLeaseTime(aMaxLeaseTime); }
    308322    HRESULT setMaxLeaseTime(ULONG aMaxLeaseTime) RT_OVERRIDE            { return i_setMaxLeaseTime(aMaxLeaseTime); }
     323    HRESULT getForcedOptions(std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE       { return i_getForcedOptions(aOptions); }
     324    HRESULT setForcedOptions(const std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE { return i_setForcedOptions(aOptions); }
     325    HRESULT getSuppressedOptions(std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE   { return i_getSuppressedOptions(aOptions); }
     326    HRESULT setSuppressedOptions(const std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE  { return i_setSuppressedOptions(aOptions); }
    309327    /** @} */
    310328
     
    318336    /** @name Wrapped IDHCPConfig methods
    319337     * @{ */
    320     HRESULT setOption(DhcpOpt_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE
     338    HRESULT setOption(DHCPOption_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE
    321339    {
    322340        return i_setOption(aOption, aEncoding, aValue);
    323341    }
    324342
    325     HRESULT removeOption(DhcpOpt_T aOption) RT_OVERRIDE
     343    HRESULT removeOption(DHCPOption_T aOption) RT_OVERRIDE
    326344    {
    327345        return i_removeOption(aOption);
     
    333351    }
    334352
    335     HRESULT getOption(DhcpOpt_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue) RT_OVERRIDE
     353    HRESULT getOption(DHCPOption_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue) RT_OVERRIDE
    336354    {
    337355        return i_getOption(aOption, aEncoding, aValue);
    338356    }
    339357
    340     HRESULT getAllOptions(std::vector<DhcpOpt_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
     358    HRESULT getAllOptions(std::vector<DHCPOption_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
    341359                          std::vector<com::Utf8Str> &aValues) RT_OVERRIDE
    342360    {
     
    438456    HRESULT getMaxLeaseTime(ULONG *aMaxLeaseTime) RT_OVERRIDE           { return i_getMaxLeaseTime(aMaxLeaseTime); }
    439457    HRESULT setMaxLeaseTime(ULONG aMaxLeaseTime) RT_OVERRIDE            { return i_setMaxLeaseTime(aMaxLeaseTime); }
     458    HRESULT getForcedOptions(std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE       { return i_getForcedOptions(aOptions); }
     459    HRESULT setForcedOptions(const std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE { return i_setForcedOptions(aOptions); }
     460    HRESULT getSuppressedOptions(std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE   { return i_getSuppressedOptions(aOptions); }
     461    HRESULT setSuppressedOptions(const std::vector<DHCPOption_T> &aOptions) RT_OVERRIDE  { return i_setSuppressedOptions(aOptions); }
    440462    /** @} */
    441463
    442464    /** @name wrapped IDHCPConfig methods
    443465     * @{ */
    444     HRESULT setOption(DhcpOpt_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE
     466    HRESULT setOption(DHCPOption_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue) RT_OVERRIDE
    445467    {
    446468        return i_setOption(aOption, aEncoding, aValue);
    447469    }
    448470
    449     HRESULT removeOption(DhcpOpt_T aOption) RT_OVERRIDE
     471    HRESULT removeOption(DHCPOption_T aOption) RT_OVERRIDE
    450472    {
    451473        return i_removeOption(aOption);
     
    457479    }
    458480
    459     HRESULT getOption(DhcpOpt_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue) RT_OVERRIDE
     481    HRESULT getOption(DHCPOption_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue) RT_OVERRIDE
    460482    {
    461483        return i_getOption(aOption, aEncoding, aValue);
    462484    }
    463485
    464     HRESULT getAllOptions(std::vector<DhcpOpt_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
     486    HRESULT getAllOptions(std::vector<DHCPOption_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
    465487                          std::vector<com::Utf8Str> &aValues) RT_OVERRIDE
    466488    {
  • trunk/src/VBox/Main/include/DHCPServerImpl.h

    r79771 r79845  
    2929    struct DHCPServer;
    3030    struct DhcpOptValue;
    31     typedef std::map<DhcpOpt_T, DhcpOptValue> DhcpOptionMap;
     31    typedef std::map<DHCPOption_T, DhcpOptValue> DhcpOptionMap;
    3232}
    3333
     
    121121                                    ComObjPtr<DHCPIndividualConfig> &a_rPtrConfig);
    122122
    123     HRESULT i_encode60Option(com::Utf8Str &strEncoded, DhcpOpt_T enmOption,
     123    HRESULT i_encode60Option(com::Utf8Str &strEncoded, DHCPOption_T enmOption,
    124124                             DHCPOptionEncoding_T enmEncoding, const com::Utf8Str &strValue);
    125125    HRESULT i_getAllOptions60(DHCPConfig &aSourceConfig, std::vector<com::Utf8Str> &aValues);
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