home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / N / TCPIP / NETKIT-A.06 / NETKIT-A / NetKit-A-0.06 / dip337d-uri / config.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-05  |  1.6 KB  |  68 lines

  1. /*
  2.  * dip        A program for handling dialup IP connecions.
  3.  *        This program handles the connections needed for dialup
  4.  *        IP links, like SLIP or PPP.  It can handle both incoming
  5.  *        and outgoing connections, using password security for
  6.  *        incoming connections.  The outgoing connections use the
  7.  *        system's dial(3) library if possible.
  8.  *
  9.  * Version:    @(#)config.c    3.3.3    08/16/93
  10.  *
  11.  * Author:      Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
  12.  *        Copyright 1988-1993 MicroWalt Corporation
  13.  *
  14.  *        This program is free software; you can redistribute it
  15.  *        and/or  modify it under  the terms of  the GNU General
  16.  *        Public  License as  published  by  the  Free  Software
  17.  *        Foundation;  either  version 2 of the License, or  (at
  18.  *        your option) any later version.
  19.  */
  20. #define GLOBAL
  21. #include "dip.h"
  22.  
  23.  
  24. #define DIP_HAVE_SLIP    1        /* select "SLIP"        */
  25. #define DIP_HAVE_CSLIP    1        /* select "CompressedSLIP"    */
  26. #define DIP_HAVE_PPP    0        /* select "PPP"            */
  27.  
  28.  
  29. #if DIP_HAVE_SLIP
  30. extern void do_slip(struct dip *dip);
  31. #endif
  32. #if DIP_HAVE_CSLIP
  33. extern void do_cslip(struct dip *dip);
  34. #endif
  35. #if DIP_HAVE_PPP
  36. extern void do_ppp(struct dip *dip);
  37. #endif
  38.  
  39.  
  40. struct protosw protosw[] = {
  41. #if DIP_HAVE_SLIP
  42.   { "SLIP",        1,    do_slip        },
  43. #endif
  44. #if DIP_HAVE_CSLIP
  45.   { "CSLIP",        2,    do_cslip    },
  46. #endif
  47. #if DIP_HAVE_PPP
  48.   { "PPP",        3,    do_ppp        },
  49. #endif
  50.   { (char *)NULL,    0,    NULL        }
  51. };
  52.  
  53.  
  54. int
  55. get_prot(char *name)
  56. {
  57.   register int i, j;
  58.  
  59.   i = 0;
  60.   j = atoi(name);
  61.   while(protosw[i].name != (char *)NULL) {
  62.     if (!strcmp(protosw[i].name, name)) return(protosw[i].type);
  63.     if (protosw[i].type == j) return(protosw[i].type);
  64.     i++;
  65.   }
  66.   return(0);
  67. }
  68.