Revert "Remove TPCS and TWPServer features"
[platform/upstream/csf-framework.git] / framework / TWPImpl.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 TWPIMPL_H
33 #define TWPIMPL_H
34
35 #ifdef __cplusplus 
36 extern "C" {
37 #endif
38
39 /**
40  * \file TWPImpl.h
41  * \brief TWP Header File
42  *
43  * This file provides the Tizen Web Protection API functions.
44  */
45
46 typedef long unsigned int TWPMallocSizeT; /* Size unit */
47
48 struct TWPLibHandle_struct {int iDummy;};
49
50 typedef struct TWPLibHandle_struct *TWPLIB_HANDLE;
51
52 #define TWP_VER_MAX 16
53
54 #define TWP_META_MAX 1000
55
56 #define TWP_FRAMEWORK_VERSION "2.0.2"
57
58 #define TWPAPI_VERSION 1 /* SDK version */
59
60 #define TWPCONFIG_VERSION 1 /* Configure version */
61
62 #define TWPREQUEST_VERSION 1 /* Request version */
63
64 #define INVALID_TWPLIB_HANDLE ((TWPLIB_HANDLE) 0) /* Invalid web protection library interface handle. */
65
66 /**
67  * Structure for version info of TWP Framework and Plugin
68  */
69 typedef struct TWPVerInfo_struct
70 {
71     char szFrameworkVer[TWP_VER_MAX];
72     char szPluginVer[TWP_VER_MAX];
73 } TWPVerInfo;
74
75 /**
76  * Result code used by TWP_RESULT
77  */
78 typedef enum
79 {
80     TWP_SUCCESS = 0,
81     TWP_ERROR = 1,
82     TWP_NOMEM = 2,
83     TWP_INVALID_HANDLE = 3,
84     TWP_INVALID_PARAMETER = 4,
85     TWP_INVALID_VERSION = 5,
86     TWP_INVALID_RESPONSE = 6,
87     TWP_NO_DATA = 7,
88     TWP_NOT_IMPLEMENTED = 500
89 } TWP_RESULT;
90
91 /**
92  * Web site category definitions
93  */
94 typedef enum 
95 {
96     TWP_Artcultureheritage,
97     TWP_Alcohol,
98     TWP_Anonymizers,
99     TWP_Anonymizingutilities,
100     TWP_Business,
101     TWP_Chat,
102     TWP_Publicinformation,
103     TWP_Potentialcriminalactivities,
104     TWP_Drugs,
105     TWP_Educationreference,
106     TWP_Entertainment,
107     TWP_Extreme,
108     TWP_Financebanking,
109     TWP_Gambling,
110     TWP_Games,
111     TWP_Governmentmilitary,
112     TWP_Potentialhackingcomputercrime,
113     TWP_Health,
114     TWP_Humorcomics,
115     TWP_Discrimination,
116     TWP_Instantmessaging,
117     TWP_Stocktrading,
118     TWP_Internetradiotv,
119     TWP_Jobsearch,
120     TWP_Informationsecurity,
121     TWP_E_RESERVED_1,
122     TWP_Mobilephone,
123     TWP_Mediadownloads,
124     TWP_Malicioussites,
125     TWP_E_RESERVED_2,
126     TWP_Nudity,
127     TWP_Nonprofitadvocacyngo,
128     TWP_Generalnews,
129     TWP_Onlineshopping,
130     TWP_Provocativeattire,
131     TWP_P2pfilesharing,
132     TWP_Politicsopinion,
133     TWP_Personalpages,
134     TWP_Portalsites,
135     TWP_Remoteaccess,
136     TWP_Religionideology,
137     TWP_Resourcesharing,
138     TWP_Searchengines,
139     TWP_Sports,
140     TWP_Streamingmedia,
141     TWP_Sharewarefreeware,
142     TWP_Pornography,
143     TWP_Spywareadwarekeyloggers,
144     TWP_Tobacco,
145     TWP_Travel,
146     TWP_Violence,
147     TWP_Webads,
148     TWP_Weapons,
149     TWP_Webmail,
150     TWP_Webphone,
151     TWP_Auctionsclassifieds,
152     TWP_Forumbulletinboards,
153     TWP_Profanity,
154     TWP_Schoolcheatinginformation,
155     TWP_Sexualmaterials,
156     TWP_Gruesomecontent,
157     TWP_Visualsearchengine,
158     TWP_Technicalbusinessforums,
159     TWP_Gamblingrelated,
160     TWP_Messaging,
161     TWP_Gamecartoonviolence,
162     TWP_Phishing,
163     TWP_Personalnetworkstorage,
164     TWP_Spamurls,
165     TWP_Interactivewebapplications,
166     TWP_Fashionbeauty,
167     TWP_Softwarehardware,
168     TWP_Potentialillegalsoftware,
169     TWP_Contentserver,
170     TWP_Internetservices,
171     TWP_Mediasharing,
172     TWP_Incidentalnudity,
173     TWP_Marketingmerchandising,
174     TWP_Parkeddomain,
175     TWP_Pharmacy,
176     TWP_Restaurants,
177     TWP_Realestate,
178     TWP_Recreationhobbies,
179     TWP_Blogswiki,
180     TWP_Digitalpostcards,
181     TWP_Historicalrevisionism,
182     TWP_Technicalinformation,
183     TWP_Datingpersonals,
184     TWP_Motorvehicles,
185     TWP_Professionalnetworking,
186     TWP_Socialnetworking,
187     TWP_Texttranslators,
188     TWP_Webmeetings,
189     TWP_Forkids,
190     TWP_E_RESERVED_3,
191     TWP_Moderated,
192     TWP_Textspokenonly,
193     TWP_Controversialopinions,
194     TWP_Residentialipaddresses,
195     TWP_Browserexploits,
196     TWP_Consumerprotection,
197     TWP_Illegaluk,
198     TWP_Majorglobalreligions,
199     TWP_Maliciousdownloads,
200     TWP_Potentiallyunwantedprograms,
201
202     TWP_LastCategoryPlaceholder = 128,
203     TWP_OverallPhishing = 129,
204     TWP_OverallRiskHigh = 130,
205     TWP_OverallRiskMedium = 131,
206     TWP_OverallRiskMinimal = 132,
207     TWP_OverallRiskUnverified = 137,
208     TWP_OverallMcAfeeSecure = 138,
209     TWP_LastAttributePlaceholder = 160,
210 } TWPCategories;
211
212 /**
213  * Risk level
214  */
215 typedef enum
216 {
217     TWP_Minimal,
218     TWP_Unverified,
219     TWP_Medium,
220     TWP_High,
221 } TWPRiskLevel;
222
223 /**
224  * Score range
225  */
226 typedef enum 
227 {
228     TWP_MinimalLow = 0,
229     TWP_MinimalHigh = 14,
230     TWP_UnverifiedLow = 15,
231     TWP_UnverifiedHigh = 29,
232     TWP_MediumLow = 30,
233     TWP_MediumHigh = 49,
234     TWP_HighLow= 50,
235     TWP_HighHigh = 127
236 } TWPScoreRange;
237
238 /**
239  * HTTP submit method
240  */
241 typedef enum
242 {
243     TWPPOST,
244 } TWPSubmitMethod;
245
246 /* forward declaration */
247 struct TWPRequest;
248 typedef struct TWPConfiguration *TWPConfigurationHandle;
249 typedef struct TWPResponse *TWPResponseHandle;
250 typedef struct TWPUrlRating *TWPUrlRatingHandle;
251 typedef struct TWPPolicy *TWPPolicyHandle;
252 typedef void *(*TWPFnMemAlloc)(TWPMallocSizeT size);
253 typedef void (*TWPFnMemFree)(void *address);
254 typedef long (*TWPFnRandom)(void);
255 typedef TWP_RESULT (*TWPFnRequestSetUrl)(struct TWPRequest *request, const char *pUrl,
256                                          unsigned int length);
257 typedef TWP_RESULT (*TWPFnRequestSetMethod)(struct TWPRequest *request, TWPSubmitMethod method);
258 typedef TWP_RESULT (*TWPFnRequestSend)(struct TWPRequest *request, TWPResponseHandle response,
259                                        const void *data, unsigned int length);
260 typedef TWP_RESULT (*TWPFnRequestReceive)(struct TWPRequest *request, void *buffer,
261                                           unsigned int buffer_length, unsigned int *length);
262
263 /**
264  * Initialize data requested by SDK initialization
265  */
266 typedef struct TWPAPIInit
267 {
268     int api_version;
269     TWPFnMemAlloc memallocfunc;
270     TWPFnMemFree memfreefunc;
271 } TWPAPIInit;
272
273 /**
274  * Configuration which enable caller to customize the SDK
275  */
276 typedef struct TWPConfiguration
277 {
278     int config_version; /* Configuration version */
279     const char *client_id; /* Client id for cloud to qualify */
280     const char *client_key; /* Corresponding key for specific client for validation from cloud */
281     const char *host; /* Host name for cloud where SDK send request to, set to NULL for SDK to use default settings in plug-in */
282     int secure_connection; /* 1 - use secured connection (HTTPS), 0 - not secured connection. */
283     int skip_dla; /* 1 - disable DLA lookup, 0 - enable DLA lookup */
284     int obfuscate_request; /* 1 - obfuscate request data, 0 - do not obfuscate request data */
285     TWPFnRandom randomfunc; /* Caller customized random function */
286 } TWPConfiguration;
287
288 /**
289  * Request for SDK to check URL against cloud database
290  */
291 typedef struct TWPRequest
292 {
293     int request_version; /* Request version */
294     TWPFnRequestSetUrl seturlfunc; /* Callback for SDK to set URL from SDK */
295     TWPFnRequestSetMethod setmethodfunc; /* Callback for SDK to set HTTP request method */
296     TWPFnRequestSend sendfunc; /* Callback for SDK to send HTTP request */
297     TWPFnRequestReceive receivefunc; /* Callback for SDK to receive HTTP response, if caller set it to be NULL,
298                                         SDK will assume the HTTP request will be handled in a-synchronized manner */
299 } TWPRequest;
300
301 /**
302  * \brief
303  * Initialize SDK
304  *
305  * This is a synchronized API
306  *
307  * \param[in] pApiInit API initialization data structure.
308  *
309  * \return TWP_RESULT
310  */
311 TWPLIB_HANDLE TWPInitLibrary(TWPAPIInit *pApiInit);
312
313 /**
314  * \brief Gets the version number of TWP Framework and Plugin.
315  *
316  * This is a synchronous API.
317  *
318  * \param[in] hLib instance handle obtained from a call to the TWPInitLibrary().
319  * \param[out] pszVersion Pointer to a structure containing version info.
320  *
321  * \return TWP_RESULT
322  */
323 TWP_RESULT TWPGetVersion(TWPLIB_HANDLE hLib, TWPVerInfo *pVerInfo);
324
325 /**
326  * \brief Gets the meta information about the plugin
327  *
328  * This is a synchronous API.
329  *
330  * \param[in] hLib instance handle obtained from a call to the TWPInitLibrary().
331  * \param[out] pszInfo string containing meta info, pszInfo allocated by caller of size TWP_META_MAX.
332  *
333  * \return TWP_RESULT
334  */
335 TWP_RESULT TWPGetInfo(TWPLIB_HANDLE hLib, char *pszInfo);
336
337 /**
338  * \brief
339  * Uninitialize SDK
340  *
341  * This is a synchronized API
342  *
343  */
344 void TWPUninitLibrary(TWPLIB_HANDLE hLib);
345
346 /**
347  * \brief
348  * Create TWP configuration to customize SDK
349  * 
350  * This is a synchronized API
351  *
352  * \param[in] pConfigure caller configurations
353  * \param[out] phConfigure created configuration for SDK
354  *
355  * \return TWP_RESULT
356  */
357 TWP_RESULT TWPConfigurationCreate(TWPLIB_HANDLE hLib, TWPConfiguration *pConfigure, TWPConfigurationHandle *phConfigure);
358
359 /**
360  * \brief
361  * Release the configuration resources allocated by TWPConfigurationCreate
362  *
363  * This is a synchronized API
364  *
365  * \param[in] hConfigure configuration to be destroyed
366  *
367  * \return TWP_RESULT
368  */
369 TWP_RESULT TWPConfigurationDestroy(TWPLIB_HANDLE hLib, TWPConfigurationHandle *hConfigure);
370
371 /**
372  * \brief
373  * Main function for caller to check URL reputation against the cloud database
374  *
375  * This can be a synchronized API or a-synchronized API depends on the configuration from caller
376  *
377  * Synchronous mode
378  *      In this synchronous operation mode, the function invokes TWPRequest::sendfunc and
379  *      TWPRequest::receivefunc, one right after the other, expecting the entire HTTP
380  *      transaction to be completed between the calls. Upon successful completion, the
381  *      phResponse will point to a valid response handle that can be used to analyze results.
382  *
383  * Asynchronous mode
384  *      In the asynchronous mode, the function invokes TWPRequest::sendfunc and returns
385  *      immediately with TWP_SUCCESS. Upon completion, phResponse is NULL. The application
386  *      is supposed to complete the HTTP transaction while calling TWPResponseWrite as
387  *      response data becomes available. When all data was read, TWPResponseWrite must
388  *      be called again with zero data length to signal the end transaction.
389  *
390  * \param[in] hConfigure Configuration of caller
391  * \param[in] pRequest Request data structure for SDK to check with cloud
392  * \param[in] iRedirUrl 1 indicating instruct the cloud server to provide a landing page
393  *            URL to which blocked URLs can be redirected.
394  * \param[in] ppUrls An array of 7 bit ASCII character strings representing URLs to obtain
395  *            the rating for.
396  *
397  *            Note: All URLs have to be normalized before submission (see RFC 3986) and
398  *            pynicoded if required.
399  * \param[in] uCount Length of the ppUrls array.
400  * \param[out] phResponse For synchronous requests, a pointer to the location where the
401  *             response object handle will be stored upon completion. It can be NULL for
402  *             asynchronous requests.
403  *
404  * \return TWP_RESULT
405  */
406 TWP_RESULT TWPLookupUrls(TWPLIB_HANDLE hLib, TWPConfigurationHandle hConfigure, TWPRequest *pRequest,
407                          int iRedirUrl, const char **ppUrls, unsigned int uCount, TWPResponseHandle *phResponse);
408
409 /**
410  * \brief
411  * In asynchronous mode, caller will call this API to write received HTTP response data
412  * to SDK. Writing with zero data length will be taken as end of HTTP transaction for
413  * SDK.
414  *
415  * This is a synchronized API
416  *
417  * \param[in] hResponse Response handle for SDK to keep track on HTTP transaction.
418  * \param[in] pData Received HTTP response data chunk.
419  * \param[in] uLength Length of the HTTP response data.
420  *
421  * \return TWP_RESULT
422  */
423 TWP_RESULT TWPResponseWrite(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, const void *pData, unsigned uLength);
424
425 /**
426  * \brief
427  * Get web site rating by its index in URL list in the response which comply to
428  * the URL list order passed by caller in TWPLookupUrls().
429  *
430  * This is a synchronized API
431  *
432  * \param[in] hResponse Response handle created based on cloud response.
433  * \param[in] iIndex Index of the web site in request list.
434  * \param[out] phRating Rating of the specified web site.
435  *
436  * \return TWP_RESULT
437  */
438 TWP_RESULT TWPResponseGetUrlRatingByIndex(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, unsigned int uIndex,
439                                           TWPUrlRatingHandle *phRating);
440
441 /**
442  * \brief
443  * Get web site rating by its URL string.
444  *
445  * This is a synchronized API
446  *
447  * \param[in] hResponse Response handle created based on cloud response.
448  * \param[in] pUrl URL string
449  * \param[in] iUrlLength URL string length
450  * \param[out] hRating Rating of the specified web site
451  *
452  * \return TWP_RESULT
453  */
454 TWP_RESULT TWPResponseGetUrlRatingByUrl(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, const char *pUrl,
455                                         unsigned int uUrlLength, TWPUrlRatingHandle *hRating);
456
457 /**
458  * \brief
459  * Get the redirection URL for blocked URL to display to user.
460  *
461  * Blocking pages can be used by application that want to block users
462  * from navigating to a URL that violates one of the defined policies.
463  * The returned string must be deallocated by the application using
464  * TWPAPIInit::TWPFnMemFree function.
465  *
466  * \param[in] hResponse Response handle created based on cloud response.
467  * \param[in] hRating Rating handle resolved from cloud response.
468  * \param[in] hPolicy Policy handle created by caller.
469  * \param[out] ppUrl Redirection URL.
470  * \param[ou] puLength Length of redirection URL
471  *
472  * \return TWP_RESULT
473  */
474 TWP_RESULT TWPResponseGetRedirUrlFor(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, TWPUrlRatingHandle hRating,
475                                      TWPPolicyHandle hPolicy, char **ppUrl, unsigned int *puLength);
476
477 /**
478  * \brief
479  * Get the rating count of specified response.
480  *
481  * \param[in] hResponse Response handle created based on cloud response.
482  * \param[out] puCount Rating count.
483  *
484  * \return TWP_RESULT
485  */
486 TWP_RESULT TWPResponseGetUrlRatingsCount(TWPLIB_HANDLE hLib, TWPResponseHandle hResponse, unsigned int *puCount);
487
488 /**
489  * \brief
490  * Release resource for response handle.
491  *
492  * \param[in] hResponse Response handle created based on cloud response.
493  *
494  * \return TWP_RESULT
495  */
496 TWP_RESULT TWPResponseDestroy(TWPLIB_HANDLE hLib, TWPResponseHandle *hResponse);
497
498 /**
499  * \brief
500  * Create the policy (set of web site categories) caller want to check.
501  *
502  * \param[in] hCfg configuration handle
503  * \param[in] pCategories Web site category list
504  * \param[in] uCount Category list length.
505  * \param[out] phPolicy Policy handle.
506  *
507  * \return TWP_RESULT
508  */
509 TWP_RESULT TWPPolicyCreate(TWPLIB_HANDLE hLib, TWPConfigurationHandle hCfg, TWPCategories *pCategories, unsigned int uCount, TWPPolicyHandle *hPolicy);
510
511 /**
512  * \brief
513  * Compare the categories assigned by security vendor to the URL represented
514  * by hRating with the categories assigned to the policy handle.
515  *
516  * \param[in] hPolicy Polcy handle
517  * \param[in] hRating Rating for specific URL
518  * \param[out] piVialated non-zero if intersection found between the policy and URL rating categories.
519  *
520  * \return TWP_RESULT
521  */
522 TWP_RESULT TWPPolicyValidate(TWPLIB_HANDLE hLib, TWPPolicyHandle hPolicy, TWPUrlRatingHandle hRating, int *piViolated);
523
524 /**
525  * \brief
526  * Retrieves all categories common between the policy and URL rating.
527  *
528  * \param[in] hPolicy Policy handle.
529  * \param[in] hRating URL rating handle.
530  * \param[out] ppViolated An array of all common categories. This array is allocated by using
531  *             TWPAPIInit::memallocfunc and has to be deallocated by the caller.
532  * \param[out] puLength Length of violation array.
533  *
534  * \return TWP_RESULT
535  */
536 TWP_RESULT TWPPolicyGetViolations(TWPLIB_HANDLE hLib, TWPPolicyHandle hPolicy, TWPUrlRatingHandle hRating,
537                                   TWPCategories **ppViolated, unsigned *puLength);
538
539 /**
540  * \brief
541  * Release resource for policy handle.
542  *
543  * \param[in] phPolicy Pointer to policy handle.
544  *
545  * \return TWP_RESULT
546  */
547 TWP_RESULT TWPPolicyDestroy(TWPLIB_HANDLE hLib, TWPPolicyHandle *hPolicy);
548
549 /**
550  * \brief
551  * Get score from URL rating data structure which is assigned by security vendor.
552  *
553  * \param[in] hRating Rating handle.
554  * \param[out] piScore URL score.
555  *
556  * \return TWP_RESULT
557  */
558 TWP_RESULT TWPUrlRatingGetScore(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, int *piScore);
559
560 /**
561  * \brief
562  * Get corresponding URL from rating handle.
563  *
564  * \param[in] hRating Rating handle.
565  * \param[out] ppUrl A pointer to a NULL terminated string representing
566  *             the URL. The string is valid as long as the URL rating
567  *             handle is valid.
568  * \param[out] puLength An optional pointer to the length of URL string.
569  *
570  * \return TWP_RESULT
571  */
572 TWP_RESULT TWPUrlRatingGetUrl(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, char **ppUrl,
573                               unsigned int *puLength);
574
575 /**
576  * \brief
577  * Get DLA (Deep Link Analysis) URL
578  *
579  * \param[in] hRating Rating handle.
580  * \param[out] ppDlaUrl A ponit to a NULL terminated string representing
581  *             the DLA URL. This string is valid as long as the URL rating
582  *             handle is valid.
583  * \param[out] puLength Length of DLA URL string.
584  *
585  * \return TWP_RESULT
586  */
587 TWP_RESULT TWPUrlRatingGetDLAUrl(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, char **ppDlaUrl,
588                                  unsigned int *puLength);
589
590 /**
591  * \brief
592  * Determine whether the URL rating object has the specified category.
593  *
594  * \param[in] hRating Rating handle.
595  * \param[in] Category Category enum value.
596  * \param[out] piPresent Non-zero value indicating exists.
597  *
598  * \return TWP_RESULT
599  */
600 TWP_RESULT TWPUrlRatingHasCategory(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, TWPCategories Category,
601                                    int *piPresent);
602
603 /**
604  * \brief
605  * Retrives categories assigned by security vendor for the rated URL.
606  *
607  * \param[in] hRating Rating handle.
608  * \param[out] ppCategories The pointer to a variable that contains the address
609  *             of the category list.
610  * \param[out] puLength Length of category list.
611  *
612  * \return TWP_RESULT
613  */
614 TWP_RESULT TWPUrlRatingGetCategories(TWPLIB_HANDLE hLib, TWPUrlRatingHandle hRating, TWPCategories **ppCategories,
615                                      unsigned int *puLength);
616 /**
617  * \brief
618  * Checks whether the URL violates the default policy and configurations.
619  * Retrieves the Risk level for all URLs and the Redirection URL is retrieved
620  * if level is greater than or equal to TWP_MediumLow score.
621  *
622  * \param[in] pUrl URL to check.
623  * \param[out] ppBlkUrl Redirection URL.
624  * \param[out] puBlkUrlLen Length of redirection URL.
625  * \param[out] pRiskLevel Risk level of the URL.
626  * 
627  * \return TWP_RESULT
628  */
629 TWP_RESULT TWPCheckURL(TWPLIB_HANDLE hLib, const char *pUrl, char **ppBlkUrl, unsigned int *puBlkUrlLen,
630                       int *pRiskLevel);
631
632 #ifdef __cplusplus
633 }
634 #endif
635 #endif
636