github.com/TeaOSLab/EdgeNode@v1.3.8/internal/waf/injectionutils/libinjection/src/libinjection.h (about) 1 /** 2 * Copyright 2012-2016 Nick Galbreath 3 * nickg@client9.com 4 * BSD License -- see COPYING.txt for details 5 * 6 * https://libinjection.client9.com/ 7 * 8 */ 9 10 #ifndef LIBINJECTION_H 11 #define LIBINJECTION_H 12 13 #ifdef __cplusplus 14 # define LIBINJECTION_BEGIN_DECLS extern "C" { 15 # define LIBINJECTION_END_DECLS } 16 #else 17 # define LIBINJECTION_BEGIN_DECLS 18 # define LIBINJECTION_END_DECLS 19 #endif 20 21 LIBINJECTION_BEGIN_DECLS 22 23 /* 24 * Pull in size_t 25 */ 26 #include <string.h> 27 28 /* 29 * Version info. 30 * 31 * This is moved into a function to allow SWIG and other auto-generated 32 * binding to not be modified during minor release changes. We change 33 * change the version number in the c source file, and not regenerated 34 * the binding 35 * 36 * See python's normalized version 37 * http://www.python.org/dev/peps/pep-0386/#normalizedversion 38 */ 39 const char* libinjection_version(void); 40 41 /** 42 * Simple API for SQLi detection - returns a SQLi fingerprint or NULL 43 * is benign input 44 * 45 * \param[in] s input string, may contain nulls, does not need to be null-terminated 46 * \param[in] slen input string length 47 * \param[out] fingerprint buffer of 8+ characters. c-string, 48 * \return 1 if SQLi, 0 if benign. fingerprint will be set or set to empty string. 49 */ 50 int libinjection_sqli(const char* s, size_t slen, char fingerprint[]); 51 52 /** ALPHA version of xss detector. 53 * 54 * NOT DONE. 55 * 56 * \param[in] s input string, may contain nulls, does not need to be null-terminated 57 * \param[in] slen input string length 58 * \return 1 if XSS found, 0 if benign 59 * 60 */ 61 int libinjection_xss(const char* s, size_t slen, int strictMode); 62 63 LIBINJECTION_END_DECLS 64 65 #endif /* LIBINJECTION_H */