• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OISF / suricata / 23350122333

20 Mar 2026 03:33PM UTC coverage: 76.492% (-2.8%) from 79.315%
23350122333

Pull #15053

github

web-flow
Merge f5bf69f97 into 6587e363a
Pull Request #15053: Flow queue/v3

113 of 129 new or added lines in 9 files covered. (87.6%)

9534 existing lines in 453 files now uncovered.

256601 of 335461 relevant lines covered (76.49%)

4680806.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.06
/src/detect-engine-uint.c
1
/* Copyright (C) 2020 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 Philippe Antoine <p.antoine@catenacyber.fr>
22
 *
23
 */
24

25
#include "suricata-common.h"
26

27
#include "util-byte.h"
28
#include "detect-parse.h"
29
#include "detect-engine-uint.h"
30

31
int DetectU32Match(const uint32_t parg, const DetectUintData_u32 *du32)
32
{
981✔
33
    return SCDetectU32Match(parg, du32);
981✔
34
}
981✔
35

36
/**
37
 * \brief This function is used to parse u32 options passed via some u32 keyword
38
 *
39
 * \param u32str Pointer to the user provided u32 options
40
 *
41
 * \retval DetectU32Data pointer to DetectU32Data on success
42
 * \retval NULL on failure
43
 */
44

45
DetectUintData_u32 *DetectU32Parse(const char *u32str)
46
{
20✔
47
    return SCDetectU32Parse(u32str);
20✔
48
}
20✔
49

50
void
51
PrefilterPacketU32Set(PrefilterPacketHeaderValue *v, void *smctx)
UNCOV
52
{
×
UNCOV
53
    const DetectUintData_u32 *a = smctx;
×
UNCOV
54
    v->u8[0] = a->mode;
×
UNCOV
55
    v->u32[1] = a->arg1;
×
UNCOV
56
    v->u32[2] = a->arg2;
×
UNCOV
57
}
×
58

59
bool
60
PrefilterPacketU32Compare(PrefilterPacketHeaderValue v, void *smctx)
UNCOV
61
{
×
UNCOV
62
    const DetectUintData_u32 *a = smctx;
×
UNCOV
63
    if (v.u8[0] == a->mode &&
×
UNCOV
64
        v.u32[1] == a->arg1 &&
×
UNCOV
65
        v.u32[2] == a->arg2)
×
UNCOV
66
        return true;
×
UNCOV
67
    return false;
×
UNCOV
68
}
×
69

70
//same as u32 but with u8
71
int DetectU8Match(const uint8_t parg, const DetectUintData_u8 *du8)
72
{
330,676✔
73
    return SCDetectU8Match(parg, du8);
330,676✔
74
}
330,676✔
75

76
/**
77
 * \brief This function is used to parse u8 options passed via some u8 keyword
78
 *
79
 * \param u8str Pointer to the user provided u8 options
80
 *
81
 * \retval DetectU8Data pointer to DetectU8Data on success
82
 * \retval NULL on failure
83
 */
84

85
DetectUintData_u8 *DetectU8Parse(const char *u8str)
86
{
327✔
87
    return SCDetectU8Parse(u8str);
327✔
88
}
327✔
89

90
void PrefilterPacketU8Set(PrefilterPacketHeaderValue *v, void *smctx)
91
{
59✔
92
    const DetectUintData_u8 *a = smctx;
59✔
93
    v->u8[0] = a->mode;
59✔
94
    v->u8[1] = a->arg1;
59✔
95
    v->u8[2] = a->arg2;
59✔
96
}
59✔
97

98
bool PrefilterPacketU8Compare(PrefilterPacketHeaderValue v, void *smctx)
99
{
52✔
100
    const DetectUintData_u8 *a = smctx;
52✔
101
    if (v.u8[0] == a->mode && v.u8[1] == a->arg1 && v.u8[2] == a->arg2)
52✔
102
        return true;
22✔
103
    return false;
30✔
104
}
52✔
105

106
// same as u32 but with u16
107
int DetectU16Match(const uint16_t parg, const DetectUintData_u16 *du16)
108
{
35,713✔
109
    return SCDetectU16Match(parg, du16);
35,713✔
110
}
35,713✔
111

112
/**
113
 * \brief This function is used to parse u16 options passed via some u16 keyword
114
 *
115
 * \param u16str Pointer to the user provided u16 options
116
 *
117
 * \retval DetectU16Data pointer to DetectU16Data on success
118
 * \retval NULL on failure
119
 */
120

121
DetectUintData_u16 *DetectU16Parse(const char *u16str)
122
{
1,697✔
123
    return SCDetectU16Parse(u16str);
1,697✔
124
}
1,697✔
125

126
void PrefilterPacketU16Set(PrefilterPacketHeaderValue *v, void *smctx)
UNCOV
127
{
×
UNCOV
128
    const DetectUintData_u16 *a = smctx;
×
UNCOV
129
    v->u8[0] = a->mode;
×
UNCOV
130
    v->u16[1] = a->arg1;
×
UNCOV
131
    v->u16[2] = a->arg2;
×
UNCOV
132
}
×
133

134
bool PrefilterPacketU16Compare(PrefilterPacketHeaderValue v, void *smctx)
UNCOV
135
{
×
UNCOV
136
    const DetectUintData_u16 *a = smctx;
×
UNCOV
137
    if (v.u8[0] == a->mode && v.u16[1] == a->arg1 && v.u16[2] == a->arg2)
×
UNCOV
138
        return true;
×
UNCOV
139
    return false;
×
UNCOV
140
}
×
141

142
int DetectU64Match(const uint64_t parg, const DetectUintData_u64 *du64)
143
{
4,530✔
144
    return SCDetectU64Match(parg, du64);
4,530✔
145
}
4,530✔
146

147
DetectUintData_u64 *DetectU64Parse(const char *u64str)
148
{
12,181✔
149
    return SCDetectU64Parse(u64str);
12,181✔
150
}
12,181✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc