version 1.15, 2013/04/02 15:50:14
|
version 1.16.8.2, 2013/08/22 08:56:15
|
Line 172 rpc_cli_openClient(u_char InstID, int netBuf, const ch
|
Line 172 rpc_cli_openClient(u_char InstID, int netBuf, const ch
|
else |
else |
netBuf = E_ALIGN(netBuf, 2); /* align netBuf length */ |
netBuf = E_ALIGN(netBuf, 2); /* align netBuf length */ |
|
|
#ifdef HAVE_SRANDOMDEV |
|
srandomdev(); |
|
#else |
|
time_t tim; |
|
|
|
srandom((time(&tim) ^ getpid())); |
|
#endif |
|
|
|
cli = e_malloc(sizeof(rpc_cli_t)); |
cli = e_malloc(sizeof(rpc_cli_t)); |
if (!cli) { |
if (!cli) { |
LOGERR; |
LOGERR; |
Line 410 rpc_pkt_Request(ait_val_t * __restrict pkt, rpc_sess_t
|
Line 402 rpc_pkt_Request(ait_val_t * __restrict pkt, rpc_sess_t
|
array_t * __restrict vars, int noreply, int nocrc) |
array_t * __restrict vars, int noreply, int nocrc) |
{ |
{ |
struct tagRPCCall *rpc; |
struct tagRPCCall *rpc; |
int ret = 0, len = sizeof(struct tagRPCCall); | int ret = 0, estlen, len = sizeof(struct tagRPCCall); |
u_char *buf; |
u_char *buf; |
|
|
if (!pkt || !sess) { |
if (!pkt || !sess) { |
rpc_SetErr(EINVAL, "Invalid argument(s)!"); |
rpc_SetErr(EINVAL, "Invalid argument(s)!"); |
return -1; |
return -1; |
} else | } |
buf = AIT_GET_BUF(pkt); | |
|
|
|
/* calc estimated length */ |
|
estlen = ait_resideVars(vars) + len; |
|
if (estlen > AIT_LEN(pkt)) |
|
AIT_RE_BUF(pkt, estlen); |
|
buf = AIT_GET_BUF(pkt); |
|
|
/* prepare RPC call */ |
/* prepare RPC call */ |
rpc = (struct tagRPCCall*) buf; |
rpc = (struct tagRPCCall*) buf; |
rpc_addPktSession(&rpc->call_session, sess); |
rpc_addPktSession(&rpc->call_session, sess); |
rpc->call_tag = htons(tag); |
rpc->call_tag = htons(tag); |
rpc->call_seq = htons(random() % USHRT_MAX); |
|
if (!vars) |
if (!vars) |
rpc->call_argc = 0; |
rpc->call_argc = 0; |
else |
else |
Line 585 rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short
|
Line 581 rpc_cli_execCall(rpc_cli_t *cli, int noreply, u_short
|
* @out_vars = Returned array with variables from RPC call |
* @out_vars = Returned array with variables from RPC call |
* return: none |
* return: none |
*/ |
*/ |
inline void | void |
rpc_cli_freeCall(array_t ** __restrict out_vars) |
rpc_cli_freeCall(array_t ** __restrict out_vars) |
{ |
{ |
#ifdef CLI_RES_ZCOPY |
#ifdef CLI_RES_ZCOPY |
Line 601 rpc_cli_freeCall(array_t ** __restrict out_vars)
|
Line 597 rpc_cli_freeCall(array_t ** __restrict out_vars)
|
* @cli = connected client |
* @cli = connected client |
* return: -1 error or !=-1 ping seq id |
* return: -1 error or !=-1 ping seq id |
*/ |
*/ |
inline int | int |
rpc_cli_ping(rpc_cli_t *cli) |
rpc_cli_ping(rpc_cli_t *cli) |
{ |
{ |
int ret = 0; |
int ret = 0; |