npftest.h revision 1.17.8.1 1 /* $NetBSD: npftest.h,v 1.17.8.1 2025/08/02 05:58:53 perseant Exp $ */
2
3 /*
4 * Public Domain.
5 */
6
7 #ifndef _NPF_TEST_H_
8 #define _NPF_TEST_H_
9
10 #include <inttypes.h>
11 #include <stdbool.h>
12
13 #if !defined(_NPF_STANDALONE)
14 #include <net/if.h>
15 #else
16 #define rumpns_npf_test_addif npf_test_addif
17 #define rumpns_npf_test_load npf_test_load
18 #define rumpns_npf_test_init npf_test_init
19 #define rumpns_npf_test_fini npf_test_fini
20 #define rumpns_npf_test_getif npf_test_getif
21 #define rumpns_npf_nbuf_test npf_nbuf_test
22 #define rumpns_npf_bpf_test npf_bpf_test
23 #define rumpns_npf_table_test npf_table_test
24 #define rumpns_npf_state_test npf_state_test
25 #define rumpns_npf_rule_test npf_rule_test
26 #define rumpns_npf_layer2_rule_test npf_layer2_rule_test
27 #define rumpns_npf_nat_test npf_nat_test
28 #define rumpns_npf_gc_test npf_gc_test
29 #define rumpns_npf_test_conc npf_test_conc
30 #define rumpns_npf_test_statetrack npf_test_statetrack
31 #define rumpns_npf_guid_test npf_guid_test
32 #define rumpns_npf_layer2only_test npf_layer2only_test
33 #endif
34
35 #include "npf.h"
36
37 void rumpns_npf_test_init(int (*)(int, const char *, void *),
38 const char *(*)(int, const void *, char *, socklen_t),
39 long (*)(void));
40 void rumpns_npf_test_fini(void);
41 int rumpns_npf_test_load(const void *, size_t, bool);
42 ifnet_t * rumpns_npf_test_addif(const char *, bool, bool);
43 ifnet_t * rumpns_npf_test_getif(const char *);
44
45 int rumpns_npf_test_statetrack(const void *, size_t,
46 ifnet_t *, bool, int64_t *);
47 void rumpns_npf_test_conc(bool, unsigned);
48
49 bool rumpns_npf_nbuf_test(bool);
50 bool rumpns_npf_bpf_test(bool);
51 bool rumpns_npf_table_test(bool, void *, size_t);
52 bool rumpns_npf_state_test(bool);
53
54 bool rumpns_npf_rule_test(bool);
55 bool rumpns_npf_layer2_rule_test(bool);
56 bool rumpns_npf_nat_test(bool);
57 bool rumpns_npf_guid_test(bool);
58 bool rumpns_npf_gc_test(bool);
59 bool rumpns_npf_layer2only_test(bool);
60
61 int process_stream(const char *, const char *, ifnet_t *);
62
63 #endif
64