suricata
detect-pcre.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  */
23 
24 #ifndef __DETECT_PCRE_H__
25 #define __DETECT_PCRE_H__
26 
27 #define DETECT_PCRE_RELATIVE 0x00001
28 #define DETECT_PCRE_RAWBYTES 0x00002
29 #define DETECT_PCRE_CASELESS 0x00004
30 
31 #define DETECT_PCRE_MATCH_LIMIT 0x00020
32 #define DETECT_PCRE_RELATIVE_NEXT 0x00040
33 #define DETECT_PCRE_NEGATE 0x00080
34 
35 #define DETECT_PCRE_CAPTURE_MAX 8
36 
37 typedef struct DetectPcreData_ {
38  /* pcre options */
39  pcre *re;
40  pcre_extra *sd;
41  int opts;
42  uint16_t flags;
43  uint8_t idx;
47 
48 /* prototypes */
49 
51  const Signature *, const SigMatchData *,
52  Packet *, Flow *, uint8_t *, uint32_t);
53 
56  Packet *, uint8_t *, uint16_t);
57 void DetectPcreRegister (void);
58 
59 #endif /* __DETECT_PCRE_H__ */
60 
int DetectPcrePayloadMatch(DetectEngineThreadCtx *, const Signature *, const SigMatchData *, Packet *, Flow *, uint8_t *, uint32_t)
Match a regex on a single payload.
Definition: detect-pcre.c:171
struct DetectPcreData_ DetectPcreData
uint32_t capids[DETECT_PCRE_CAPTURE_MAX]
Definition: detect-pcre.h:45
Data needed for Match()
Definition: detect.h:333
void DetectPcreRegister(void)
Definition: detect-pcre.c:86
Signature container.
Definition: detect.h:492
uint16_t flags
Definition: detect-pcre.h:42
int DetectPcrePayloadDoMatch(DetectEngineThreadCtx *, Signature *, SigMatch *, Packet *, uint8_t *, uint16_t)
pcre_extra * sd
Definition: detect-pcre.h:40
int DetectPcrePacketPayloadMatch(DetectEngineThreadCtx *, Packet *, Signature *, SigMatch *)
#define DETECT_PCRE_CAPTURE_MAX
Definition: detect-pcre.h:35
uint8_t captypes[DETECT_PCRE_CAPTURE_MAX]
Definition: detect-pcre.h:44
Flow data structure.
Definition: flow.h:327
a single match condition for a signature
Definition: detect.h:324