VirtualBox

Changeset 79618 in vbox


Ignore:
Timestamp:
Jul 9, 2019 12:51:37 AM (5 years ago)
Author:
vboxsync
Message:

VBoxManage/dhcpserver, manpage: Adjustmens and fixes. bugref:9288

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/en_US/man_VBoxManage-dhcpserver.xml

    r79611 r79618  
    3939        <arg choice="plain">--interface=<replaceable>ifname</replaceable></arg>
    4040      </group>
    41       <arg choice="req">--ip=<replaceable>dhcpd-address</replaceable></arg>
     41      <arg choice="req">--server-ip=<replaceable>address</replaceable></arg>
    4242      <arg choice="req">--netmask=<replaceable>mask</replaceable></arg>
    4343      <arg choice="req">--lower-ip=<replaceable>address</replaceable></arg>
     
    6565        <arg choice="plain">--interface=<replaceable>ifname</replaceable></arg>
    6666      </group>
    67       <arg choice="opt">--ip=<replaceable>dhcpd-address</replaceable></arg>
    68       <arg choice="opt">--netmask=<replaceable>mask</replaceable></arg>
     67      <arg choice="opt">--server-ip=<replaceable>address</replaceable></arg>
    6968      <arg choice="opt">--lower-ip=<replaceable>address</replaceable></arg>
    7069      <arg choice="opt">--upper-ip=<replaceable>address</replaceable></arg>
     70      <arg choice="opt">--netmask=<replaceable>mask</replaceable></arg>
    7171      <group choice="opt">
    7272        <arg choice="plain">--enable</arg>
     
    159159      <variablelist>
    160160        <varlistentry>
    161           <term><option>--ip=<replaceable>dhcpd-address</replaceable></option></term>
     161          <term><option>--server-ip=<replaceable>address</replaceable></option></term>
    162162          <listitem><para>The IP address the DHCP server should use.</para></listitem>
    163         </varlistentry>
    164         <varlistentry>
    165           <term><option>--netmask=<replaceable>mask</replaceable></option></term>
    166           <listitem><para>The network mask.  Typically 255.255.255.0.</para></listitem>
    167163        </varlistentry>
    168164        <varlistentry>
     
    170166          <listitem><para>The IP address range for the DHCP server to manage.  This
    171167            should not include the address of the DHCP server itself, but it must be
    172             in the same network as it is.  The boundraries are inclusive, so both the
     168            in the same network as it.  The boundraries are inclusive, so both the
    173169            lower and upper addresses will be handed out to clients.</para></listitem>
     170        </varlistentry>
     171        <varlistentry>
     172          <term><option>--netmask=<replaceable>mask</replaceable></option></term>
     173          <listitem><para>The network mask.  Typically 255.255.255.0.</para></listitem>
    174174        </varlistentry>
    175175        <varlistentry>
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp

    r79617 r79618  
    212212    {
    213213        DHCPD_CMD_COMMON_OPTION_DEFS(),
    214         { "--ip",               'a', RTGETOPT_REQ_STRING  },
     214        { "--server-ip",        'a', RTGETOPT_REQ_STRING  },
     215        { "--ip",               'a', RTGETOPT_REQ_STRING  },    // deprecated
    215216        { "-ip",                'a', RTGETOPT_REQ_STRING  },    // deprecated
    216217        { "--netmask",          'm', RTGETOPT_REQ_STRING  },
    217218        { "-netmask",           'm', RTGETOPT_REQ_STRING  },    // deprecated
     219        { "--lower-ip",         'l', RTGETOPT_REQ_STRING  },
    218220        { "--lowerip",          'l', RTGETOPT_REQ_STRING  },
    219221        { "-lowerip",           'l', RTGETOPT_REQ_STRING  },    // deprecated
     222        { "--upper-ip",         'u', RTGETOPT_REQ_STRING  },
    220223        { "--upperip",          'u', RTGETOPT_REQ_STRING  },
    221224        { "-upperip",           'u', RTGETOPT_REQ_STRING  },    // deprecated
     
    236239    };
    237240
    238     const char       *pszDhcpdIp = NULL;
    239     const char       *pszNetmask = NULL;
    240     const char       *pszLowerIp = NULL;
    241     const char       *pszUpperIp = NULL;
    242     int               fEnabled   = -1;
     241    const char       *pszServerIp          = NULL;
     242    const char       *pszNetmask            = NULL;
     243    const char       *pszLowerIp            = NULL;
     244    const char       *pszUpperIp            = NULL;
     245    int               fEnabled              = -1;
    243246
    244247    DhcpOpts          GlobalDhcpOptions;
     
    265268        {
    266269            DHCPD_CMD_COMMON_OPTION_CASES(pCtx, vrc, &ValueUnion);
    267             case 'a':   // -ip
    268                 pszDhcpdIp = ValueUnion.psz;
     270            case 'a':   // --server-ip
     271                pszServerIp = ValueUnion.psz;
    269272                break;
    270273            case 'm':   // --netmask
    271274                pszNetmask = ValueUnion.psz;
    272275                break;
    273             case 'l':   // --lowerip
     276            case 'l':   // --lower-ip
    274277                pszLowerIp = ValueUnion.psz;
    275278                break;
    276             case 'u':   // --upperip
     279            case 'u':   // --upper-ip
    277280                pszUpperIp = ValueUnion.psz;
    278281                break;
     
    375378    {
    376379        RTEXITCODE rcExit = RTEXITCODE_SUCCESS;
    377         if (!pszDhcpdIp)
     380        if (!pszServerIp)
    378381            rcExit = errorSyntax("Missing required option: --ip");
    379382        if (!pszNetmask)
     
    430433    HRESULT hrc;
    431434    RTEXITCODE rcExit = RTEXITCODE_SUCCESS;
    432     if (pszDhcpdIp || pszNetmask || pszLowerIp || pszUpperIp)
    433     {
    434         Bstr bstrDhcpdIp(pszDhcpdIp);
     435    if (pszServerIp || pszNetmask || pszLowerIp || pszUpperIp)
     436    {
     437        Bstr bstrServerIp(pszServerIp);
    435438        Bstr bstrNetmask(pszNetmask);
    436439        Bstr bstrLowerIp(pszLowerIp);
    437440        Bstr bstrUpperIp(pszUpperIp);
    438441
    439         if (!pszDhcpdIp)
    440         {
    441             CHECK_ERROR2_RET(hrc, svr, COMGETTER(IPAddress)(bstrDhcpdIp.asOutParam()), RTEXITCODE_FAILURE);
     442        if (!pszServerIp)
     443        {
     444            CHECK_ERROR2_RET(hrc, svr, COMGETTER(IPAddress)(bstrServerIp.asOutParam()), RTEXITCODE_FAILURE);
    442445        }
    443446        if (!pszNetmask)
     
    447450        if (!pszLowerIp)
    448451        {
    449             CHECK_ERROR2_RET(hrc, svr, COMGETTER(LowerIP)(bstrNetmask.asOutParam()), RTEXITCODE_FAILURE);
     452            CHECK_ERROR2_RET(hrc, svr, COMGETTER(LowerIP)(bstrLowerIp.asOutParam()), RTEXITCODE_FAILURE);
    450453        }
    451454        if (!pszUpperIp)
    452455        {
    453             CHECK_ERROR2_RET(hrc, svr, COMGETTER(UpperIP)(bstrNetmask.asOutParam()), RTEXITCODE_FAILURE);
    454         }
    455 
    456         CHECK_ERROR2_STMT(hrc, svr, SetConfiguration(bstrDhcpdIp.raw(), bstrNetmask.raw(), bstrLowerIp.raw(), bstrUpperIp.raw()),
    457                           rcExit = errorArgument("Failed to set configuration"));
     456            CHECK_ERROR2_RET(hrc, svr, COMGETTER(UpperIP)(bstrUpperIp.asOutParam()), RTEXITCODE_FAILURE);
     457        }
     458
     459        CHECK_ERROR2_STMT(hrc, svr, SetConfiguration(bstrServerIp.raw(), bstrNetmask.raw(), bstrLowerIp.raw(), bstrUpperIp.raw()),
     460                          rcExit = errorArgument("Failed to set configuration (%ls, %ls, %ls, %ls)", bstrServerIp.raw(),
     461                                                 bstrNetmask.raw(), bstrLowerIp.raw(), bstrUpperIp.raw()));
    458462    }
    459463
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