From 36f82820c15a3f9f1b376c3d3a54b8537a077dae Mon Sep 17 00:00:00 2001 From: Juan Carlos Luciani Date: Mon, 4 Sep 2006 06:11:28 +0000 Subject: [PATCH] CASA IPC Client API changes to support multiple remote endpoints. --- CASA-auth-token/non-java/include/casa_c_ipc.h | 214 +++++++++++------- 1 file changed, 129 insertions(+), 85 deletions(-) diff --git a/CASA-auth-token/non-java/include/casa_c_ipc.h b/CASA-auth-token/non-java/include/casa_c_ipc.h index 4fdbc6a0..d0b53642 100644 --- a/CASA-auth-token/non-java/include/casa_c_ipc.h +++ b/CASA-auth-token/non-java/include/casa_c_ipc.h @@ -45,7 +45,133 @@ //++======================================================================= -extern "C" +extern +int +IpcClientOpenUnixRemoteEndPoint( + IN char *pSocketFileName, + IN int maxRpcRetries, + INOUT uint32_t *pEndPointHandle); +// +// Arguments In: port - Server's listening port number. +// +// address - The server's IP Address. Use +// 0x7F000001 if the server is local. +// +// maxRpcRetries - Maximum number of Rpc retries that +// should be utilized when submitting +// a request to the endpoint. A value +// of zero requests that the default +// setting be utilized. +// +// Arguments Out: pEndPointHandle - Pointer to variable that will receive +// the endpoint handle. +// +// Returns: 0 == Success +// -1 == Failure +// +// Abstract: Method to open a UNIX (PF_UNIX) remote endpoint. +// +// Note: The service should have been initialized before calling +// this procedure. +// +//=======================================================================-- + + +//++======================================================================= +extern +int +IpcClientOpenInetRemoteEndPoint( + IN unsigned short int port, + IN uint32_t address, + IN int maxRpcRetries, + INOUT uint32_t *pEndPointHandle); +// +// Arguments In: port - Server's listening port number. +// +// address - The server's IP Address. Use +// 0x7F000001 if the server is local. +// +// maxRpcRetries - Maximum number of Rpc retries that +// should be utilized when submitting +// a request to the endpoint. A value +// of zero requests that the default +// setting be utilized. +// +// Arguments Out: pEndPointHandle - Pointer to variable that will receive +// the endpoint handle. +// +// Returns: 0 == Success +// -1 == Failure +// +// Abstract: Method to open a TCP (AF_INET) remote endpoint. +// +// Note: The service should have been initialized before calling +// this procedure. +// +//=======================================================================-- + + +//++======================================================================= +extern +int +IpcClientCloseRemoteEndPoint( + IN uint32_t endPointHandle); +// +// Arguments In: endpointHandle - Handle of the endpoint being closed. +// +// +// Arguments Out: None. +// the endpoint handle. +// +// Returns: 0 == Success +// -1 == Failure +// +// Abstract: Method to close a remote endpoint. +// +// Note: The service should have been initialized before calling +// this procedure. +// +//=======================================================================-- + + +//++======================================================================= +extern +int +IpcClientSubmitReq( + IN uint32_t endPointHandle, + IN char *pClientData, + IN int clientDataLen, + INOUT char **ppServerData, + INOUT int *pServerDataLen); +// +// Arguments In: endPointHandle - Handle of the remote endpoint that will +// be the target of the request. +// +// pClientData - Pointer to client data that must be sent to +// the server. Buffer is NEVER released by the +// procedure. +// +// clientDataLen - Length of the client data. +// +// Arguments Out: ppServerData - Pointer to variable that will receive a +// pointer to the buffer containing the data +// received from the server. +// +// pServerDataLen - Pointer to variable that will receive the +// length of the data received from the server. +// +// Returns: 0 == Request completed gracefully +// -1 == Request did not complete gracefully +// +// Abstract: Method to submit a request. +// +// Note: The routine blocks until the request completes. +// +//=======================================================================-- + + +//++======================================================================= +extern int IpcClientInit( IN char *pName, @@ -82,7 +208,7 @@ IpcClientInit( //++======================================================================= -extern "C" +extern void IpcClientShutdown(void); // @@ -90,94 +216,12 @@ IpcClientShutdown(void); // // Arguments Out: None. // -// Returns: 0 == Success -// -1 == Failure +// Returns: Nothing. // // Abstract: Method to shutdown the IPC infrastructure for process. // //=======================================================================-- - -//++======================================================================= -extern "C" -int -IpcClientSetUnAddress( - IN char *pSocketFileName); -// -// Arguments In: pSocketFileName - Pointer to string containing the name -// of the socket file. -// -// Arguments Out: None. -// -// Returns: 0 == Success -// -1 == Failure -// -// Abstract: Method to set the socket file name to utilize for -// communicating with the server via DOMAIN sockets. -// -// Note: The service should have been initialized before calling -// this procedure. -// -//=======================================================================-- - - -//++======================================================================= -extern "C" -int -IpcClientSetInAddress( - IN unsigned short int serverPort, - IN uint32_t serverAddress); -// -// Arguments In: serverPort - Server's listening port number. -// -// serverAddress - The server's IP Address. Use -// 0x7F000001 if the server is local. -// -// Arguments Out: None. -// -// Returns: 0 == Success -// -1 == Failure -// -// Abstract: Method to set the address to utilize for communicating -// with the server via TCP sockets. -// -// Note: The service should have been initialized before calling -// this procedure. -// -//=======================================================================-- - - -//++======================================================================= -extern "C" -int -IpcClientSubmitReq( - IN char *pClientData, - IN int clientDataLen, - INOUT char **ppServerData, - INOUT int *pServerDataLen); -// -// Arguments In: pClientData - Pointer to client data that must be sent to -// the server. Buffer is NEVER released by the -// procedure. -// -// clientDataLen - Length of the client data. -// -// Arguments Out: ppServerData - Pointer to variable that will receive a -// pointer to the buffer containing the data -// received from the server. -// -// pServerDataLen - Pointer to variable that will receive the -// length of the data received from the server. -// -// Returns: 0 == Request completed gracefully -// -1 == Request did not complete gracefully -// -// Abstract: Method to submit a request. -// -// Note: The routine blocks until the request completes. -// -//=======================================================================-- - #endif // _IPCCLIENT_ //=========================================================================