summaryrefslogtreecommitdiff
path: root/device/net_io.h
diff options
context:
space:
mode:
Diffstat (limited to 'device/net_io.h')
-rw-r--r--device/net_io.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/device/net_io.h b/device/net_io.h
index cbf6845..0cdd712 100644
--- a/device/net_io.h
+++ b/device/net_io.h
@@ -46,6 +46,15 @@
#include <device/io_req.h>
#include <device/net_status.h>
+struct net_rcv_port;
+typedef struct net_rcv_port *net_rcv_port_t;
+
+struct net_hash_entry;
+typedef struct net_hash_entry *net_hash_entry_t;
+
+struct net_hash_header;
+typedef struct net_hash_header *net_hash_header_t;
+
/*
* A network packet is wrapped in a kernel message while in
* the kernel.
@@ -91,4 +100,53 @@ extern unsigned short int ntohs(unsigned short int);
extern unsigned int htonl(unsigned int);
extern unsigned short int htons(unsigned short int);
+unsigned int bpf_hash(int n, unsigned int *keys);
+
+extern boolean_t
+net_do_filter(
+ net_rcv_port_t infp,
+ char * data,
+ unsigned int data_count,
+ char * header); /* CSPF */
+
+extern int
+bpf_do_filter(
+ net_rcv_port_t infp,
+ char * p,
+ unsigned int wirelen,
+ char * header,
+ unsigned int hlen,
+ net_hash_entry_t **hash_headpp,
+ net_hash_entry_t *entpp); /* BPF */
+
+int hash_ent_remove(
+ struct ifnet *ifp,
+ net_hash_header_t hp,
+ int used,
+ net_hash_entry_t *head,
+ net_hash_entry_t entp,
+ queue_entry_t *dead_p);
+
+void net_free_dead_infp(queue_entry_t dead_infp);
+void net_free_dead_entp (queue_entry_t dead_entp);
+
+int bpf_validate(
+ bpf_insn_t f,
+ int bytes,
+ bpf_insn_t *match);
+
+int bpf_eq(
+ bpf_insn_t f1,
+ bpf_insn_t f2,
+ int bytes);
+
+int net_add_q_info(ipc_port_t rcv_port);
+
+int bpf_match (
+ net_hash_header_t hash,
+ int n_keys,
+ unsigned int *keys,
+ net_hash_entry_t **hash_headpp,
+ net_hash_entry_t *entpp);
+
#endif /* _DEVICE_NET_IO_H_ */