glusterfs  8.2
About: GlusterFS is a network/cluster filesystem. The storage server (or each in a cluster) runs glusterfsd and the clients use mount command or glusterfs client to mount the exported filesystem. Release series 8.x (latest version).
  Fossies Dox: glusterfs-8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rpc-transport.h File Reference
#include <inttypes.h>
#include <rpc/rpc.h>
#include <rpc/rpc_msg.h>
#include <glusterfs/dict.h>
#include <glusterfs/compat.h>
#include <glusterfs/async.h>
#include "rpcsvc-common.h"
Include dependency graph for rpc-transport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  peer_info
 
struct  rpc_transport_msg
 
struct  rpc_transport_rsp
 
struct  rpc_transport_req
 
struct  rpc_transport_reply
 
struct  rpc_transport_data
 
struct  rpc_request_info
 
struct  rpc_transport
 
struct  rpc_transport_pollin
 
struct  rpc_transport_ops
 

Macros

#define MAX_IOVEC   16
 
#define AI_ADDRCONFIG   0
 
#define RPC_LASTFRAG(fraghdr)   ((uint32_t)(fraghdr & 0x80000000U))
 
#define RPC_FRAGSIZE(fraghdr)   ((uint32_t)(fraghdr & 0x7fffffffU))
 
#define RPC_FRAGHDR_SIZE   4
 
#define RPC_MSGTYPE_SIZE   8
 
#define RPC_CALL_BODY_SIZE   24
 
#define RPC_REPLY_STATUS_SIZE   4
 
#define RPC_AUTH_FLAVOUR_N_LENGTH_SIZE   8
 
#define RPC_ACCEPT_STATUS_LEN   4
 

Typedefs

typedef struct rpc_transport rpc_transport_t
 
typedef struct peer_info peer_info_t
 
typedef enum msg_type msg_type_t
 
typedef struct rpc_transport_msg rpc_transport_msg_t
 
typedef struct rpc_transport_rsp rpc_transport_rsp_t
 
typedef struct rpc_transport_req rpc_transport_req_t
 
typedef struct rpc_transport_reply rpc_transport_reply_t
 
typedef struct rpc_transport_data rpc_transport_data_t
 
typedef struct rpc_request_info rpc_request_info_t
 
typedef int(* rpc_transport_notify_t) (rpc_transport_t *, void *mydata, rpc_transport_event_t, void *data,...)
 
typedef struct rpc_transport_pollin rpc_transport_pollin_t
 

Enumerations

enum  rpc_transport_event_t {
  RPC_TRANSPORT_ACCEPT, RPC_TRANSPORT_DISCONNECT, RPC_TRANSPORT_CLEANUP, RPC_TRANSPORT_MAP_XID_REQUEST,
  RPC_TRANSPORT_MSG_RECEIVED, RPC_TRANSPORT_CONNECT, RPC_TRANSPORT_MSG_SENT, RPC_TRANSPORT_EVENT_THREAD_DIED
}
 

Functions

int32_t rpc_transport_count (const char *transport_type)
 
int32_t rpc_transport_listen (rpc_transport_t *this)
 
int32_t rpc_transport_connect (rpc_transport_t *this, int port)
 
int32_t rpc_transport_disconnect (rpc_transport_t *this, bool wait)
 
int32_t rpc_transport_notify (rpc_transport_t *this, rpc_transport_event_t event, void *data,...)
 
int32_t rpc_transport_submit_request (rpc_transport_t *this, rpc_transport_req_t *req)
 
int32_t rpc_transport_submit_reply (rpc_transport_t *this, rpc_transport_reply_t *reply)
 
rpc_transport_trpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *name)
 
rpc_transport_trpc_transport_ref (rpc_transport_t *trans)
 
int32_t rpc_transport_unref (rpc_transport_t *trans)
 
int rpc_transport_register_notify (rpc_transport_t *trans, rpc_transport_notify_t, void *mydata)
 
int32_t rpc_transport_get_peername (rpc_transport_t *this, char *hostname, int hostlen)
 
int32_t rpc_transport_get_peeraddr (rpc_transport_t *this, char *peeraddr, int addrlen, struct sockaddr_storage *sa, size_t salen)
 
int32_t rpc_transport_get_myaddr (rpc_transport_t *this, char *peeraddr, int addrlen, struct sockaddr_storage *sa, size_t salen)
 
int rpc_transport_throttle (rpc_transport_t *this, bool onoff)
 
rpc_transport_pollin_trpc_transport_pollin_alloc (rpc_transport_t *this, struct iovec *vector, int count, struct iobuf *hdr_iobuf, struct iobref *iobref, void *private)
 
void rpc_transport_pollin_destroy (rpc_transport_pollin_t *pollin)
 
int rpc_transport_keepalive_options_set (dict_t *options, int32_t interval, int32_t time, int32_t timeout)
 
int rpc_transport_unix_options_build (dict_t *options, char *filepath, int frame_timeout)
 
int rpc_transport_inet_options_build (dict_t *options, const char *hostname, int port, char *af)
 
void rpc_transport_cleanup (rpc_transport_t *)
 

Macro Definition Documentation

◆ AI_ADDRCONFIG

#define AI_ADDRCONFIG   0

Definition at line 28 of file rpc-transport.h.

◆ MAX_IOVEC

#define MAX_IOVEC   16

Definition at line 24 of file rpc-transport.h.

◆ RPC_ACCEPT_STATUS_LEN

#define RPC_ACCEPT_STATUS_LEN   4

Definition at line 54 of file rpc-transport.h.

◆ RPC_AUTH_FLAVOUR_N_LENGTH_SIZE

#define RPC_AUTH_FLAVOUR_N_LENGTH_SIZE   8

Definition at line 52 of file rpc-transport.h.

◆ RPC_CALL_BODY_SIZE

#define RPC_CALL_BODY_SIZE   24

Definition at line 48 of file rpc-transport.h.

◆ RPC_FRAGHDR_SIZE

#define RPC_FRAGHDR_SIZE   4

Definition at line 44 of file rpc-transport.h.

◆ RPC_FRAGSIZE

#define RPC_FRAGSIZE (   fraghdr)    ((uint32_t)(fraghdr & 0x7fffffffU))

Definition at line 42 of file rpc-transport.h.

◆ RPC_LASTFRAG

#define RPC_LASTFRAG (   fraghdr)    ((uint32_t)(fraghdr & 0x80000000U))

Definition at line 37 of file rpc-transport.h.

◆ RPC_MSGTYPE_SIZE

#define RPC_MSGTYPE_SIZE   8

Definition at line 45 of file rpc-transport.h.

◆ RPC_REPLY_STATUS_SIZE

#define RPC_REPLY_STATUS_SIZE   4

Definition at line 50 of file rpc-transport.h.

Typedef Documentation

◆ msg_type_t

typedef enum msg_type msg_type_t

Definition at line 1 of file rpc-transport.h.

◆ peer_info_t

typedef struct peer_info peer_info_t

Definition at line 1 of file rpc-transport.h.

◆ rpc_request_info_t

Definition at line 1 of file rpc-transport.h.

◆ rpc_transport_data_t

Definition at line 1 of file rpc-transport.h.

◆ rpc_transport_msg_t

Definition at line 1 of file rpc-transport.h.

◆ rpc_transport_notify_t

typedef int(* rpc_transport_notify_t) (rpc_transport_t *, void *mydata, rpc_transport_event_t, void *data,...)

Definition at line 159 of file rpc-transport.h.

◆ rpc_transport_pollin_t

Definition at line 159 of file rpc-transport.h.

◆ rpc_transport_reply_t

Definition at line 1 of file rpc-transport.h.

◆ rpc_transport_req_t

Definition at line 1 of file rpc-transport.h.

◆ rpc_transport_rsp_t

Definition at line 1 of file rpc-transport.h.

◆ rpc_transport_t

Definition at line 1 of file rpc-transport.h.

Enumeration Type Documentation

◆ rpc_transport_event_t

Enumerator
RPC_TRANSPORT_ACCEPT 
RPC_TRANSPORT_DISCONNECT 
RPC_TRANSPORT_CLEANUP 
RPC_TRANSPORT_MAP_XID_REQUEST 
RPC_TRANSPORT_MSG_RECEIVED 
RPC_TRANSPORT_CONNECT 
RPC_TRANSPORT_MSG_SENT 
RPC_TRANSPORT_EVENT_THREAD_DIED 

Definition at line 78 of file rpc-transport.h.

Function Documentation

◆ rpc_transport_cleanup()

◆ rpc_transport_connect()

int32_t rpc_transport_connect ( rpc_transport_t this,
int  port 
)

◆ rpc_transport_count()

int32_t rpc_transport_count ( const char *  transport_type)

Definition at line 24 of file rpc-transport.c.

References GF_FREE, and gf_strdup().

Referenced by init(), and server_init().

◆ rpc_transport_disconnect()

◆ rpc_transport_get_myaddr()

int32_t rpc_transport_get_myaddr ( rpc_transport_t this,
char *  peeraddr,
int  addrlen,
struct sockaddr_storage *  sa,
size_t  salen 
)

Definition at line 50 of file rpc-transport.c.

References GF_VALIDATE_OR_GOTO, generator::ops, and out.

◆ rpc_transport_get_peeraddr()

int32_t rpc_transport_get_peeraddr ( rpc_transport_t this,
char *  peeraddr,
int  addrlen,
struct sockaddr_storage *  sa,
size_t  salen 
)

◆ rpc_transport_get_peername()

int32_t rpc_transport_get_peername ( rpc_transport_t this,
char *  hostname,
int  hostlen 
)

Definition at line 63 of file rpc-transport.c.

References GF_VALIDATE_OR_GOTO, generator::ops, and out.

Referenced by rpcsvc_transport_peername().

◆ rpc_transport_inet_options_build()

int rpc_transport_inet_options_build ( dict_t options,
const char *  hostname,
int  port,
char *  af 
)

◆ rpc_transport_keepalive_options_set()

int rpc_transport_keepalive_options_set ( dict_t options,
int32_t  interval,
int32_t  time,
int32_t  timeout 
)

Definition at line 547 of file rpc-transport.c.

References dict_set_int32_sizen, GF_ASSERT, options, and out.

Referenced by glusterd_transport_inet_options_build().

◆ rpc_transport_listen()

int32_t rpc_transport_listen ( rpc_transport_t this)

Definition at line 418 of file rpc-transport.c.

References src.utils::fail(), GF_VALIDATE_OR_GOTO, and generator::ops.

Referenced by rpcsvc_create_listener().

◆ rpc_transport_load()

◆ rpc_transport_notify()

◆ rpc_transport_pollin_alloc()

rpc_transport_pollin_t* rpc_transport_pollin_alloc ( rpc_transport_t this,
struct iovec *  vector,
int  count,
struct iobuf hdr_iobuf,
struct iobref iobref,
void *  private 
)

◆ rpc_transport_pollin_destroy()

void rpc_transport_pollin_destroy ( rpc_transport_pollin_t pollin)

◆ rpc_transport_ref()

◆ rpc_transport_register_notify()

int rpc_transport_register_notify ( rpc_transport_t trans,
rpc_transport_notify_t  notify,
void *  mydata 
)

◆ rpc_transport_submit_reply()

int32_t rpc_transport_submit_reply ( rpc_transport_t this,
rpc_transport_reply_t reply 
)

Definition at line 393 of file rpc-transport.c.

References src.utils::fail(), GF_VALIDATE_OR_GOTO, and generator::ops.

Referenced by rpcsvc_transport_submit().

◆ rpc_transport_submit_request()

int32_t rpc_transport_submit_request ( rpc_transport_t this,
rpc_transport_req_t req 
)

Definition at line 380 of file rpc-transport.c.

References src.utils::fail(), GF_VALIDATE_OR_GOTO, and generator::ops.

Referenced by rpc_clnt_submit(), and rpcsvc_callback_submit().

◆ rpc_transport_throttle()

int rpc_transport_throttle ( rpc_transport_t this,
bool  onoff 
)

Definition at line 74 of file rpc-transport.c.

References generator::ops.

Referenced by rpcsvc_request_outstanding().

◆ rpc_transport_unix_options_build()

◆ rpc_transport_unref()