X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fminconn.c;h=c12216a0a7d81d55a86e424b74a3756682cbf194;hb=HEAD;hp=40855ee1673637f565b6b19913bfd8b02f7958ba;hpb=032020241d270c53dff479a7b0eb7fe487c56a78;p=ppp.git diff --git a/pppd/plugins/minconn.c b/pppd/plugins/minconn.c index 40855ee..cd61ccd 100644 --- a/pppd/plugins/minconn.c +++ b/pppd/plugins/minconn.c @@ -22,7 +22,7 @@ * 4. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by Paul Mackerras - * ". + * ". * * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY @@ -32,19 +32,28 @@ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #include #include -#include "pppd.h" +#include +#include +#include +#include + +#include +#include + +#if !defined(SOL2) +#include +#else +#include +#endif -char pppd_version[] = VERSION; +char pppd_version[] = PPPD_VERSION; static int minconnect = 0; -static option_t my_options[] = { +static struct option my_options[] = { { "minconnect", o_int, &minconnect, "Set minimum connect time before idle timeout applies" }, { NULL } @@ -55,16 +64,16 @@ static int my_get_idle(struct ppp_idle *idle) time_t t; if (idle == NULL) - return minconnect? minconnect: idle_time_limit; + return minconnect ? minconnect: ppp_get_max_idle_time(); t = idle->xmit_idle; if (idle->recv_idle < t) t = idle->recv_idle; - return idle_time_limit - t; + return ppp_get_max_idle_time() - t; } void plugin_init(void) { info("plugin_init"); - add_options(my_options); + ppp_add_options(my_options); idle_time_hook = my_get_idle; }