VirtualBox

Changeset 94207 in vbox for trunk


Ignore:
Timestamp:
Mar 13, 2022 7:36:57 PM (3 years ago)
Author:
vboxsync
Message:

doc/manual,FE/VBoxManage: Convert usbfilter command to refentry documentation, ​bugref:9186

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/manual/Config.kmk

    r94206 r94207  
    7676        man_VBoxManage-setextradata.xml \
    7777        man_VBoxManage-getextradata.xml \
    78         man_VBoxManage-setproperty.xml
     78        man_VBoxManage-setproperty.xml \
     79        man_VBoxManage-usbfilter.xml
    7980
    8081## List of user manual XML files.
  • trunk/doc/manual/en_US/man_VBoxManage-usbfilter.xml

    r93737 r94207  
    2020<refentry id="vboxmanage-usbfilter" lang="en">
    2121  <refentryinfo>
    22     <pubdate>September 2019</pubdate>
     22    <pubdate>$Date$</pubdate>
    2323    <title>VBoxManage usbfilter</title>
    2424  </refentryinfo>
     
    3232    <refname>VBoxManage-usbfilter</refname>
    3333    <refpurpose>manage USB filters</refpurpose>
    34     <refclass>Oracle VM VirtualBox</refclass>
     34    <refclass>&product-name;</refclass>
    3535  </refnamediv>
    3636
  • trunk/doc/manual/en_US/user_VBoxManage.xml

    r94206 r94207  
    11071107  <xi:include href="user_man_VBoxManage-setproperty.xml"    xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />
    11081108
    1109   <sect1 id="vboxmanage-usbfilter">
    1110 
    1111     <title>VBoxManage usbfilter add/modify/remove</title>
    1112 
    1113 <screen>VBoxManage usbfilter        add &lt;index,0-N&gt;
    1114                           --target &lt;uuid|vmname&gt;global
    1115                           --name &lt;string&gt;
    1116                           --action ignore|hold (global filters only)
    1117                          [--active yes|no (yes)]
    1118                          [--vendorid &lt;XXXX&gt; (null)]
    1119                          [--productid &lt;XXXX&gt; (null)]
    1120                          [--revision &lt;IIFF&gt; (null)]
    1121                          [--manufacturer &lt;string&gt; (null)]
    1122                          [--product &lt;string&gt; (null)]
    1123                          [--remote yes|no (null, VM filters only)]
    1124                          [--serialnumber &lt;string&gt; (null)]
    1125                          [--maskedinterfaces &lt;XXXXXXXX&gt;]
    1126     </screen>
    1127 
    1128 <screen>VBoxManage usbfilter        modify &lt;index,0-N&gt;
    1129                           --target &lt;uuid|vmname&gt;global
    1130                          [--name &lt;string&gt;]
    1131                          [--action ignore|hold (global filters only)]
    1132                          [--active yes|no]
    1133                          [--vendorid &lt;XXXX&gt;]
    1134                          [--productid &lt;XXXX&gt;]
    1135                          [--revision &lt;IIFF&gt;]
    1136                          [--manufacturer &lt;string&gt;]
    1137                          [--product &lt;string&gt;]
    1138                          [--remote yes|no (null, VM filters only)]
    1139                          [--serialnumber &lt;string&gt;]
    1140                          [--maskedinterfaces &lt;XXXXXXXX&gt;]
    1141     </screen>
    1142 
    1143 <screen>VBoxManage usbfilter        remove &lt;index,0-N&gt;
    1144                           --target &lt;uuid|vmname&gt;global
    1145     </screen>
    1146 
    1147     <para>
    1148       The <command>usbfilter</command> commands are used for working
    1149       with USB filters in virtual machines, or global filters which
    1150       affect the whole &product-name; setup. Global filters are applied
    1151       before machine-specific filters, and may be used to prevent
    1152       devices from being captured by any virtual machine. Global filters
    1153       are always applied in a particular order, and only the first
    1154       filter which fits a device is applied. For example, if the first
    1155       global filter says to hold, or make available, a particular
    1156       Kingston memory stick device and the second filter says to ignore
    1157       all Kingston devices. That particular Kingston memory stick will
    1158       be available to any machine with the appropriate filter, but no
    1159       other Kingston device will.
    1160     </para>
    1161 
    1162     <para>
    1163       When creating a USB filter using <command>usbfilter add</command>,
    1164       you must supply three or four mandatory parameters. The index
    1165       specifies the position in the list at which the filter should be
    1166       placed. If there is already a filter at that position, then it and
    1167       the following ones will be shifted back one place. Otherwise, the
    1168       new filter will be added onto the end of the list. The
    1169       <computeroutput>target</computeroutput> parameter selects the
    1170       virtual machine that the filter should be attached to or use
    1171       <computeroutput>global</computeroutput> to apply it to all virtual
    1172       machines. <computeroutput>name</computeroutput> is a name for the
    1173       new filter. For global filters,
    1174       <computeroutput>action</computeroutput> says whether to allow VMs
    1175       access to devices that fit the filter description (hold) or not to
    1176       give them access (ignore). In addition, you should specify
    1177       parameters to filter by. You can find the parameters for devices
    1178       attached to your system using <command>VBoxManage list
    1179       usbhost</command>. Finally, you can specify whether the filter
    1180       should be active. For local filters, whether they are for local
    1181       devices, remote devices over an RDP connection, or either.
    1182     </para>
    1183 
    1184     <para>
    1185       When you modify a USB filter using <command>usbfilter
    1186       modify</command>, you must specify the filter by index and by
    1187       target, which is either a virtual machine or
    1188       <computeroutput>global</computeroutput>. See the output of
    1189       <command>VBoxManage list usbfilters</command> to find global
    1190       filter indexes and <command>VBoxManage showvminfo</command> to
    1191       find indexes for individual machines. The properties which can be
    1192       changed are the same as for <command>usbfilter add</command>. To
    1193       remove a filter, use <command>usbfilter remove</command> and
    1194       specify the index and the target.
    1195     </para>
    1196 
    1197     <para>
    1198       The following is a list of the additional <command>usbfilter
    1199       add</command> and <command>usbfilter modify</command> options,
    1200       with details of how to use them.
    1201     </para>
    1202 
    1203     <itemizedlist>
    1204 
    1205       <listitem>
    1206         <para>
    1207           <computeroutput>--action ignore|hold</computeroutput>:
    1208           Specifies whether devices that fit the filter description are
    1209           allowed access by machines (hold), or have access denied
    1210           (ignore). Applies to global filters only.
    1211         </para>
    1212       </listitem>
    1213 
    1214       <listitem>
    1215         <para>
    1216           <computeroutput>--active yes|no</computeroutput>: Specifies
    1217           whether the USB Filter is active or temporarily disabled. For
    1218           <computeroutput>usbfilter create</computeroutput> the default
    1219           is active.
    1220         </para>
    1221       </listitem>
    1222 
    1223       <listitem>
    1224         <para>
    1225           <computeroutput>--vendorid &lt;XXXX&gt;|""</computeroutput>:
    1226           Specifies a vendor ID filter. The string representation for an
    1227           exact match has the form XXXX, where X is the hexadecimal
    1228           digit, including leading zeroes.
    1229         </para>
    1230       </listitem>
    1231 
    1232       <listitem>
    1233         <para>
    1234           <computeroutput>--productid &lt;XXXX&gt;|""</computeroutput>:
    1235           Specifies a product ID filter. The string representation for
    1236           an exact match has the form XXXX, where X is the hexadecimal
    1237           digit, including leading zeroes.
    1238         </para>
    1239       </listitem>
    1240 
    1241       <listitem>
    1242         <para>
    1243           <computeroutput>--revision &lt;IIFF&gt;|""</computeroutput>:
    1244           Specifies a revision ID filter. The string representation for
    1245           an exact match has the form IIFF, where I is the decimal digit
    1246           of the integer part of the revision, and F is the decimal
    1247           digit of its fractional part, including leading and trailing
    1248           zeros. Note that for interval filters, it is best to use the
    1249           hexadecimal form, because the revision is stored as a 16-bit
    1250           packed BCD value. Therefore, the expression int:0x0100-0x0199
    1251           will match any revision from 1.0 to 1.99 inclusive.
    1252         </para>
    1253       </listitem>
    1254 
    1255       <listitem>
    1256         <para>
    1257           <computeroutput>--manufacturer
    1258           &lt;string&gt;|""</computeroutput>: Specifies a manufacturer
    1259           ID filter, as a string.
    1260         </para>
    1261       </listitem>
    1262 
    1263       <listitem>
    1264         <para>
    1265           <computeroutput>--product &lt;string&gt;|""</computeroutput>:
    1266           Specifies a product ID filter, as a string.
    1267         </para>
    1268       </listitem>
    1269 
    1270       <listitem>
    1271         <para>
    1272           <computeroutput>--remote yes|no""</computeroutput>: Specifies
    1273           a remote filter, indicating whether the device is physically
    1274           connected to a remote VRDE client or to a local host machine.
    1275           Applies to VM filters only.
    1276         </para>
    1277       </listitem>
    1278 
    1279       <listitem>
    1280         <para>
    1281           <computeroutput>--serialnumber
    1282           &lt;string&gt;|""</computeroutput>: Specifies a serial number
    1283           filter, as a string.
    1284         </para>
    1285       </listitem>
    1286 
    1287       <listitem>
    1288         <para>
    1289           <computeroutput>--maskedinterfaces
    1290           &lt;XXXXXXXX&gt;</computeroutput>: Specifies a masked
    1291           interface filter, for hiding one or more USB interfaces from
    1292           the guest. The value is a bit mask where the set bits
    1293           correspond to the USB interfaces that should be hidden, or
    1294           masked off. This feature only works on Linux hosts.
    1295         </para>
    1296       </listitem>
    1297 
    1298     </itemizedlist>
    1299 
    1300   </sect1>
     1109  <xi:include href="user_man_VBoxManage-usbfilter.xml"      xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />
    13011110
    13021111  <xi:include href="user_man_VBoxManage-sharedfolder.xml"   xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r94206 r94207  
    229229    { "setextradata",       USAGE_S_NEWCMD, HELP_CMD_SETEXTRADATA, handleSetExtraData,         0 },
    230230    { "setproperty",        USAGE_S_NEWCMD,  HELP_CMD_SETPROPERTY, handleSetProperty,          0 },
    231     { "usbfilter",          USAGE_USBFILTER,        VBMG_CMD_TODO, handleUSBFilter,            0 },
     231    { "usbfilter",          USAGE_S_NEWCMD,    HELP_CMD_USBFILTER, handleUSBFilter,            0 },
    232232    { "sharedfolder",       USAGE_S_NEWCMD, HELP_CMD_SHAREDFOLDER, handleSharedFolder,         0 },
    233233#ifdef VBOX_WITH_GUEST_PROPS
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r94206 r94207  
    101101    USAGE_CREATEHOSTIF,
    102102    USAGE_REMOVEHOSTIF,
    103     USAGE_USBFILTER,
    104103    USAGE_I_LOADSYMS,
    105104    USAGE_I_LOADMAP,
     
    139138
    140139
    141 #define HELP_SCOPE_USBFILTER_ADD        RT_BIT_64(0)
    142 #define HELP_SCOPE_USBFILTER_MODIFY     RT_BIT_64(1)
    143 #define HELP_SCOPE_USBFILTER_REMOVE     RT_BIT_64(2)
    144 
    145140#ifdef VBOX_WITH_GUEST_CONTROL
    146141# define HELP_SCOPE_GSTCTRL_RUN             RT_BIT(0)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp

    r94206 r94207  
    639639                     "\n", SEP);
    640640
    641     if (enmCommand == USAGE_USBFILTER || enmCommand == USAGE_S_ALL)
    642     {
    643         if (fSubcommandScope & HELP_SCOPE_USBFILTER_ADD)
    644             RTStrmPrintf(pStrm,
    645                                "%s usbfilter %s       add <index,0-N>\n"
    646                          "                            --target <uuid|vmname>|global\n"
    647                          "                            --name <string>\n"
    648                          "                            --action ignore|hold (global filters only)\n"
    649                          "                            [--active yes|no] (yes)\n"
    650                          "                            [--vendorid <XXXX>] (null)\n"
    651                          "                            [--productid <XXXX>] (null)\n"
    652                          "                            [--revision <IIFF>] (null)\n"
    653                          "                            [--manufacturer <string>] (null)\n"
    654                          "                            [--product <string>] (null)\n"
    655                          "                            [--remote yes|no] (null, VM filters only)\n"
    656                          "                            [--serialnumber <string>] (null)\n"
    657                          "                            [--maskedinterfaces <XXXXXXXX>]\n"
    658                          "\n", SEP);
    659 
    660         if (fSubcommandScope & HELP_SCOPE_USBFILTER_MODIFY)
    661             RTStrmPrintf(pStrm,
    662                                "%s usbfilter %s       modify <index,0-N>\n"
    663                          "                            --target <uuid|vmname>|global\n"
    664                          "                            [--name <string>]\n"
    665                          "                            [--action ignore|hold] (global filters only)\n"
    666                          "                            [--active yes|no]\n"
    667                          "                            [--vendorid <XXXX>|\"\"]\n"
    668                          "                            [--productid <XXXX>|\"\"]\n"
    669                          "                            [--revision <IIFF>|\"\"]\n"
    670                          "                            [--manufacturer <string>|\"\"]\n"
    671                          "                            [--product <string>|\"\"]\n"
    672                          "                            [--remote yes|no] (null, VM filters only)\n"
    673                          "                            [--serialnumber <string>|\"\"]\n"
    674                          "                            [--maskedinterfaces <XXXXXXXX>]\n"
    675                          "\n", SEP);
    676 
    677         if (fSubcommandScope & HELP_SCOPE_USBFILTER_REMOVE)
    678             RTStrmPrintf(pStrm,
    679                                "%s usbfilter %s       remove <index,0-N>\n"
    680                          "                            --target <uuid|vmname>|global\n"
    681                          "\n", SEP);
    682     }
    683 
    684641#ifdef VBOX_WITH_GUEST_PROPS
    685642    if (enmCommand == USAGE_GUESTPROPERTY || enmCommand == USAGE_S_ALL)
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageUSB.cpp

    r93115 r94207  
    176176    /* at least: 0: command, 1: index, 2: --target, 3: <target value> */
    177177    if (a->argc < 4)
    178         return errorSyntax(USAGE_USBFILTER, Usb::tr("Not enough parameters"));
     178        return errorSyntax(Usb::tr("Not enough parameters"));
    179179
    180180    /* which command? */
    181181    cmd.mAction = USBFilterCmd::Invalid;
    182     if      (!strcmp(a->argv[0], "add"))     cmd.mAction = USBFilterCmd::Add;
    183     else if (!strcmp(a->argv[0], "modify"))  cmd.mAction = USBFilterCmd::Modify;
    184     else if (!strcmp(a->argv[0], "remove"))  cmd.mAction = USBFilterCmd::Remove;
     182    if      (!strcmp(a->argv[0], "add"))
     183    {
     184        cmd.mAction = USBFilterCmd::Add;
     185        setCurrentSubcommand(HELP_SCOPE_USBFILTER_ADD);
     186    }
     187    else if (!strcmp(a->argv[0], "modify"))
     188    {
     189        cmd.mAction = USBFilterCmd::Modify;
     190        setCurrentSubcommand(HELP_SCOPE_USBFILTER_MODIFY);
     191    }
     192    else if (!strcmp(a->argv[0], "remove"))
     193    {
     194        cmd.mAction = USBFilterCmd::Remove;
     195        setCurrentSubcommand(HELP_SCOPE_USBFILTER_REMOVE);
     196    }
    185197
    186198    if (cmd.mAction == USBFilterCmd::Invalid)
    187         return errorSyntax(USAGE_USBFILTER, Usb::tr("Invalid parameter '%s'"), a->argv[0]);
     199        return errorSyntax(Usb::tr("Invalid parameter '%s'"), a->argv[0]);
    188200
    189201    /* which index? */
    190202    if (VINF_SUCCESS !=  RTStrToUInt32Full(a->argv[1], 10, &cmd.mIndex))
    191         return errorSyntax(USAGE_USBFILTER, Usb::tr("Invalid index '%s'"), a->argv[1]);
     203        return errorSyntax(Usb::tr("Invalid index '%s'"), a->argv[1]);
    192204
    193205    switch (cmd.mAction)
     
    200212            {
    201213                if (cmd.mAction == USBFilterCmd::Add)
    202                     return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_ADD, Usb::tr("Not enough parameters"));
    203 
    204                 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_MODIFY, Usb::tr("Not enough parameters"));
     214                    return errorSyntax(Usb::tr("Not enough parameters"));
     215
     216                return errorSyntax(Usb::tr("Not enough parameters"));
    205217            }
    206218
     
    332344                }
    333345                else
    334                     return errorSyntaxEx(USAGE_USBFILTER, cmd.mAction == USBFilterCmd::Add ? HELP_SCOPE_USBFILTER_ADD : HELP_SCOPE_USBFILTER_MODIFY,
    335                                          Usb::tr("Unknown option '%s'"), a->argv[i]);
     346                    return errorSyntax(Usb::tr("Unknown option '%s'"), a->argv[i]);
    336347            }
    337348
     
    350361                   )
    351362                {
    352                     return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_ADD, Usb::tr("Mandatory options not supplied"));
     363                    return errorSyntax(Usb::tr("Mandatory options not supplied"));
    353364                }
    354365            }
     
    360371            /* at least: 0: command, 1: index, 2: --target, 3: <target value> */
    361372            if (a->argc < 4)
    362                 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_REMOVE, Usb::tr("Not enough parameters"));
     373                return errorSyntax(Usb::tr("Not enough parameters"));
    363374
    364375            for (int i = 2; i < a->argc; i++)
     
    382393            // mandatory options
    383394            if (!cmd.mGlobal && !cmd.mMachine)
    384                 return errorSyntaxEx(USAGE_USBFILTER, HELP_SCOPE_USBFILTER_REMOVE, Usb::tr("Mandatory options not supplied"));
     395                return errorSyntax(Usb::tr("Mandatory options not supplied"));
    385396
    386397            break;
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