summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/filter.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-06-23 16:48:24 +0000
committerbrian <brian@FreeBSD.org>1999-06-23 16:48:24 +0000
commitf32906f4850984e002004d359ebc9dbf5d9d68c3 (patch)
treeafdaf207c3a90a551246c2814f7618cac59b36c5 /usr.sbin/ppp/filter.c
parent5924813a9fe9b7766494b9b8baab4cb1e8e0c667 (diff)
downloadFreeBSD-src-f32906f4850984e002004d359ebc9dbf5d9d68c3.zip
FreeBSD-src-f32906f4850984e002004d359ebc9dbf5d9d68c3.tar.gz
Support `igmp' filters.
Mostly submitted by: Timo Geusch <freebsd@sleepycat.ukpeople.net>
Diffstat (limited to 'usr.sbin/ppp/filter.c')
-rw-r--r--usr.sbin/ppp/filter.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index 3d3a3f70d..024cd91 100644
--- a/usr.sbin/ppp/filter.c
+++ b/usr.sbin/ppp/filter.c
@@ -17,7 +17,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: filter.c,v 1.28 1999/05/08 11:06:33 brian Exp $
+ * $Id: filter.c,v 1.29 1999/05/31 23:57:36 brian Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
@@ -261,6 +261,18 @@ ParseUdpOrTcp(int argc, char const *const *argv, int proto,
return 1;
}
+static int ParseIgmp(int argc, char const * const *argv, struct filterent *tgt) {
+ /* Filter currently is a catch-all. Requests are either permitted or
+ dropped. */
+ if (argc != 0) {
+ log_Printf(LogWARN, "ParseIgmp: Too many parameters\n");
+ return 0;
+ } else
+ tgt->opt.srcop = OP_NONE;
+
+ return 1;
+}
+
static unsigned
addrtype(const char *addr)
{
@@ -396,6 +408,9 @@ Parse(struct ipcp *ipcp, int argc, char const *const *argv,
case P_ICMP:
val = ParseIcmp(argc, argv, &filterdata);
break;
+ case P_IGMP:
+ val = ParseIgmp(argc, argv, &filterdata);
+ break;
}
log_Printf(LogDEBUG, "Parse: Src: %s\n", inet_ntoa(filterdata.src.ipaddr));
@@ -529,7 +544,7 @@ filter_Show(struct cmdargs const *arg)
return 0;
}
-static const char *protoname[] = { "none", "tcp", "udp", "icmp" };
+static const char *protoname[] = { "none", "tcp", "udp", "icmp", "igmp" };
const char *
filter_Proto2Nam(int proto)
OpenPOWER on IntegriCloud