--- libaitrpc/inc/aitrpc.h 2012/05/15 16:06:13 1.8.2.1 +++ libaitrpc/inc/aitrpc.h 2012/05/15 20:49:46 1.8.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitrpc.h,v 1.8.2.1 2012/05/15 16:06:13 misho Exp $ +* $Id: aitrpc.h,v 1.8.2.3 2012/05/15 20:49:46 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -114,39 +114,22 @@ typedef enum { typedef struct { uint8_t sess_version; - uint8_t sess_timeout; uint32_t sess_program; - uint16_t sess_process; -} __packed rpc_sess_t; /* size == 8 bytes */ + uint8_t sess_process; +} __packed rpc_sess_t; /* size == 6 bytes */ /* Server managment RPC functions ... */ -/* RPC function registration element! */ -typedef struct tagRPCFunc { - uint16_t func_tag; - uint32_t func_hash; - ait_val_t func_file; - ait_val_t func_name; - - array_t *func_vars; - - void *func_parent; - TAILQ_ENTRY(tagRPCFunc) func_node; -} rpc_func_t; - - /* Network RPC packet - Client request */ struct tagRPCCall { rpc_sess_t call_session; + uint16_t call_seq; uint16_t call_len; + uint16_t call_crc; - uint16_t call_tag; - uint32_t call_hash; - uint16_t call_argc; - union { struct { uint64_t flags; @@ -157,8 +140,10 @@ struct tagRPCCall { } call_rep; }; - uint16_t call_crc; -} __packed; /* size == 28 bytes */ + uint16_t call_tag; + uint16_t call_argc; + ait_val_t call_argv[0]; +} __packed; /* size == 24 bytes */ /* Network BLOB packet - Header */ @@ -174,6 +159,17 @@ struct tagBLOBHdr { /* Network RPC client & server elements */ +/* RPC function registration element! */ +typedef struct tagRPCFunc { + ait_val_t func_name; + + array_t *func_vars; + + void *func_parent; + TAILQ_ENTRY(tagRPCFunc) func_node; +} rpc_func_t; + + typedef struct { int cli_id; /* slot id */ int cli_sock; /* socket fd */ @@ -277,8 +273,9 @@ int rpc_register_srvServices(rpc_srv_t * __restrict sr * @Port = Port for bind server, if Port == 0 default port is selected * return: NULL == error or !=NULL bind and created RPC server instance */ -rpc_srv_t *rpc_srv_initServer(u_int regProgID, u_int regProcID, int concurentClients, - int netBuf, const char *csHost, u_short Port); +rpc_srv_t *rpc_srv_initServer(unsigned int regProgID, unsigned char regProcID, + int concurentClients, int netBuf, + const char *csHost, unsigned short Port); /* * rpc_srv_endServer() - Destroy RPC server, close all opened sockets and free resources * @@ -368,10 +365,9 @@ rpc_func_t *rpc_srv_getFunc(rpc_srv_t * __restrict srv * * @srv = RPC Server instance * @tag = tag for function - * @hash = hash for function * return: NULL not found call, !=NULL return call */ -inline rpc_func_t *rpc_srv_getCall(rpc_srv_t * __restrict srv, uint16_t tag, uint32_t hash); +inline rpc_func_t *rpc_srv_getCall(rpc_srv_t * __restrict srv, uint16_t tag); /* * rpc_srv_execCall() - Execute registered call from RPC server *