snort  2.9.17.1
About: Snort is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.
  Fossies Dox: snort-2.9.17.1.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

appInfoTable.h
Go to the documentation of this file.
1 /*
2 ** Copyright (C) 2014-2020 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 #ifndef __APP_INFO_TABLE_H__
23 #define __APP_INFO_TABLE_H__
24 
25 #include "appId.h"
26 #include "client_app_api.h"
27 #include "detector_api.h"
28 #include "service_api.h"
29 
30 #define APP_PRIORITY_DEFAULT 2
31 #define HTTP_TUNNEL_DETECT_RESTART 0
32 #define HTTP_TUNNEL_DETECT_RESTART_AND_RESET 1
33 
34 typedef enum
35 {
44 
52 
56 
58 {
69  char *appName;
70 };
72 
73 void appInfoTableInit(tAppidStaticConfig* appidSC, tAppIdConfig* pConfig);
74 void appInfoTableFini(tAppIdConfig *pConfig);
78 void AppIdDumpStats(int exit_flag);
79 void appInfoTableDump(tAppIdConfig *pConfig);
80 void appInfoSetActive(tAppId appId, bool active);
81 const char * appGetAppName(int32_t appId);
82 int32_t appGetAppId(const char *appName);
83 
84 static inline void appInfoEntryFlagSet (tAppId appId, unsigned flags, const tAppIdConfig *pConfig)
85 {
86  AppInfoTableEntry* entry = appInfoEntryGet(appId, pConfig);
87  if (entry)
88  entry->flags |= flags;
89 }
90 
91 static inline void appInfoEntryFlagClear (tAppId appId, unsigned flags, const tAppIdConfig *pConfig)
92 {
93  AppInfoTableEntry* entry = appInfoEntryGet(appId, pConfig);
94  if (entry)
95  entry->flags &= (~flags);
96 }
97 
98 static inline unsigned appInfoEntryFlagGet (tAppId app_id, unsigned flags, const tAppIdConfig *pConfig)
99 {
100  AppInfoTableEntry* entry = appInfoEntryGet(app_id, pConfig);
101  if (entry)
102  return (entry->flags & flags);
103  return 0;
104 }
105 
106 static inline uint32_t appInfoEntryFlags (tAppId app_id, const tAppIdConfig *pConfig)
107 {
108  AppInfoTableEntry* entry = appInfoEntryGet(app_id, pConfig);
109  if (entry)
110  return entry->flags;
111  return 0;
112 }
113 
114 static inline void appInfoEntryPrioritySet (tAppId appId, unsigned priority, const tAppIdConfig *pConfig)
115 {
116  AppInfoTableEntry* entry = appInfoEntryGet(appId, pConfig);
117  if (entry)
118  entry->priority |= priority;
119 }
120 
121 static inline unsigned appInfoEntryPriorityGet (tAppId app_id, const tAppIdConfig *pConfig)
122 {
123  AppInfoTableEntry* entry = appInfoEntryGet(app_id, pConfig);
124  if (entry)
125  return (entry->priority);
126  return 0;
127 }
128 
129 
130 #endif
int32_t tAppId
Definition: appIdApi.h:30
AppInfoTableEntry * appInfoEntryCreate(const char *appName, tAppIdConfig *pConfig)
Definition: appInfoTable.c:267
static void appInfoEntryFlagSet(tAppId appId, unsigned flags, const tAppIdConfig *pConfig)
Definition: appInfoTable.h:84
tAppInfoFlags
Definition: appInfoTable.h:35
@ APPINFO_FLAG_SSL_SQUELCH
Definition: appInfoTable.h:46
@ APPINFO_FLAG_CLIENT_USER
Definition: appInfoTable.h:39
@ APPINFO_FLAG_CLIENT_DETECTOR_CALLBACK
Definition: appInfoTable.h:53
@ APPINFO_FLAG_IGNORE
Definition: appInfoTable.h:45
@ APPINFO_FLAG_SSL_INSPECT
Definition: appInfoTable.h:41
@ APPINFO_FLAG_CLIENT_ADDITIONAL
Definition: appInfoTable.h:38
@ APPINFO_FLAG_SEARCH_ENGINE
Definition: appInfoTable.h:50
@ APPINFO_FLAG_ACTIVE
Definition: appInfoTable.h:40
@ APPINFO_FLAG_DEFER
Definition: appInfoTable.h:43
@ APPINFO_FLAG_SUPPORTED_SEARCH
Definition: appInfoTable.h:51
@ APPINFO_FLAG_DEFER_PAYLOAD
Definition: appInfoTable.h:49
@ APPINFO_FLAG_REFERRED
Definition: appInfoTable.h:42
@ APPINFO_FLAG_PERSISTENT
Definition: appInfoTable.h:47
@ APPINFO_FLAG_SERVICE_UDP_REVERSED
Definition: appInfoTable.h:37
@ APPINFO_FLAG_SERVICE_ADDITIONAL
Definition: appInfoTable.h:36
@ APPINFO_FLAG_SERVICE_DETECTOR_CALLBACK
Definition: appInfoTable.h:54
@ APPINFO_FLAG_TP_CLIENT
Definition: appInfoTable.h:48
static uint32_t appInfoEntryFlags(tAppId app_id, const tAppIdConfig *pConfig)
Definition: appInfoTable.h:106
const char * appGetAppName(int32_t appId)
Definition: appInfoTable.c:550
void appInfoTableDump(tAppIdConfig *pConfig)
Definition: appInfoTable.c:495
static unsigned appInfoEntryPriorityGet(tAppId app_id, const tAppIdConfig *pConfig)
Definition: appInfoTable.h:121
void appInfoTableInit(tAppidStaticConfig *appidSC, tAppIdConfig *pConfig)
Definition: appInfoTable.c:312
tAppId appGetSnortIdFromAppId(tAppId appId)
int32_t appGetAppId(const char *appName)
Definition: appInfoTable.c:564
static void appInfoEntryPrioritySet(tAppId appId, unsigned priority, const tAppIdConfig *pConfig)
Definition: appInfoTable.h:114
static unsigned appInfoEntryFlagGet(tAppId app_id, unsigned flags, const tAppIdConfig *pConfig)
Definition: appInfoTable.h:98
void appInfoSetActive(tAppId appId, signed char active)
Definition: appInfoTable.c:573
void appInfoTableFini(tAppIdConfig *pConfig)
Definition: appInfoTable.c:477
static void appInfoEntryFlagClear(tAppId appId, unsigned flags, const tAppIdConfig *pConfig)
Definition: appInfoTable.h:91
AppInfoTableEntry * appInfoEntryGet(tAppId appId, const tAppIdConfig *pConfig)
Definition: appInfoTable.c:259
void AppIdDumpStats(int exit_flag)
Definition: spp_appid.c:371
static int16_t app_id
Definition: service_tftp.c:98
__int16 int16_t
Definition: stdint.h:27
__int32 int32_t
Definition: stdint.h:28
tRNAClientAppModule * clntValidator
Definition: appInfoTable.h:66
tRNAServiceElement * svrValidator
Definition: appInfoTable.h:67
struct _AppInfoTableEntry * next
Definition: appInfoTable.h:59
AppId static configuration data structure.
unsigned int uint32_t
Definition: u2openappid.c:52