Re: PPP Idle-time

Al Longyear (
Wed, 19 Jul 1995 06:01:51 -0700 (PDT)

E.J. Wilburn wrote:

> I'm trying to get PPP to change the idletime reported by the program w to
> reflect when it sent or recieved the last packet instead of when the
> program was run. To do this I need to have the kernel touch the device
> being used by the spefic ppp channel. I'm thinking I need to find the
> exact place in the kernel were ppp<channel> recieves or transmits a
> packet and add a line like this -
> utime(stdout, buftime);
> Am I on the right track? Would this signifigantly slow down the kernel
> or would it just be an unnoticable increase? Currently I'm running a max
> of 27 PPP channels and average about 20. Also where could I find where
> a specfic PPP channel inputs or outputs a packet? I'm running 1.2.11 on
> that particular system.

PPPPLLLLEEEEAAAASSSSEEEE, please, re-think and don't do this.

Frames are being sent on a busy ppp link at a very high rate. I know that
the buffering for the disk is in place however it must still do a directory
search to find the appropriate tty device file.

You should severly degrade your kernel if you do change file times based
upon frame activity.

If you wish to find the last time a frame was transmitted then why don't
you ask the ppp driver. It has a function for obtaining the following data:

1) time since the last IP frame was transmitted
2) time since the last IP frame was received
3) time since the last PPP (non-IP) frame was transmitted
4) time since the last PPP (non-IP) frame was received

To find the last time that a frame was transmitted, choose the smaller of
the times for the IP and non-IP transmitted entries. The values are
represented in jiffies (1/100ths of a second).

(Look at the code in the lcp.c file which is part of the pppd program for
examples on how to read the 'demand-dial' info (ddinfo).)

Al Longyear 
Finger for PGP key