VirtualBox

Changeset 79845 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 17, 2019 9:12:50 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132232
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
Files:
9 edited

Legend:

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

    r79778 r79845  
    113113} DHCPDCMDCTX;
    114114
    115 typedef std::pair<DhcpOpt_T, Utf8Str> DhcpOptSpec;
     115typedef std::pair<DHCPOption_T, Utf8Str> DhcpOptSpec;
    116116typedef std::vector<DhcpOptSpec> DhcpOpts;
    117117typedef DhcpOpts::iterator DhcpOptIterator;
    118118
    119 typedef std::vector<DhcpOpt_T> DhcpOptIds;
     119typedef std::vector<DHCPOption_T> DhcpOptIds;
    120120typedef DhcpOptIds::iterator DhcpOptIdIterator;
    121121
     
    511511                        if (ptrConfig.isNull())
    512512                            return RTEXITCODE_FAILURE;
    513                         CHECK_ERROR2I_STMT(ptrConfig, SetOption((DhcpOpt_T)idAddOpt, DHCPOptionEncoding_Normal,
     513                        CHECK_ERROR2I_STMT(ptrConfig, SetOption((DHCPOption_T)idAddOpt, DHCPOptionEncoding_Normal,
    514514                                                                Bstr(ValueUnion.psz).raw()), rcExit = RTEXITCODE_FAILURE);
    515515                    }
     
    534534                        if (ptrConfig.isNull())
    535535                            return RTEXITCODE_FAILURE;
    536                         CHECK_ERROR2I_STMT(ptrConfig, SetOption((DhcpOpt_T)idAddOpt, DHCPOptionEncoding_Hex,
     536                        CHECK_ERROR2I_STMT(ptrConfig, SetOption((DHCPOption_T)idAddOpt, DHCPOptionEncoding_Hex,
    537537                                                                Bstr(ValueUnion.psz).raw()), rcExit = RTEXITCODE_FAILURE);
    538538                    }
     
    548548                        if (ptrConfig.isNull())
    549549                            return RTEXITCODE_FAILURE;
    550                         CHECK_ERROR2I_STMT(ptrConfig, RemoveOption((DhcpOpt_T)ValueUnion.u8), rcExit = RTEXITCODE_FAILURE);
     550                        CHECK_ERROR2I_STMT(ptrConfig, RemoveOption((DHCPOption_T)ValueUnion.u8), rcExit = RTEXITCODE_FAILURE);
    551551                    }
    552552                    break;
     
    780780                        if (ptrConfig.isNull())
    781781                            return RTEXITCODE_FAILURE;
    782                         CHECK_ERROR2I_STMT(ptrConfig, SetOption((DhcpOpt_T)u8OptId, DHCPOptionEncoding_Normal,
     782                        CHECK_ERROR2I_STMT(ptrConfig, SetOption((DHCPOption_T)u8OptId, DHCPOptionEncoding_Normal,
    783783                                                                Bstr(ValueUnion.psz).raw()), rcExit = RTEXITCODE_FAILURE);
    784784                    }
     
    797797                        if (ptrConfig.isNull())
    798798                            return RTEXITCODE_FAILURE;
    799                         CHECK_ERROR2I_STMT(ptrConfig, RemoveOption((DhcpOpt_T)u8OptId), rcExit = RTEXITCODE_FAILURE);
     799                        CHECK_ERROR2I_STMT(ptrConfig, RemoveOption((DHCPOption_T)u8OptId), rcExit = RTEXITCODE_FAILURE);
    800800                    }
    801801                    fNeedValueOrRemove = false;
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r79826 r79845  
    17641764      name="DhcpOpt"
    17651765      uuid="40d99bd3-3ece-44d2-a07e-1085fe9c4f0b">
     1766    <desc>Deprecated enum, will be removed in 6.1.</desc>
    17661767    <const name="SubnetMask" value="1"/>
    17671768    <const name="TimeOffset" value="2"/>
     
    18301831
    18311832  <enum
     1833      name="DHCPOption"
     1834      uuid="00f5b10f-0021-4513-00f7-5bf4000982bf">
     1835    <!-- Names should exactly match those given in DhcpOptions.h. -->
     1836    <!-- Note! we use the descriptions here in the VBoxManage man page / manual. Everything must be propertly described. -->
     1837    <const name="SubnetMask"              value="1"><desc>IPv4 netmask. Set to <link to="IDHCPServer::networkMask"/> by default.</desc></const>
     1838    <const name="TimeOffset"              value="2"><desc>UTC offset in seconds (32-bit decimal value).</desc></const>
     1839    <const name="Routers"                 value="3"><desc>Space separated list of IPv4 router addresses.</desc></const>
     1840    <const name="TimeServers"             value="4"><desc>Space separated list of IPv4 time server (RFC 868) addresses.</desc></const>
     1841    <const name="NameServers"             value="5"><desc>Space separated list of IPv4 name server (IEN 116) addresses.</desc></const>
     1842    <const name="DomainNameServers"       value="6"><desc>Space separated list of IPv4 DNS addresses.</desc></const>
     1843    <const name="LogServers"              value="7"><desc>Space separated list of IPv4 log server addresses.</desc></const>
     1844    <const name="CookieServers"           value="8"><desc>Space separated list of IPv4 cookie server (RFC 865) addresses.</desc></const>
     1845    <const name="LPRServers"              value="9"><desc>Space separated list of IPv4 line printer server (RFC 1179) addresses.</desc></const>
     1846    <const name="ImpressServers"          value="10"><desc>Space separated list of IPv4 imagen impress server addresses.</desc></const>
     1847    <const name="ResourseLocationServers" value="11"><desc>Space separated list of IPv4 resource location (RFC 887) addresses.</desc></const>
     1848    <const name="HostName"                value="12"><desc>The client name. See RFC 1035 for character limits. </desc></const>
     1849    <const name="BootFileSize"            value="13"><desc>Number of 512 byte blocks making up the boot file (16-bit decimal value).</desc></const>
     1850    <const name="MeritDumpFile"           value="14"><desc>Client core file.</desc></const>
     1851    <const name="DomainName"              value="15"><desc>Domain name for the client.</desc></const>
     1852    <const name="SwapServer"              value="16"><desc>IPv4 address of the swap server that the client should use.</desc></const>
     1853    <const name="RootPath"                value="17"><desc>The path to the root disk the client should use.</desc></const>
     1854    <const name="ExtensionPath"           value="18"><desc>Path to a file containing additional DHCP options (RFC2123).</desc></const>
     1855    <const name="IPForwarding"            value="19"><desc>Whether IP forwarding should be enabled by the client (boolean).</desc></const>
     1856    <const name="OptNonLocalSourceRouting" value="20"><desc>Whether non-local datagrams should be forwarded by the client (boolean)</desc></const>
     1857    <const name="PolicyFilter"            value="21"><desc>List of IPv4 addresses and masks paris controlling non-local source routing.</desc></const>
     1858    <const name="MaxDgramReassemblySize"  value="22"><desc>The maximum datagram size the client should reassemble (16-bit decimal value).</desc></const>
     1859    <const name="DefaultIPTTL"            value="23"><desc>The default time-to-leave on outgoing (IP) datagrams (8-bit decimal value).</desc></const>
     1860    <const name="PathMTUAgingTimeout"     value="24"><desc>RFC1191 path MTU discovery timeout value in seconds (32-bit decimal value).</desc></const>
     1861    <const name="PathMTUPlateauTable"     value="25"><desc>RFC1191 path MTU discovery size table, sorted in ascending order (list of 16-bit decimal values).</desc></const>
     1862    <const name="InterfaceMTU"            value="26"><desc>The MTU size for the interface (16-bit decimal value).</desc></const>
     1863    <const name="AllSubnetsAreLocal"      value="27"><desc>Indicates whether the MTU size is the same for all subnets (boolean).</desc></const>
     1864    <const name="BroadcastAddress"        value="28"><desc>Broadcast address (RFC1122) for the client to use (IPv4 address).</desc></const>
     1865    <const name="PerformMaskDiscovery"    value="29"><desc>Whether to perform subnet mask discovery via ICMP (boolean).</desc></const>
     1866    <const name="MaskSupplier"            value="30"><desc>Whether to respond to subnet mask requests via ICMP (boolean).</desc></const>
     1867    <const name="PerformRouterDiscovery"  value="31"><desc>Whether to perform router discovery (RFC1256) (boolean).</desc></const>
     1868    <const name="RouterSolicitationAddress" value="32"><desc>Where to send router solicitation requests (RFC1256) (IPv4 address).</desc></const>
     1869    <const name="StaticRoute"             value="33"><desc>List of network and router address pairs addresses.</desc></const>
     1870    <const name="TrailerEncapsulation"    value="34"><desc>Whether to negotiate the use of trailers for ARP (RTF893) (boolean).</desc></const>
     1871    <const name="ARPCacheTimeout"         value="35"><desc>The timeout in seconds for ARP cache entries (32-bit decimal value).</desc></const>
     1872    <const name="EthernetEncapsulation"   value="36"><desc>Whether to use IEEE 802.3 (RTF1042) rather than of v2 (RFC894) ethernet encapsulation (boolean).</desc></const>
     1873    <const name="TCPDefaultTTL"           value="37"><desc>Default time-to-live for TCP sends (non-zero 8-bit decimal value).</desc></const>
     1874    <const name="TCPKeepaliveInterval"    value="38"><desc>The interface in seconds between TCP keepalive messages (32-bit decimal value).</desc></const>
     1875    <const name="TCPKeepaliveGarbage"     value="39"><desc>Whether to include a byte of garbage in TCP keepalive messages for backward compatibility (boolean).</desc></const>
     1876    <const name="NISDomain"               value="40"><desc>The NIS (Sun Network Information Services) domain name (string).</desc></const>
     1877    <const name="NISServers"              value="41"><desc>Space separated list of IPv4 NIS server addresses.</desc></const>
     1878    <const name="NTPServers"              value="42"><desc>Space separated list of IPv4 NTP (RFC1035) server addresses.</desc></const>
     1879    <const name="VendorSpecificInfo"      value="43"><desc>Vendor specific information. Only <link to="DHCPOptionEncoding_hex"/></desc></const>
     1880    <const name="NetBIOSNameServers"      value="44"><desc>Space separated list of IPv4 NetBIOS name server (NBNS) addresses ((RFC1001,RFC1002).</desc></const>
     1881    <const name="NetBIOSDatagramServers"  value="45"><desc>Space separated list of IPv4 NetBIOS datagram distribution server (NBDD) addresses (RFC1001,RFC1002).</desc></const>
     1882    <const name="NetBIOSNodeType"         value="46"><desc>NetBIOS node type (RFC1001,RFC1002): 1=B-node, 2=P-node, 4=M-node, and 8=H-node (8-bit decimal value).</desc></const>
     1883    <const name="NetBIOSScope"            value="47"><desc>NetBIOS scope (RFC1001,RFC1002). Only <link to="DHCPOptionEncoding_hex"/></desc></const>
     1884    <const name="XWindowsFontServers"     value="48"><desc>Space separated list of IPv4 X windows font server addresses.</desc></const>
     1885    <const name="XWindowsDisplayManager"  value="49"><desc>Space separated list of IPv4 X windows display manager addresses.</desc></const>
     1886    <!-- Options 50 thru 59 are considered DHCP internal and currently not settable. -->
     1887    <const name="NetWareIPDomainName"     value="62"><desc>Netware IP domain name (RFC2242) (string).</desc></const>
     1888    <const name="NetWareIPInformation"    value="63"><desc>Netware IP information (RFC2242). Only <link to="DHCPOptionEncoding_hex"/></desc></const>
     1889    <const name="NISPlusDomain"           value="64"><desc>The NIS+ domain name (string).</desc></const>
     1890    <const name="NISPlusServers"          value="65"><desc>Space separated list of IPv4 NIS+ server addresses.</desc></const>
     1891    <const name="TFTPServerName"          value="66"><desc>TFTP server name (string).</desc></const>
     1892    <const name="BootfileName"            value="67"><desc>Bootfile name (string).</desc></const>
     1893    <const name="MobileIPHomeAgents"      value="68"><desc>Space separated list of IPv4 mobile IP agent addresses.</desc></const>
     1894    <const name="SMTPServers"             value="69"><desc>Space separated list of IPv4 simple mail transport protocol (SMPT) server addresses.</desc></const>
     1895    <const name="POP3Servers"             value="70"><desc>Space separated list of IPv4 post office protocol 3 (POP3) server addresses.</desc></const>
     1896    <const name="NNTPServers"             value="71"><desc>Space separated list of IPv4 network news transport protocol (NTTP) server addresses.</desc></const>
     1897    <const name="WWWServers"              value="72"><desc>Space separated list of default IPv4 world wide web (WWW) server addresses.</desc></const>
     1898    <const name="FingerServers"           value="73"><desc>Space separated list of default IPv4 finger server addresses.</desc></const>
     1899    <const name="IRCServers"              value="74"><desc>Space separated list of default IPv4 internet relay chat (IRC) server  addresses.</desc></const>
     1900    <const name="StreetTalkServers"       value="75"><desc>Space separated list of IPv4 StreetTalk server addresses.</desc></const>
     1901    <const name="STDAServers"             value="76"><desc>Space separated list of IPv4 StreetTalk directory assistance (STDA) server addresses.</desc></const>
     1902    <!-- 77 is client only -->
     1903    <const name="SLPDirectoryAgent"       value="78"><desc>Addresses of one or more service location protocol (SLP) directory agent, and an indicator of whether their use is mandatory. Only <link to="DHCPOptionEncoding_hex"/>.</desc></const>
     1904    <const name="SLPServiceScope"         value="79"><desc>List of service scopes for the service location protocol (SLP) and whether using the list is mandator. Only <link to="DHCPOptionEncoding_hex"/>.</desc></const>
     1905    <!-- 80 is client only -->
     1906    <const name="DomainSearch"            value="119"><desc>Domain search list, see RFC3397 and section 4.1.4 in RFC1035 for encoding.  Only <link to="DHCPOptionEncoding_hex"/>.</desc></const>
     1907  </enum>
     1908
     1909  <enum
    18321910      name="DHCPOptionEncoding"
    18331911      uuid="84b6d460-2838-4682-c0d6-ef5b573ef28a">
     
    21402218  <interface
    21412219    name="IDHCPConfig" extends="$unknown"
    2142     uuid="39cdde66-cfc3-4eec-7427-faf5b16469ae"
     2220    uuid="00f4a8dc-0002-4b81-0077-1dcb004571ba"
    21432221    wsmap="managed"
    21442222    reservedMethods="8" reservedAttributes="16"
     
    21662244    </attribute>
    21672245
     2246    <attribute name="forcedOptions" type="DHCPOption" safearray="yes" readonly="no">
     2247      <desc>List of DHCP options which should be forced upon the clients in this
     2248       config scope when they are available, whether the clients asks for them
     2249       or not.</desc>
     2250    </attribute>
     2251
     2252    <attribute name="suppressedOptions" type="DHCPOption" safearray="yes" readonly="no">
     2253      <desc>List of DHCP options which should not be sent to the clients in
     2254        this config scope.  This is intended for cases where one client or a
     2255        group of clients shouldn't see one or more (typically global) options.</desc>
     2256    </attribute>
     2257
    21682258    <method name="setOption">
    21692259      <desc>
    21702260        Sets a DHCP option.
    21712261      </desc>
    2172       <param name="option"    dir="in" type="DhcpOpt">
     2262      <param name="option"    dir="in" type="DHCPOption">
    21732263        <desc>The DHCP option.</desc>
    21742264      </param>
     
    21782268      <param name="value"     dir="in" type="wstring">
    21792269        <desc>The DHCP option value.  The exact format depends on the DHCP
    2180           option and should be documented in <link to="DhcpOpt"/>.
    2181         </desc>
     2270          @a option value and @a encoding, see see <link to="DHCPOption"/>
     2271          for the <link to="DHCPOptionEncoding::Normal"/> format.
     2272         </desc>
    21822273      </param>
    21832274    </method>
     
    21852276    <method name="removeOption">
    21862277      <desc>Removes the given DHCP option.</desc>
    2187       <param name="option"    dir="in" type="DhcpOpt"/>
     2278      <param name="option"    dir="in" type="DHCPOption"/>
    21882279    </method>
    21892280
     
    22002291    <method name="getOption">
    22012292      <desc>Gets the value of a single DHCP option.</desc>
    2202       <param name="option"    dir="in" type="DhcpOpt">
     2293      <param name="option"    dir="in" type="DHCPOption">
    22032294        <desc>The DHCP option being sought.</desc>
    22042295      </param>
     
    22072298      </param>
    22082299      <param name="value"     dir="return" type="wstring">
    2209         <desc>The value of the requested DHCP option.</desc>
     2300        <desc>The value of the requested DHCP option. The exact format depends on
     2301          the DHCP @a option value and the @a encoding, see <link to="DHCPOption"/>
     2302          for the <link to="DHCPOptionEncoding::Normal"/> format.
     2303        </desc>
    22102304      </param>
    22112305    </method>
     
    22132307    <method name="getAllOptions">
    22142308      <desc>Gets all DHCP options and their values</desc>
    2215       <param name="options"   dir="out" type="DhcpOpt" safearray="yes">
     2309      <param name="options"   dir="out" type="DHCPOption" safearray="yes">
    22162310        <desc>Array containing the DHCP option numbers.</desc>
    22172311      </param>
     
    22202314      </param>
    22212315      <param name="values"    dir="return" type="wstring" safearray="yes">
    2222         <desc>Array of values that runs parallel to @a options and @a encodings.</desc>
     2316        <desc>Array of values that runs parallel to @a options and @a encodings.  The
     2317          format depends on both of those.
     2318        </desc>
    22232319      </param>
    22242320    </method>
  • 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);
  • trunk/src/VBox/Main/src-server/DHCPConfigImpl.cpp

    r79822 r79845  
    6363    m_secMaxLeaseTime     = rConfig.secMaxLeaseTime;
    6464
     65    /*
     66     * The two option list:
     67     */
     68    struct
     69    {
     70        const char                *psz;
     71        std::vector<DHCPOption_T> *pDst;
     72    } aStr2Vec[] =
     73    {
     74        { rConfig.strForcedOptions.c_str(),     &m_vecForcedOptions },
     75        { rConfig.strSuppressedOptions.c_str(), &m_vecSuppressedOptions },
     76    };
     77    for (size_t i = 0; i < RT_ELEMENTS(aStr2Vec); i++)
     78    {
     79        Assert(aStr2Vec[i].pDst->size() == 0);
     80        const char *psz = RTStrStripL(aStr2Vec[i].psz);
     81        while (*psz != '\0')
     82        {
     83            uint8_t  bOpt;
     84            char    *pszNext;
     85            int vrc = RTStrToUInt8Ex(psz, &pszNext, 10, &bOpt);
     86            if (vrc == VINF_SUCCESS || vrc == VWRN_TRAILING_SPACES)
     87            {
     88                try
     89                {
     90                    aStr2Vec[i].pDst->push_back((DHCPOption_T)bOpt);
     91                }
     92                catch (std::bad_alloc &)
     93                {
     94                    return E_OUTOFMEMORY;
     95                }
     96            }
     97            else
     98            {
     99                LogRelFunc(("Trouble at offset %#zu converting '%s' to a DHCPOption_T vector (vrc=%Rrc)!  Ignornig the remainder.\n",
     100                            psz - aStr2Vec[i].psz, aStr2Vec[i].psz, vrc));
     101                break;
     102            }
     103            psz = RTStrStripL(pszNext);
     104        }
     105    }
     106
     107    /*
     108     * The option map:
     109     */
    65110    for (settings::DhcpOptionMap::const_iterator it = rConfig.mapOptions.begin(); it != rConfig.mapOptions.end(); ++it)
    66111    {
     
    86131    a_rDst.secMaxLeaseTime     = m_secMaxLeaseTime;
    87132
     133    /* Forced and suppressed vectors: */
     134    try
     135    {
     136        a_rDst.strForcedOptions.setNull();
     137        for (size_t i = 0; i < m_vecForcedOptions.size(); i++)
     138            a_rDst.strForcedOptions.appendPrintf(i ? " %d" : "%d", m_vecForcedOptions[i]);
     139
     140        a_rDst.strSuppressedOptions.setNull();
     141        for (size_t i = 0; i < m_vecSuppressedOptions.size(); i++)
     142            a_rDst.strSuppressedOptions.appendPrintf(i ? " %d" : "%d", m_vecSuppressedOptions[i]);
     143    }
     144    catch (std::bad_alloc &)
     145    {
     146        return E_OUTOFMEMORY;
     147    }
     148
     149
    88150    /* Options: */
    89151    try
     
    161223
    162224
    163 HRESULT DHCPConfig::i_setOption(DhcpOpt_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue)
     225HRESULT DHCPConfig::i_getForcedOptions(std::vector<DHCPOption_T> &aOptions)
     226{
     227    AutoReadLock alock(m_pHack COMMA_LOCKVAL_SRC_POS);
     228    try
     229    {
     230        aOptions = m_vecForcedOptions;
     231    }
     232    catch (std::bad_alloc &)
     233    {
     234        return E_OUTOFMEMORY;
     235    }
     236    return S_OK;
     237}
     238
     239
     240HRESULT DHCPConfig::i_setForcedOptions(const std::vector<DHCPOption_T> &aOptions)
     241{
     242    /*
     243     * Validate the options.
     244     */
     245    try
     246    {
     247        std::map<DHCPOption_T, bool> mapDuplicates;
     248        for (size_t i = 0; i < aOptions.size(); i++)
     249        {
     250            DHCPOption_T enmOpt = aOptions[i];
     251            if ((int)enmOpt > 0 && (int)enmOpt < 255)
     252            {
     253                if (mapDuplicates.find(enmOpt) == mapDuplicates.end())
     254                    mapDuplicates[enmOpt] = true;
     255                else
     256                    return m_pHack->setError(E_INVALIDARG, m_pHack->tr("Duplicate option value: %d"), (int)enmOpt);
     257            }
     258            else
     259                return m_pHack->setError(E_INVALIDARG, m_pHack->tr("Invalid option value: %d"), (int)enmOpt);
     260        }
     261    }
     262    catch (std::bad_alloc &)
     263    {
     264        return E_OUTOFMEMORY;
     265    }
     266
     267    /*
     268     * Do the updating.
     269     */
     270    {
     271        AutoWriteLock alock(m_pHack COMMA_LOCKVAL_SRC_POS);
     272
     273        /* Actually changed? */
     274        if (m_vecForcedOptions.size() == aOptions.size())
     275        {
     276            ssize_t i = m_vecForcedOptions.size();
     277            while (i-- > 0)
     278                if (m_vecForcedOptions[i] != aOptions[i])
     279                    break;
     280            if (i < 0)
     281                return S_OK;
     282        }
     283
     284        /* Copy over the changes: */
     285        try
     286        {
     287            m_vecForcedOptions = aOptions;
     288        }
     289        catch (std::bad_alloc &)
     290        {
     291            return E_OUTOFMEMORY;
     292        }
     293    }
     294
     295    return i_doWriteConfig();
     296}
     297
     298
     299HRESULT DHCPConfig::i_getSuppressedOptions(std::vector<DHCPOption_T> &aOptions)
     300{
     301    AutoReadLock alock(m_pHack COMMA_LOCKVAL_SRC_POS);
     302    try
     303    {
     304        aOptions = m_vecSuppressedOptions;
     305    }
     306    catch (std::bad_alloc &)
     307    {
     308        return E_OUTOFMEMORY;
     309    }
     310    return S_OK;
     311}
     312
     313
     314HRESULT DHCPConfig::i_setSuppressedOptions(const std::vector<DHCPOption_T> &aOptions)
     315{
     316    /*
     317     * Validate and normalize it.
     318     */
     319    std::map<DHCPOption_T, bool> mapNormalized;
     320    try
     321    {
     322        for (size_t i = 0; i < aOptions.size(); i++)
     323        {
     324            DHCPOption_T enmOpt = aOptions[i];
     325            if ((int)enmOpt > 0 && (int)enmOpt < 255)
     326                mapNormalized[enmOpt] = true;
     327            else
     328                return m_pHack->setError(E_INVALIDARG, m_pHack->tr("Invalid option value: %d"), (int)enmOpt);
     329        }
     330    }
     331    catch (std::bad_alloc &)
     332    {
     333        return E_OUTOFMEMORY;
     334    }
     335
     336    /*
     337     * Do the updating.
     338     */
     339    {
     340        AutoWriteLock alock(m_pHack COMMA_LOCKVAL_SRC_POS);
     341
     342        /* Actually changed? */
     343        if (m_vecSuppressedOptions.size() == mapNormalized.size())
     344        {
     345            size_t i = 0;
     346            for (std::map<DHCPOption_T, bool>::const_iterator itMap = mapNormalized.begin();; ++itMap, i++)
     347            {
     348                if (itMap == mapNormalized.end())
     349                    return S_OK; /* no change */
     350                if (itMap->first != m_vecSuppressedOptions[i])
     351                    break;
     352            }
     353        }
     354
     355        /* Copy over the changes: */
     356        try
     357        {
     358            m_vecSuppressedOptions.resize(mapNormalized.size());
     359            size_t i = 0;
     360            for (std::map<DHCPOption_T, bool>::const_iterator itMap = mapNormalized.begin();
     361                 itMap != mapNormalized.end(); ++itMap, i++)
     362                m_vecSuppressedOptions[i] = itMap->first;
     363        }
     364        catch (std::bad_alloc &)
     365        {
     366            return E_OUTOFMEMORY;
     367        }
     368    }
     369
     370    return i_doWriteConfig();
     371}
     372
     373
     374HRESULT DHCPConfig::i_setOption(DHCPOption_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue)
    164375{
    165376    /*
     
    211422
    212423
    213 HRESULT DHCPConfig::i_removeOption(DhcpOpt_T aOption)
     424HRESULT DHCPConfig::i_removeOption(DHCPOption_T aOption)
    214425{
    215426    {
     
    235446
    236447
    237 HRESULT DHCPConfig::i_getOption(DhcpOpt_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue)
     448HRESULT DHCPConfig::i_getOption(DHCPOption_T aOption, DHCPOptionEncoding_T *aEncoding, com::Utf8Str &aValue)
    238449{
    239450    AutoReadLock alock(m_pHack COMMA_LOCKVAL_SRC_POS);
     
    248459
    249460
    250 HRESULT DHCPConfig::i_getAllOptions(std::vector<DhcpOpt_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
     461HRESULT DHCPConfig::i_getAllOptions(std::vector<DHCPOption_T> &aOptions, std::vector<DHCPOptionEncoding_T> &aEncodings,
    251462                                    std::vector<com::Utf8Str> &aValues)
    252463{
     
    338549    HRESULT hrc = DHCPConfig::i_initWithDefaults(a_pVirtualBox, a_pParent);
    339550    if (SUCCEEDED(hrc))
    340         hrc = i_setOption(DhcpOpt_SubnetMask, DHCPOptionEncoding_Normal, "0.0.0.0");
     551        hrc = i_setOption(DHCPOption_SubnetMask, DHCPOptionEncoding_Normal, "0.0.0.0");
    341552
    342553    if (SUCCEEDED(hrc))
     
    386597{
    387598    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    388     settings::DhcpOptionMap::const_iterator it = m_OptionMap.find(DhcpOpt_SubnetMask);
     599    settings::DhcpOptionMap::const_iterator it = m_OptionMap.find(DHCPOption_SubnetMask);
    389600    if (it != m_OptionMap.end())
    390601    {
     
    412623        return setErrorBoth(E_INVALIDARG, vrc, tr("Invalid IPv4 netmask '%s': %Rrc"), a_rSrc.c_str(), vrc);
    413624
    414     return i_setOption(DhcpOpt_SubnetMask, DHCPOptionEncoding_Normal, a_rSrc);
     625    return i_setOption(DHCPOption_SubnetMask, DHCPOptionEncoding_Normal, a_rSrc);
    415626}
    416627
     
    419630 * Overriden to ensure the sanity of the DhcpOpt_SubnetMask option.
    420631 */
    421 HRESULT DHCPGlobalConfig::i_setOption(DhcpOpt_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue)
     632HRESULT DHCPGlobalConfig::i_setOption(DHCPOption_T aOption, DHCPOptionEncoding_T aEncoding, const com::Utf8Str &aValue)
    422633{
    423634    if (aOption != DhcpOpt_SubnetMask || aEncoding == DHCPOptionEncoding_Normal)
     
    430641 * Overriden to ensure the sanity of the DhcpOpt_SubnetMask option.
    431642 */
    432 HRESULT DHCPGlobalConfig::i_removeOption(DhcpOpt_T aOption)
     643HRESULT DHCPGlobalConfig::i_removeOption(DHCPOption_T aOption)
    433644{
    434645    if (aOption != DhcpOpt_SubnetMask)
     
    445656    {
    446657        AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    447         settings::DhcpOptionMap::iterator it = m_OptionMap.find(DhcpOpt_SubnetMask);
     658        settings::DhcpOptionMap::iterator it = m_OptionMap.find(DHCPOption_SubnetMask);
    448659        m_OptionMap.erase(m_OptionMap.begin(), it);
    449660        if (it != m_OptionMap.end())
  • trunk/src/VBox/Main/src-server/DHCPServerImpl.cpp

    r79823 r79845  
    580580 * value.
    581581 */
    582 HRESULT DHCPServer::i_encode60Option(com::Utf8Str &strEncoded, DhcpOpt_T enmOption,
     582HRESULT DHCPServer::i_encode60Option(com::Utf8Str &strEncoded, DHCPOption_T enmOption,
    583583                                     DHCPOptionEncoding_T enmEncoding, const com::Utf8Str &strValue)
    584584{
     
    634634{
    635635    /* Get the values using the new getter: */
    636     std::vector<DhcpOpt_T>              Options;
     636    std::vector<DHCPOption_T>           Options;
    637637    std::vector<DHCPOptionEncoding_T>   Encodings;
    638638    std::vector<com::Utf8Str>           Values;
     
    658658{
    659659    if (aOption != 0)
    660         return aTargetConfig.i_setOption(aOption, DHCPOptionEncoding_Normal, aValue);
     660        return aTargetConfig.i_setOption((DHCPOption_T)aOption, DHCPOptionEncoding_Normal, aValue);
    661661
    662662    /*
     
    703703    }
    704704
    705     return aTargetConfig.i_setOption(aOption, enmEncoding, com::Utf8Str(pszNext + 1));
     705    return aTargetConfig.i_setOption((DHCPOption_T)aOption, enmEncoding, com::Utf8Str(pszNext + 1));
    706706}
    707707
     
    715715HRESULT DHCPServer::removeGlobalOption(DhcpOpt_T aOption)
    716716{
    717     return m->globalConfig->i_removeOption(aOption);
     717    return m->globalConfig->i_removeOption((DHCPOption_T)aOption);
    718718}
    719719
     
    885885    HRESULT hrc = i_vmNameAndSlotToConfig(aVmName, aSlot, false, ptrConfig);
    886886    if (SUCCEEDED(hrc))
    887         hrc = ptrConfig->i_removeOption(aOption);
     887        hrc = ptrConfig->i_removeOption((DHCPOption_T)aOption);
    888888    return hrc;
    889889}
  • trunk/src/VBox/Main/xml/Settings.cpp

    r79778 r79845  
    17381738        pElmThis->setAttribute("networkName", srv.strNetworkName);
    17391739        pElmThis->setAttribute("IPAddress", srv.strIPAddress);
    1740         DhcpOptConstIterator itOpt = srv.globalConfig.mapOptions.find(DhcpOpt_SubnetMask);
     1740        DhcpOptConstIterator itOpt = srv.globalConfig.mapOptions.find(DHCPOption_SubnetMask);
    17411741        if (itOpt != srv.globalConfig.mapOptions.end())
    17421742            pElmThis->setAttribute("networkMask", itOpt->second.strValue);
     
    18021802    if (rConfig.secMaxLeaseTime > 0)
    18031803        elmOptions.setAttribute("secMaxLeaseTime", rConfig.secMaxLeaseTime);
     1804    if (rConfig.strForcedOptions.isNotEmpty())
     1805        elmOptions.setAttribute("forcedOptions", rConfig.strForcedOptions);
     1806    if (rConfig.strSuppressedOptions.isNotEmpty())
     1807        elmOptions.setAttribute("suppressedOptions", rConfig.strSuppressedOptions);
    18041808
    18051809    /* The DHCP options are <Option> child elements: */
    18061810    for (DhcpOptConstIterator it = rConfig.mapOptions.begin(); it != rConfig.mapOptions.end(); ++it)
    1807         if (it->first != DhcpOpt_SubnetMask || !fSkipSubnetMask)
     1811        if (it->first != DHCPOption_SubnetMask || !fSkipSubnetMask)
    18081812        {
    18091813            xml::ElementNode *pElmOption = elmOptions.createChild("Option");
     
    18301834            if (   pelmServer->getAttributeValue("networkName", srv.strNetworkName)
    18311835                && pelmServer->getAttributeValue("IPAddress", srv.strIPAddress)
    1832                 && pelmServer->getAttributeValue("networkMask", srv.globalConfig.mapOptions[DhcpOpt_SubnetMask].strValue)
     1836                && pelmServer->getAttributeValue("networkMask", srv.globalConfig.mapOptions[DHCPOption_SubnetMask].strValue)
    18331837                && pelmServer->getAttributeValue("lowerIP", srv.strIPLower)
    18341838                && pelmServer->getAttributeValue("upperIP", srv.strIPUpper)
     
    19271931    if (!elmConfig.getAttributeValue("secMaxLeaseTime", rConfig.secMaxLeaseTime))
    19281932        rConfig.secMaxLeaseTime = 0;
     1933    if (!elmConfig.getAttributeValue("forcedOptions", rConfig.strForcedOptions))
     1934        rConfig.strSuppressedOptions.setNull();
     1935    if (!elmConfig.getAttributeValue("suppressedOptions", rConfig.strSuppressedOptions))
     1936        rConfig.strSuppressedOptions.setNull();
    19291937
    19301938    /* The DHCP options are <Option> child elements: */
     
    19361944        if (!pElmOption->getAttributeValue("name", iOptName))
    19371945            continue;
    1938         DhcpOpt_T OptName = (DhcpOpt_T)iOptName;
    1939         if (OptName == DhcpOpt_SubnetMask && fIgnoreSubnetMask)
     1946        DHCPOption_T OptName = (DHCPOption_T)iOptName;
     1947        if (OptName == DHCPOption_SubnetMask && fIgnoreSubnetMask)
    19401948            continue;
    19411949
     
    22582266#endif
    22592267        srv.strIPAddress = "192.168.56.100";
    2260         srv.globalConfig.mapOptions[DhcpOpt_SubnetMask] = DhcpOptValue("255.255.255.0");
     2268        srv.globalConfig.mapOptions[DHCPOption_SubnetMask] = DhcpOptValue("255.255.255.0");
    22612269        srv.strIPLower = "192.168.56.101";
    22622270        srv.strIPUpper = "192.168.56.254";
  • trunk/src/VBox/NetworkServices/Dhcpd/DhcpOptions.cpp

    r79778 r79845  
    321321                HANDLE(OptNonLocalSourceRouting);       // 20
    322322                HANDLE(OptPolicyFilter);                // 21
    323                 HANDLE(OptMaxDatagramReassemblySize);   // 22
     323                HANDLE(OptMaxDgramReassemblySize);      // 22
    324324                HANDLE(OptDefaultIPTTL);                // 23
    325                 HANDLE(OptDefaultPathMTUAgingTimeout);  // 24
     325                HANDLE(OptPathMTUAgingTimeout);         // 24
    326326                HANDLE(OptPathMTUPlateauTable);         // 25
    327327                HANDLE(OptInterfaceMTU);                // 26
     
    342342                HANDLE(OptNISServers);                  // 41
    343343                HANDLE(OptNTPServers);                  // 42
    344                 HANDLE(OptVendorSpecificInfo);          // 43
     344                //HANDLE(OptVendorSpecificInfo);          // 43 - Only DHCPOptionEncoding_hex
    345345                HANDLE(OptNetBIOSNameServers);          // 44
    346346                HANDLE(OptNetBIOSDatagramServers);      // 45
    347347                HANDLE(OptNetBIOSNodeType);             // 46
    348                 HANDLE(OptNetBIOSScope);                // 47
     348                //HANDLE(OptNetBIOSScope);                // 47 - Only DHCPOptionEncoding_hex
    349349                HANDLE(OptXWindowsFontServers);         // 48
    350350                HANDLE(OptXWindowsDisplayManager);      // 49
     
    364364#endif
    365365                HANDLE(OptNetWareIPDomainName);         // 62
    366                 HANDLE(OptNetWareIPInformation);        // 63
     366                //HANDLE(OptNetWareIPInformation);        // 63 - Only DHCPOptionEncoding_hex
    367367                HANDLE(OptNISPlusDomain);               // 64
    368368                HANDLE(OptNISPlusServers);              // 65
    369                 HANDLE(OptTFTPServer);                  // 66 - perhaps we should use an alternative way to configure these.
    370                 HANDLE(OptBootFileName);                // 67 - perhaps we should use an alternative way to configure these.
     369                HANDLE(OptTFTPServerName);              // 66 - perhaps we should use an alternative way to configure these.
     370                HANDLE(OptBootfileName);                // 67 - perhaps we should use an alternative way to configure these.
    371371                HANDLE(OptMobileIPHomeAgents);          // 68
    372372                HANDLE(OptSMTPServers);                 // 69
     
    379379                HANDLE(OptSTDAServers);                 // 76
    380380                // OptUserClassId (77) is client only and not configurable.
    381                 HANDLE(OptSLPDirectoryAgent);           // 78
    382                 HANDLE(OptSLPServiceScope);             // 79
     381                //HANDLE(OptSLPDirectoryAgent);           // 78 - Only DHCPOptionEncoding_hex
     382                //HANDLE(OptSLPServiceScope);             // 79 - Only DHCPOptionEncoding_hex
    383383                // OptRapidCommit (80) is not configurable.
     384
     385                //HANDLE(OptDomainSearch);                // 119 - Only DHCPOptionEncoding_hex
    384386
    385387#undef HANDLE
  • trunk/src/VBox/NetworkServices/Dhcpd/DhcpOptions.h

    r79763 r79845  
    756756typedef OptValue<20, bool>              OptNonLocalSourceRouting;
    757757typedef OptList<21, DhcpIpv4AddrAndMask> OptPolicyFilter;
    758 typedef OptValue<22, uint16_t>          OptMaxDatagramReassemblySize;
     758typedef OptValue<22, uint16_t>          OptMaxDgramReassemblySize;
    759759typedef OptValue<23, uint16_t>          OptDefaultIPTTL;
    760 typedef OptValue<24, uint32_t>          OptDefaultPathMTUAgingTimeout;
     760typedef OptValue<24, uint32_t>          OptPathMTUAgingTimeout;
    761761typedef OptList<25, uint16_t>           OptPathMTUPlateauTable;
    762762typedef OptValue<26, uint16_t>          OptInterfaceMTU;
     
    801801typedef OptString<64>                   OptNISPlusDomain;
    802802typedef OptString<65>                   OptNISPlusServers;
    803 typedef OptString<66>                   OptTFTPServer;              /**< when overloaded */
    804 typedef OptString<67>                   OptBootFileName;            /**< when overloaded */
     803typedef OptString<66>                   OptTFTPServerName;          /**< when overloaded */
     804typedef OptString<67>                   OptBootfileName;            /**< when overloaded */
    805805typedef OptList<68, RTNETADDRIPV4>      OptMobileIPHomeAgents;
    806806typedef OptList<69, RTNETADDRIPV4>      OptSMTPServers;
     
    816816typedef OptList<79, uint8_t>            OptSLPServiceScope;         /**< complicated, so just byte list for now. RFC2610 */
    817817typedef OptNoValue<80>                  OptRapidCommit;             /**< RFC4039 */
     818typedef OptList<119, uint8_t>           OptDomainSearch;            /**< RFC3397 */
    818819/** @} */
    819820
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette