Debian Codegraph @

pppd/ipcp.h

raw
1 /*
2 * ipcp.h - IP Control Protocol definitions.
3 *
4 * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 *
18 * 3. The name "Carnegie Mellon University" must not be used to
19 * endorse or promote products derived from this software without
20 * prior written permission. For permission or any legal
21 * details, please contact
22 * Office of Technology Transfer
23 * Carnegie Mellon University
24 * 5000 Forbes Avenue
25 * Pittsburgh, PA 15213-3890
26 * (412) 268-4387, fax: (412) 268-7395
27 * [email protected]
28 *
29 * 4. Redistributions of any form whatsoever must retain the following
30 * acknowledgment:
31 * "This product includes software developed by Computing Services
32 * at Carnegie Mellon University (http://www.cmu.edu/computing/)."
33 *
34 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
35 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
36 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE
37 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
38 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
39 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
40 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
41 */
42 #ifndef PPP_IPCP_H
43 #define PPP_IPCP_H
44
45 #include "pppdconf.h"
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 /*
52 * Options.
53 */
54 #define CI_ADDRS 1 /* IP Addresses */
55 #define CI_COMPRESSTYPE 2 /* Compression Type */
56 #define CI_ADDR 3
57
58 #define CI_MS_DNS1 129 /* Primary DNS value */
59 #define CI_MS_WINS1 130 /* Primary WINS value */
60 #define CI_MS_DNS2 131 /* Secondary DNS value */
61 #define CI_MS_WINS2 132 /* Secondary WINS value */
62
63 #define MAX_STATES 16 /* from slcompress.h */
64
65 #define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */
66 #define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */
67 #define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */
68 /* maxslot and slot number compression) */
69
70 #define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/
71 #define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */
72 /* compression option*/
73
74 typedef struct ipcp_options {
75 bool neg_addr; /* Negotiate IP Address? */
76 bool old_addrs; /* Use old (IP-Addresses) option? */
77 bool req_addr; /* Ask peer to send IP address? */
78 bool default_route; /* Assign default route through interface? */
79 bool replace_default_route; /* Replace default route through interface? */
80 bool proxy_arp; /* Make proxy ARP entry for peer? */
81 bool neg_vj; /* Van Jacobson Compression? */
82 bool old_vj; /* use old (short) form of VJ option? */
83 bool accept_local; /* accept peer's value for ouraddr */
84 bool accept_remote; /* accept peer's value for hisaddr */
85 bool req_dns1; /* Ask peer to send primary DNS address? */
86 bool req_dns2; /* Ask peer to send secondary DNS address? */
87 bool req_wins1; /* Ask peer to send primary WINS address? */
88 bool req_wins2; /* Ask peer to send secondary WINS address? */
89 int vj_protocol; /* protocol value to use in VJ option */
90 int maxslotindex; /* values for RFC1332 VJ compression neg. */
91 bool cflag;
92 uint32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */
93 uint32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */
94 uint32_t winsaddr[2]; /* Primary and secondary MS WINS entries */
95 } ipcp_options;
96
97 extern fsm ipcp_fsm[];
98 extern ipcp_options ipcp_wantoptions[];
99 extern ipcp_options ipcp_gotoptions[];
100 extern ipcp_options ipcp_allowoptions[];
101 extern ipcp_options ipcp_hisoptions[];
102
103 char *ip_ntoa(uint32_t);
104
105 extern struct protent ipcp_protent;
106
107 /*
108 * Hook for a plugin to know when IP protocol has come up
109 */
110 typedef void (ip_up_hook_fn)(void);
111 extern ip_up_hook_fn *ip_up_hook;
112
113 /*
114 * Hook for a plugin to know when IP protocol has come down
115 */
116 typedef void (ip_down_hook_fn)(void);
117 extern ip_down_hook_fn *ip_down_hook;
118
119 /*
120 * Hook for a plugin to choose the remote IP address
121 */
122 typedef void (ip_choose_hook_fn)(uint32_t *);
123 extern ip_choose_hook_fn *ip_choose_hook;
124
125 #ifdef __cplusplus
126 }
127 #endif
128
129 #endif /* PPP_IPCP_H */