summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_divert.h
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2004-10-19 21:14:57 +0000
committerandre <andre@FreeBSD.org>2004-10-19 21:14:57 +0000
commit9f43dad9fc6c03f7de0b8524d64fa3cdac16bd58 (patch)
treecdb937a58e5fb1c4e6d3074c04eadefb30ae7251 /sys/netinet/ip_divert.h
parent40693cc7d92c8317aac4b7e774996bf54b3d79f9 (diff)
downloadFreeBSD-src-9f43dad9fc6c03f7de0b8524d64fa3cdac16bd58.zip
FreeBSD-src-9f43dad9fc6c03f7de0b8524d64fa3cdac16bd58.tar.gz
Convert IPDIVERT into a loadable module. This makes use of the dynamic loadability
of protocols. The call to divert_packet() is done through a function pointer. All semantics of IPDIVERT remain intact. If IPDIVERT is not loaded ipfw will refuse to install divert rules and natd will complain about 'protocol not supported'. Once it is loaded both will work and accept rules and open the divert socket. The module can only be unloaded if no divert sockets are open. It does not close any divert sockets when an unload is requested but will return EBUSY instead.
Diffstat (limited to 'sys/netinet/ip_divert.h')
-rw-r--r--sys/netinet/ip_divert.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/netinet/ip_divert.h b/sys/netinet/ip_divert.h
index d925918..1bb0944 100644
--- a/sys/netinet/ip_divert.h
+++ b/sys/netinet/ip_divert.h
@@ -36,9 +36,15 @@
#define _NETINET_IP_DIVERT_H_
/*
- * Divert socket definitions.
+ * Sysctl declaration.
*/
+#ifdef SYSCTL_DECL
+SYSCTL_DECL(_net_inet_divert);
+#endif
+/*
+ * Divert socket definitions.
+ */
struct divert_tag {
u_int32_t info; /* port & flags */
u_int16_t cookie; /* ipfw rule number */
@@ -74,10 +80,10 @@ divert_find_info(struct mbuf *m)
return mtag ? divert_info(mtag) : 0;
}
+typedef void ip_divert_packet_t(struct mbuf *m, int incoming);
+extern ip_divert_packet_t *ip_divert_ptr;
+
extern void div_init(void);
extern void div_input(struct mbuf *, int);
extern void div_ctlinput(int, struct sockaddr *, void *);
-extern void divert_packet(struct mbuf *m, int incoming);
-extern struct mbuf *divert_clone(struct mbuf *);
-extern struct pr_usrreqs div_usrreqs;
#endif /* _NETINET_IP_DIVERT_H_ */
OpenPOWER on IntegriCloud