diff options
author | Niels de Vos <ndevos@redhat.com> | 2017-03-13 14:01:24 +0100 |
---|---|---|
committer | Niels de Vos <ndevos@redhat.com> | 2017-03-17 15:11:09 +0100 |
commit | 5d3d0bc59c1115117e6e624d12227d53a474b2ec (patch) | |
tree | 85139ac97fa680ce3b52c1ff4250bb29069a12a9 /rpc/block.h | |
parent | 30e5f195a1b80ffe304b2ed70e0a2d8253d0cc42 (diff) |
build: use rpcgen to generate all XDR code
Remove all generated files and have them generated when needed. This
build a libgbrpcxdr.la archive with the .o files that gets linked into
the libgbrpc.la archive. 'rpcgen' generates .c code that triggers
warnings for various compilers. This is not something that can easily be
fixed, so add rpc-pragmas.h (like GlusterFS does) to prevent these
warnings.
There are some functions used by gluster-blockd.c that are not part of
the header and were manually added to block.h. Because block.h get
regenerated now, these functions have been added to a new file
block_svc.h.
Note that generated and compiled files land in $(top_builddir). This
directory does not need to be the same as $(top_srcdir).
Change-Id: I0e764d159d6d785699537eed4e24b16883218038
Fixes: #2
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'rpc/block.h')
-rw-r--r-- | rpc/block.h | 173 |
1 files changed, 0 insertions, 173 deletions
diff --git a/rpc/block.h b/rpc/block.h deleted file mode 100644 index fcf6832..0000000 --- a/rpc/block.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Please do not edit this file. - * It was generated using rpcgen. - */ - -#ifndef _BLOCK_H_RPCGEN -#define _BLOCK_H_RPCGEN - -#include <rpc/rpc.h> - - -#ifdef __cplusplus -extern "C" { -#endif - - -struct blockCreate { - char ipaddr[255]; - char volume[255]; - char gbid[127]; - u_quad_t size; - char block_name[255]; -}; -typedef struct blockCreate blockCreate; - -struct blockCreateCli { - char volume[255]; - u_quad_t size; - u_int mpath; - char block_name[255]; - char *block_hosts; -}; -typedef struct blockCreateCli blockCreateCli; - -struct blockDeleteCli { - char block_name[255]; - char volume[255]; -}; -typedef struct blockDeleteCli blockDeleteCli; - -struct blockDelete { - char block_name[255]; - char gbid[127]; -}; -typedef struct blockDelete blockDelete; - -struct blockInfoCli { - char block_name[255]; - char volume[255]; -}; -typedef struct blockInfoCli blockInfoCli; - -struct blockListCli { - char volume[255]; - u_quad_t offset; -}; -typedef struct blockListCli blockListCli; - -struct blockResponse { - int exit; - char *out; - u_quad_t offset; - struct { - u_int xdata_len; - char *xdata_val; - } xdata; -}; -typedef struct blockResponse blockResponse; - -typedef struct blockServerDef { - size_t nhosts; - char **hosts; -} blockServerDef; -typedef blockServerDef *blockServerDefPtr; - -typedef enum operations { - CREATE_SRV = 1, - DELETE_SRV = 2, -} operations; - -void -gluster_block_cli_1(struct svc_req *rqstp, register SVCXPRT *transp); - -void -gluster_block_1(struct svc_req *rqstp, register SVCXPRT *transp); - - -int -glusterBlockCallRPC_1(char *host, void *cobj, operations opt, char **out); - -#define GLUSTER_BLOCK_CLI 212153113 -#define GLUSTER_BLOCK_CLI_VERS 1 - -#if defined(__STDC__) || defined(__cplusplus) -#define BLOCK_CREATE_CLI 1 -extern blockResponse * block_create_cli_1(blockCreateCli *, CLIENT *); -extern blockResponse * block_create_cli_1_svc(blockCreateCli *, struct svc_req *); -#define BLOCK_LIST_CLI 2 -extern blockResponse * block_list_cli_1(blockListCli *, CLIENT *); -extern blockResponse * block_list_cli_1_svc(blockListCli *, struct svc_req *); -#define BLOCK_INFO_CLI 3 -extern blockResponse * block_info_cli_1(blockInfoCli *, CLIENT *); -extern blockResponse * block_info_cli_1_svc(blockInfoCli *, struct svc_req *); -#define BLOCK_DELETE_CLI 4 -extern blockResponse * block_delete_cli_1(blockDeleteCli *, CLIENT *); -extern blockResponse * block_delete_cli_1_svc(blockDeleteCli *, struct svc_req *); -extern int gluster_block_cli_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define BLOCK_CREATE_CLI 1 -extern blockResponse * block_create_cli_1(); -extern blockResponse * block_create_cli_1_svc(); -#define BLOCK_LIST_CLI 2 -extern blockResponse * block_list_cli_1(); -extern blockResponse * block_list_cli_1_svc(); -#define BLOCK_INFO_CLI 3 -extern blockResponse * block_info_cli_1(); -extern blockResponse * block_info_cli_1_svc(); -#define BLOCK_DELETE_CLI 4 -extern blockResponse * block_delete_cli_1(); -extern blockResponse * block_delete_cli_1_svc(); -extern int gluster_block_cli_1_freeresult (); -#endif /* K&R C */ - -#define GLUSTER_BLOCK 21215311 -#define GLUSTER_BLOCK_VERS 1 - -#if defined(__STDC__) || defined(__cplusplus) -#define BLOCK_CREATE 1 -extern blockResponse * block_create_1(blockCreate *, CLIENT *); -extern blockResponse * block_create_1_svc(blockCreate *, struct svc_req *); -#define BLOCK_DELETE 2 -extern blockResponse * block_delete_1(blockDelete *, CLIENT *); -extern blockResponse * block_delete_1_svc(blockDelete *, struct svc_req *); -extern int gluster_block_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t); - -#else /* K&R C */ -#define BLOCK_CREATE 1 -extern blockResponse * block_create_1(); -extern blockResponse * block_create_1_svc(); -#define BLOCK_DELETE 2 -extern blockResponse * block_delete_1(); -extern blockResponse * block_delete_1_svc(); -extern int gluster_block_1_freeresult (); -#endif /* K&R C */ - -/* the xdr functions */ - -#if defined(__STDC__) || defined(__cplusplus) -extern bool_t xdr_blockCreate (XDR *, blockCreate*); -extern bool_t xdr_blockCreateCli (XDR *, blockCreateCli*); -extern bool_t xdr_blockDeleteCli (XDR *, blockDeleteCli*); -extern bool_t xdr_blockDelete (XDR *, blockDelete*); -extern bool_t xdr_blockInfoCli (XDR *, blockInfoCli*); -extern bool_t xdr_blockListCli (XDR *, blockListCli*); -extern bool_t xdr_blockResponse (XDR *, blockResponse*); - -#else /* K&R C */ -extern bool_t xdr_blockCreate (); -extern bool_t xdr_blockCreateCli (); -extern bool_t xdr_blockDeleteCli (); -extern bool_t xdr_blockDelete (); -extern bool_t xdr_blockInfoCli (); -extern bool_t xdr_blockListCli (); -extern bool_t xdr_blockResponse (); - -#endif /* K&R C */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_BLOCK_H_RPCGEN */ |