[En-Nut-Discussion] Pausing PPP session?

Vesa Jääskeläinen chaac at nic.fi
Sun Jun 26 15:15:01 CEST 2005


Hi,

Thank you for your reply. While I were there, I made a bit cleaner 
modification and submitted it to CVS. It should be available shortly on 
public CVS.

I implemented RAWMODE for AHDLC driver. When it is enabled it disables 
all data encapsulation. If Nut/Net tries to send PPP packet it just 
discards it to emulate packet loss. If session is too long in pause 
mode, some timeouts could terminate open connections. In my testing all 
seemed to work well.

To pause PPP session:

/* enable RAW mode */
u_long tmp;
tmp = 1;
_ioctl(pppcom, UART_SETRAWMODE, &tmp);

/* now PPP session is paused */

/* TODO: wait sufficient amount of time to allow packets to allow 
currently sending packet to be sent */

/* TODO: enter AT command mode, send +++ */

To resume PPP session:

/* TODO: send ATO to modem */

/* disable RAW mode */
u_long tmp;
tmp = 0;
_ioctl(pppcom, UART_SETRAWMODE, &tmp);

/* now PPP session is resumed */

Thanks,
Vesa Jääskeläinen

Brett Abbott wrote:
> Vesa
> 
> I was one of these optimistic people.  I spent some time looking at this 
> but have be working on paying customer needs..... ;)
> 
> A good solution involves preventing inwards and outwards packet flow and 
> signalling to the PPP layer to pause at the end of the next frame (or 
> now if silent) for both sending and receiving of packets.  There are 
> various short cuts but these were unlikely to be robust enough for what 
> I needed.  The trick is keeping the code compact.

[snip]

> 
> The above assumes that the ppp connection is already established.  There 
> may need to be extra code added to cope with a better implementation.  I 
> hope this helps.
> 
> Cheers
> Brett




More information about the En-Nut-Discussion mailing list