#ifndef _NPFKERN_H_
#define _NPFKERN_H_
#ifndef _KERNEL
#include <stdbool.h>
#include <inttypes.h>
#endif
struct mbuf;
struct ifnet;
#if defined(_NPF_STANDALONE) || !defined(__NetBSD__)
#define PFIL_IN 0x00000001
#define PFIL_OUT 0x00000002
#endif
#define NPF_NO_GC 0x01
typedef struct {
const char * (*getname)(npf_t *, struct ifnet *);
struct ifnet * (*lookup)(npf_t *, const char *);
void (*flush)(npf_t *, void *);
void * (*getmeta)(npf_t *, const struct ifnet *);
void (*setmeta)(npf_t *, struct ifnet *, void *);
} npf_ifops_t;
typedef struct {
struct mbuf * (*alloc)(npf_t *, unsigned, size_t);
void (*free)(struct mbuf *);
void * (*getdata)(const struct mbuf *);
struct mbuf * (*getnext)(struct mbuf *);
size_t (*getlen)(const struct mbuf *);
size_t (*getchainlen)(const struct mbuf *);
bool (*ensure_contig)(struct mbuf **, size_t);
bool (*ensure_writable)(struct mbuf **, size_t);
int (*get_tag)(const struct mbuf *, uint32_t *);
int (*set_tag)(struct mbuf *, uint32_t);
} npf_mbufops_t;
int npfk_sysinit(unsigned);
void npfk_sysfini(void);
npf_t * npfk_create(int, const npf_mbufops_t *, const npf_ifops_t *, void *);
int npfk_load(npf_t *, const void *, npf_error_t *);
int npfk_socket_load(npf_t *, int);
void npfk_gc(npf_t *);
void npfk_destroy(npf_t *);
void * npfk_getarg(npf_t *);
void npfk_thread_register(npf_t *);
void npfk_thread_unregister(npf_t *);
int npfk_packet_handler(npf_t *, struct mbuf **, struct ifnet *, int);
int npfk_layer2_handler(npf_t *, struct mbuf **, struct ifnet *, int);
void npfk_ifmap_attach(npf_t *, struct ifnet *);
void npfk_ifmap_detach(npf_t *, struct ifnet *);
int npfk_param_get(npf_t *, const char *, int *);
int npfk_param_set(npf_t *, const char *, int);
void npfk_stats(npf_t *, uint64_t *);
void npfk_stats_clear(npf_t *);
int npf_ext_log_init(npf_t *);
int npf_ext_log_fini(npf_t *);
int npf_ext_normalize_init(npf_t *);
int npf_ext_normalize_fini(npf_t *);
int npf_ext_rndblock_init(npf_t *);
int npf_ext_rndblock_fini(npf_t *);
int npf_ext_route_init(npf_t *);
int npf_ext_route_fini(npf_t *);
int npf_alg_icmp_init(npf_t *);
int npf_alg_icmp_fini(npf_t *);
int npf_alg_pptp_init(npf_t *);
int npf_alg_pptp_fini(npf_t *);
#endif