1 #include <stdio.h> 2 3 // Speed constants 4 inline constexpr int USBIP_SPEED_HIGH = 3; 5 inline constexpr int USBIP_SPEED_SUPER = 4; 6 7 // Status Constants 8 inline constexpr int USBIP_VDEV_NULL = 4; 9 10 // Connection information 11 typedef struct usbip_conn_info { 12 int sock_fd; 13 int speed; 14 int dev_id; 15 } usbip_conn_info; 16 17 /* 18 * Connects to server and retrieves required info for connection. 19 * NOTE: User must close the sock_fd when they are done with it. 20 */ 21 bool get_usbip_connection(const char *server, const char *port, 22 const char *dev_id, usbip_conn_info *info); 23 24 /* Returns free port number from vhci, -1 on failure. */ 25 int get_free_vhci_port(FILE *file, int speed); 26