home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 May / pcp151c.iso / misc / src / install / modutils / kerneld / README.ppp-slip < prev    next >
Encoding:
Text File  |  1998-01-06  |  3.2 KB  |  91 lines

  1. Here is an example of support for automatic dialling, suitable for ppp, slip
  2. and plip connections.
  3. It is included as a working example of what can be done with kerneld.
  4. There is yet no support for automatic re-dialling of dropped lines...
  5.  
  6. For ppp, you should use a recent release of pppd, that supports the
  7. "idle-disconnect" parameter.
  8.  
  9. Note: there is a patch below that will autoload the slip module as well..
  10.  
  11. Anyway, the connection will be set up automatically whenever you try
  12. to make a connection with ping, ftp or whatever...
  13. (Check your "/etc/resolv.conf" for the "nameserver" directive.)
  14.  
  15. The rest of this text concerns ppp, but it is easy to "convert" the
  16. instructions so that they will fit slip, if that is what you use.
  17.  
  18. The kerneld utility will also be triggered automatically by pppd, via the
  19. kernel, to load the modules "ppp" and "slhc" if they aren't resident.
  20. These modules will be removed by kerneld when they have done their job...
  21. If your normal dialup time exceeds 60 seconds, you could try to adjust
  22. the timeout in the script "/sbin/request-route" as well as the "delay"
  23. parameter to kerneld (see the man page for kerneld).
  24.  
  25. The patch to "linux/net/inet/route.c" will make a kerneld request for
  26. the action KERNELD_REQUEST_ROUTE if no suitable route has been found.
  27. This will make kerneld start the utility "/sbin/request-route" with
  28. the requested route as a parameter (in aaa.bbb.ccc.ddd notation).
  29.  
  30. The included "request-route" will start up pppd and wait for a connection.
  31. When the connection is up, pppd will execute the script "/etc/ppp/ip-up".
  32. A suitable low-budget "/etc/ppp/ip-up" can look like this:
  33.  
  34.     #! /bin/sh
  35.     LOCK=/tmp/request-route
  36.     if [ -f $LOCK ]
  37.     then
  38.         to_kill=`cat $LOCK`
  39.         kill -1 $to_kill
  40.     fi
  41.  
  42. This will make "/sbin/request-route" return before the timeout of 60 seconds.
  43. If no IP-activity has been seen for at least the timeout period, the patched
  44. pppd will terminate after "idle-diconnect" seconds.
  45.  
  46.  
  47. So, you will need to update your "/etc/ppp/ip-up" script according to
  48. the example above, maybe adapt /sbin/request-route so that it fits your
  49. needs, possibly create a chat-file "/etc/ppp/chat-1.2.3.4" (the IP address
  50. of your name server, to be accessed by ppp), and finally apply the patch to
  51. your pppd-2.1.2[bc] sources.
  52.  
  53. That's it!
  54.  
  55. Bjorn Ekwall <bj0rn@blox.se>
  56.  
  57. ============= Kernel support for autoloading slip =============
  58. --- linux/drivers/char/tty_io.c.1.3.57    Tue Dec 12 06:16:36 1995
  59. +++ linux/drivers/char/tty_io.c    Sun Jan 14 11:16:29 1996
  60. @@ -73,6 +73,10 @@
  61.  #include "vt_kern.h"
  62.  #include "selection.h"
  63.  
  64. +#ifdef CONFIG_KERNELD
  65. +#include <linux/kerneld.h>
  66. +#endif
  67. +
  68.  #define CONSOLE_DEV MKDEV(TTY_MAJOR,0)
  69.  #define TTY_DEV MKDEV(TTYAUX_MAJOR,0)
  70.  
  71. @@ -211,8 +215,17 @@
  72.      int    retval = 0;
  73.      struct    tty_ldisc o_ldisc;
  74.  
  75. -    if ((ldisc < N_TTY) || (ldisc >= NR_LDISCS) ||
  76. -        !(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED))
  77. +    if ((ldisc < N_TTY) || (ldisc >= NR_LDISCS))
  78. +        return -EINVAL;
  79. +#ifdef CONFIG_KERNELD
  80. +    /* Eduardo Blanco <ejbs@cs.cs.com.uy> */
  81. +    if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED)) {
  82. +        char modname [20];
  83. +        sprintf(modname, "tty-ldisc-%d", ldisc);
  84. +        request_module (modname);
  85. +    }
  86. +#endif
  87. +    if (!(ldiscs[ldisc].flags & LDISC_FLAG_DEFINED))
  88.          return -EINVAL;
  89.  
  90.      if (tty->ldisc.num == ldisc)
  91.