nbd-tester-client.c File Reference

#include <stdlib.h>
#include <stdio.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"

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, 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 throughput_test (gchar *hostname, int port, 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

Define Documentation

#define MY_NAME   "nbd-tester-client"

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


Enumeration Type Documentation

enum CLOSE_TYPE
Enumerator:
CONNECTION_CLOSE_PROPERLY 
CONNECTION_CLOSE_FAST 

Definition at line 51 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 43 of file nbd-tester-client.c.


Function Documentation

int close_connection ( int  sock,
CLOSE_TYPE  type 
)

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

References CONNECTION_CLOSE_FAST, CONNECTION_CLOSE_PROPERLY, errstr, and errstr_len.

Referenced by throughput_test().

int main ( int  argc,
char **  argv 
)

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

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

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

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

References errstr, and errstr_len.

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

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

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

References errstr, errstr_len, and read_all().

Referenced by throughput_test().

int setup_connection ( gchar *  hostname,
int  port,
CONNECTION_TYPE  ctype 
)
int throughput_test ( gchar *  hostname,
int  port,
int  sock,
char  sock_is_open,
char  close_sock 
)

Variable Documentation

gchar errstr[1024] [static]
const int errstr_len = 1024 [static]
Generated on Mon Jul 5 13:04:48 2010 for Network Block Device by  doxygen 1.6.3