Motr  M0
main.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "motr/init.h"
#include "lib/assert.h"
#include "lib/errno.h"
#include "lib/getopts.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/thread.h"
#include "net/net.h"
#include "net/bulk_mem.h"
#include "ping.h"
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  ping_xprt
 
struct  client_params
 

Enumerations

enum  {
  DEF_BUFS = 20, DEF_CLIENT_THREADS = 1, MAX_CLIENT_THREADS = 4196, DEF_LOOPS = 1,
  PING_CLIENT_SEGMENTS = 8, PING_CLIENT_SEGMENT_SIZE = 8192, PING_SERVER_SEGMENTS = 4, PING_SERVER_SEGMENT_SIZE = 16384,
  MEM_CLIENT_BASE_PORT = PING_PORT2, ONE_MILLION = 1000000ULL, SEC_PER_HR = 60 * 60, SEC_PER_MIN = 60
}
 

Functions

int canon_host (const char *hostname, char *buf, size_t bufsiz)
 
int lookup_xprt (const char *xprt_name, struct ping_xprt **xprt)
 
void list_xprt_names (FILE *s, struct ping_xprt *def)
 
void print_qstats (struct ping_ctx *ctx, bool reset)
 
int quiet_printf (const char *fmt,...)
 
void client (struct client_params *params)
 
int main (int argc, char *argv[])
 

Variables

struct ping_xprt xprts [1]
 
struct ping_ctx sctx
 
struct m0_mutex qstats_mutex
 
struct ping_ops verbose_ops
 
struct ping_ops quiet_ops
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEF_BUFS 
DEF_CLIENT_THREADS 
MAX_CLIENT_THREADS 
DEF_LOOPS 
PING_CLIENT_SEGMENTS 
PING_CLIENT_SEGMENT_SIZE 
PING_SERVER_SEGMENTS 
PING_SERVER_SEGMENT_SIZE 
MEM_CLIENT_BASE_PORT 
ONE_MILLION 
SEC_PER_HR 
SEC_PER_MIN 

Definition at line 45 of file main.c.

Function Documentation

◆ canon_host()

int canon_host ( const char *  hostname,
char *  buf,
size_t  bufsiz 
)

Definition at line 86 of file main.c.

Here is the caller graph for this function:

◆ client()

void client ( struct client_params params)

Definition at line 233 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ list_xprt_names()

void list_xprt_names ( FILE *  s,
struct ping_xprt def 
)

Definition at line 145 of file main.c.

Here is the caller graph for this function:

◆ lookup_xprt()

int lookup_xprt ( const char *  xprt_name,
struct ping_xprt **  xprt 
)

Definition at line 133 of file main.c.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 304 of file main.c.

Here is the call graph for this function:

◆ print_qstats()

void print_qstats ( struct ping_ctx ctx,
bool  reset 
)

Definition at line 157 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quiet_printf()

int quiet_printf ( const char *  fmt,
  ... 
)

Definition at line 205 of file main.c.

Variable Documentation

◆ qstats_mutex

struct m0_mutex qstats_mutex

Definition at line 155 of file main.c.

◆ quiet_ops

struct ping_ops quiet_ops
Initial value:
= {
.pf = quiet_printf,
.pqs = print_qstats
}
int quiet_printf(const char *fmt,...)
Definition: main.c:205
void print_qstats(struct ping_ctx *ctx, bool reset)
Definition: main.c:157

Definition at line 215 of file main.c.

◆ sctx

struct ping_ctx sctx
Initial value:
= {
.pc_tm = {
.ntm_state = M0_NET_TM_UNDEFINED
}
}

Definition at line 80 of file main.c.

◆ verbose_ops

struct ping_ops verbose_ops
Initial value:
= {
.pf = printf,
.pqs = print_qstats
}
void print_qstats(struct ping_ctx *ctx, bool reset)
Definition: main.c:157

Definition at line 210 of file main.c.

◆ xprts

struct ping_xprt xprts[1]
Initial value:
= {
{
.px_xprt = &m0_net_bulk_mem_xprt,
.px_dual_only = true,
.px_3part_addr = false,
.px_client_port = MEM_CLIENT_BASE_PORT,
},
}
const struct m0_net_xprt m0_net_bulk_mem_xprt
Definition: mem_xprt_xo.c:761

Definition at line 71 of file main.c.