aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/socketvar.h
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2000-06-20 01:09:23 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2000-06-20 01:09:23 +0000
commita79b71281cd63ad7a6cc43a6d5673a2510b51630 (patch)
tree9aa09a30edf1fe89abe012a7e6a3a40b73b49b32 /sys/sys/socketvar.h
parent35bdac5bbd4463b0eb53ccfd8179f479d854bff9 (diff)
downloadsrc-a79b71281cd63ad7a6cc43a6d5673a2510b51630.tar.gz
src-a79b71281cd63ad7a6cc43a6d5673a2510b51630.zip
return of the accept filter part II
accept filters are now loadable as well as able to be compiled into the kernel. two accept filters are provided, one that returns sockets when data arrives the other when an http request is completed (doesn't work with 0.9 requests) Reviewed by: jmg
Notes
Notes: svn path=/head/; revision=61837
Diffstat (limited to 'sys/sys/socketvar.h')
-rw-r--r--sys/sys/socketvar.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h
index add6eb6c988e..f1134b774259 100644
--- a/sys/sys/socketvar.h
+++ b/sys/sys/socketvar.h
@@ -48,6 +48,8 @@
*/
typedef u_quad_t so_gen_t;
+struct accept_filter;
+
struct socket {
struct vm_zone *so_zone; /* zone we were allocated from */
short so_type; /* generic type, see socket.h */
@@ -112,6 +114,11 @@ struct socket {
/* NB: generation count must not be first; easiest to make it last. */
so_gen_t so_gencnt; /* generation count */
void *so_emuldata; /* private data for emulators */
+ struct so_accf {
+ struct accept_filter *so_accept_filter;
+ void *so_accept_filter_arg; /* saved filter args */
+ char *so_accept_filter_str; /* saved user args */
+ } *so_accf;
};
/*
@@ -270,9 +277,21 @@ struct sf_buf {
vm_offset_t kva; /* va of mapping */
};
+struct accept_filter {
+ char accf_name[16];
+ void (*accf_callback)
+ __P((struct socket *so, void *arg, int waitflag));
+ void * (*accf_create)
+ __P((struct socket *so, char *arg));
+ void (*accf_destroy)
+ __P((struct socket *so));
+ SLIST_ENTRY(accept_filter) accf_next; /* next on the list */
+};
+
#ifdef MALLOC_DECLARE
MALLOC_DECLARE(M_PCB);
MALLOC_DECLARE(M_SONAME);
+MALLOC_DECLARE(M_ACCF);
#endif
extern int maxsockets;
@@ -380,6 +399,14 @@ int soshutdown __P((struct socket *so, int how));
void sotoxsocket __P((struct socket *so, struct xsocket *xso));
void sowakeup __P((struct socket *so, struct sockbuf *sb));
+/* accept filter functions */
+int accept_filt_add __P((struct accept_filter *filt));
+int accept_filt_del __P((char *name));
+struct accept_filter * accept_filt_get __P((char *name));
+#ifdef ACCEPT_FILTER_MOD
+int accept_filt_generic_mod_event __P((module_t mod, int event, void *data));
+#endif /* ACCEPT_FILTER_MOD */
+
#endif /* _KERNEL */
#endif /* !_SYS_SOCKETVAR_H_ */