summaryrefslogtreecommitdiff
path: root/contrib/ipfilter/ipl_ldev.c
diff options
context:
space:
mode:
authorcvs2svn <cvs2svn@FreeBSD.org>2000-08-13 04:58:03 +0000
committercvs2svn <cvs2svn@FreeBSD.org>2000-08-13 04:58:03 +0000
commitff24aa67fbd1e9460da19def786a865ecfd7cda0 (patch)
treeb6208e834da3a031f782602d46cbaf8bb71261c3 /contrib/ipfilter/ipl_ldev.c
parentf345cd2b83cb22b57029f3252ab0431b366cdc13 (diff)
downloadsrc-test2-vendor/ipfilter/3.4.9.tar.gz
src-test2-vendor/ipfilter/3.4.9.zip
Diffstat (limited to 'contrib/ipfilter/ipl_ldev.c')
-rw-r--r--contrib/ipfilter/ipl_ldev.c83
1 files changed, 0 insertions, 83 deletions
diff --git a/contrib/ipfilter/ipl_ldev.c b/contrib/ipfilter/ipl_ldev.c
deleted file mode 100644
index a2893257e72e..000000000000
--- a/contrib/ipfilter/ipl_ldev.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * (C)opyright 1993,1994,1995 by Darren Reed.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and due credit is given
- * to the original author and the contributors.
- */
-
-/*
- * routines below for saving IP headers to buffer
- */
-int iplopen(struct inode * inode, struct file * filp)
-{
- u_int min = MINOR(inode->i_rdev);
-
- if (flags & FWRITE)
- return ENXIO;
- if (min)
- return ENXIO;
- iplbusy++;
- return 0;
-}
-
-
-int iplclose(struct inode * inode, struct file * filp)
-{
- u_int min = MINOR(inode->i_rdev);
-
- if (min)
- return ENXIO;
- iplbusy--;
- return 0;
-}
-
-
-/*
- * iplread/ipllog
- * all three of these must operate with at least splnet() lest they be
- * called during packet processing and cause an inconsistancy to appear in
- * the filter lists.
- */
-int iplread(struct inode *inode, struct file *file, char *buf, int count)
-{
- register int ret, s;
- register size_t sz, sx;
- int error;
-
- if (!uio->uio_resid)
- return 0;
- while (!iplused) {
- error = SLEEP(iplbuf, "ipl sleep");
- if (error)
- return error;
- }
-
- SPLNET(s);
-
- ret = sx = sz = MIN(count, iplused);
- if (iplh < iplt)
- sz = MIN(sz, LOGSIZE - (iplt - iplbuf));
- sx -= sz;
-
- memcpy_tofs(buf, iplt, sz);
- buf += sz;
- iplt += sz;
- iplused -= sz;
- if ((iplh < iplt) && (iplt == iplbuf + LOGSIZE))
- iplt = iplbuf;
-
- if (sx) {
- memcpy_tofs(buf, iplt, sx);
- ret += sx;
- iplt += sx;
- iplused -= sx;
- if ((iplh < iplt) && (iplt == iplbuf + LOGSIZE))
- iplt = iplbuf;
- }
- if (!iplused) /* minimise wrapping around the end */
- iplh = iplt = iplbuf;
-
- SPLX(s);
- return ret;
-}