VirtualBox

Changeset 54584 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Mar 2, 2015 4:45:57 PM (10 years ago)
Author:
vboxsync
Message:

DHCPServer: Define DHCP option encodings as an enum. The enum is not
currently used in the API itself as we only smugle hex-encoded options
through existing API to remain backward compatible, but it provides
authoritative C definitions that we can now use on both sides of the API.

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r54582 r54584  
    16501650  </enum>
    16511651
     1652  <enum
     1653      name="DhcpOptEncoding"
     1654      uuid="88ea6d70-8648-4871-ba30-1f49c61cfaa2">
     1655    <const name="Legacy" value="0"/>
     1656    <const name="Hex" value="1"/>
     1657  </enum>
     1658
    16521659  <interface
    16531660    name="IDHCPServer" extends="$unknown"
  • trunk/src/VBox/NetworkServices/DHCP/Config.cpp

    r54544 r54584  
    10521052
    10531053
    1054 /*
    1055  * XXX: Since encoding info is "smuggled" through the API and is not
    1056  * exposed properly we don't have a common definition we can use here.
    1057  *
    1058  * TODO: We can define the encodings enum in the IDL without breaking
    1059  * backward compatibility.  This will provide the authoritative
    1060  * definition.
    1061  */
    10621054static int fillDhcpOption(RawOption &opt, const std::string &OptText, int OptEncoding)
    10631055{
    10641056    int rc;
    10651057 
    1066     if (OptEncoding == /* HEX */ 1)
     1058    if (OptEncoding == DhcpOptEncoding_Hex)
    10671059    {
    10681060        if (OptText.empty())
     
    10911083        opt.cbRawOpt = (uint8_t)cbRawOpt;
    10921084    }
    1093     else if (OptEncoding == /* LEGACY */ 0)
     1085    else if (OptEncoding == DhcpOptEncoding_Legacy)
    10941086    {
    10951087        /*
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