nbd-tester-client.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <syslog.h>
#include <unistd.h>
#include "config.h"
#include "lfs.h"
#include "cliserv.h"
#include <netinet/in.h>
#include <glib.h>

Go to the source code of this file.

Defines

#define MY_NAME   "nbd-tester-client"

Typedefs

typedef int(* testfunc )(gchar *, int, char *, int, char, char)

Enumerations

enum  CONNECTION_TYPE {
  CONNECTION_TYPE_NONE, CONNECTION_TYPE_CONNECT, CONNECTION_TYPE_INIT_PASSWD, CONNECTION_TYPE_CLISERV,
  CONNECTION_TYPE_FULL
}
enum  CLOSE_TYPE { CONNECTION_CLOSE_PROPERLY, CONNECTION_CLOSE_FAST }

Functions

int read_all (int f, void *buf, size_t len)
int setup_connection (gchar *hostname, int port, gchar *name, CONNECTION_TYPE ctype)
int close_connection (int sock, CLOSE_TYPE type)
int read_packet_check_header (int sock, size_t datasize, long long int curhandle)
int oversize_test (gchar *hostname, int port, char *name, int sock, char sock_is_open, char close_sock)
int throughput_test (gchar *hostname, int port, char *name, int sock, char sock_is_open, char close_sock)
int main (int argc, char **argv)

Variables

static gchar errstr [1024]
static const int errstr_len = 1024
static uint64_t size


Define Documentation

#define MY_NAME   "nbd-tester-client"

Definition at line 35 of file nbd-tester-client.c.


Typedef Documentation

typedef int(* testfunc)(gchar *, int, char *, int, char, char)

Definition at line 397 of file nbd-tester-client.c.


Enumeration Type Documentation

enum CLOSE_TYPE

Enumerator:
CONNECTION_CLOSE_PROPERLY 
CONNECTION_CLOSE_FAST 

Definition at line 54 of file nbd-tester-client.c.

Enumerator:
CONNECTION_TYPE_NONE 
CONNECTION_TYPE_CONNECT 
CONNECTION_TYPE_INIT_PASSWD 
CONNECTION_TYPE_CLISERV 
CONNECTION_TYPE_FULL 

Definition at line 46 of file nbd-tester-client.c.


Function Documentation

int close_connection ( int  sock,
CLOSE_TYPE  type 
)

int main ( int  argc,
char **  argv 
)

Definition at line 399 of file nbd-tester-client.c.

References errstr, logging(), oversize_test(), and throughput_test().

int oversize_test ( gchar *  hostname,
int  port,
char *  name,
int  sock,
char  sock_is_open,
char  close_sock 
)

int read_all ( int  f,
void *  buf,
size_t  len 
) [inline]

Definition at line 59 of file nbd-tester-client.c.

References errstr, and errstr_len.

Referenced by oversize_test(), read_packet_check_header(), and setup_connection().

int read_packet_check_header ( int  sock,
size_t  datasize,
long long int  curhandle 
)

int setup_connection ( gchar *  hostname,
int  port,
gchar *  name,
CONNECTION_TYPE  ctype 
)

int throughput_test ( gchar *  hostname,
int  port,
char *  name,
int  sock,
char  sock_is_open,
char  close_sock 
)


Variable Documentation

gchar errstr[1024] [static]

const int errstr_len = 1024 [static]

uint64_t size [static]

Definition at line 44 of file nbd-tester-client.c.

Referenced by setmysockopt(), setsizes(), setup_connection(), and throughput_test().


Generated on Wed Aug 6 08:11:12 2014 for Network Block Device by  doxygen 1.5.6