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 static int minconnect
= 0;
17 static option_t my_options
[] = {
18 { "minconnect", o_int
, &minconnect
,
19 "Set minimum connect time before idle timeout applies" },
23 static int my_get_idle(struct ppp_idle
*idle
)
28 return minconnect
? minconnect
: idle_time_limit
;
30 if (idle
->recv_idle
< t
)
32 return idle_time_limit
- t
;
35 void plugin_init(void)
38 add_options(my_options
);
39 idle_time_hook
= my_get_idle
;