1 |
786 |
skrzyp |
//==========================================================================
|
2 |
|
|
//
|
3 |
|
|
// include/ipcp.h
|
4 |
|
|
//
|
5 |
|
|
//==========================================================================
|
6 |
|
|
// ####ECOSGPLCOPYRIGHTBEGIN####
|
7 |
|
|
// -------------------------------------------
|
8 |
|
|
// This file is part of eCos, the Embedded Configurable Operating System.
|
9 |
|
|
// Copyright (C) 2003 Free Software Foundation, Inc.
|
10 |
|
|
//
|
11 |
|
|
// eCos is free software; you can redistribute it and/or modify it under
|
12 |
|
|
// the terms of the GNU General Public License as published by the Free
|
13 |
|
|
// Software Foundation; either version 2 or (at your option) any later
|
14 |
|
|
// version.
|
15 |
|
|
//
|
16 |
|
|
// eCos is distributed in the hope that it will be useful, but WITHOUT
|
17 |
|
|
// ANY 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
|
22 |
|
|
// along with eCos; if not, write to the Free Software Foundation, Inc.,
|
23 |
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
24 |
|
|
//
|
25 |
|
|
// As a special exception, if other files instantiate templates or use
|
26 |
|
|
// macros or inline functions from this file, or you compile this file
|
27 |
|
|
// and link it with other works to produce a work based on this file,
|
28 |
|
|
// this file does not by itself cause the resulting work to be covered by
|
29 |
|
|
// the GNU General Public License. However the source code for this file
|
30 |
|
|
// must still be made available in accordance with section (3) of the GNU
|
31 |
|
|
// General Public License v2.
|
32 |
|
|
//
|
33 |
|
|
// This exception does not invalidate any other reasons why a work based
|
34 |
|
|
// on this file might be covered by the GNU General Public License.
|
35 |
|
|
// -------------------------------------------
|
36 |
|
|
// ####ECOSGPLCOPYRIGHTEND####
|
37 |
|
|
// ####BSDALTCOPYRIGHTBEGIN####
|
38 |
|
|
// -------------------------------------------
|
39 |
|
|
// Portions of this software may have been derived from FreeBSD, OpenBSD,
|
40 |
|
|
// or other sources, and if so are covered by the appropriate copyright
|
41 |
|
|
// and license included herein.
|
42 |
|
|
// -------------------------------------------
|
43 |
|
|
// ####BSDALTCOPYRIGHTEND####
|
44 |
|
|
//==========================================================================
|
45 |
|
|
|
46 |
|
|
/*
|
47 |
|
|
* ipcp.h - IP Control Protocol definitions.
|
48 |
|
|
*
|
49 |
|
|
* Copyright (c) 1989 Carnegie Mellon University.
|
50 |
|
|
* All rights reserved.
|
51 |
|
|
*
|
52 |
|
|
* Redistribution and use in source and binary forms are permitted
|
53 |
|
|
* provided that the above copyright notice and this paragraph are
|
54 |
|
|
* duplicated in all such forms and that any documentation,
|
55 |
|
|
* advertising materials, and other materials related to such
|
56 |
|
|
* distribution and use acknowledge that the software was developed
|
57 |
|
|
* by Carnegie Mellon University. The name of the
|
58 |
|
|
* University may not be used to endorse or promote products derived
|
59 |
|
|
* from this software without specific prior written permission.
|
60 |
|
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
61 |
|
|
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
62 |
|
|
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
63 |
|
|
*
|
64 |
|
|
* $FreeBSD: src/usr.sbin/pppd/ipcp.h,v 1.10 1999/08/28 01:19:03 peter Exp $
|
65 |
|
|
*/
|
66 |
|
|
|
67 |
|
|
/*
|
68 |
|
|
* Options.
|
69 |
|
|
*/
|
70 |
|
|
#define CI_ADDRS 1 /* IP Addresses */
|
71 |
|
|
#define CI_COMPRESSTYPE 2 /* Compression Type */
|
72 |
|
|
#define CI_ADDR 3
|
73 |
|
|
|
74 |
|
|
#define CI_MS_DNS1 129 /* Primary DNS value */
|
75 |
|
|
#define CI_MS_WINS1 130 /* Primary WINS value */
|
76 |
|
|
#define CI_MS_DNS2 131 /* Secondary DNS value */
|
77 |
|
|
#define CI_MS_WINS2 132 /* Secondary WINS value */
|
78 |
|
|
|
79 |
|
|
#define MAX_STATES 16 /* from slcompress.h */
|
80 |
|
|
|
81 |
|
|
#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */
|
82 |
|
|
#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */
|
83 |
|
|
#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */
|
84 |
|
|
/* maxslot and slot number compression) */
|
85 |
|
|
|
86 |
|
|
#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/
|
87 |
|
|
#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
|
88 |
|
|
/* compression option*/
|
89 |
|
|
|
90 |
|
|
typedef struct ipcp_options {
|
91 |
|
|
int neg_addr : 1; /* Negotiate IP Address? */
|
92 |
|
|
int old_addrs : 1; /* Use old (IP-Addresses) option? */
|
93 |
|
|
int req_addr : 1; /* Ask peer to send IP address? */
|
94 |
|
|
int default_route : 1; /* Assign default route through interface? */
|
95 |
|
|
int proxy_arp : 1; /* Make proxy ARP entry for peer? */
|
96 |
|
|
int neg_vj : 1; /* Van Jacobson Compression? */
|
97 |
|
|
int old_vj : 1; /* use old (short) form of VJ option? */
|
98 |
|
|
int accept_local : 1; /* accept peer's value for ouraddr */
|
99 |
|
|
int accept_remote : 1; /* accept peer's value for hisaddr */
|
100 |
|
|
#ifdef CYGOPT_PPP_NS_NEGOTIATE
|
101 |
|
|
int neg_dns1 : 1; /* Negotiate primary domain name server? */
|
102 |
|
|
int neg_wins1 : 1; /* Negotiate primary WINS? */
|
103 |
|
|
int neg_dns2 : 1; /* Negotiate secondary domain name server? */
|
104 |
|
|
int neg_wins2 : 1; /* Negotiate secondary WINS? */
|
105 |
|
|
#endif
|
106 |
|
|
u_short vj_protocol; /* protocol value to use in VJ option */
|
107 |
|
|
u_char maxslotindex, cflag; /* values for RFC1332 VJ compression neg. */
|
108 |
|
|
u_int32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
|
109 |
|
|
u_int32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
|
110 |
|
|
u_int32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
|
111 |
|
|
} ipcp_options;
|
112 |
|
|
|
113 |
|
|
extern fsm ipcp_fsm[];
|
114 |
|
|
extern ipcp_options ipcp_wantoptions[];
|
115 |
|
|
extern ipcp_options ipcp_gotoptions[];
|
116 |
|
|
extern ipcp_options ipcp_allowoptions[];
|
117 |
|
|
extern ipcp_options ipcp_hisoptions[];
|
118 |
|
|
|
119 |
|
|
char *ip_ntoa __P((u_int32_t));
|
120 |
|
|
|
121 |
|
|
extern struct protent ipcp_protent;
|