Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
usbip_network.h File Reference
#include <sys/types.h>
#include <sysfs/libsysfs.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  op_common
 
struct  op_devinfo_request
 
struct  op_devinfo_reply
 
struct  op_import_request
 
struct  op_import_reply
 
struct  op_export_request
 
struct  op_export_reply
 
struct  op_unexport_request
 
struct  op_unexport_reply
 
struct  op_crypkey_request
 
struct  op_crypkey_reply
 
struct  op_devlist_request
 
struct  op_devlist_reply
 
struct  op_devlist_reply_extra
 

Macros

#define USBIP_PORT   3240
 
#define USBIP_PORT_STRING   "3240"
 
#define OP_REQUEST   (0x80 << 8)
 
#define OP_REPLY   (0x00 << 8)
 
#define ST_OK   0x00
 
#define ST_NA   0x01
 
#define PACK_OP_COMMON(pack, op_common)
 
#define OP_UNSPEC   0x00
 
#define OP_REQ_UNSPEC   OP_UNSPEC
 
#define OP_REP_UNSPEC   OP_UNSPEC
 
#define OP_DEVINFO   0x02
 
#define OP_REQ_DEVINFO   (OP_REQUEST | OP_DEVINFO)
 
#define OP_REP_DEVINFO   (OP_REPLY | OP_DEVINFO)
 
#define OP_IMPORT   0x03
 
#define OP_REQ_IMPORT   (OP_REQUEST | OP_IMPORT)
 
#define OP_REP_IMPORT   (OP_REPLY | OP_IMPORT)
 
#define PACK_OP_IMPORT_REQUEST(pack, request)
 
#define PACK_OP_IMPORT_REPLY(pack, reply)
 
#define OP_EXPORT   0x06
 
#define OP_REQ_EXPORT   (OP_REQUEST | OP_EXPORT)
 
#define OP_REP_EXPORT   (OP_REPLY | OP_EXPORT)
 
#define PACK_OP_EXPORT_REQUEST(pack, request)
 
#define PACK_OP_EXPORT_REPLY(pack, reply)
 
#define OP_UNEXPORT   0x07
 
#define OP_REQ_UNEXPORT   (OP_REQUEST | OP_UNEXPORT)
 
#define OP_REP_UNEXPORT   (OP_REPLY | OP_UNEXPORT)
 
#define PACK_OP_UNEXPORT_REQUEST(pack, request)
 
#define PACK_OP_UNEXPORT_REPLY(pack, reply)
 
#define OP_CRYPKEY   0x04
 
#define OP_REQ_CRYPKEY   (OP_REQUEST | OP_CRYPKEY)
 
#define OP_REP_CRYPKEY   (OP_REPLY | OP_CRYPKEY)
 
#define OP_DEVLIST   0x05
 
#define OP_REQ_DEVLIST   (OP_REQUEST | OP_DEVLIST)
 
#define OP_REP_DEVLIST   (OP_REPLY | OP_DEVLIST)
 
#define PACK_OP_DEVLIST_REQUEST(pack, request)
 
#define PACK_OP_DEVLIST_REPLY(pack, reply)
 

Functions

struct op_common __attribute__ ((packed))
 
void usbip_net_pack_uint32_t (int pack, uint32_t *num)
 
void usbip_net_pack_uint16_t (int pack, uint16_t *num)
 
void usbip_net_pack_usb_device (int pack, struct usbip_usb_device *udev)
 
void usbip_net_pack_usb_interface (int pack, struct usbip_usb_interface *uinf)
 
ssize_t usbip_net_recv (int sockfd, void *buff, size_t bufflen)
 
ssize_t usbip_net_send (int sockfd, void *buff, size_t bufflen)
 
int usbip_net_send_op_common (int sockfd, uint32_t code, uint32_t status)
 
int usbip_net_recv_op_common (int sockfd, uint16_t *code)
 
int usbip_net_set_reuseaddr (int sockfd)
 
int usbip_net_set_nodelay (int sockfd)
 
int usbip_net_set_keepalive (int sockfd)
 
int usbip_net_tcp_connect (char *hostname, char *port)
 

Variables

uint16_t version
 
uint16_t code
 
uint32_t status
 
char busid [SYSFS_BUS_ID_SIZE]
 
struct usbip_usb_device udev
 
struct usbip_usb_interface uinf []
 
int returncode
 
uint32_t key [4]
 
uint32_t __reserved
 
uint32_t ndev
 

Macro Definition Documentation

#define OP_CRYPKEY   0x04

Definition at line 130 of file usbip_network.h.

#define OP_DEVINFO   0x02

Definition at line 50 of file usbip_network.h.

#define OP_DEVLIST   0x05

Definition at line 146 of file usbip_network.h.

#define OP_EXPORT   0x06

Definition at line 87 of file usbip_network.h.

#define OP_IMPORT   0x03

Definition at line 65 of file usbip_network.h.

#define OP_REP_CRYPKEY   (OP_REPLY | OP_CRYPKEY)

Definition at line 132 of file usbip_network.h.

#define OP_REP_DEVINFO   (OP_REPLY | OP_DEVINFO)

Definition at line 52 of file usbip_network.h.

#define OP_REP_DEVLIST   (OP_REPLY | OP_DEVLIST)

Definition at line 148 of file usbip_network.h.

#define OP_REP_EXPORT   (OP_REPLY | OP_EXPORT)

Definition at line 89 of file usbip_network.h.

#define OP_REP_IMPORT   (OP_REPLY | OP_IMPORT)

Definition at line 67 of file usbip_network.h.

#define OP_REP_UNEXPORT   (OP_REPLY | OP_UNEXPORT)

Definition at line 111 of file usbip_network.h.

#define OP_REP_UNSPEC   OP_UNSPEC

Definition at line 46 of file usbip_network.h.

#define OP_REPLY   (0x00 << 8)

Definition at line 38 of file usbip_network.h.

#define OP_REQ_CRYPKEY   (OP_REQUEST | OP_CRYPKEY)

Definition at line 131 of file usbip_network.h.

#define OP_REQ_DEVINFO   (OP_REQUEST | OP_DEVINFO)

Definition at line 51 of file usbip_network.h.

#define OP_REQ_DEVLIST   (OP_REQUEST | OP_DEVLIST)

Definition at line 147 of file usbip_network.h.

#define OP_REQ_EXPORT   (OP_REQUEST | OP_EXPORT)

Definition at line 88 of file usbip_network.h.

#define OP_REQ_IMPORT   (OP_REQUEST | OP_IMPORT)

Definition at line 66 of file usbip_network.h.

#define OP_REQ_UNEXPORT   (OP_REQUEST | OP_UNEXPORT)

Definition at line 110 of file usbip_network.h.

#define OP_REQ_UNSPEC   OP_UNSPEC

Definition at line 45 of file usbip_network.h.

#define OP_REQUEST   (0x80 << 8)

Definition at line 37 of file usbip_network.h.

#define OP_UNEXPORT   0x07

Definition at line 109 of file usbip_network.h.

#define OP_UNSPEC   0x00

Definition at line 44 of file usbip_network.h.

#define PACK_OP_COMMON (   pack,
  op_common 
)
Value:
do {\
usbip_net_pack_uint16_t(pack, &(op_common)->version);\
usbip_net_pack_uint16_t(pack, &(op_common)->code );\
usbip_net_pack_uint32_t(pack, &(op_common)->status );\
} while (0)

Definition at line 36 of file usbip_network.h.

#define PACK_OP_DEVLIST_REPLY (   pack,
  reply 
)
Value:
do {\
usbip_net_pack_uint32_t(pack, &(reply)->ndev);\
} while (0)

Definition at line 166 of file usbip_network.h.

#define PACK_OP_DEVLIST_REQUEST (   pack,
  request 
)
Value:
do {\
} while (0)

Definition at line 163 of file usbip_network.h.

#define PACK_OP_EXPORT_REPLY (   pack,
  reply 
)
Value:
do {\
} while (0)

Definition at line 104 of file usbip_network.h.

#define PACK_OP_EXPORT_REQUEST (   pack,
  request 
)
Value:
do {\
usbip_net_pack_usb_device(pack, &(request)->udev);\
} while (0)

Definition at line 100 of file usbip_network.h.

#define PACK_OP_IMPORT_REPLY (   pack,
  reply 
)
Value:
do {\
usbip_net_pack_usb_device(pack, &(reply)->udev);\
} while (0)

Definition at line 81 of file usbip_network.h.

#define PACK_OP_IMPORT_REQUEST (   pack,
  request 
)
Value:
do {\
} while (0)

Definition at line 78 of file usbip_network.h.

#define PACK_OP_UNEXPORT_REPLY (   pack,
  reply 
)
Value:
do {\
} while (0)

Definition at line 125 of file usbip_network.h.

#define PACK_OP_UNEXPORT_REQUEST (   pack,
  request 
)
Value:
do {\
usbip_net_pack_usb_device(pack, &(request)->udev);\
} while (0)

Definition at line 121 of file usbip_network.h.

#define ST_NA   0x01

Definition at line 43 of file usbip_network.h.

#define ST_OK   0x00

Definition at line 42 of file usbip_network.h.

#define USBIP_PORT   3240

Definition at line 17 of file usbip_network.h.

#define USBIP_PORT_STRING   "3240"

Definition at line 18 of file usbip_network.h.

Function Documentation

struct op_common __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

void usbip_net_pack_uint16_t ( int  pack,
uint16_t num 
)

Definition at line 43 of file usbip_network.c.

void usbip_net_pack_uint32_t ( int  pack,
uint32_t num 
)

Definition at line 31 of file usbip_network.c.

void usbip_net_pack_usb_device ( int  pack,
struct usbip_usb_device udev 
)

Definition at line 55 of file usbip_network.c.

void usbip_net_pack_usb_interface ( int  pack,
struct usbip_usb_interface uinf 
)
ssize_t usbip_net_recv ( int  sockfd,
void buff,
size_t  bufflen 
)

Definition at line 100 of file usbip_network.c.

int usbip_net_recv_op_common ( int  sockfd,
uint16_t code 
)

Definition at line 132 of file usbip_network.c.

ssize_t usbip_net_send ( int  sockfd,
void buff,
size_t  bufflen 
)

Definition at line 105 of file usbip_network.c.

int usbip_net_send_op_common ( int  sockfd,
uint32_t  code,
uint32_t  status 
)

Definition at line 110 of file usbip_network.c.

int usbip_net_set_keepalive ( int  sockfd)

Definition at line 200 of file usbip_network.c.

int usbip_net_set_nodelay ( int  sockfd)

Definition at line 188 of file usbip_network.c.

int usbip_net_set_reuseaddr ( int  sockfd)

Definition at line 176 of file usbip_network.c.

int usbip_net_tcp_connect ( char hostname,
char port 
)

Definition at line 215 of file usbip_network.c.

Variable Documentation

uint32_t __reserved

Definition at line 142 of file usbip_network.h.

char busid[SYSFS_BUS_ID_SIZE]

Definition at line 57 of file usbip_network.h.

Definition at line 39 of file usbip_network.h.

uint32_t key[4]

Definition at line 139 of file usbip_network.h.

uint32_t ndev

Definition at line 157 of file usbip_network.h.

int returncode

Definition at line 98 of file usbip_network.h.

Definition at line 44 of file usbip_network.h.

Definition at line 62 of file usbip_network.h.

Definition at line 63 of file usbip_network.h.

uint16_t version

Definition at line 35 of file usbip_network.h.