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 {
32 
33 typedef int (*MacSetIteratorFunc)(uint8_t *addr, MacSetSide side, void*);
34 
35 MacSet *MacSetInit(int size);
36 void MacSetAdd(MacSet *, const uint8_t *src_addr, const uint8_t *dst_addr);
37 void MacSetAddWithCtr(MacSet *, const uint8_t *src_addr, const uint8_t *dst_addr, ThreadVars *tv,
38  uint16_t ctr_src, uint16_t ctr_dst);
39 int MacSetForEach(const MacSet*, MacSetIteratorFunc, void*);
40 int MacSetSize(const MacSet*);
42 void MacSetFree(MacSet*);
43 void MacSetRegisterFlowStorage(void);
45 bool MacSetFlowStorageEnabled(void);
46 void MacSetRegisterTests(void);
47 
48 #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:233
MacSetForEach
int MacSetForEach(const MacSet *, MacSetIteratorFunc, void *)
Definition: util-macset.c:220
MacSetInit
MacSet * MacSetInit(int size)
Definition: util-macset.c:91
MacSetIteratorFunc
int(* MacSetIteratorFunc)(uint8_t *addr, MacSetSide side, void *)
Definition: util-macset.h:33
MacSetRegisterFlowStorage
void MacSetRegisterFlowStorage(void)
Definition: util-macset.c:62
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
MacSetRegisterTests
void MacSetRegisterTests(void)
Definition: util-macset.c:421
MacSetReset
void MacSetReset(MacSet *)
MacSetAddWithCtr
void MacSetAddWithCtr(MacSet *, const uint8_t *src_addr, const uint8_t *dst_addr, ThreadVars *tv, uint16_t ctr_src, uint16_t ctr_dst)
Definition: util-macset.c:181
MAC_SET_DST
@ MAC_SET_DST
Definition: util-macset.h:30
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:190
MacSet_
Definition: util-macset.c:45
MacSetGetFlowStorageID
FlowStorageId MacSetGetFlowStorageID(void)
Definition: util-macset.c:114
MAC_SET_SRC
@ MAC_SET_SRC
Definition: util-macset.h:29
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
MacSetFree
void MacSetFree(MacSet *)
Definition: util-macset.c:264
MacSetFlowStorageEnabled
bool MacSetFlowStorageEnabled(void)
Definition: util-macset.c:85