1 /****************************************************************************
2  *
3  * Copyright (C) 2014-2021 Cisco and/or its affiliates. All rights reserved.
4  * Copyright (C) 2011-2013 Sourcefire, Inc.
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 
23 /*
24  * @file    snort_stream_ip.h
25  * @author  Russ Combs <rcombs@sourcefire.com>
26  *
27  */
28 
29 #ifndef __STREAM_IP_H__
30 #define __STREAM_IP_H__
31 
32 #include "session_common.h"
33 #include "stream_common.h"
34 #include "sfPolicy.h"
35 
36 void StreamCleanIp(void);
37 void StreamResetIp(void);
38 void StreamInitIp(void);
39 
40 void StreamIpPolicyInit(StreamIpConfig*, char*);
41 int StreamVerifyIpConfig(StreamIpConfig*, tSfPolicyId);
42 void StreamIpConfigFree(StreamIpConfig*);
43 
44 int StreamProcessIp(Packet *p, SessionControlBlock *scb, SessionKey *skey);
45 
46 uint32_t StreamGetIpPrunes(void);
47 void StreamResetIpPrunes(void);
48 
49 void IpSessionCleanup (void* lws);
50 
51 void SessionIPReload(uint32_t max_sessions, uint16_t pruningTimeout, uint16_t nominalTimeout);
52 unsigned SessionIPReloadAdjust(unsigned maxWork);
53 
54 size_t get_ip_used_mempool();
55 
56 #endif
57