Changeset 79618 in vbox
- Timestamp:
- Jul 9, 2019 12:51:37 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
doc/manual/en_US/man_VBoxManage-dhcpserver.xml (modified) (4 diffs)
-
src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/man_VBoxManage-dhcpserver.xml
r79611 r79618 39 39 <arg choice="plain">--interface=<replaceable>ifname</replaceable></arg> 40 40 </group> 41 <arg choice="req">-- ip=<replaceable>dhcpd-address</replaceable></arg>41 <arg choice="req">--server-ip=<replaceable>address</replaceable></arg> 42 42 <arg choice="req">--netmask=<replaceable>mask</replaceable></arg> 43 43 <arg choice="req">--lower-ip=<replaceable>address</replaceable></arg> … … 65 65 <arg choice="plain">--interface=<replaceable>ifname</replaceable></arg> 66 66 </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> 69 68 <arg choice="opt">--lower-ip=<replaceable>address</replaceable></arg> 70 69 <arg choice="opt">--upper-ip=<replaceable>address</replaceable></arg> 70 <arg choice="opt">--netmask=<replaceable>mask</replaceable></arg> 71 71 <group choice="opt"> 72 72 <arg choice="plain">--enable</arg> … … 159 159 <variablelist> 160 160 <varlistentry> 161 <term><option>-- ip=<replaceable>dhcpd-address</replaceable></option></term>161 <term><option>--server-ip=<replaceable>address</replaceable></option></term> 162 162 <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>167 163 </varlistentry> 168 164 <varlistentry> … … 170 166 <listitem><para>The IP address range for the DHCP server to manage. This 171 167 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 the168 in the same network as it. The boundraries are inclusive, so both the 173 169 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> 174 174 </varlistentry> 175 175 <varlistentry> -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
r79617 r79618 212 212 { 213 213 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 215 216 { "-ip", 'a', RTGETOPT_REQ_STRING }, // deprecated 216 217 { "--netmask", 'm', RTGETOPT_REQ_STRING }, 217 218 { "-netmask", 'm', RTGETOPT_REQ_STRING }, // deprecated 219 { "--lower-ip", 'l', RTGETOPT_REQ_STRING }, 218 220 { "--lowerip", 'l', RTGETOPT_REQ_STRING }, 219 221 { "-lowerip", 'l', RTGETOPT_REQ_STRING }, // deprecated 222 { "--upper-ip", 'u', RTGETOPT_REQ_STRING }, 220 223 { "--upperip", 'u', RTGETOPT_REQ_STRING }, 221 224 { "-upperip", 'u', RTGETOPT_REQ_STRING }, // deprecated … … 236 239 }; 237 240 238 const char *psz DhcpdIp= 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; 243 246 244 247 DhcpOpts GlobalDhcpOptions; … … 265 268 { 266 269 DHCPD_CMD_COMMON_OPTION_CASES(pCtx, vrc, &ValueUnion); 267 case 'a': // - ip268 psz DhcpdIp = ValueUnion.psz;270 case 'a': // --server-ip 271 pszServerIp = ValueUnion.psz; 269 272 break; 270 273 case 'm': // --netmask 271 274 pszNetmask = ValueUnion.psz; 272 275 break; 273 case 'l': // --lower ip276 case 'l': // --lower-ip 274 277 pszLowerIp = ValueUnion.psz; 275 278 break; 276 case 'u': // --upper ip279 case 'u': // --upper-ip 277 280 pszUpperIp = ValueUnion.psz; 278 281 break; … … 375 378 { 376 379 RTEXITCODE rcExit = RTEXITCODE_SUCCESS; 377 if (!psz DhcpdIp)380 if (!pszServerIp) 378 381 rcExit = errorSyntax("Missing required option: --ip"); 379 382 if (!pszNetmask) … … 430 433 HRESULT hrc; 431 434 RTEXITCODE rcExit = RTEXITCODE_SUCCESS; 432 if (psz DhcpdIp || pszNetmask || pszLowerIp || pszUpperIp)433 { 434 Bstr bstr DhcpdIp(pszDhcpdIp);435 if (pszServerIp || pszNetmask || pszLowerIp || pszUpperIp) 436 { 437 Bstr bstrServerIp(pszServerIp); 435 438 Bstr bstrNetmask(pszNetmask); 436 439 Bstr bstrLowerIp(pszLowerIp); 437 440 Bstr bstrUpperIp(pszUpperIp); 438 441 439 if (!psz DhcpdIp)440 { 441 CHECK_ERROR2_RET(hrc, svr, COMGETTER(IPAddress)(bstr DhcpdIp.asOutParam()), RTEXITCODE_FAILURE);442 if (!pszServerIp) 443 { 444 CHECK_ERROR2_RET(hrc, svr, COMGETTER(IPAddress)(bstrServerIp.asOutParam()), RTEXITCODE_FAILURE); 442 445 } 443 446 if (!pszNetmask) … … 447 450 if (!pszLowerIp) 448 451 { 449 CHECK_ERROR2_RET(hrc, svr, COMGETTER(LowerIP)(bstr Netmask.asOutParam()), RTEXITCODE_FAILURE);452 CHECK_ERROR2_RET(hrc, svr, COMGETTER(LowerIP)(bstrLowerIp.asOutParam()), RTEXITCODE_FAILURE); 450 453 } 451 454 if (!pszUpperIp) 452 455 { 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())); 458 462 } 459 463
Note:
See TracChangeset
for help on using the changeset viewer.

