Changeset 79867 in vbox
- Timestamp:
- Jul 18, 2019 8:33:32 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132265
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/man_VBoxManage-dhcpserver.xml
r79853 r79867 52 52 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 53 53 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 54 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 55 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 54 56 <arg choice="opt">--min-lease-time=<replaceable>seconds</replaceable></arg> 55 57 <arg choice="opt">--default-lease-time=<replaceable>seconds</replaceable></arg> … … 61 63 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 62 64 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 65 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 66 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 63 67 <arg choice="opt" rep="repeat">--incl-mac=<replaceable>address</replaceable></arg> 64 68 <arg choice="opt" rep="repeat">--excl-mac=<replaceable>address</replaceable></arg> … … 83 87 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 84 88 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 89 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 90 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 85 91 <arg choice="opt">--min-lease-time=<replaceable>seconds</replaceable></arg> 86 92 <arg choice="opt">--default-lease-time=<replaceable>seconds</replaceable></arg> … … 93 99 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 94 100 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 101 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 102 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 95 103 <arg choice="opt">--min-lease-time=<replaceable>seconds</replaceable></arg> 96 104 <arg choice="opt">--default-lease-time=<replaceable>seconds</replaceable></arg> … … 115 123 <sbr/> 116 124 <arg choice="opt" rep="repeat"> 125 <arg choice="opt">--global</arg> 126 <arg choice="opt" rep="repeat">--del-opt=<replaceable>dhcp-opt-no</replaceable></arg> 127 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 128 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 129 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 130 <arg choice="opt" rep="repeat">--unforce-opt=<replaceable>dhcp-opt-no</replaceable></arg> 131 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 132 <arg choice="opt" rep="repeat">--unsupress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 133 <arg choice="opt">--min-lease-time=<replaceable>seconds</replaceable></arg> 134 <arg choice="opt">--default-lease-time=<replaceable>seconds</replaceable></arg> 135 <arg choice="opt">--max-lease-time=<replaceable>seconds</replaceable></arg> 136 <arg choice="opt">--remove-config</arg> 137 </arg> 138 <sbr/> 139 <arg choice="opt" rep="repeat"> 117 140 <arg choice="req">--group=<replaceable>name</replaceable></arg> 118 141 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 119 142 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 143 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 144 <arg choice="opt" rep="repeat">--unforce-opt=<replaceable>dhcp-opt-no</replaceable></arg> 145 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 146 <arg choice="opt" rep="repeat">--unsupress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 120 147 <arg choice="opt" rep="repeat">--del-mac=<replaceable>address</replaceable></arg> 121 148 <arg choice="opt" rep="repeat">--incl-mac=<replaceable>address</replaceable></arg> … … 144 171 <sbr/> 145 172 <arg choice="opt" rep="repeat"> 146 <arg choice="opt">--global</arg>147 <arg choice="opt" rep="repeat">--del-opt=<replaceable>dhcp-opt-no</replaceable></arg>148 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg>149 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg>150 <arg choice="opt">--min-lease-time=<replaceable>seconds</replaceable></arg>151 <arg choice="opt">--default-lease-time=<replaceable>seconds</replaceable></arg>152 <arg choice="opt">--max-lease-time=<replaceable>seconds</replaceable></arg>153 <arg choice="opt">--remove-config</arg>154 </arg>155 <sbr/>156 <arg choice="opt" rep="repeat">157 173 <arg choice="req">--vm=<replaceable>name|uuid</replaceable></arg> 158 174 <arg choice="opt">--nic=<replaceable>1-N</replaceable></arg> … … 160 176 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 161 177 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 178 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 179 <arg choice="opt" rep="repeat">--unforce-opt=<replaceable>dhcp-opt-no</replaceable></arg> 180 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 181 <arg choice="opt" rep="repeat">--unsupress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 162 182 <arg choice="opt">--min-lease-time=<replaceable>seconds</replaceable></arg> 163 183 <arg choice="opt">--default-lease-time=<replaceable>seconds</replaceable></arg> … … 172 192 <arg choice="opt" rep="repeat">--set-opt=<replaceable>dhcp-opt-no value</replaceable></arg> 173 193 <arg choice="opt" rep="repeat">--set-opt-hex=<replaceable>dhcp-opt-no hexstring</replaceable></arg> 194 <arg choice="opt" rep="repeat">--force-opt=<replaceable>dhcp-opt-no</replaceable></arg> 195 <arg choice="opt" rep="repeat">--unforce-opt=<replaceable>dhcp-opt-no</replaceable></arg> 196 <arg choice="opt" rep="repeat">--supress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 197 <arg choice="opt" rep="repeat">--unsupress-opt=<replaceable>dhcp-opt-no</replaceable></arg> 174 198 <arg choice="opt">--min-lease-time=<replaceable>seconds</replaceable></arg> 175 199 <arg choice="opt">--default-lease-time=<replaceable>seconds</replaceable></arg> … … 324 348 </varlistentry> 325 349 <varlistentry> 350 <term><option>--force-opt=<replaceable>dhcp-opt-no</replaceable></option></term> 351 <listitem><para>Forces the specified DHCP option number (0-255) onto to be 352 sent to the client whether it requested it or not (provided the option is 353 configured with a value at some level). 354 </para></listitem> 355 </varlistentry> 356 <varlistentry> 357 <term><option>--suppress-opt=<replaceable>dhcp-opt-no</replaceable></option></term> 358 <listitem><para>Prevents the specified DHCP option number (0-255) from being 359 sent to the client when present in this or a high configuration scope. 360 </para></listitem> 361 </varlistentry> 362 <varlistentry> 326 363 <term><option>--min-lease-time=<replaceable>seconds</replaceable></option></term> 327 364 <listitem><para>Sets the minimum lease time for the current scope in seconds. … … 424 461 </varlistentry> 425 462 <varlistentry> 463 <term><option>--unforce-opt=<replaceable>dhcp-opt-no</replaceable></option></term> 464 <listitem><para>Removes the specified DHCP option number (0-255) from the forced 465 option list (i.e. the reverse of <option>--force-opt</option>). Like with 466 <option>--set-opt</option> the scope of the deletion is governed by the 467 <option>--global</option>, <option>--vm</option>, <option>--mac-address</option> 468 and <option>--group</option> options. 469 </para></listitem> 470 </varlistentry> 471 <varlistentry> 472 <term><option>--unsuppress-opt=<replaceable>dhcp-opt-no</replaceable></option></term> 473 <listitem><para>Removes the specified DHCP option number (0-255) from the supressed 474 option list (i.e. the reverse of <option>--suppress-opt</option>). Like with 475 <option>--set-opt</option> the scope of the deletion is governed by the 476 <option>--global</option>, <option>--vm</option>, <option>--mac-address</option> 477 and <option>--group</option> options. 478 </para></listitem> 479 </varlistentry> 480 <varlistentry> 426 481 <term><option>--remove-config</option></term> 427 482 <listitem><para>Removes the configuration currently being scoped. The -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageDHCPServer.cpp
r79845 r79867 316 316 { 317 317 DHCP_ADDMOD = 1000, 318 DHCP_ADDMOD_FORCE_OPTION, 319 DHCP_ADDMOD_UNFORCE_OPTION, 320 DHCP_ADDMOD_SUPPRESS_OPTION, 321 DHCP_ADDMOD_UNSUPPRESS_OPTION, 318 322 DHCP_ADDMOD_ZAP_OPTIONS, 319 323 DHCP_ADDMOD_INCL_MAC, … … 369 373 { "--set-opt-hex", 'x', RTGETOPT_REQ_UINT8 }, 370 374 { "--del-opt", 'D', RTGETOPT_REQ_UINT8 }, 375 { "--force-opt", DHCP_ADDMOD_FORCE_OPTION, RTGETOPT_REQ_UINT8 }, 376 { "--unforce-opt", DHCP_ADDMOD_UNFORCE_OPTION, RTGETOPT_REQ_UINT8 }, 377 { "--suppress-opt", DHCP_ADDMOD_SUPPRESS_OPTION, RTGETOPT_REQ_UINT8 }, 378 { "--unsuppress-opt", DHCP_ADDMOD_UNSUPPRESS_OPTION, RTGETOPT_REQ_UINT8 }, 371 379 { "--zap-options", DHCP_ADDMOD_ZAP_OPTIONS, RTGETOPT_REQ_NOTHING }, 372 380 { "--min-lease-time", 'q' , RTGETOPT_REQ_UINT32 }, … … 552 560 break; 553 561 562 case DHCP_ADDMOD_UNFORCE_OPTION: // --unforce-opt 563 if (pCtx->pCmdDef->fSubcommandScope == HELP_SCOPE_DHCPSERVER_ADD) 564 return errorSyntax("--unforce-opt does not apply to the 'add' subcommand"); 565 case DHCP_ADDMOD_UNSUPPRESS_OPTION: // --unsupress-opt 566 if (pCtx->pCmdDef->fSubcommandScope == HELP_SCOPE_DHCPSERVER_ADD) 567 return errorSyntax("--unsuppress-opt does not apply to the 'add' subcommand"); 568 case DHCP_ADDMOD_FORCE_OPTION: // --force-opt 569 case DHCP_ADDMOD_SUPPRESS_OPTION: // --suppress-opt 570 if (iPass == 1) 571 { 572 DHCPOption_T const enmOption = (DHCPOption_T)ValueUnion.u8; 573 bool const fForced = vrc == DHCP_ADDMOD_FORCE_OPTION || vrc == DHCP_ADDMOD_UNFORCE_OPTION; 574 575 /* Get the current option list: */ 576 ComPtr<IDHCPConfig> &ptrConfig = Scope.getConfig(ptrDHCPServer); 577 if (ptrConfig.isNull()) 578 return RTEXITCODE_FAILURE; 579 com::SafeArray<DHCPOption_T> Options; 580 if (fForced) 581 CHECK_ERROR2I_STMT(ptrConfig, COMGETTER(ForcedOptions)(ComSafeArrayAsOutParam(Options)), 582 rcExit = RTEXITCODE_FAILURE; break); 583 else 584 CHECK_ERROR2I_STMT(ptrConfig, COMGETTER(SuppressedOptions)(ComSafeArrayAsOutParam(Options)), 585 rcExit = RTEXITCODE_FAILURE; break); 586 if (vrc == DHCP_ADDMOD_FORCE_OPTION || vrc == DHCP_ADDMOD_SUPPRESS_OPTION) 587 { 588 /* Add if not present. */ 589 size_t iSrc; 590 for (iSrc = 0; iSrc < Options.size(); iSrc++) 591 if (Options[iSrc] == enmOption) 592 break; 593 if (iSrc < Options.size()) 594 break; /* already present */ 595 Options.push_back(enmOption); 596 } 597 else 598 { 599 /* Remove */ 600 size_t iDst = 0; 601 for (size_t iSrc = 0; iSrc < Options.size(); iSrc++) 602 { 603 DHCPOption_T enmCurOpt = Options[iSrc]; 604 if (enmCurOpt != enmOption) 605 Options[iDst++] = enmCurOpt; 606 } 607 if (iDst == Options.size()) 608 break; /* Not found. */ 609 Options.resize(iDst); 610 } 611 612 /* Update the option list: */ 613 if (fForced) 614 CHECK_ERROR2I_STMT(ptrConfig, COMSETTER(ForcedOptions)(ComSafeArrayAsInParam(Options)), 615 rcExit = RTEXITCODE_FAILURE); 616 else 617 CHECK_ERROR2I_STMT(ptrConfig, COMSETTER(SuppressedOptions)(ComSafeArrayAsInParam(Options)), 618 rcExit = RTEXITCODE_FAILURE); 619 } 620 break; 621 554 622 case DHCP_ADDMOD_ZAP_OPTIONS: 555 623 if (pCtx->pCmdDef->fSubcommandScope == HELP_SCOPE_DHCPSERVER_ADD) -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageList.cpp
r79847 r79867 814 814 815 815 com::SafeArray<DHCPOption_T> Options; 816 HRESULT hrc; 817 CHECK_ERROR2_STMT(hrc, ptrConfig, COMGETTER(ForcedOptions(ComSafeArrayAsOutParam(Options))), hrcRet = hrc); 818 if (FAILED(hrc)) 819 RTPrintf(" Forced options: %Rhrc\n", hrc); 820 else if (Options.size() == 0) 821 RTPrintf(" Forced options: None\n"); 822 else 823 { 824 RTPrintf(" Forced options: "); 825 for (size_t i = 0; i < Options.size(); i++) 826 RTPrintf(i ? ", %u" : "%u", Options[i]); 827 RTPrintf("\n"); 828 } 829 830 CHECK_ERROR2_STMT(hrc, ptrConfig, COMGETTER(SuppressedOptions(ComSafeArrayAsOutParam(Options))), hrcRet = hrc); 831 if (FAILED(hrc)) 832 RTPrintf(" Suppressed opt.s: %Rhrc\n", hrc); 833 else if (Options.size() == 0) 834 RTPrintf(" Suppressed opts.: None\n"); 835 else 836 { 837 RTPrintf(" Suppressed opts.: "); 838 for (size_t i = 0; i < Options.size(); i++) 839 RTPrintf(i ? ", %u" : "%u", Options[i]); 840 RTPrintf("\n"); 841 } 842 816 843 com::SafeArray<DHCPOptionEncoding_T> Encodings; 817 844 com::SafeArray<BSTR> Values; 818 HRESULT hrc;819 845 CHECK_ERROR2_STMT(hrc, ptrConfig, GetAllOptions(ComSafeArrayAsOutParam(Options), 820 846 ComSafeArrayAsOutParam(Encodings),
Note:
See TracChangeset
for help on using the changeset viewer.