Revert "Remove TPCS and TWPServer features"
[platform/upstream/csf-framework.git] / framework / TWPSerDaemon.h
1 /*
2     Copyright (c) 2014, McAfee, Inc.
3
4     All rights reserved.
5
6     Redistribution and use in source and binary forms, with or without modification,
7     are permitted provided that the following conditions are met:
8
9     Redistributions of source code must retain the above copyright notice, this list
10     of conditions and the following disclaimer.
11
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.
15
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
18     written permission.
19
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.
30 */
31
32 #ifndef TWPSERDAEMON_H
33 #define TWPSERDAEMON_H
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 /**
40  * \file TWPSerDaemon.h
41  * \brief TWP Server Daemon Header file.
42  *
43  * This file has the function prototypes.
44  * These functions should not be called directly but instead through IpcClient.h APIs
45  */
46
47 #include "IpcServer.h"
48
49 #define TWP_DAEMON_VERSION "1.0.0"
50
51 /*==================================================================================================
52                                      FUNCTION PROTOTYPES
53 ==================================================================================================*/
54 /**
55  * \brief handler method to get the version information.
56  * This will be called by IpcServer library with the following input/output params.
57  * This can be both synchronous and asynchronous API.
58  *
59  * \param[in] pData - contextual data.
60  * \param[in] req_argc - set to 0.
61  * \param[in] req_argv - set to null.
62  * \param[out] rep_argc - set to 0, 1 or 4.
63  * \param[out] rep_argv - contains  0, 1 or 4 strings for result code, framework version, plugin version, daemon version.
64  * \param[in] callback - method callback.
65  * \param[in] handle - handler.
66  * \return Return Type (int) \n
67  */
68 int TWPSerGetVersion(void *pData, int req_argc, char **req_argv, char ***rep_argv, int *rep_argc,
69                         CALLBACKFUNC callback, TSC_METHOD_HANDLE *handle);
70
71 /**
72  * \brief handler method to get the URL Reputation.
73  * This will be called by IpcServer library with the following input/output params.
74  * This can be both synchronous and asynchronous API.
75  *
76  * \param[in] pData - contextual data.
77  * \param[in] req_argc - set to 1.
78  * \param[in] req_argv - set to the URL required to check reputation.
79  *
80  * \param[out] rep_argc - set to 0, 1, 2 or 3.
81  * \param[out] rep_argv - contains 0, 1, 2  or 3 strings, first is the result code, second is the risklevel, third is the redirect URL.
82  *                        redirect URL is returned only if risk level is greater than or equal to TWP_Medium.
83  * \param[in] callback - method callback.
84  * \param[in] handle - handler.
85  * \return Return Type (int) \n
86  */
87 int TWPSerGetURLReputation(void *pData, int req_argc, char **req_argv, char ***rep_argv, int *rep_argc,
88                                CALLBACKFUNC callback, TSC_METHOD_HANDLE *handle);
89
90
91 #ifdef __cplusplus
92 }
93 #endif
94
95 #endif  /* TWPSERDAEMON_H */