diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-02-13 15:25:34 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2012-02-14 18:56:08 +0100 |
commit | 952d838efab53b2817a2783aa9ee31f6485a1a76 (patch) | |
tree | 6b764c176571c89faa53b9f0a3fac471fc2a9818 /usb-redirection-protocol.txt | |
parent | 79e2330bc5c7127d9bfaba3291a3aa3630fbd253 (diff) |
Add a usb_redir_filter_filter packet
Make this conditional on the same cap as device_reject, rename
the cap to usb_redir_cap_filter. Rename device_reject to filter_reject to
reflect that it is filtering related and that the the cap and packet names
are consistent with each other. Also cleanup some related comments / docs.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'usb-redirection-protocol.txt')
-rw-r--r-- | usb-redirection-protocol.txt | 80 |
1 files changed, 57 insertions, 23 deletions
diff --git a/usb-redirection-protocol.txt b/usb-redirection-protocol.txt index 7e84d82..508ccf9 100644 --- a/usb-redirection-protocol.txt +++ b/usb-redirection-protocol.txt @@ -51,8 +51,8 @@ Version 0.3.3, released 12 January 2012 - No protocol changes Version 0.3.4, released FIXME 2012 -- Add an usb_redir_device_reject packet to allow notifying the usb-host when - an usb-guest rejects a device because of usb-guest side device filtering +- Add usb_redir_filter_reject and usb_redir_filter_filter packets and + an usb_redir_cap_filter capability flag USB redirerection protocol version 0.3 -------------------------------------- @@ -146,7 +146,8 @@ usb_redir_alloc_bulk_streams usb_redir_free_bulk_streams usb_redir_bulk_streams_status usb_redir_cancel_data_packet -usb_redir_device_reject +usb_redir_filter_reject +usb_redir_filter_filter data packets: usb_redir_control_packet @@ -202,12 +203,12 @@ etc. the value is 64 + capabilities-array-size * sizeof(uint32_t). Currently the following capabilities are defined: enum { - /* USB 3 bulk streams are supported ? */ + /* Supports USB 3 bulk streams */ usb_redir_cap_bulk_streams, - /* The device_connect packet has the device_version_bcd field ? */ + /* The device_connect packet has the device_version_bcd field */ usb_redir_cap_connect_device_version, - /* Knows how to handle the usb_redir_device_reject packet ? */ - usb_redir_cap_reject_device, + /* Supports usb_redir_filter_reject and usb_redir_filter_filter pkts */ + usb_redir_cap_filter, }; usb_redir_device_connect @@ -263,22 +264,6 @@ This packet may be send by the usb-host to indicate that the device has been disconnect (unplugged). Note on some platforms the usb-host may not become aware of the disconnection until a usb packet is send to the device. -usb_redir_device_reject ------------------------ - -usb_redir_header.type: usb_redir_device_reject -usb_redir_header.length: 0 -usb_redir_header.id: 0 (always as this is an unsolicited packet) - -No packet type specific header. - -No packet type specific additional data. - -This packet may be send by the usb-guest to indicate to the usb-host that the -device has been rejected. Usually the usb-guest will send this after receiving -a usb_redir_device_connect or usb_redir_interface_info packet which fails -to match an usb-guest side device filter. - usb_redir_reset --------------- @@ -651,6 +636,55 @@ and with the same id, the usb-guest can check if the packet completed normally (before the cancel packet was processed by the usb-host), or was cancelled by looking at the return data packet's status field. +usb_redir_filter_reject +----------------------- + +usb_redir_header.type: usb_redir_filter_reject +usb_redir_header.length: 0 +usb_redir_header.id: 0 (always as this is an unsolicited packet) + +No packet type specific header. + +No packet type specific additional data. + +This packet is send by the usb-guest after receiving a usb_redir_device_connect +or usb_redir_interface_info packet which was rejected by an usb-guest side +device filter. This packet should only be send to usb-hosts with the +usb_redir_cap_filter capability. + +usb_redir_filter_filter +----------------------- + +usb_redir_header.type: usb_redir_filter_filter +usb_redir_header.length: string-length + 1 (for 0 termination) +usb_redir_header.id: 0 (always as this is an unsolicited packet) + +No packet type specific header. + +The additional data contains a 0 terminated usredirfilter string. + +This packet can be send directly after the hello packet to inform the other +side that a filter is in place and some devices may be rejected. + +An usredirfilter consists of one or more rules, where in string form each rule +has the following format: + <class>,<vendor>,<product>,<version>,<allow> + +Values can be either in decimal format, or in hexadecimal format pre-fixed +with 0x, a value of -1 can be used to allow any value. + +All rules of a filter are concatonated, separated by the '|' character +to form a single usredirfilter string: + <rule1>|<rule2>|<rule3> + +If a device matches none of the rules the result of the filter is deny and +the device will be rejected. + +For more info on filtering see usbredirfilter.h + +This packet should only be send to peers with the usb_redir_cap_filter +capability. + usb_redir_control_packet ------------------------ |