summaryrefslogtreecommitdiff
path: root/plugin/TWPPImpl.h
blob: b47c6ad1bba1262f85221c3067c83adb95792055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#ifndef TWPPIMPL_H
#define TWPPIMPL_H

#ifdef __cplusplus 
extern "C" {
#endif

#define TWPP_PLUGIN_VERSION "2.0.2"

#define TWPP_PLUGIN_INFO "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
        <Root><Plug>\n\
        <Version>2.0.2</Version>\n\
        <VendorName>McAfee</VendorName>\n\
        <ProductName>TWP</ProductName>\n\
        <AppId>EmbkcJFK7q</AppId>\n\
        </Plug></Root>\n"
/**
 * \file TWPPImpl.h
 * \brief TWP Plug-in Header File
 *  
 * This file provides the Tizen Web Protection Plug-in API functions.
 */


/*==================================================================================================
                                     FUNCTION PROTOTYPES
==================================================================================================*/

/**
 * \brief Initializes.
 *
 * This is a synchronous API.
 *
 */
TWP_RESULT TWPPInitLibrary(TWPAPIInit *pApiInit);

void TWPPUninitLibrary(void);

TWP_RESULT TWPPConfigurationCreate(TWPConfiguration *pConfigure, TWPConfigurationHandle *phConfigure);

TWP_RESULT TWPPConfigurationDestroy(TWPConfigurationHandle *phConfigure);

TWP_RESULT TWPPLookupUrls(TWPConfigurationHandle hConfigure, TWPRequest *pRequest, int iRedirUrl,
                          const char **ppUrls, unsigned int uCount, TWPResponseHandle *phResponse);

TWP_RESULT TWPPResponseWrite(TWPResponseHandle hResponse, const void *pData, unsigned uLength);

TWP_RESULT TWPPResponseGetUrlRatingByIndex(TWPResponseHandle hResponse, unsigned int uIndex,
                                           TWPUrlRatingHandle *phRating);

TWP_RESULT TWPPResponseGetUrlRatingByUrl(TWPResponseHandle hResponse, const char *pUrl,
                                         unsigned int uUrlLength, TWPUrlRatingHandle *phRating);

TWP_RESULT TWPPResponseGetRedirUrlFor(TWPResponseHandle hResponse, TWPUrlRatingHandle hRating,
                                      TWPPolicyHandle hPolicy, char **ppUrl, unsigned int *puLength);

TWP_RESULT TWPPResponseGetUrlRatingsCount(TWPResponseHandle hResponse, unsigned int *puCount);

TWP_RESULT TWPPResponseDestroy(TWPResponseHandle *phResponse);

TWP_RESULT TWPPPolicyCreate(TWPConfigurationHandle hCfg, TWPCategories *pCategories, unsigned int uCount,
                            TWPPolicyHandle *phPolicy);

TWP_RESULT TWPPPolicyValidate(TWPPolicyHandle hPolicy, TWPUrlRatingHandle hRating, int *piViolated);

TWP_RESULT TWPPPolicyGetViolations(TWPPolicyHandle hPolicy, TWPUrlRatingHandle hRating,
                                   TWPCategories **ppViolated, unsigned *puLength);

TWP_RESULT TWPPPolicyDestroy(TWPPolicyHandle *phPolicy);

TWP_RESULT TWPPUrlRatingGetScore(TWPUrlRatingHandle hRating, int *piScore);

TWP_RESULT TWPPUrlRatingGetUrl(TWPUrlRatingHandle hRating, const char **ppUrl,
                              unsigned int *puLength);

TWP_RESULT TWPPUrlRatingGetDLAUrl(TWPUrlRatingHandle hRating, const char **ppDlaUrl,
                                  unsigned int *puLength);

TWP_RESULT TWPPUrlRatingHasCategory(TWPUrlRatingHandle hRating, TWPCategories Category,
                                    int *piPresent);

TWP_RESULT TWPPUrlRatingGetCategories(TWPUrlRatingHandle hRating, TWPCategories **ppCategories,
                                      unsigned int *puLength);

TWP_RESULT TWPPCheckURL(const char *pUrl, char **ppBlkUrl, unsigned int *puBlkUrlLen,
                        int *pRiskLevel);

const char *TWPPGetVersion(void);

const char *TWPPGetInfo(void);

#ifdef __cplusplus
}
#endif 

#endif  /* TWPPIMPL_H */