]> git.karo-electronics.de Git - karo-tx-redboot.git/blob - packages/net/ppp/v2_0/include/lcp.h
Initial revision
[karo-tx-redboot.git] / packages / net / ppp / v2_0 / include / lcp.h
1 //==========================================================================
2 //
3 //      include/lcp.h
4 //
5 //==========================================================================
6 //####ECOSGPLCOPYRIGHTBEGIN####
7 // -------------------------------------------
8 // This file is part of eCos, the Embedded Configurable Operating System.
9 // Portions created by Nick Garnett are
10 // Copyright (C) 2003 eCosCentric Ltd.
11 //
12 // eCos is free software; you can redistribute it and/or modify it under
13 // the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 2 or (at your option) any later version.
15 //
16 // eCos is distributed in the hope that it will be useful, but WITHOUT ANY
17 // WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19 // for more details.
20 //
21 // You should have received a copy of the GNU General Public License along
22 // with eCos; if not, write to the Free Software Foundation, Inc.,
23 // 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
24 //
25 // As a special exception, if other files instantiate templates or use macros
26 // or inline functions from this file, or you compile this file and link it
27 // with other works to produce a work based on this file, this file does not
28 // by itself cause the resulting work to be covered by the GNU General Public
29 // License. However the source code for this file must still be made available
30 // in accordance with section (3) of the GNU General Public License.
31 //
32 // This exception does not invalidate any other reasons why a work based on
33 // this file might be covered by the GNU General Public License.
34 //
35 // -------------------------------------------
36 //####ECOSGPLCOPYRIGHTEND####
37 //####BSDCOPYRIGHTBEGIN####
38 //
39 // -------------------------------------------
40 //
41 // Portions of this software may have been derived from OpenBSD, 
42 // FreeBSD or other sources, and are covered by the appropriate
43 // copyright disclaimers included herein.
44 //
45 // -------------------------------------------
46 //
47 //####BSDCOPYRIGHTEND####
48 //==========================================================================
49
50 /*
51  * lcp.h - Link Control Protocol definitions.
52  *
53  * Copyright (c) 1989 Carnegie Mellon University.
54  * All rights reserved.
55  *
56  * Redistribution and use in source and binary forms are permitted
57  * provided that the above copyright notice and this paragraph are
58  * duplicated in all such forms and that any documentation,
59  * advertising materials, and other materials related to such
60  * distribution and use acknowledge that the software was developed
61  * by Carnegie Mellon University.  The name of the
62  * University may not be used to endorse or promote products derived
63  * from this software without specific prior written permission.
64  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
65  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
66  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
67  *
68  * $FreeBSD: src/usr.sbin/pppd/lcp.h,v 1.7 1999/08/28 01:19:05 peter Exp $
69  */
70
71 /*
72  * Options.
73  */
74 #define CI_MRU          1       /* Maximum Receive Unit */
75 #define CI_ASYNCMAP     2       /* Async Control Character Map */
76 #define CI_AUTHTYPE     3       /* Authentication Type */
77 #define CI_QUALITY      4       /* Quality Protocol */
78 #define CI_MAGICNUMBER  5       /* Magic Number */
79 #define CI_PCOMPRESSION 7       /* Protocol Field Compression */
80 #define CI_ACCOMPRESSION 8      /* Address/Control Field Compression */
81 #define CI_CALLBACK     13      /* callback */
82
83 /*
84  * LCP-specific packet types.
85  */
86 #define PROTREJ         8       /* Protocol Reject */
87 #define ECHOREQ         9       /* Echo Request */
88 #define ECHOREP         10      /* Echo Reply */
89 #define DISCREQ         11      /* Discard Request */
90 #define CBCP_OPT        6       /* Use callback control protocol */
91
92 /*
93  * The state of options is described by an lcp_options structure.
94  */
95 typedef struct lcp_options {
96     int passive : 1;            /* Don't die if we don't get a response */
97     int silent : 1;             /* Wait for the other end to start first */
98     int restart : 1;            /* Restart vs. exit after close */
99     int neg_mru : 1;            /* Negotiate the MRU? */
100     int neg_asyncmap : 1;       /* Negotiate the async map? */
101     int neg_upap : 1;           /* Ask for UPAP authentication? */
102     int neg_chap : 1;           /* Ask for CHAP authentication? */
103     int neg_magicnumber : 1;    /* Ask for magic number? */
104     int neg_pcompression : 1;   /* HDLC Protocol Field Compression? */
105     int neg_accompression : 1;  /* HDLC Address/Control Field Compression? */
106     int neg_lqr : 1;            /* Negotiate use of Link Quality Reports */
107     int neg_cbcp : 1;           /* Negotiate use of CBCP */
108     u_short mru;                /* Value of MRU */
109     u_char chap_mdtype;         /* which MD type (hashing algorithm) */
110     u_int32_t asyncmap;         /* Value of async map */
111     u_int32_t magicnumber;
112     int numloops;               /* Number of loops during magic number neg. */
113     u_int32_t lqr_period;       /* Reporting period for LQR 1/100ths second */
114 } lcp_options;
115
116 extern fsm lcp_fsm[];
117 extern lcp_options lcp_wantoptions[];
118 extern lcp_options lcp_gotoptions[];
119 extern lcp_options lcp_allowoptions[];
120 extern lcp_options lcp_hisoptions[];
121 extern u_int32_t xmit_accm[][8];
122
123 #define DEFMRU  1500            /* Try for this */
124 #define MINMRU  128             /* No MRUs below this */
125 #define MAXMRU  16384           /* Normally limit MRU to this */
126
127 void lcp_open __P((int));
128 void lcp_close __P((int, char *));
129 void lcp_lowerup __P((int));
130 void lcp_lowerdown __P((int));
131 void lcp_sprotrej __P((int, u_char *, int));    /* send protocol reject */
132
133 extern struct protent lcp_protent;
134
135 /* Default number of times we receive our magic number from the peer
136    before deciding the link is looped-back. */
137 #define DEFLOOPBACKFAIL 10