2 Copyright (c) 2014, McAfee, Inc.
6 Redistribution and use in source and binary forms, with or without modification,
7 are permitted provided that the following conditions are met:
9 Redistributions of source code must retain the above copyright notice, this list
10 of conditions and the following disclaimer.
12 Redistributions in binary form must reproduce the above copyright notice, this
13 list of conditions and the following disclaimer in the documentation and/or other
14 materials provided with the distribution.
16 Neither the name of McAfee, Inc. nor the names of its contributors may be used
17 to endorse or promote products derived from this software without specific prior
20 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
28 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 OF THE POSSIBILITY OF SUCH DAMAGE.
41 * \brief Ipc Client Header File
43 * This file provides the IPC Client API functions used by Security framework.
48 /*==================================================================================================
50 ==================================================================================================*/
51 #define DEF_TIMEOUT -1
54 /*==================================================================================================
56 ==================================================================================================*/
59 * \brief Initializes client side IPC and returns its handle.
61 * Opens and initialises the handle to client side IPC using the security
64 * This is a synchronous API.
66 * \return Return Type (TSC_IPC_HANDLE) \n
67 * Client IPC handle - on success. \n
68 * NULL - on failure. \n
70 TSC_IPC_HANDLE IpcClientOpen(void);
73 * \brief Requests the Security framework's IPC server and returns back the reply.
75 * This is a synchronous API.
77 * \param[in] hIpc IPC handle returned by IpcClientOpen().
79 * \return Return Type (void) \n
81 void IpcClientClose(TSC_IPC_HANDLE hIpc);
84 * \brief Requests the Security framework's IPC server and returns back the reply.
86 * This is a synchronous API.
88 * \param[in] hIpc Client side IPC handle.
89 * \param[in] szMethod Name of the method called.
90 * \param[in] argc Number of parameters passed in argv.
91 * \param[in] argv Array of strings representing parameters for method called.
92 * \param[out] reply_len Length of the string in reply_argv.
93 * \param[out] reply_argv Array of strings representing result value from method called.
94 * \param[in] timeout_milliseconds Timeout in milliseconds. -1 for default or 0 for no timeout.
96 * \return Return Type (int) \n
97 * 0 - on send success. \n
98 * -1 - on send failure. \n
100 int TSCSendMessageN(TSC_IPC_HANDLE hIpc, const char *service_name, const char *szMethod, int argc,
101 char **argv, int *argc_reply, char ***argv_reply, int timeout_milliseconds);
104 * \brief Requests the Security framework's IPC server asynchronously.
106 * This is an asynchronous API.
108 * \param[in] hIpc Client side IPC handle.
109 * \param[in] szMethod Name of the method called.
110 * \param[in] argc Number of parameters passed in argv.
111 * \param[in] argv Array of strings representing parameters for method called.
112 * \param[out] phCallHandle Pointer to handle of the asynchronous message sent.
113 * \param[in] pCallback Callback function for the asynchronous reply.
114 * \param[in] pPrivate API caller's context information, to be supplied with callback.
115 * \param[in] timeout_milliseconds Timeout in milliseconds. -1 for default or 0 for no timeout.
117 * \return Return Type (int) \n
118 * 0 - on send success. \n
119 * Error code - on send failure. \n
121 int TSCSendMessageAsync(TSC_IPC_HANDLE hIpc, const char *service_name, const char *szMethod, int argc, char **argv,
122 TSC_CALL_HANDLE *phCallHandle, TSCCallback pCallback, void *pPrivate,
123 int timeout_milliseconds);
126 * \brief Releases the asynchronous call handle.
128 * \param[in] hCallHandle Handle of the asynchronous message sent earlier.
130 void TSCFreeSentMessageHandle(TSC_CALL_HANDLE hCallHandle);
133 * \brief Cancels an asynchronous request previously made to the Security framework's IPC server.
134 * On success, releases the handle of the previously called asynchronous method.
136 * This is an asynchronous API.
138 * \param[in] hIpc Client side IPC handle.
139 * \param[in] hCallHandle Handle of the asynchronous message sent earlier.
141 * \return Return Type (int) \n
142 * 0 - on send success. \n
143 * Error code - on failure. \n
145 int TSCCancelMessage(TSC_IPC_HANDLE hIpc, TSC_CALL_HANDLE hCallHandle);
151 #endif /* IPCCLIENT_H */