Blame apache2/libinjection/libinjection.h

Packit 284210
/**
Packit 284210
 * Copyright 2012-2016 Nick Galbreath
Packit 284210
 * nickg@client9.com
Packit 284210
 * BSD License -- see COPYING.txt for details
Packit 284210
 *
Packit 284210
 * https://libinjection.client9.com/
Packit 284210
 *
Packit 284210
 */
Packit 284210
Packit 284210
#ifndef LIBINJECTION_H
Packit 284210
#define LIBINJECTION_H
Packit 284210
Packit 284210
#ifdef __cplusplus
Packit 284210
# define LIBINJECTION_BEGIN_DECLS    extern "C" {
Packit 284210
# define LIBINJECTION_END_DECLS      }
Packit 284210
#else
Packit 284210
# define LIBINJECTION_BEGIN_DECLS
Packit 284210
# define LIBINJECTION_END_DECLS
Packit 284210
#endif
Packit 284210
Packit 284210
LIBINJECTION_BEGIN_DECLS
Packit 284210
Packit 284210
/*
Packit 284210
 * Pull in size_t
Packit 284210
 */
Packit 284210
#include <string.h>
Packit 284210
Packit 284210
/*
Packit 284210
 * Version info.
Packit 284210
 *
Packit 284210
 * This is moved into a function to allow SWIG and other auto-generated
Packit 284210
 * binding to not be modified during minor release changes.  We change
Packit 284210
 * change the version number in the c source file, and not regenerated
Packit 284210
 * the binding
Packit 284210
 *
Packit 284210
 * See python's normalized version
Packit 284210
 * http://www.python.org/dev/peps/pep-0386/#normalizedversion
Packit 284210
 */
Packit 284210
const char* libinjection_version(void);
Packit 284210
Packit 284210
/**
Packit 284210
 * Simple API for SQLi detection - returns a SQLi fingerprint or NULL
Packit 284210
 * is benign input
Packit 284210
 *
Packit 284210
 * \param[in] s  input string, may contain nulls, does not need to be null-terminated
Packit 284210
 * \param[in] slen input string length
Packit 284210
 * \param[out] fingerprint buffer of 8+ characters.  c-string,
Packit 284210
 * \return 1 if SQLi, 0 if benign.  fingerprint will be set or set to empty string.
Packit 284210
 */
Packit 284210
int libinjection_sqli(const char* s, size_t slen, char fingerprint[]);
Packit 284210
Packit 284210
/** ALPHA version of xss detector.
Packit 284210
 *
Packit 284210
 * NOT DONE.
Packit 284210
 *
Packit 284210
 * \param[in] s  input string, may contain nulls, does not need to be null-terminated
Packit 284210
 * \param[in] slen input string length
Packit 284210
 * \return 1 if XSS found, 0 if benign
Packit 284210
 *
Packit 284210
 */
Packit 284210
int libinjection_xss(const char* s, size_t slen);
Packit 284210
Packit 284210
LIBINJECTION_END_DECLS
Packit 284210
Packit 284210
#endif /* LIBINJECTION_H */