Blame usbredirparser/usbredirproto-compat.h

Packit 9795e1
/* usbredirproto-compat.h usb redirection compatibility protocol definitions
Packit 9795e1
Packit 9795e1
   Copyright 2011 Red Hat, Inc.
Packit 9795e1
Packit 9795e1
   Red Hat Authors:
Packit 9795e1
   Hans de Goede <hdegoede@redhat.com>
Packit 9795e1
Packit 9795e1
   This library is free software; you can redistribute it and/or
Packit 9795e1
   modify it under the terms of the GNU Lesser General Public
Packit 9795e1
   License as published by the Free Software Foundation; either
Packit 9795e1
   version 2.1 of the License, or (at your option) any later version.
Packit 9795e1
Packit 9795e1
   This library is distributed in the hope that it will be useful,
Packit 9795e1
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 9795e1
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 9795e1
   Lesser General Public License for more details.
Packit 9795e1
Packit 9795e1
   You should have received a copy of the GNU Lesser General Public
Packit 9795e1
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
Packit 9795e1
*/
Packit 9795e1
#ifndef __USBREDIRPROTO_COMPAT_H
Packit 9795e1
#define __USBREDIRPROTO_COMPAT_H
Packit 9795e1
Packit 9795e1
/* PACK macros borrowed from spice-protocol */
Packit 9795e1
#ifdef __GNUC__
Packit 9795e1
Packit 9795e1
#define ATTR_PACKED __attribute__ ((__packed__))
Packit 9795e1
Packit 9795e1
#ifdef __MINGW32__
Packit 9795e1
#pragma pack(push,1)
Packit 9795e1
#endif
Packit 9795e1
Packit 9795e1
#else
Packit 9795e1
Packit 9795e1
#pragma pack(push)
Packit 9795e1
#pragma pack(1)
Packit 9795e1
#define ATTR_PACKED
Packit 9795e1
#pragma warning(disable:4200)
Packit 9795e1
#pragma warning(disable:4103)
Packit 9795e1
Packit 9795e1
#endif
Packit 9795e1
Packit 9795e1
#include <stdint.h>
Packit 9795e1
Packit 9795e1
struct usb_redir_device_connect_header_no_device_version {
Packit 9795e1
    uint8_t speed;
Packit 9795e1
    uint8_t device_class;
Packit 9795e1
    uint8_t device_subclass;
Packit 9795e1
    uint8_t device_protocol;
Packit 9795e1
    uint16_t vendor_id;
Packit 9795e1
    uint16_t product_id;
Packit 9795e1
} ATTR_PACKED;
Packit 9795e1
Packit 9795e1
struct usb_redir_ep_info_header_no_max_pktsz {
Packit 9795e1
    uint8_t type[32];
Packit 9795e1
    uint8_t interval[32];
Packit 9795e1
    uint8_t interface[32];
Packit 9795e1
} ATTR_PACKED;
Packit 9795e1
Packit 9795e1
struct usb_redir_ep_info_header_no_max_streams {
Packit 9795e1
    uint8_t type[32];
Packit 9795e1
    uint8_t interval[32];
Packit 9795e1
    uint8_t interface[32];
Packit 9795e1
    uint16_t max_packet_size[32];
Packit 9795e1
} ATTR_PACKED;
Packit 9795e1
Packit 9795e1
struct usb_redir_header_32bit_id {
Packit 9795e1
    uint32_t type;
Packit 9795e1
    uint32_t length;
Packit 9795e1
    uint32_t id;
Packit 9795e1
} ATTR_PACKED;
Packit 9795e1
Packit 9795e1
struct usb_redir_bulk_packet_header_16bit_length {
Packit 9795e1
    uint8_t endpoint;
Packit 9795e1
    uint8_t status;
Packit 9795e1
    uint16_t length;
Packit 9795e1
    uint32_t stream_id;
Packit 9795e1
} ATTR_PACKED;
Packit 9795e1
Packit 9795e1
#undef ATTR_PACKED
Packit 9795e1
Packit 9795e1
#if defined(__MINGW32__) || !defined(__GNUC__)
Packit 9795e1
#pragma pack(pop)
Packit 9795e1
#endif
Packit 9795e1
Packit 9795e1
#endif