CERT NetSA Security Suite
Monitoring for Large-Scale Networks
YAF
YAF: ring.h Source File
YAF
2.x (stable)
2.x (stable)
3.x (pre-release)
Documentation
Latest Downloads
Release History
YAF License
Main Page
Tutorials
Data Structures
Files
File List
Globals
yaf-2.16.1
include
yaf
ring.h
1
/*
2
* Copyright 2007-2024 Carnegie Mellon University
3
* See license information in LICENSE.txt.
4
*/
5
/*
6
* ring.c
7
* General ring array implementation
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
41
#ifndef _YAF_RING_H_
42
#define _YAF_RING_H_
43
#include <yaf/autoinc.h>
44
45
struct
rgaRing_st;
46
typedef
struct
rgaRing_st rgaRing_t;
47
48
rgaRing_t *
49
rgaAlloc(
50
size_t
elt_sz,
51
size_t
cap);
52
53
void
54
rgaFree(
55
rgaRing_t *ring);
56
57
uint8_t *
58
rgaNextHead(
59
rgaRing_t *ring);
60
61
void
62
rgaRewindHead(
63
rgaRing_t *ring);
64
65
uint8_t *
66
rgaNextTail(
67
rgaRing_t *ring);
68
69
size_t
70
rgaCount(
71
rgaRing_t *ring);
72
73
size_t
74
rgaPeak(
75
rgaRing_t *ring);
76
77
#if YAF_RING_THREAD
78
79
rgaRing_t *
80
rgaAllocThreaded(
81
size_t
elt_sz,
82
size_t
cap);
83
84
uint8_t *
85
rgaWaitHead(
86
rgaRing_t *ring);
87
88
void
89
rgaReleaseHead(
90
rgaRing_t *ring,
91
size_t
rsv);
92
93
uint8_t *
94
rgaWaitTail(
95
rgaRing_t *ring);
96
97
void
98
rgaReleaseTail(
99
rgaRing_t *ring,
100
size_t
rsv);
101
102
void
103
rgaSetInterrupt(
104
rgaRing_t *ring);
105
106
void
107
rgaClearInterrupt(
108
rgaRing_t *ring);
109
110
#endif
/* if YAF_RING_THREAD */
111
#endif
/* ifndef _YAF_RING_H_ */