2 * minconn.c - pppd plugin to implement a `minconnect' option.
4 * Copyright 1999 Paul Mackerras.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
15 char pppd_version[] = VERSION;
17 static int minconnect = 0;
19 static option_t my_options[] = {
20 { "minconnect", o_int, &minconnect,
21 "Set minimum connect time before idle timeout applies" },
25 static int my_get_idle(struct ppp_idle *idle)
30 return minconnect? minconnect: idle_time_limit;
32 if (idle->recv_idle < t)
34 return idle_time_limit - t;
37 void plugin_init(void)
40 add_options(my_options);
41 idle_time_hook = my_get_idle;