lcp.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:3k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* lcp.h - Link Control Protocol header */
  2. /* Copyright 1995 Wind River Systems, Inc. */
  3. /*
  4.  * Copyright (c) 1989 Carnegie Mellon University.
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms are permitted
  8.  * provided that the above copyright notice and this paragraph are
  9.  * duplicated in all such forms and that any documentation,
  10.  * advertising materials, and other materials related to such
  11.  * distribution and use acknowledge that the software was developed
  12.  * by Carnegie Mellon University.  The name of the
  13.  * University may not be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  */
  19. /*
  20. modification history
  21. --------------------
  22. 01a,16jan95,dzb  WRS-ize.
  23. */
  24. #ifndef __INClcph
  25. #define __INClcph
  26. #ifdef  __cplusplus
  27. extern "C" {
  28. #endif
  29. /*
  30.  * Options.
  31.  */
  32. #define CI_MRU 1 /* Maximum Receive Unit */
  33. #define CI_ASYNCMAP 2 /* Async Control Character Map */
  34. #define CI_AUTHTYPE 3 /* Authentication Type */
  35. #define CI_QUALITY 4 /* Quality Protocol */
  36. #define CI_MAGICNUMBER 5 /* Magic Number */
  37. #define CI_PCOMPRESSION 7 /* Protocol Field Compression */
  38. #define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */
  39. /*
  40.  * LCP-specific packet types.
  41.  */
  42. #define PROTREJ         8       /* Protocol Reject */
  43. #define ECHOREQ         9       /* Echo Request */
  44. #define ECHOREP         10      /* Echo Reply */
  45. #define DISCREQ         11      /* Discard Request */
  46. /*
  47.  * The state of options is described by an lcp_options structure.
  48.  */
  49. typedef struct lcp_options {
  50.     int passive : 1; /* Don't die if we don't get a response */
  51.     int silent : 1; /* Wait for the other end to start first */
  52.     int restart : 1; /* Restart vs. exit after close */
  53.     int neg_mru : 1; /* Negotiate the MRU? */
  54.     int neg_asyncmap : 1; /* Negotiate the async map? */
  55.     int neg_upap : 1; /* Ask for UPAP authentication? */
  56.     int neg_chap : 1; /* Ask for CHAP authentication? */
  57.     int neg_magicnumber : 1; /* Ask for magic number? */
  58.     int neg_pcompression : 1; /* HDLC Protocol Field Compression? */
  59.     int neg_accompression : 1; /* HDLC Address/Control Field Compression? */
  60.     int neg_lqr : 1; /* Negotiate use of Link Quality Reports */
  61.     u_short mru; /* Value of MRU */
  62.     u_char chap_mdtype; /* which MD type (hashing algorithm) */
  63.     u_long asyncmap; /* Value of async map */
  64.     u_long magicnumber;
  65.     int numloops; /* Number of loops during magic number neg. */
  66.     u_long lqr_period; /* Reporting period for link quality */
  67. } lcp_options;
  68. #define DEFMRU 1500 /* Try for this */
  69. #define MINMRU 128 /* No MRUs below this */
  70. #define MAXMRU 16384 /* Normally limit MRU to this */
  71. extern void lcp_init __ARGS((int));
  72. extern void lcp_open __ARGS((int));
  73. extern void lcp_close __ARGS((int));
  74. extern void lcp_lowerup __ARGS((int));
  75. extern void lcp_lowerdown __ARGS((int));
  76. extern void lcp_input __ARGS((int, u_char *, int));
  77. extern void lcp_protrej __ARGS((int));
  78. extern void lcp_sprotrej __ARGS((int, u_char *, int));
  79. extern int  lcp_printpkt __ARGS((u_char *, int,
  80.                           void (*) __ARGS((void *, char *, ...)), void *));
  81. extern int lcp_warnloops; /* Warn about a loopback this often */
  82. #define DEFWARNLOOPS 10 /* Default value for above */
  83. #ifdef  __cplusplus
  84. }
  85. #endif
  86. #endif /* __INClcph */