Home | History | Annotate | Line # | Download | only in libnpftest
npf_test.h revision 1.6.2.1
      1      1.4  rmind /*	$NetBSD: npf_test.h,v 1.6.2.1 2014/08/20 00:05:11 tls Exp $	*/
      2      1.1  rmind 
      3      1.1  rmind /*
      4      1.1  rmind  * Public Domain.
      5      1.1  rmind  */
      6      1.1  rmind 
      7      1.1  rmind #ifndef _LIB_NPF_TEST_H_
      8      1.1  rmind #define _LIB_NPF_TEST_H_
      9      1.1  rmind 
     10      1.1  rmind #include <sys/types.h>
     11      1.1  rmind #include <sys/mbuf.h>
     12      1.1  rmind 
     13      1.1  rmind #include <netinet/in_systm.h>
     14      1.1  rmind #include <netinet/in.h>
     15      1.1  rmind #include <netinet6/in6.h>
     16      1.1  rmind 
     17      1.1  rmind #include <netinet/ip.h>
     18      1.1  rmind #include <netinet/ip6.h>
     19      1.1  rmind #include <netinet/tcp.h>
     20      1.1  rmind #include <netinet/udp.h>
     21      1.1  rmind #include <netinet/ip_icmp.h>
     22      1.1  rmind 
     23      1.1  rmind #include <net/if.h>
     24      1.1  rmind #include <net/if_ether.h>
     25      1.1  rmind #include <net/ethertypes.h>
     26      1.1  rmind 
     27  1.6.2.1    tls /* Test interfaces and IP addresses. */
     28  1.6.2.1    tls #define	IFNAME_EXT	"npftest0"
     29  1.6.2.1    tls #define	IFNAME_INT	"npftest1"
     30  1.6.2.1    tls #define	IFNAME_TEST	"npftest2"
     31  1.6.2.1    tls 
     32  1.6.2.1    tls #define	LOCAL_IP1	"10.1.1.1"
     33  1.6.2.1    tls #define	LOCAL_IP2	"10.1.1.2"
     34  1.6.2.1    tls #define	LOCAL_IP3	"10.1.1.3"
     35  1.6.2.1    tls 
     36  1.6.2.1    tls /* Note: RFC 5737 compliant addresses. */
     37  1.6.2.1    tls #define	PUB_IP1		"192.0.2.1"
     38  1.6.2.1    tls #define	PUB_IP2		"192.0.2.2"
     39  1.6.2.1    tls #define	PUB_IP3		"192.0.2.3"
     40  1.6.2.1    tls 
     41  1.6.2.1    tls #define	REMOTE_IP1	"192.0.2.101"
     42  1.6.2.1    tls #define	REMOTE_IP2	"192.0.2.102"
     43  1.6.2.1    tls #define	REMOTE_IP3	"192.0.2.103"
     44  1.6.2.1    tls 
     45  1.6.2.1    tls #define	LOCAL_IP6	"fd01:203:405:1::1234"
     46  1.6.2.1    tls #define	REMOTE_IP6	"2001:db8:fefe::1010"
     47  1.6.2.1    tls #define	EXPECTED_IP6	"2001:db8:1:d550::1234"
     48  1.6.2.1    tls 
     49  1.6.2.1    tls void		npf_test_init(int (*)(int, const char *, void *),
     50  1.6.2.1    tls 		    const char *(*)(int, const void *, char *, socklen_t),
     51  1.6.2.1    tls 		    long (*)(void));
     52      1.2  rmind int		npf_test_load(const void *);
     53  1.6.2.1    tls ifnet_t *	npf_test_addif(const char *, bool, bool);
     54  1.6.2.1    tls ifnet_t *	npf_test_getif(const char *);
     55  1.6.2.1    tls 
     56  1.6.2.1    tls int		npf_test_statetrack(const void *, size_t, ifnet_t *,
     57      1.2  rmind 		    bool, int64_t *);
     58  1.6.2.1    tls void		npf_test_conc(bool, unsigned);
     59      1.2  rmind 
     60      1.2  rmind struct mbuf *	mbuf_getwithdata(const void *, size_t);
     61      1.1  rmind struct mbuf *	mbuf_construct_ether(int);
     62      1.1  rmind struct mbuf *	mbuf_construct(int);
     63      1.4  rmind struct mbuf *	mbuf_construct6(int);
     64      1.1  rmind void *		mbuf_return_hdrs(struct mbuf *, bool, struct ip **);
     65  1.6.2.1    tls void *		mbuf_return_hdrs6(struct mbuf *, struct ip6_hdr **);
     66      1.1  rmind void		mbuf_icmp_append(struct mbuf *, struct mbuf *);
     67      1.1  rmind 
     68      1.1  rmind bool		npf_nbuf_test(bool);
     69  1.6.2.1    tls bool		npf_bpf_test(bool);
     70  1.6.2.1    tls bool		npf_table_test(bool, void *, size_t);
     71      1.3  rmind bool		npf_state_test(bool);
     72      1.1  rmind 
     73      1.5  rmind bool		npf_rule_test(bool);
     74      1.5  rmind bool		npf_nat_test(bool);
     75      1.5  rmind 
     76  1.6.2.1    tls int		npf_inet_pton(int, const char *, void *);
     77  1.6.2.1    tls const char *	npf_inet_ntop(int, const void *, char *, socklen_t);
     78  1.6.2.1    tls 
     79      1.1  rmind #endif
     80