yafrag.h
Go to the documentation of this file.
1/*
2 * Copyright 2006-2024 Carnegie Mellon University
3 * See license information in LICENSE.txt.
4 */
5/*
6 * yafrag.h
7 * YAF Active Fragment Table
8 *
9 * ------------------------------------------------------------------------
10 * Authors: Brian Trammell
11 * ------------------------------------------------------------------------
12 * @DISTRIBUTION_STATEMENT_BEGIN@
13 * YAF 2.16
14 *
15 * Copyright 2024 Carnegie Mellon University.
16 *
17 * NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING
18 * INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON
19 * UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
20 * AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR
21 * PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF
22 * THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF
23 * ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT
24 * INFRINGEMENT.
25 *
26 * Licensed under a GNU GPL 2.0-style license, please see LICENSE.txt or
27 * contact permission@sei.cmu.edu for full terms.
28 *
29 * [DISTRIBUTION STATEMENT A] This material has been approved for public
30 * release and unlimited distribution. Please see Copyright notice for
31 * non-US Government use and distribution.
32 *
33 * This Software includes and/or makes use of Third-Party Software each
34 * subject to its own license.
35 *
36 * DM24-1063
37 * @DISTRIBUTION_STATEMENT_END@
38 * ------------------------------------------------------------------------
39 */
40
49#ifndef _YAF_FRAG_H_
50#define _YAF_FRAG_H_
51
52#include <yaf/autoinc.h>
53#include <yaf/decode.h>
54#include <yaf/yafcore.h>
55
56struct yfFragTab_st;
61typedef struct yfFragTab_st yfFragTab_t;
62
83 uint32_t idle_ms,
84 uint32_t max_frags,
85 uint32_t max_payload);
86
92void
94 yfFragTab_t *fragtab);
95
117gboolean
119 yfFragTab_t *fragtab,
120 yfIPFragInfo_t *fraginfo,
121 size_t pbuflen,
122 yfPBuf_t *pbuf,
123 const uint8_t *pkt,
124 size_t hdr_len);
125
132void
134 yfFragTab_t *fragtab,
135 uint64_t packetTotal);
136
145void
147 yfFragTab_t *fragtab,
148 uint32_t *dropped,
149 uint32_t *assembled,
150 uint32_t *frags);
151
152#endif /* ifndef _YAF_FRAG_H_ */
Fragmentation information structure.
Definition decode.h:66
Full packet information structure.
Definition decode.h:133
YAF Core Library.
void yfFragTabFree(yfFragTab_t *fragtab)
Free a fragment table.
void yfFragDumpStats(yfFragTab_t *fragtab, uint64_t packetTotal)
Print fragment reassembler statistics to the log.
void yfGetFragTabStats(yfFragTab_t *fragtab, uint32_t *dropped, uint32_t *assembled, uint32_t *frags)
Get Frag Stats to yfWriteStatsFlow for Stats Export.
struct yfFragTab_st yfFragTab_t
A fragment table.
Definition yafrag.h:61
yfFragTab_t * yfFragTabAlloc(uint32_t idle_ms, uint32_t max_frags, uint32_t max_payload)
Allocate a fragment table.
gboolean yfDefragPBuf(yfFragTab_t *fragtab, yfIPFragInfo_t *fraginfo, size_t pbuflen, yfPBuf_t *pbuf, const uint8_t *pkt, size_t hdr_len)
Defragment a fragment returned by yfDecodeToPBuf().