--- libaitrpc/inc/aitrpc.h 2013/08/21 09:42:11 1.17.2.2 +++ libaitrpc/inc/aitrpc.h 2013/08/23 13:53:15 1.19 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitrpc.h,v 1.17.2.2 2013/08/21 09:42:11 misho Exp $ +* $Id: aitrpc.h,v 1.19 2013/08/23 13:53:15 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -62,7 +62,7 @@ SUCH DAMAGE. #include -#define RPC_VERSION 6 +#define RPC_VERSION 7 #define RPC_DEFPORT 2611 /* RPC call request flags */ @@ -197,7 +197,7 @@ typedef struct { int cli_id; /* slot id */ int cli_sock; /* socket fd */ sockaddr_t cli_sa; /* host address */ - array_t *cli_buf; /* network buffer(s) */ + ait_val_t cli_buf; /* network buffer */ array_t *cli_vars; /* function return variables */ @@ -259,6 +259,33 @@ const char *rpc_GetError(); void rpc_SetErr(int eno, char *estr, ...); + +/* + * rpc_Read() - RPC read operation + * + * @sock = socket + * @type = type of socket + * @flags = receive flags + * @sa = check client address, if you use udp protocol + * @buf = buffer + * @blen = buffer length + * return: -1 error or >-1 readed bytes into buffer + */ +ssize_t rpc_Read(int sock, int type, int flags, sockaddr_t * __restrict sa, + unsigned char * __restrict buf, size_t blen); +/* + * rpc_Write() - RPC write operation + * + * @sock = socket + * @type = type of socket + * @flags = send flags + * @sa = send to client address, if you use udp protocol + * @buf = buffer + * @blen = buffer length + * return: -1 error or >-1 written bytes into buffer + */ +ssize_t rpc_Write(int sock, int type, int flags, sockaddr_t * __restrict sa, + unsigned char * __restrict buf, size_t blen); /* * rpc_chkPktSession() - Check RPC session