Mercury
Classes | Macros | Functions
mercury_proc_header.h File Reference
#include "mercury_types.h"
Include dependency graph for mercury_proc_header.h:

Go to the source code of this file.

Classes

struct  hg_header_request
 
struct  hg_header_response
 

Macros

#define HG_IDENTIFIER   (('H' << 1) | ('G')) /* 0xD7 */
 
#define HG_PROTOCOL_VERSION   0x00000002
 
#define HG_GET_MAJOR(value)   ((value >> 24) & 0xFF)
 
#define HG_GET_MINOR(value)   ((value >> 16) & 0xFF)
 
#define HG_GET_PATCH(value)   (value & 0xFFFF)
 
#define HG_VERSION
 
#define HG_PROC_HEADER_INLINE   HG_INLINE
 

Functions

HG_EXPORT
HG_PROC_HEADER_INLINE size_t 
hg_proc_header_request_get_size (void)
 Get size reserved for request header (separate user data stored in payload). More...
 
HG_EXPORT
HG_PROC_HEADER_INLINE size_t 
hg_proc_header_response_get_size (void)
 Get size reserved for response header (separate user data stored in payload). More...
 
HG_EXPORT void hg_proc_header_request_init (hg_id_t id, hg_bulk_t extra_buf_handle, struct hg_header_request *header)
 Initialize RPC request header. More...
 
HG_EXPORT void hg_proc_header_response_init (struct hg_header_response *header)
 Initialize RPC response header. More...
 
HG_EXPORT hg_return_t hg_proc_header_request (void *buf, size_t buf_size, struct hg_header_request *header, hg_proc_op_t op)
 Process private information for sending/receiving RPC request. More...
 
HG_EXPORT hg_return_t hg_proc_header_response (void *buf, size_t buf_size, struct hg_header_response *header, hg_proc_op_t op)
 Process private information for sending/receiving response. More...
 
HG_EXPORT hg_return_t hg_proc_header_request_verify (struct hg_header_request header)
 Verify private information from request header. More...
 
HG_EXPORT hg_return_t hg_proc_header_response_verify (struct hg_header_response header)
 Verify private information from response header. More...
 

Macro Definition Documentation

#define HG_IDENTIFIER   (('H' << 1) | ('G')) /* 0xD7 */

Definition at line 52 of file mercury_proc_header.h.

#define HG_PROTOCOL_VERSION   0x00000002

Definition at line 55 of file mercury_proc_header.h.

#define HG_GET_MAJOR (   value)    ((value >> 24) & 0xFF)

Definition at line 58 of file mercury_proc_header.h.

#define HG_GET_MINOR (   value)    ((value >> 16) & 0xFF)

Definition at line 59 of file mercury_proc_header.h.

#define HG_GET_PATCH (   value)    (value & 0xFFFF)

Definition at line 60 of file mercury_proc_header.h.

#define HG_VERSION
Value:
((HG_VERSION_MAJOR << 24) | (HG_VERSION_MINOR << 16) \
| HG_VERSION_PATCH)

Definition at line 61 of file mercury_proc_header.h.

#define HG_PROC_HEADER_INLINE   HG_INLINE

Definition at line 68 of file mercury_proc_header.h.

Function Documentation

HG_PROC_HEADER_INLINE size_t hg_proc_header_request_get_size ( void  )

Get size reserved for request header (separate user data stored in payload).

Returns
Non-negative size value

Definition at line 85 of file mercury_proc_header.h.

HG_PROC_HEADER_INLINE size_t hg_proc_header_response_get_size ( void  )

Get size reserved for response header (separate user data stored in payload).

Returns
Non-negative size value

Definition at line 97 of file mercury_proc_header.h.

HG_EXPORT void hg_proc_header_request_init ( hg_id_t  id,
hg_bulk_t  extra_buf_handle,
struct hg_header_request header 
)

Initialize RPC request header.

Parameters
id[IN] registered function ID
extra_buf_handle[IN] extra bulk handle
header[IN/OUT] pointer to request header structure
HG_EXPORT void hg_proc_header_response_init ( struct hg_header_response header)

Initialize RPC response header.

Parameters
header[IN/OUT] pointer to response header structure
HG_EXPORT hg_return_t hg_proc_header_request ( void *  buf,
size_t  buf_size,
struct hg_header_request header,
hg_proc_op_t  op 
)

Process private information for sending/receiving RPC request.

Parameters
buf[IN/OUT] buffer
buf_size[IN] buffer size
header[IN/OUT] pointer to header structure
op[IN] operation type: HG_ENCODE / HG_DECODE
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t hg_proc_header_response ( void *  buf,
size_t  buf_size,
struct hg_header_response header,
hg_proc_op_t  op 
)

Process private information for sending/receiving response.

Parameters
buf[IN/OUT] buffer
buf_size[IN] buffer size
header[IN/OUT] pointer to header structure
op[IN] operation type: HG_ENCODE / HG_DECODE
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t hg_proc_header_request_verify ( struct hg_header_request  header)

Verify private information from request header.

Parameters
header[IN] request header structure
Returns
HG_SUCCESS or corresponding HG error code
HG_EXPORT hg_return_t hg_proc_header_response_verify ( struct hg_header_response  header)

Verify private information from response header.

Parameters
header[IN] response header structure
Returns
HG_SUCCESS or corresponding HG error code