From 7bc7c104eeee992d6a92297317b9f35e89e9096c Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 11 Jul 2000 22:11:36 +0000 Subject: Allow a ``timeout secs'' filter option to let specific packet types effect the idle timer in different ways. Submitted by: Stefan Esser With adjustments by me to document the option in the man page and to give the same semantics for outgoing traffic as incoming. I made the style more consistent in ip.c - this should really have been done as a separate commit. --- usr.sbin/ppp/filter.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'usr.sbin/ppp/filter.c') diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c index bed986e..3f0293b 100644 --- a/usr.sbin/ppp/filter.c +++ b/usr.sbin/ppp/filter.c @@ -468,6 +468,11 @@ Parse(struct ipcp *ipcp, int argc, char const *const *argv, argv++; } + if (argc >= 2 && strcmp(argv[argc - 2], "timeout") == 0) { + filterdata.timeout = strtoul(argv[argc - 1], NULL, 10); + argc -= 2; + } + val = 1; filterdata.f_proto = proto; @@ -587,6 +592,8 @@ doShowFilter(struct filterent *fp, struct prompt *prompt) if (fp->f_finrst) prompt_Printf(prompt, " finrst"); } + if (fp->timeout != 0) + prompt_Printf(prompt, " timeout %u", fp->timeout); prompt_Printf(prompt, "\n"); } } -- cgit v1.1