1 /*
2 ** Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
3 ** Copyright (C) 2002-2013 Sourcefire, Inc.
4 ** Copyright (C) 1998-2002 Martin Roesch <roesch@sourcefire.com>
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License Version 2 as
8 ** published by the Free Software Foundation.  You may not use, modify or
9 ** distribute this program under any other version of the GNU General
10 ** Public License.
11 **
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ** GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; if not, write to the Free Software
19 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 */
21 
22 /* $Id$ */
23 /* ClientServer detection plugin header */
24 
25 #ifndef __SP_CLIENTSERVER_H__
26 #define __SP_CLIENTSERVER_H__
27 
28 #define ONLY_STREAM 0x01
29 #define ONLY_FRAG 0x02
30 #define IGNORE_STREAM 0x01
31 #define IGNORE_FRAG 0x02
32 
33 typedef struct _ClientServerData
34 {
35     uint8_t from_server;
36     uint8_t from_client;
37     uint8_t ignore_reassembled; /* ignore reassembled sessions */
38     uint8_t only_reassembled; /* ignore reassembled sessions */
39     uint8_t stateless;
40     uint8_t established;
41     uint8_t unestablished;
42 } ClientServerData;
43 
44 void SetupClientServer(void);
45 int OtnFlowFromServer( OptTreeNode * otn );
46 int OtnFlowFromClient( OptTreeNode * otn );
47 int OtnFlowIgnoreReassembled( OptTreeNode * otn );
48 int OtnFlowOnlyReassembled( OptTreeNode * otn );
49 uint32_t FlowHash(void *d);
50 int FlowCompare(void *l, void *r);
51 
52 #endif  /* __SP_CLIENTSERVER_H__ */
53