suricata
util-macset.h
Go to the documentation of this file.
1 /* Copyright (C) 2020 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 Sascha Steinbiss <sascha.steinbiss@dcso.de>
22  */
23 
24 #ifndef SURICATA_UTIL_MACSET_H
25 #define SURICATA_UTIL_MACSET_H
26 
27 typedef struct MacSet_ MacSet;
28 typedef enum { MAC_SET_SRC = 0, MAC_SET_DST } MacSetSide;
29 
30 typedef int (*MacSetIteratorFunc)(uint8_t *addr, MacSetSide side, void *);
31 
32 MacSet *MacSetInit(int size);
33 void MacSetAdd(MacSet *, const uint8_t *src_addr, const uint8_t *dst_addr);
34 void MacSetAddWithCtr(MacSet *, const uint8_t *src_addr, const uint8_t *dst_addr, ThreadVars *tv,
35  StatsCounterMaxId ctr_src, StatsCounterMaxId ctr_dst);
36 int MacSetForEach(const MacSet *, MacSetIteratorFunc, void *);
37 uint8_t *MacSetGetFirst(const MacSet *, MacSetSide);
38 int MacSetSize(const MacSet *);
40 void MacSetFree(MacSet *);
41 void MacSetRegisterFlowStorage(void);
43 bool MacSetFlowStorageEnabled(void);
44 void MacSetSwap(MacSet *);
45 void MacSetRegisterTests(void);
46 
47 #endif /* SURICATA_UTIL_MACSET_H */
FlowStorageId
Definition: flow-storage.h:31
MacSetSide
MacSetSide
Definition: util-macset.h:28
MacSetSize
int MacSetSize(const MacSet *)
Definition: util-macset.c:246
MacSetForEach
int MacSetForEach(const MacSet *, MacSetIteratorFunc, void *)
Definition: util-macset.c:220
MacSetInit
MacSet * MacSetInit(int size)
Definition: util-macset.c:90
MacSetIteratorFunc
int(* MacSetIteratorFunc)(uint8_t *addr, MacSetSide side, void *)
Definition: util-macset.h:30
MacSetGetFirst
uint8_t * MacSetGetFirst(const MacSet *, MacSetSide)
Definition: util-macset.c:233
MacSetRegisterFlowStorage
void MacSetRegisterFlowStorage(void)
Definition: util-macset.c:61
StatsCounterMaxId
Definition: counters.h:38
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
MacSetRegisterTests
void MacSetRegisterTests(void)
Definition: util-macset.c:489
MacSetReset
void MacSetReset(MacSet *)
MAC_SET_DST
@ MAC_SET_DST
Definition: util-macset.h:28
MacSet_::size
int size
Definition: util-macset.c:56
MacSetAdd
void MacSetAdd(MacSet *, const uint8_t *src_addr, const uint8_t *dst_addr)
Definition: util-macset.c:189
MacSet_
Definition: util-macset.c:45
MacSetAddWithCtr
void MacSetAddWithCtr(MacSet *, const uint8_t *src_addr, const uint8_t *dst_addr, ThreadVars *tv, StatsCounterMaxId ctr_src, StatsCounterMaxId ctr_dst)
Definition: util-macset.c:180
MacSetGetFlowStorageID
FlowStorageId MacSetGetFlowStorageID(void)
Definition: util-macset.c:113
MAC_SET_SRC
@ MAC_SET_SRC
Definition: util-macset.h:28
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:33
MacSetFree
void MacSetFree(MacSet *)
Definition: util-macset.c:277
MacSetSwap
void MacSetSwap(MacSet *)
Definition: util-macset.c:295
MacSetFlowStorageEnabled
bool MacSetFlowStorageEnabled(void)
Definition: util-macset.c:85