#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 MY_NAME "nbd-tester-client" |
Definition at line 34 of file nbd-tester-client.c.
enum CLOSE_TYPE |
Definition at line 51 of file nbd-tester-client.c.
enum CONNECTION_TYPE |
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.
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 | |||
) |
Definition at line 72 of file nbd-tester-client.c.
References cliserv_magic, CONNECTION_TYPE_CLISERV, CONNECTION_TYPE_CONNECT, CONNECTION_TYPE_FULL, CONNECTION_TYPE_INIT_PASSWD, err(), errstr, errstr_len, INIT_PASSWD, ntohll(), read_all(), and setmysockopt().
Referenced by throughput_test().
int throughput_test | ( | gchar * | hostname, | |
int | port, | |||
int | sock, | |||
char | sock_is_open, | |||
char | close_sock | |||
) |
Definition at line 197 of file nbd-tester-client.c.
References close_connection(), CONNECTION_CLOSE_PROPERLY, CONNECTION_TYPE_CLISERV, err(), errstr, errstr_len, htonll, ntohll(), read_all(), read_packet_check_header(), and setup_connection().
Referenced by main().
gchar errstr[1024] [static] |
Definition at line 40 of file nbd-tester-client.c.
Referenced by close_connection(), main(), read_all(), read_packet_check_header(), setup_connection(), and throughput_test().
const int errstr_len = 1024 [static] |
Definition at line 41 of file nbd-tester-client.c.
Referenced by close_connection(), read_all(), read_packet_check_header(), setup_connection(), and throughput_test().