suricata
app-layer-protos.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2013 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  * \author Anoop Saldanha <anoopsaldanha@gmail.com>
23  */
24 
25 #ifndef __APP_LAYER_PROTOS_H__
26 #define __APP_LAYER_PROTOS_H__
27 
33  ALPROTO_TLS, /* SSLv2, SSLv3 & TLSv1 */
41 
56 
57  /* used by the probing parser when alproto detection fails
58  * permanently for that particular stream */
60 #ifdef UNITTESTS
62 #endif /* UNITESTS */
63  /* keep last */
65 };
66 // NOTE: if ALPROTO's get >= 256, update SignatureNonPrefilterStore
67 
68 /* not using the enum as that is a unsigned int, so 4 bytes */
69 typedef uint16_t AppProto;
70 
71 static inline bool AppProtoIsValid(AppProto a)
72 {
73  return ((a > ALPROTO_UNKNOWN && a < ALPROTO_FAILED));
74 }
75 
76 /**
77  * \brief Maps the ALPROTO_*, to its string equivalent.
78  *
79  * \param alproto App layer protocol id.
80  *
81  * \retval String equivalent for the alproto.
82  */
83 const char *AppProtoToString(AppProto alproto);
84 
85 /**
86  * \brief Maps a string to its ALPROTO_* equivalent.
87  *
88  * \param String equivalent for the alproto.
89  *
90  * \retval alproto App layer protocol id, or ALPROTO_UNKNOWN.
91  */
92 AppProto StringToAppProto(const char *proto_name);
93 
94 #endif /* __APP_LAYER_PROTOS_H__ */
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
AppProtoEnum
uint16_t AppProto
AppProto StringToAppProto(const char *proto_name)
Maps a string to its ALPROTO_* equivalent.