2 * minconn.c - pppd plugin to implement a `minconnect' option.
4 * Copyright 1999 Paul Mackerras.
6 * Redistribution and use in source and binary forms are permitted
7 * provided that the above copyright notice and this paragraph are
8 * duplicated in all such forms. The name of the author
9 * may not be used to endorse or promote products derived
10 * from this software without specific prior written permission.
11 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
12 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
13 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 char pppd_version
[] = VERSION
;
21 static int minconnect
= 0;
23 static option_t my_options
[] = {
24 { "minconnect", o_int
, &minconnect
,
25 "Set minimum connect time before idle timeout applies" },
29 static int my_get_idle(struct ppp_idle
*idle
)
34 return minconnect
? minconnect
: idle_time_limit
;
36 if (idle
->recv_idle
< t
)
38 return idle_time_limit
- t
;
41 void plugin_init(void)
44 add_options(my_options
);
45 idle_time_hook
= my_get_idle
;