Remote Procedure Calls

Remote Procedure Calls — Making and servicing remote procedure calls

Synopsis


#include <nhproxy/nhproxy.h>


#define     NHPROXY_PARAM_INT
#define     NHPROXY_PARAM_LONG
#define     NHPROXY_PARAM_STRING
#define     NHPROXY_PARAM_BYTES
#define     NHPROXY_PARAM_BOOLEAN
#define     NHPROXY_PARAM_CHAR
#define     NHPROXY_PARAM_XDRF
#define     NHPROXY_PARAM_PTR
#define     NHPROXY_INT                     (i)
#define     NHPROXY_LONG                    (l)
#define     NHPROXY_STRING                  (s)
#define     NHPROXY_BYTES                   (buf, nb)
#define     NHPROXY_BOOLEAN                 (b)
#define     NHPROXY_CHAR                    (c)
#define     NHPROXY_XDRF                    (func, data)
#define     NHPROXY_INT_PTR                 (i)
#define     NHPROXY_LONG_PTR                (l)
#define     NHPROXY_STRING_PTR              (s)
#define     NHPROXY_BYTES_PTR               (buf, nb)
#define     NHPROXY_BOOLEAN_PTR             (b)
#define     NHPROXY_CHAR_PTR                (c)
#define     NHPROXY_SPECIAL_ERROR
#define     NHPROXY_ERROR_EXT_UNSUPPORTED
#define     NHPROXY_ERROR_EXT_UNAVAILABLE
#define     NHPROXY_ERROR_EXT_INVALIDENCODING
#define     NHPROXY_ERROR_EXT_INVALIDPARAMS
#define     NHPROXY_ERROR_EXT_RESOURCEFAILURE
#define     NHPROXY_ERROR_GENERIC
#define     NHPROXY_ERROR_INTERNAL
#define     NHPROXY_ERROR_COMMS
#define     NHPROXY_ERROR_NOTSUPPORTED
#define     NHPROXY_ERROR_PROTOCOL
struct      nhproxy_line;
void        (*nhproxy_rpc_errhandler)       (int type,
                                             const char *error);
nhproxy_bool_t nhproxy_rpc_init             (NhProxyIO *rd,
                                             NhProxyIO *wr,
                                             struct nhproxy_rpc_services *cb);
nhproxy_bool_t nhproxy_rpc_set_protocol     (int protocol);
nhproxy_bool_t nhproxy_rpc_async_mode       (void);
void        nhproxy_rpc_end                 (void);
nhproxy_rpc_errhandler nhproxy_rpc_set_errhandler
                                            (nhproxy_rpc_errhandler new);
nhproxy_bool_t nhproxy_rpc_params           (NhProxyXdr *xdrs,
                                             int no,
                                             ...);
nhproxy_bool_t nhproxy_rpc                  (unsigned short id,
                                             ...);
struct      nhproxy_rpc_services;
int         nhproxy_rpc_svc                 (struct nhproxy_rpc_services *services);
void        nhproxy_rpc_set_async_masks     (int n,
                                             unsigned long *masks);
void        nhproxy_rpc_set_unsupported     (int id);
unsigned short nhproxy_rpc_get_next_serial  (void);
unsigned short nhproxy_rpc_svc_get_serial   (void);
void        nhproxy_rpc_send_error          (unsigned short id,
                                             unsigned char error_code);

Description

Details

NHPROXY_PARAM_INT

#define NHPROXY_PARAM_INT	0x4001


NHPROXY_PARAM_LONG

#define NHPROXY_PARAM_LONG	0x4002


NHPROXY_PARAM_STRING

#define NHPROXY_PARAM_STRING	0x4003


NHPROXY_PARAM_BYTES

#define NHPROXY_PARAM_BYTES	0x4004


NHPROXY_PARAM_BOOLEAN

#define NHPROXY_PARAM_BOOLEAN	0x4005


NHPROXY_PARAM_CHAR

#define NHPROXY_PARAM_CHAR	0x4006


NHPROXY_PARAM_XDRF

#define NHPROXY_PARAM_XDRF	0x4007


NHPROXY_PARAM_PTR

#define NHPROXY_PARAM_PTR	0x8000


NHPROXY_INT()

#define NHPROXY_INT(i)		NHPROXY_PARAM_INT, i

i :

NHPROXY_LONG()

#define NHPROXY_LONG(l)		NHPROXY_PARAM_LONG, l

l :

NHPROXY_STRING()

#define NHPROXY_STRING(s)	NHPROXY_PARAM_STRING, (s) ? (s) : ""

s :

NHPROXY_BYTES()

#define NHPROXY_BYTES(buf, nb)	NHPROXY_PARAM_BYTES, buf, nb

buf :
nb :

NHPROXY_BOOLEAN()

#define NHPROXY_BOOLEAN(b)	NHPROXY_PARAM_BOOLEAN, b

b :

NHPROXY_CHAR()

#define NHPROXY_CHAR(c)		NHPROXY_PARAM_CHAR, c

c :

NHPROXY_XDRF()

#define NHPROXY_XDRF(func, data)	NHPROXY_PARAM_XDRF, func, data

func :
data :

NHPROXY_INT_PTR()

#define NHPROXY_INT_PTR(i)	NHPROXY_PARAM_PTR | NHPROXY_PARAM_INT, &(i)

i :

NHPROXY_LONG_PTR()

#define NHPROXY_LONG_PTR(l)	NHPROXY_PARAM_PTR | NHPROXY_PARAM_LONG, &(l)

l :

NHPROXY_STRING_PTR()

#define NHPROXY_STRING_PTR(s)	NHPROXY_PARAM_PTR | NHPROXY_PARAM_STRING, &(s)

s :

NHPROXY_BYTES_PTR()

#define     NHPROXY_BYTES_PTR(buf, nb)

buf :
nb :

NHPROXY_BOOLEAN_PTR()

#define NHPROXY_BOOLEAN_PTR(b)	NHPROXY_PARAM_PTR | NHPROXY_PARAM_BOOLEAN, &(b)

b :

NHPROXY_CHAR_PTR()

#define NHPROXY_CHAR_PTR(c)	NHPROXY_PARAM_PTR | NHPROXY_PARAM_CHAR, &(c)

c :

NHPROXY_SPECIAL_ERROR

#define NHPROXY_SPECIAL_ERROR			0


NHPROXY_ERROR_EXT_UNSUPPORTED

#define NHPROXY_ERROR_EXT_UNSUPPORTED		1


NHPROXY_ERROR_EXT_UNAVAILABLE

#define NHPROXY_ERROR_EXT_UNAVAILABLE		2


NHPROXY_ERROR_EXT_INVALIDENCODING

#define NHPROXY_ERROR_EXT_INVALIDENCODING	3


NHPROXY_ERROR_EXT_INVALIDPARAMS

#define NHPROXY_ERROR_EXT_INVALIDPARAMS		4


NHPROXY_ERROR_EXT_RESOURCEFAILURE

#define NHPROXY_ERROR_EXT_RESOURCEFAILURE	5


NHPROXY_ERROR_GENERIC

#define NHPROXY_ERROR_GENERIC			0x100


NHPROXY_ERROR_INTERNAL

#define NHPROXY_ERROR_INTERNAL			0x101


NHPROXY_ERROR_COMMS

#define NHPROXY_ERROR_COMMS			0x102


NHPROXY_ERROR_NOTSUPPORTED

#define NHPROXY_ERROR_NOTSUPPORTED		0x103


NHPROXY_ERROR_PROTOCOL

#define NHPROXY_ERROR_PROTOCOL			0x104


struct nhproxy_line

struct nhproxy_line {
    char *type;
    int n;
    char **tags, **values;
};


nhproxy_rpc_errhandler ()

void        (*nhproxy_rpc_errhandler)       (int type,
                                             const char *error);

type :
error :

nhproxy_rpc_init ()

nhproxy_bool_t nhproxy_rpc_init             (NhProxyIO *rd,
                                             NhProxyIO *wr,
                                             struct nhproxy_rpc_services *cb);

rd :
wr :
cb :
Returns :

nhproxy_rpc_set_protocol ()

nhproxy_bool_t nhproxy_rpc_set_protocol     (int protocol);

protocol :
Returns :

nhproxy_rpc_async_mode ()

nhproxy_bool_t nhproxy_rpc_async_mode       (void);

Returns :

nhproxy_rpc_end ()

void        nhproxy_rpc_end                 (void);


nhproxy_rpc_set_errhandler ()

nhproxy_rpc_errhandler nhproxy_rpc_set_errhandler
                                            (nhproxy_rpc_errhandler new);

new :
Returns :

nhproxy_rpc_params ()

nhproxy_bool_t nhproxy_rpc_params           (NhProxyXdr *xdrs,
                                             int no,
                                             ...);

xdrs :
no :
... :
Returns :

nhproxy_rpc ()

nhproxy_bool_t nhproxy_rpc                  (unsigned short id,
                                             ...);

Param1 :
... :
Returns :

struct nhproxy_rpc_services

struct nhproxy_rpc_services {
    unsigned short id;
    void (*handler)(unsigned short, NhProxyXdr *,
      NhProxyXdr *);
};


nhproxy_rpc_svc ()

int         nhproxy_rpc_svc                 (struct nhproxy_rpc_services *services);

services :
Returns :

nhproxy_rpc_set_async_masks ()

void        nhproxy_rpc_set_async_masks     (int n,
                                             unsigned long *masks);

n :
masks :

nhproxy_rpc_set_unsupported ()

void        nhproxy_rpc_set_unsupported     (int id);

id :

nhproxy_rpc_get_next_serial ()

unsigned short nhproxy_rpc_get_next_serial  (void);

Returns :

nhproxy_rpc_svc_get_serial ()

unsigned short nhproxy_rpc_svc_get_serial   (void);

Returns :

nhproxy_rpc_send_error ()

void        nhproxy_rpc_send_error          (unsigned short id,
                                             unsigned char error_code);

Param1 :
error_code :