1 /*
2  ** Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
3  ** Copyright (C) 2005-2013 Sourcefire, Inc.
4  **
5  ** This program is free software; you can redistribute it and/or modify
6  ** it under the terms of the GNU General Public License Version 2 as
7  ** published by the Free Software Foundation.  You may not use, modify or
8  ** distribute this program under any other version of the GNU General
9  ** Public License.
10  **
11  ** This program is distributed in the hope that it will be useful,
12  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  ** GNU General Public License for more details.
15  **
16  ** You should have received a copy of the GNU General Public License
17  ** along with this program; if not, write to the Free Software
18  ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19  */
20 
21 /*
22  * sp_urilen_check.h: Structure definitions/function prototype(s)
23  * 		      for the URI length detection plugin.
24  */
25 
26 /* $Id */
27 
28 #ifndef _SP_URILEN_CHECK_H_
29 #define _SP_URILEN_CHECK_H_
30 
31 #define URI_LEN_BUF_NORM  "norm"
32 #define URI_LEN_BUF_RAW   "raw"
33 
34 #define URILEN_CHECK_EQ 1
35 #define URILEN_CHECK_GT 2
36 #define URILEN_CHECK_LT 3
37 #define URILEN_CHECK_RG 4
38 
39 /* Structure stored in the rule OTN struct for use by URILEN
40  * detection plugin code.
41  */
42 typedef struct _UriLenCheckData
43 {
44     uint16_t urilen;
45     uint16_t urilen2;
46     char oper;
47     int uri_buf;
48 
49 } UriLenCheckData;
50 
51 /*
52  * Structure stored in the rule OTN struct for use by URINORMLEN
53  * detection plugin code.
54  */
55 typedef struct _UriNormLenCheckData
56 {
57     int urinormlen;
58     int urinormlen2;
59 } UriNormLenCheckData;
60 
61 
62 extern void SetupUriLenCheck(void);
63 uint32_t UriLenCheckHash(void *d);
64 int UriLenCheckCompare(void *l, void *r);
65 
66 #endif /* _SP_URILEN_CHECK_H_ */
67