void ccs_rpc_request( const long rpcmsg, /* Message type */ const char tspHandle[], /* Client's tspdata* */ const char* pszUUID, /* Where client will listen for the reply */ const long lenRequest, /* Length of buffer */ const char pbRequest[], /* Data buffer */ const long serverStartTime, /* Which server session we're talking to */ long* return_status ) { /* Return code */ cc_int32 status = 0; k5_ipc_stream stream; DWORD* p = (DWORD*)(tspHandle); WIN_PIPE* pipe = NULL; #if 0 cci_debug_printf("%s rpcmsg:%d; UUID:<%s> SST:<%s>", __FUNCTION__, rpcmsg, pszUUID, serverStartTime); #endif status = (rpcmsg != CCMSG_REQUEST) && (rpcmsg != CCMSG_PING); if (!status) { status = k5_ipc_stream_new (&stream); /* Create a stream for the request data */ } if (!status) { /* Put the data into the stream */ status = k5_ipc_stream_write (stream, pbRequest, lenRequest); } pipe = ccs_win_pipe_new(pszUUID, *p); worklist_add(rpcmsg, pipe, stream, serverStartTime); *return_status = status; }
cc_int32 ccs_win_pipe_copy (WIN_PIPE** out_pipe, const WIN_PIPE* in_pipe) { *out_pipe = ccs_win_pipe_new( ccs_win_pipe_getUuid (in_pipe), ccs_win_pipe_getHandle(in_pipe) ); return (*out_pipe) ? ccNoError : ccErrBadParam; }
void ccs_rpc_connect( const long rpcmsg, /* Message type */ const char tspHandle[], /* Client's tspdata* */ const char* pszUUID, /* Data buffer */ long* return_status ) { /* Return code */ DWORD* p = (DWORD*)(tspHandle); WIN_PIPE* pipe = ccs_win_pipe_new(pszUUID, *p); #if 0 cci_debug_printf("%s; rpcmsg:%d; UUID: <%s>", __FUNCTION__, rpcmsg, pszUUID); #endif worklist_add( rpcmsg, pipe, NULL, /* No payload with connect request */ (const time_t)0 ); /* No server session number with connect request */ }