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 
55 
56  /* used by the probing parser when alproto detection fails
57  * permanently for that particular stream */
59 #ifdef UNITTESTS
61 #endif /* UNITESTS */
62  /* keep last */
64 };
65 // NOTE: if ALPROTO's get >= 256, update SignatureNonPrefilterStore
66 
67 /* not using the enum as that is a unsigned int, so 4 bytes */
68 typedef uint16_t AppProto;
69 
70 static inline bool AppProtoIsValid(AppProto a)
71 {
72  return ((a > ALPROTO_UNKNOWN && a < ALPROTO_FAILED));
73 }
74 
75 /**
76  * \brief Maps the ALPROTO_*, to its string equivalent.
77  *
78  * \param alproto App layer protocol id.
79  *
80  * \retval String equivalent for the alproto.
81  */
82 const char *AppProtoToString(AppProto alproto);
83 
84 /**
85  * \brief Maps a string to its ALPROTO_* equivalent.
86  *
87  * \param String equivalent for the alproto.
88  *
89  * \retval alproto App layer protocol id, or ALPROTO_UNKNOWN.
90  */
91 AppProto StringToAppProto(const char *proto_name);
92 
93 #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.