suricata
detect-app-layer-protocol.h
Go to the documentation of this file.
1
/* Copyright (C) 2007-2022 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 Anoop Saldanha <anoopsaldanha@gmail.com>
22
*/
23
24
#ifndef SURICATA_DETECT_APP_LAYER_PROTOCOL__H
25
#define SURICATA_DETECT_APP_LAYER_PROTOCOL__H
26
27
#include "
app-layer-protos.h
"
28
29
void
DetectAppLayerProtocolRegister
(
void
);
30
const
char
*
DetectAppLayerProtocolModeName
(uint8_t mode);
31
struct
DetectAppLayerProtocolData_
;
32
uint16_t
DetectAppLayerProtocolGetValues
(
33
const
struct
DetectAppLayerProtocolData_
*data,
AppProto
*out, uint16_t max);
34
35
/**
36
* \brief Per-rule keyword data for `app-layer-protocol:`.
37
*
38
* `alprotos` is the effective match set: a bitmask (one bit per AppProto,
39
* sized g_alproto_max) holding every flow protocol that should match, with the
40
* AppProtoEquals() equivalences (or, with the `exact` option, only the exact
41
* values) already expanded in at rule load. The per-packet match is then a
42
* single bitmask test. `alproto` is the first configured value, used as the
43
* prefilter bucket key for single-value (prefilterable) rules.
44
*/
45
typedef
struct
DetectAppLayerProtocolData_
{
46
AppProto
alproto
;
/**< first configured value; single-value prefilter key */
47
bool
negated
;
48
bool
exact
;
/**< `exact` option: strict identity, no equivalences/umbrella */
49
bool
is_list
;
/**< more than one value configured (not prefilterable) */
50
uint8_t
mode
;
51
uint8_t *
alprotos
;
/**< effective match set (g_alproto_max bits) */
52
}
DetectAppLayerProtocolData
;
53
54
#endif
/* SURICATA_DETECT_APP_LAYER_PROTOCOL__H */
DetectAppLayerProtocolData_::mode
uint8_t mode
Definition:
detect-app-layer-protocol.h:50
DetectAppLayerProtocolModeName
const char * DetectAppLayerProtocolModeName(uint8_t mode)
Map a DETECT_ALPROTO_* mode value to its textual qualifier.
Definition:
detect-app-layer-protocol.c:196
DetectAppLayerProtocolData_
Per-rule keyword data for app-layer-protocol:.
Definition:
detect-app-layer-protocol.h:45
AppProto
uint16_t AppProto
Definition:
app-layer-protos.h:87
DetectAppLayerProtocolData_::alprotos
uint8_t * alprotos
Definition:
detect-app-layer-protocol.h:51
DetectAppLayerProtocolData
struct DetectAppLayerProtocolData_ DetectAppLayerProtocolData
Per-rule keyword data for app-layer-protocol:.
DetectAppLayerProtocolData_::exact
bool exact
Definition:
detect-app-layer-protocol.h:48
DetectAppLayerProtocolGetValues
uint16_t DetectAppLayerProtocolGetValues(const struct DetectAppLayerProtocolData_ *data, AppProto *out, uint16_t max)
DetectAppLayerProtocolData_::alproto
AppProto alproto
Definition:
detect-app-layer-protocol.h:46
app-layer-protos.h
DetectAppLayerProtocolData_::negated
bool negated
Definition:
detect-app-layer-protocol.h:47
DetectAppLayerProtocolData_::is_list
bool is_list
Definition:
detect-app-layer-protocol.h:49
DetectAppLayerProtocolRegister
void DetectAppLayerProtocolRegister(void)
Definition:
detect-app-layer-protocol.c:663
src
detect-app-layer-protocol.h
Generated on Fri Jul 17 2026 23:30:24 for suricata by
1.8.18