3d9a792dd8
- Convert NPF connection table to thmap. State lookup is now lock-free. - Improve connection state G/C: it is now incremental and tunable. - Add support for dynamic NAT address. Translation addresses can now be selected from a pool of addresses. There are two selection algorithms, "ip-hash" and "round-robin" (see the man page). - Translation address can be specified as e.g. ifaddrs(wm0) in npf.conf to dynamically choose an IP from the interface address(es). - Add support for the NETMAP algorithm with static NAT for net-to-net translation (it is equivalent to iptables NETMAP logic). - Convert 'ipset' tables to use thmap; the table lookup is now lock-free. - Misc improvements, bug fixes and more unit tests. - Bump NPF_VERSION (will also bump libnpf).
58 lines
1.7 KiB
C
58 lines
1.7 KiB
C
/* $NetBSD: npftest.h,v 1.16 2019/01/19 21:19:32 rmind Exp $ */
|
|
|
|
/*
|
|
* Public Domain.
|
|
*/
|
|
|
|
#ifndef _NPF_TEST_H_
|
|
#define _NPF_TEST_H_
|
|
|
|
#include <inttypes.h>
|
|
#include <stdbool.h>
|
|
|
|
#if !defined(_NPF_STANDALONE)
|
|
#include <net/if.h>
|
|
#else
|
|
#define rumpns_npf_test_addif npf_test_addif
|
|
#define rumpns_npf_test_load npf_test_load
|
|
#define rumpns_npf_test_init npf_test_init
|
|
#define rumpns_npf_test_fini npf_test_fini
|
|
#define rumpns_npf_test_getif npf_test_getif
|
|
#define rumpns_npf_nbuf_test npf_nbuf_test
|
|
#define rumpns_npf_bpf_test npf_bpf_test
|
|
#define rumpns_npf_table_test npf_table_test
|
|
#define rumpns_npf_state_test npf_state_test
|
|
#define rumpns_npf_rule_test npf_rule_test
|
|
#define rumpns_npf_conn_test npf_conn_test
|
|
#define rumpns_npf_nat_test npf_nat_test
|
|
#define rumpns_npf_test_conc npf_test_conc
|
|
#define rumpns_npf_test_statetrack npf_test_statetrack
|
|
#endif
|
|
|
|
#include "npf.h"
|
|
|
|
void rumpns_npf_test_init(int (*)(int, const char *, void *),
|
|
const char *(*)(int, const void *, char *, socklen_t),
|
|
long (*)(void));
|
|
void rumpns_npf_test_fini(void);
|
|
int rumpns_npf_test_load(const void *, size_t, bool);
|
|
ifnet_t * rumpns_npf_test_addif(const char *, bool, bool);
|
|
ifnet_t * rumpns_npf_test_getif(const char *);
|
|
|
|
int rumpns_npf_test_statetrack(const void *, size_t,
|
|
ifnet_t *, bool, int64_t *);
|
|
void rumpns_npf_test_conc(bool, unsigned);
|
|
|
|
bool rumpns_npf_nbuf_test(bool);
|
|
bool rumpns_npf_bpf_test(bool);
|
|
bool rumpns_npf_table_test(bool, void *, size_t);
|
|
bool rumpns_npf_state_test(bool);
|
|
|
|
bool rumpns_npf_rule_test(bool);
|
|
bool rumpns_npf_conn_test(bool);
|
|
bool rumpns_npf_nat_test(bool);
|
|
|
|
int process_stream(const char *, const char *, ifnet_t *);
|
|
|
|
#endif
|