1 /* $NetBSD: npftest.h,v 1.17 2020/05/30 14:16:56 rmind 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_nat_test npf_nat_test 27 #define rumpns_npf_gc_test npf_gc_test 28 #define rumpns_npf_test_conc npf_test_conc 29 #define rumpns_npf_test_statetrack npf_test_statetrack 30 #endif 31 32 #include "npf.h" 33 34 void rumpns_npf_test_init(int (*)(int, const char *, void *), 35 const char *(*)(int, const void *, char *, socklen_t), 36 long (*)(void)); 37 void rumpns_npf_test_fini(void); 38 int rumpns_npf_test_load(const void *, size_t, bool); 39 ifnet_t * rumpns_npf_test_addif(const char *, bool, bool); 40 ifnet_t * rumpns_npf_test_getif(const char *); 41 42 int rumpns_npf_test_statetrack(const void *, size_t, 43 ifnet_t *, bool, int64_t *); 44 void rumpns_npf_test_conc(bool, unsigned); 45 46 bool rumpns_npf_nbuf_test(bool); 47 bool rumpns_npf_bpf_test(bool); 48 bool rumpns_npf_table_test(bool, void *, size_t); 49 bool rumpns_npf_state_test(bool); 50 51 bool rumpns_npf_rule_test(bool); 52 bool rumpns_npf_nat_test(bool); 53 bool rumpns_npf_gc_test(bool); 54 55 int process_stream(const char *, const char *, ifnet_t *); 56 57 #endif 58