summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/filter.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-08-02 11:53:16 +0000
committerbrian <brian@FreeBSD.org>1999-08-02 11:53:16 +0000
commit5b5828498ce7d177092ce4cab703281dbce9c563 (patch)
tree286e715bb495cf12ce3d6a2f222e318b996048fa /usr.sbin/ppp/filter.c
parentede804a7142c392ebacfd6ddedb78a29727a8ca8 (diff)
downloadFreeBSD-src-5b5828498ce7d177092ce4cab703281dbce9c563.zip
FreeBSD-src-5b5828498ce7d177092ce4cab703281dbce9c563.tar.gz
Filter ospf and igmp separately.
Kind-of submitted by: phk
Diffstat (limited to 'usr.sbin/ppp/filter.c')
-rw-r--r--usr.sbin/ppp/filter.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c
index b9e129e..3287ca5 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.32 1999/07/27 23:43:58 brian Exp $
+ * $Id: filter.c,v 1.33 1999/07/28 03:01:51 brian Exp $
*
* TODO: Shoud send ICMP error message when we discard packets.
*/
@@ -261,10 +261,13 @@ ParseUdpOrTcp(int argc, char const *const *argv, int proto,
return 1;
}
-static int ParseIgmp(int argc, char const * const *argv, struct filterent *tgt)
+static int
+ParseIgmp(int argc, char const * const *argv, struct filterent *tgt)
{
- /* Filter currently is a catch-all. Requests are either permitted or
- dropped. */
+ /*
+ * 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;
@@ -274,6 +277,22 @@ static int ParseIgmp(int argc, char const * const *argv, struct filterent *tgt)
return 1;
}
+static int
+ParseOspf(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, "ParseOspf: Too many parameters\n");
+ return 0;
+ } else
+ tgt->f_srcop = OP_NONE;
+
+ return 1;
+}
+
static unsigned
addrtype(const char *addr)
{
@@ -432,6 +451,9 @@ Parse(struct ipcp *ipcp, int argc, char const *const *argv,
case P_IGMP:
val = ParseIgmp(argc, argv, &filterdata);
break;
+ case P_OSPF:
+ val = ParseOspf(argc, argv, &filterdata);
+ break;
}
log_Printf(LogDEBUG, "Parse: Src: %s\n", inet_ntoa(filterdata.f_src.ipaddr));
@@ -569,7 +591,9 @@ filter_Show(struct cmdargs const *arg)
return 0;
}
-static const char *protoname[] = { "none", "tcp", "udp", "icmp", "igmp" };
+static const char *protoname[] = {
+ "none", "tcp", "udp", "icmp", "ospf", "igmp"
+};
const char *
filter_Proto2Nam(int proto)
OpenPOWER on IntegriCloud