yafrag.h
Go to the documentation of this file.
1 /*
2  ** yafrag.h
3  ** YAF Active Fragment Table
4  **
5  ** ------------------------------------------------------------------------
6  ** Copyright (C) 2006-2015 Carnegie Mellon University. All Rights Reserved.
7  ** ------------------------------------------------------------------------
8  ** Authors: Brian Trammell
9  ** ------------------------------------------------------------------------
10  ** @OPENSOURCE_HEADER_START@
11  ** Use of the YAF system and related source code is subject to the terms
12  ** of the following licenses:
13  **
14  ** GNU Public License (GPL) Rights pursuant to Version 2, June 1991
15  ** Government Purpose License Rights (GPLR) pursuant to DFARS 252.227.7013
16  **
17  ** NO WARRANTY
18  **
19  ** ANY INFORMATION, MATERIALS, SERVICES, INTELLECTUAL PROPERTY OR OTHER
20  ** PROPERTY OR RIGHTS GRANTED OR PROVIDED BY CARNEGIE MELLON UNIVERSITY
21  ** PURSUANT TO THIS LICENSE (HEREINAFTER THE "DELIVERABLES") ARE ON AN
22  ** "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY
23  ** KIND, EITHER EXPRESS OR IMPLIED AS TO ANY MATTER INCLUDING, BUT NOT
24  ** LIMITED TO, WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE,
25  ** MERCHANTABILITY, INFORMATIONAL CONTENT, NONINFRINGEMENT, OR ERROR-FREE
26  ** OPERATION. CARNEGIE MELLON UNIVERSITY SHALL NOT BE LIABLE FOR INDIRECT,
27  ** SPECIAL OR CONSEQUENTIAL DAMAGES, SUCH AS LOSS OF PROFITS OR INABILITY
28  ** TO USE SAID INTELLECTUAL PROPERTY, UNDER THIS LICENSE, REGARDLESS OF
29  ** WHETHER SUCH PARTY WAS AWARE OF THE POSSIBILITY OF SUCH DAMAGES.
30  ** LICENSEE AGREES THAT IT WILL NOT MAKE ANY WARRANTY ON BEHALF OF
31  ** CARNEGIE MELLON UNIVERSITY, EXPRESS OR IMPLIED, TO ANY PERSON
32  ** CONCERNING THE APPLICATION OF OR THE RESULTS TO BE OBTAINED WITH THE
33  ** DELIVERABLES UNDER THIS LICENSE.
34  **
35  ** Licensee hereby agrees to defend, indemnify, and hold harmless Carnegie
36  ** Mellon University, its trustees, officers, employees, and agents from
37  ** all claims or demands made against them (and any related losses,
38  ** expenses, or attorney's fees) arising out of, or relating to Licensee's
39  ** and/or its sub licensees' negligent use or willful misuse of or
40  ** negligent conduct or willful misconduct regarding the Software,
41  ** facilities, or other rights or assistance granted by Carnegie Mellon
42  ** University under this License, including, but not limited to, any
43  ** claims of product liability, personal injury, death, damage to
44  ** property, or violation of any laws or regulations.
45  **
46  ** Carnegie Mellon University Software Engineering Institute authored
47  ** documents are sponsored by the U.S. Department of Defense under
48  ** Contract FA8721-05-C-0003. Carnegie Mellon University retains
49  ** copyrights in all material produced under this contract. The U.S.
50  ** Government retains a non-exclusive, royalty-free license to publish or
51  ** reproduce these documents, or allow others to do so, for U.S.
52  ** Government purposes only pursuant to the copyright license under the
53  ** contract clause at 252.227.7013.
54  **
55  ** @OPENSOURCE_HEADER_END@
56  ** ------------------------------------------------------------------------
57  */
58 
67 #ifndef _YAF_FRAG_H_
68 #define _YAF_FRAG_H_
69 
70 #include <yaf/autoinc.h>
71 #include <yaf/decode.h>
72 #include <yaf/yafcore.h>
73 
74 struct yfFragTab_st;
79 typedef struct yfFragTab_st yfFragTab_t;
80 
99  uint32_t idle_ms,
100  uint32_t max_frags,
101  uint32_t max_payload);
102 
109 void yfFragTabFree(
110  yfFragTab_t *fragtab);
111 
132 gboolean yfDefragPBuf(
133  yfFragTab_t *fragtab,
134  yfIPFragInfo_t *fraginfo,
135  size_t pbuflen,
136  yfPBuf_t *pbuf,
137  const uint8_t *pkt,
138  size_t hdr_len);
139 
147 void yfFragDumpStats(
148  yfFragTab_t *fragtab,
149  uint64_t packetTotal);
150 
159 void yfGetFragTabStats(
160  yfFragTab_t *fragtab,
161  uint32_t *dropped,
162  uint32_t *assembled,
163  uint32_t *frags);
164 
165 #endif
void yfFragTabFree(yfFragTab_t *fragtab)
Free a fragment table.
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().
YAF Core Library.
struct yfFragTab_st yfFragTab_t
A fragment table.
Definition: yafrag.h:79
void yfGetFragTabStats(yfFragTab_t *fragtab, uint32_t *dropped, uint32_t *assembled, uint32_t *frags)
Get Frag Stats to yfWriteStatsFlow for Stats Export.
Packet decoding interface for YAF.
Definition: decode.h:82
Full packet information structure.
Definition: decode.h:149
void yfFragDumpStats(yfFragTab_t *fragtab, uint64_t packetTotal)
Print fragment reassembler statistics to the log.