1/*
2 * Copyright (c) 2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23/*
24 * ipcp.h - IP Control Protocol definitions.
25 *
26 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
27 *
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that the following conditions
30 * are met:
31 *
32 * 1. Redistributions of source code must retain the above copyright
33 *    notice, this list of conditions and the following disclaimer.
34 *
35 * 2. Redistributions in binary form must reproduce the above copyright
36 *    notice, this list of conditions and the following disclaimer in
37 *    the documentation and/or other materials provided with the
38 *    distribution.
39 *
40 * 3. The name "Carnegie Mellon University" must not be used to
41 *    endorse or promote products derived from this software without
42 *    prior written permission. For permission or any legal
43 *    details, please contact
44 *      Office of Technology Transfer
45 *      Carnegie Mellon University
46 *      5000 Forbes Avenue
47 *      Pittsburgh, PA  15213-3890
48 *      (412) 268-4387, fax: (412) 268-7395
49 *      tech-transfer@andrew.cmu.edu
50 *
51 * 4. Redistributions of any form whatsoever must retain the following
52 *    acknowledgment:
53 *    "This product includes software developed by Computing Services
54 *     at Carnegie Mellon University (http://www.cmu.edu/computing/)."
55 *
56 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
57 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
58 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
59 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
60 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
61 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
62 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
63 *
64 * $Id: ipcp.h,v 1.5 2004/02/10 19:29:23 callie 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
90typedef struct ipcp_options {
91    bool neg_addr;		/* Negotiate IP Address? */
92    bool old_addrs;		/* Use old (IP-Addresses) option? */
93    bool req_addr;		/* Ask peer to send IP address? */
94    bool default_route;		/* Assign default route through interface? */
95    bool proxy_arp;		/* Make proxy ARP entry for peer? */
96    bool neg_vj;		/* Van Jacobson Compression? */
97    bool old_vj;		/* use old (short) form of VJ option? */
98    bool accept_local;		/* accept peer's value for ouraddr */
99    bool accept_remote;		/* accept peer's value for hisaddr */
100    bool req_dns1;		/* Ask peer to send primary DNS address? */
101    bool req_dns2;		/* Ask peer to send secondary DNS address? */
102    bool req_wins1;		/* Ask peer to send primary WINS address? */
103    bool req_wins2;		/* Ask peer to send secondary WINS address? */
104    int  vj_protocol;		/* protocol value to use in VJ option */
105    int  maxslotindex;		/* values for RFC1332 VJ compression neg. */
106    bool cflag;
107    u_int32_t ouraddr, hisaddr;	/* Addresses in NETWORK BYTE ORDER */
108    u_int32_t dnsaddr[2];	/* Primary and secondary MS DNS entries */
109    u_int32_t winsaddr[2];	/* Primary and secondary MS WINS entries */
110} ipcp_options;
111
112extern fsm ipcp_fsm[];
113extern ipcp_options ipcp_wantoptions[];
114extern ipcp_options ipcp_gotoptions[];
115extern ipcp_options ipcp_allowoptions[];
116extern ipcp_options ipcp_hisoptions[];
117
118char *ip_ntoa __P((u_int32_t));
119
120extern struct protent ipcp_protent;
121extern void check_protocols_ready(void);
122
123