[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 25/29] device/net_io.c: remove forward declarations
From: |
Marin Ramesa |
Subject: |
[PATCH 25/29] device/net_io.c: remove forward declarations |
Date: |
Mon, 9 Dec 2013 23:57:40 +0100 |
* device/net_io.c (bpf_hash, net_do_filter, bpf_do_filter, hash_ent_remove,
net_free_dead_infp, net_free_dead_entp, bpf_validate, bpf_eq, net_add_q_info,
bpf_match): Remove forward declarations.
* device/net_io.h (net_rcv_port, net_hash_entry, net_hash_header): Declare
forward.
(bpf_hash, net_do_filter, bpf_do_filter, hash_ent_remove, net_free_dead_infp,
net_free_dead_entp, bpf_validate, bpf_eq, net_add_q_info, bpf_match): Add
prototypes.
---
device/net_io.c | 38 -------------------------------------
device/net_io.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 38 deletions(-)
diff --git a/device/net_io.c b/device/net_io.c
index ee475ef..b3ec292 100644
--- a/device/net_io.c
+++ b/device/net_io.c
@@ -305,13 +305,10 @@ typedef struct net_rcv_port *net_rcv_port_t;
struct kmem_cache net_rcv_cache; /* cache of net_rcv_port structs */
-
#define NET_HASH_SIZE 256
#define N_NET_HASH 4
#define N_NET_HASH_KEYS 4
-unsigned int bpf_hash (int, unsigned int *);
-
/*
* A single hash entry.
*/
@@ -351,7 +348,6 @@ decl_simple_lock_data(,net_hash_header_lock)
(elt) = (net_hash_entry_t) queue_next((queue_entry_t) (elt)); \
} while ((elt) != (head));
-
#define FILTER_ITERATE(if_port_list, fp, nextfp, chain) \
for ((fp) = (net_rcv_port_t) queue_first(if_port_list); \
!queue_end(if_port_list, (queue_entry_t)(fp)); \
@@ -365,40 +361,6 @@ decl_simple_lock_data(,net_hash_header_lock)
(dead) = (queue_entry_t)(entry_p); \
}
-extern boolean_t net_do_filter(); /* CSPF */
-extern int bpf_do_filter(); /* 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);
-
-
/*
* ethernet_priority:
*
diff --git a/device/net_io.h b/device/net_io.h
index cbf6845..dd00edd 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_ */
--
1.8.1.4
- [PATCH 17/29] device/dev_pager.c (device_pager_data_request_done): remove unnecessary cast, (continued)
- [PATCH 17/29] device/dev_pager.c (device_pager_data_request_done): remove unnecessary cast, Marin Ramesa, 2013/12/09
- [PATCH 18/29] device/dev_pager.c: remove forward declaration, Marin Ramesa, 2013/12/09
- [PATCH 19/29] device/dev_pager.c: remove forward declarations, Marin Ramesa, 2013/12/09
- [PATCH 20/29] device/ds_routines.c: remove forward declaration, Marin Ramesa, 2013/12/09
- [PATCH 21/29] device/ds_routines.c (device_write_get): check if io_count is larger or equal to zero and cast it to size_t, Marin Ramesa, 2013/12/09
- [PATCH 22/29] device/kmsg.c (kmsgread): check if io_count is larger or equal to zero and cast it to vm_size_t, Marin Ramesa, 2013/12/09
- [PATCH 23/29] device/kmsg.c (kmsgread, kmsg_read_done): cast arguments to memcpy(), Marin Ramesa, 2013/12/09
- [PATCH 24/29] device/kmsg.c (kmsg_read_done): check if amt is negative, Marin Ramesa, 2013/12/09
- [PATCH 25/29] device/net_io.c: remove forward declarations,
Marin Ramesa <=
- [PATCH 26/29] device/net_io.c (net_getstat): check if addr_byte_count is negative, Marin Ramesa, 2013/12/09
- [PATCH 27/29] device/net_io.c (net_getstat): cast arguments to memcpy(), Marin Ramesa, 2013/12/09
- [PATCH 28/29] device/net_io.c (net_getstat): cast arguments to memset(), Marin Ramesa, 2013/12/09
- [PATCH 29/29] device/subrs.c: use io_req_t instead of struct buf, Marin Ramesa, 2013/12/09