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

OISF / suricata / 23374838686

21 Mar 2026 07:29AM UTC coverage: 59.341% (-20.0%) from 79.315%
23374838686

Pull #15075

github

web-flow
Merge 90b4e834f into 6587e363a
Pull Request #15075: Stack 8001 v16.4

38 of 70 new or added lines in 10 files covered. (54.29%)

34165 existing lines in 563 files now uncovered.

119621 of 201584 relevant lines covered (59.34%)

650666.92 hits per line

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

0.0
/src/stream.c
1
/* Copyright (C) 2007-2017 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
 */
23

24
#include "suricata-common.h"
25
#include "decode.h"
26
#include "threads.h"
27
#include "stream.h"
28
#include "util-pool.h"
29
#include "util-debug.h"
30
#include "stream-tcp.h"
31
#include "flow-util.h"
32

33
/** \brief Run callback for all segments in a single direction.
34
 *
35
 * Must be called under flow lock.
36
 * \var flag determines the direction to run callback on (either to server or to client).
37
 *
38
 * \return -1 in case of error, the number of segment in case of success
39
 */
40
int StreamSegmentForEach(const Packet *p, uint8_t flag, StreamSegmentCallback CallbackFunc, void *data)
41
{
×
42
    switch(p->proto) {
×
43
        case IPPROTO_TCP:
×
44
            return StreamTcpSegmentForEach(p, flag, CallbackFunc, data);
×
45
            break;
×
46
#ifdef DEBUG
47
        case IPPROTO_UDP:
48
            SCLogWarning("UDP is currently unsupported");
49
            break;
50
        default:
51
            SCLogWarning("This protocol is currently unsupported");
52
            break;
53
#endif
54
    }
×
55
    return 0;
×
56
}
×
57

58
/** \brief Run callback for all segments on both directions of the session
59
 *
60
 * Must be called under flow lock.
61
 *
62
 * \return -1 in case of error, the number of segments in case of success.
63
 */
64
int StreamSegmentForSession(
65
        const Packet *p, uint8_t flag, StreamSegmentCallback CallbackFunc, void *data)
UNCOV
66
{
×
UNCOV
67
    switch (p->proto) {
×
UNCOV
68
        case IPPROTO_TCP:
×
UNCOV
69
            return StreamTcpSegmentForSession(p, flag, CallbackFunc, data);
×
70
            break;
×
71
#ifdef DEBUG
72
        case IPPROTO_UDP:
73
            SCLogWarning("UDP is currently unsupported");
74
            break;
75
        default:
76
            SCLogWarning("This protocol is currently unsupported");
77
            break;
78
#endif
UNCOV
79
    }
×
80
    return 0;
×
UNCOV
81
}
×
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