Motr  M0
fdmi_echo.c File Reference
#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 "lib/time.h"
#include "motr/init.h"
#include "reqh/reqh.h"
#include "net/net.h"
#include "net/lnet/lnet.h"
#include "fop/fop.h"
#include "rpc/rpc.h"
#include "rpc/rpclib.h"
#include "ut/cs_service.h"
#include "fop/fom_generic.h"
#include "fdmi/fdmi.h"
#include "fdmi/fops.h"
#include "fdmi/plugin_dock.h"
#include "fol/fol.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "module/instance.h"
Include dependency graph for fdmi_echo.c:

Go to the source code of this file.

Data Structures

struct  fdmi_plugin_ctx
 

Macros

#define SERVER_DB_FILE_NAME   "echo_plugin_server.db"
 
#define SERVER_STOB_FILE_NAME   "echo_plugin_server.stob"
 
#define SERVER_ADDB_STOB_FILE_NAME   "linuxstob:echo_plugin_server_addb.stob"
 
#define SERVER_LOG_FILE_NAME   "echo_plugin.log"
 

Enumerations

enum  { BUF_LEN = 128, M0_LNET_PORTAL = 34, MAX_RPCS_IN_FLIGHT = 32, MAX_RETRIES = 10 }
 

Functions

static int build_endpoint_addr (char *out_buf, size_t buf_size)
 
static void quit_dialog (void)
 
static int int2str (char *dest, size_t size, int src, int defval)
 
int handle_fdmi_rec_not (struct m0_uint128 *rec_id, struct m0_buf fdmi_rec, struct m0_fid filter_id)
 
static int init_plugin (struct fdmi_plugin_ctx *ctx, const char *fname)
 
static void deinit_plugin (struct fdmi_plugin_ctx *ctx)
 
static int run_server (void)
 
int main (int argc, char *argv[])
 

Variables

static struct m0 instance
 
const char g_filenane [] = "/tmp/fdmi_plugin.txt"
 
struct fdmi_plugin_ctx g_plugin_ctx
 
static bool verbose = false
 
static char * server_nid = "10.0.2.15@tcp"
 
static int server_tmid = 1
 
static int tm_recv_queue_len = M0_NET_TM_RECV_QUEUE_DEF_LEN
 
static int max_rpc_msg_size = M0_RPC_DEF_MAX_RPC_MSG_SIZE
 
static char server_endpoint [M0_NET_LNET_XEP_ADDR_LEN]
 

Macro Definition Documentation

◆ SERVER_ADDB_STOB_FILE_NAME

#define SERVER_ADDB_STOB_FILE_NAME   "linuxstob:echo_plugin_server_addb.stob"

Definition at line 55 of file fdmi_echo.c.

◆ SERVER_DB_FILE_NAME

#define SERVER_DB_FILE_NAME   "echo_plugin_server.db"

Definition at line 53 of file fdmi_echo.c.

◆ SERVER_LOG_FILE_NAME

#define SERVER_LOG_FILE_NAME   "echo_plugin.log"

Definition at line 56 of file fdmi_echo.c.

◆ SERVER_STOB_FILE_NAME

#define SERVER_STOB_FILE_NAME   "echo_plugin_server.stob"

Definition at line 54 of file fdmi_echo.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BUF_LEN 
M0_LNET_PORTAL 
MAX_RPCS_IN_FLIGHT 
MAX_RETRIES 

Definition at line 72 of file fdmi_echo.c.

Function Documentation

◆ build_endpoint_addr()

static int build_endpoint_addr ( char *  out_buf,
size_t  buf_size 
)
static

Definition at line 90 of file fdmi_echo.c.

Here is the caller graph for this function:

◆ deinit_plugin()

static void deinit_plugin ( struct fdmi_plugin_ctx ctx)
static

Definition at line 222 of file fdmi_echo.c.

Here is the caller graph for this function:

◆ handle_fdmi_rec_not()

int handle_fdmi_rec_not ( struct m0_uint128 rec_id,
struct m0_buf  fdmi_rec,
struct m0_fid  filter_id 
)
Todo:
Call decode for fdmi record type (frt_rec_decode)
Todo:
Consider special ret code if processing is complete ?

Definition at line 134 of file fdmi_echo.c.

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

◆ init_plugin()

static int init_plugin ( struct fdmi_plugin_ctx ctx,
const char *  fname 
)
static

Definition at line 171 of file fdmi_echo.c.

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

◆ int2str()

static int int2str ( char *  dest,
size_t  size,
int  src,
int  defval 
)
static

Definition at line 127 of file fdmi_echo.c.

Here is the caller graph for this function:

◆ main()

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

Definition at line 301 of file fdmi_echo.c.

Here is the call graph for this function:

◆ quit_dialog()

static void quit_dialog ( void  )
static

Definition at line 114 of file fdmi_echo.c.

Here is the caller graph for this function:

◆ run_server()

static int run_server ( void  )
static

Definition at line 233 of file fdmi_echo.c.

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

Variable Documentation

◆ g_filenane

const char g_filenane[] = "/tmp/fdmi_plugin.txt"

Definition at line 60 of file fdmi_echo.c.

◆ g_plugin_ctx

struct fdmi_plugin_ctx g_plugin_ctx

Definition at line 70 of file fdmi_echo.c.

◆ instance

struct m0 instance
static

Definition at line 58 of file fdmi_echo.c.

◆ max_rpc_msg_size

int max_rpc_msg_size = M0_RPC_DEF_MAX_RPC_MSG_SIZE
static

Definition at line 86 of file fdmi_echo.c.

◆ server_endpoint

char server_endpoint[M0_NET_LNET_XEP_ADDR_LEN]
static

Definition at line 88 of file fdmi_echo.c.

◆ server_nid

char* server_nid = "10.0.2.15@tcp"
static

Definition at line 81 of file fdmi_echo.c.

◆ server_tmid

int server_tmid = 1
static

Definition at line 84 of file fdmi_echo.c.

◆ tm_recv_queue_len

int tm_recv_queue_len = M0_NET_TM_RECV_QUEUE_DEF_LEN
static

Definition at line 85 of file fdmi_echo.c.

◆ verbose

bool verbose = false
static

Definition at line 80 of file fdmi_echo.c.