xref: /illumos-gate/usr/src/cmd/cmd-inet/usr.bin/pppd/ipcp.h (revision 69a119caa6570c7077699161b7c28b6ee9f8b0f4)
1 /*
2  * ipcp.h - IP Control Protocol definitions.
3  *
4  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
5  * Use is subject to license terms.
6  *
7  * Copyright (c) 1989 Carnegie Mellon University.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms are permitted
11  * provided that the above copyright notice and this paragraph are
12  * duplicated in all such forms and that any documentation,
13  * advertising materials, and other materials related to such
14  * distribution and use acknowledge that the software was developed
15  * by Carnegie Mellon University.  The name of the
16  * University may not be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
20  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21  *
22  * $Id: ipcp.h,v 1.13 1999/03/02 05:35:09 paulus Exp $
23  */
24 
25 /*
26  * Options.
27  */
28 #define CI_ADDRS	1	/* IP Addresses */
29 #define CI_COMPRESSTYPE	2	/* Compression Type */
30 #define	CI_ADDR		3
31 
32 #define CI_MS_DNS1	129	/* Primary DNS value */
33 #define CI_MS_WINS1	130	/* Primary WINS value */
34 #define CI_MS_DNS2	131	/* Secondary DNS value */
35 #define CI_MS_WINS2	132	/* Secondary WINS value */
36 #define	CI_SUBNET	144	/* Bogus subnet option */
37 
38 #define MAX_STATES 16		/* from slcompress.h */
39 
40 #define IPCP_VJMODE_OLD 1	/* "old" mode (option # = 0x0037) */
41 #define IPCP_VJMODE_RFC1172 2	/* "old-rfc"mode (option # = 0x002d) */
42 #define IPCP_VJMODE_RFC1332 3	/* "new-rfc"mode (option # = 0x002d, */
43                                 /*  maxslot and slot number compression) */
44 
45 #define IPCP_VJ_COMP 0x002d	/* current value for VJ compression option*/
46 #define IPCP_VJ_COMP_OLD 0x0037	/* "old" (i.e, broken) value for VJ */
47 				/* compression option*/
48 
49 typedef struct ipcp_options {
50     bool neg_addr;		/* Negotiate IP Address? */
51     bool old_addrs;		/* Use old (IP-Addresses) option? */
52     bool req_addr;		/* Ask peer to send IP address? */
53     bool default_route;		/* Assign default route through interface? */
54     bool proxy_arp;		/* Make proxy ARP entry for peer? */
55     bool neg_vj;		/* Van Jacobson Compression? */
56     bool old_vj;		/* use old (short) form of VJ option? */
57     bool accept_local;		/* accept peer's value for ouraddr */
58     bool accept_remote;		/* accept peer's value for hisaddr */
59     bool req_dns1;		/* Ask peer to send primary DNS address? */
60     bool req_dns2;		/* Ask peer to send secondary DNS address? */
61     bool cflag;			/* VJ slot compression flag */
62     int  vj_protocol;		/* protocol value to use in VJ option */
63     int  maxslotindex;		/* values for RFC1332 VJ compression neg. */
64     u_int32_t ouraddr, hisaddr;	/* Addresses in NETWORK BYTE ORDER */
65     u_int32_t dnsaddr[2];	/* Primary and secondary MS DNS entries */
66     u_int32_t winsaddr[2];	/* Primary and secondary MS WINS entries */
67 } ipcp_options;
68 
69 extern fsm ipcp_fsm[];
70 extern ipcp_options ipcp_wantoptions[];
71 extern ipcp_options ipcp_gotoptions[];
72 extern ipcp_options ipcp_allowoptions[];
73 extern ipcp_options ipcp_hisoptions[];
74 
75 extern char *ip_ntoa __P((u_int32_t));
76 extern char *tcp_flag_decode __P((int));
77 
78 extern struct protent ipcp_protent;
79 extern bool ipcp_from_hostname;
80