VFER

High Performance data-transfer in user-space.


The VFER implementation uses the Bulk Transport API outlined by Steven Senger. This API resembles berkeley sockets but also contains some extensions such as an equivalent of a select() call. These extensions are very useful as VFER sockets are not system sockets and therefore cannot be used with existing calls that operate on system sockets.

Below are two API lists. The first is list of the basic VFER library calls, and the second lists the API for the VFER Secure Layer.


Basic VFER API

/* Connection setup/teardown functions */

vfer_fd         vfer_socket     (int socktype);
int             vfer_close      (vfer_fd vfd);
int             vfer_connect    (vfer_fd vfd, const struct sockaddr *addr, int len);
int             vfer_bind       (vfer_fd vfd, struct sockaddr *addr, int len);
int             vfer_listen     (vfer_fd vfd, int backlog);
vfer_fd         vfer_accept     (vfer_fd vfd, struct sockaddr *addr, int *len);


/* Option handling functions */

int             vfer_setsockopt (vfer_fd vfd, int optname, void *optval, int optlen);
int             vfer_getsockopt (vfer_fd vfd, int optname, void *optval, int *optlen);


/* Data transfer functions */

int             vfer_send       (vfer_fd vfd, const void * buf, size_t len);
int             vfer_recv       (vfer_fd vfd, void *buf, size_t len);
int             vfer_sendfile   (vfer_fd vfd, int fd, off_t offset, size_t size);
int             vfer_recvfile   (vfer_fd vfd, int fd, off_t offset, size_t size);


/* IO Multiplexing */

int             vfer_selectmark (vfer_fd vfd, int mark);
int             vfer_selecttest (vfer_fd vfd);
int             vfer_select     (int len, vfer_fd *vfds, struct timeval *timeout);


/* Information reporting functions */

vfer_stats      vfer_sockstats  (vfer_fd vfd);
int             vfer_debug      (FILE* debug_file, FILE* error_file, char* layers);
int             vfer_sockerror  (vfer_fd vfd);
char*           vfer_errortext  (int err);

VFER Secure Layer API


/* Connection setup/teardown functions */

vsl_sock	vsl_socket	(const vfer_fd vfd);
void		vsl_close	(vsl_sock socket);
int		vsl_connect_ssh	(vsl_sock sock, const char* host, const char* user, const char* cmd,
				 int argc, const char* const *argv, char* errmsg);
int		vsl_accept_ssh	(vsl_sock sock);


/* Data transfer functions */

ssize_t		vsl_send	(vsl_sock socket, const void * buf, size_t len);
ssize_t		vsl_recv	(vsl_sock socket, void *buf, size_t len);
ssize_t		vsl_sendfile	(vsl_sock socket, int fd, off_t offset, size_t size);
ssize_t		vsl_recvfile	(vsl_sock socket, int fd, off_t offset, size_t size);


/* IO Multiplexing */

int		vsl_selectmark	(vsl_sock socket, int mark);
int		vsl_selecttest	(vsl_sock socket);
int		vsl_select	(int len, vsl_sock* socks, struct timeval *timeout);
int		vsl_selectpoll	(int len, vsl_sock* socks, struct timeval *stimeout, int usec);


/* Information reporting function */

void		vsl_debug	(FILE* fp, const char* vfer);
char*		vsl_errortext	(int err);
vfer_fd		vsl_vferfd	(vsl_sock socket);

Last Updated: August 8, 2006
SourceForge.net Logo Internet2 Logo Google_SOC Logo