yafrag.h
Go to the documentation of this file.
1/*
2 * Copyright 2006-2023 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.14.0
14 *
15 * Copyright 2023 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 * Released 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 * GOVERNMENT PURPOSE RIGHTS - Software and Software Documentation
34 *
35 * Contract No.: FA8702-15-D-0002
36 *
37 * Contractor Name: Carnegie Mellon University
38 *
39 * Contractor Address: 4500 Fifth Avenue, Pittsburgh, PA 15213
40 *
41 * The Government's rights to use, modify, reproduce, release, perform,
42 * display, or disclose this software are restricted by paragraph (b)(2) of
43 * the Rights in Noncommercial Computer Software and Noncommercial Computer
44 * Software Documentation clause contained in the above identified
45 * contract. No restrictions apply after the expiration date shown
46 * above. Any reproduction of the software or portions thereof marked with
47 * this legend must also reproduce the markings.
48 *
49 * Carnegie Mellon(R) and CERT(R) are registered in the U.S. Patent and
50 * Trademark Office by Carnegie Mellon University.
51 *
52 * This Software includes and/or makes use of Third-Party Software each
53 * subject to its own license.
54 *
55 * DM23-0544
56 * @DISTRIBUTION_STATEMENT_END@
57 * ------------------------------------------------------------------------
58 */
59
68#ifndef _YAF_FRAG_H_
69#define _YAF_FRAG_H_
70
71#include <yaf/autoinc.h>
72#include <yaf/decode.h>
73#include <yaf/yafcore.h>
74
75struct yfFragTab_st;
80typedef struct yfFragTab_st yfFragTab_t;
81
102 uint32_t idle_ms,
103 uint32_t max_frags,
104 uint32_t max_payload);
105
111void
113 yfFragTab_t *fragtab);
114
136gboolean
138 yfFragTab_t *fragtab,
139 yfIPFragInfo_t *fraginfo,
140 size_t pbuflen,
141 yfPBuf_t *pbuf,
142 const uint8_t *pkt,
143 size_t hdr_len);
144
151void
153 yfFragTab_t *fragtab,
154 uint64_t packetTotal);
155
164void
166 yfFragTab_t *fragtab,
167 uint32_t *dropped,
168 uint32_t *assembled,
169 uint32_t *frags);
170
171#endif /* ifndef _YAF_FRAG_H_ */
Fragmentation information structure.
Definition: decode.h:85
Full packet information structure.
Definition: decode.h:152
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:80
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().