xref: /freebsd/usr.sbin/ppp/ipcp.h (revision 02f2e93b60c2b91feac8f45c4c889a5a8e40d8a2)
1 /*
2  *	    Written by Toshiharu OHNO (tony-o@iij.ad.jp)
3  *
4  *   Copyright (C) 1993, Internet Initiative Japan, Inc. All rights reserverd.
5  *
6  * Redistribution and use in source and binary forms are permitted
7  * provided that the above copyright notice and this paragraph are
8  * duplicated in all such forms and that any documentation,
9  * advertising materials, and other materials related to such
10  * distribution and use acknowledge that the software was developed
11  * by the Internet Initiative Japan.  The name of the
12  * IIJ may not be used to endorse or promote products derived
13  * from this software without specific prior written permission.
14  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  *
18  * $Id: ipcp.h,v 1.10 1997/09/03 02:08:19 brian Exp $
19  *
20  *	TODO:
21  */
22 
23 #define	IPCP_MAXCODE	CODE_CODEREJ
24 
25 #define	TY_IPADDRS	1
26 #define	TY_COMPPROTO	2
27 #define	TY_IPADDR	3
28 
29 /* MS PPP NameServer and NetBIOS NameServer stuff */
30 
31 #ifndef NOMSEXT
32 #define TY_PRIMARY_DNS		129
33 #define TY_PRIMARY_NBNS		130
34 #define TY_SECONDARY_DNS	131
35 #define TY_SECONDARY_NBNS	132
36 
37 extern struct in_addr ns_entries[2];
38 extern struct in_addr nbns_entries[2];
39 #endif
40 
41 struct ipcpstate {
42   struct in_addr his_ipaddr;	/* IP address he is willing to use */
43   u_long his_compproto;
44 
45   struct in_addr want_ipaddr;	/* IP address I'm willing to use */
46   u_long want_compproto;
47 
48   u_long his_reject;		/* Request codes rejected by peer */
49   u_long my_reject;		/* Request codes I have rejected */
50   int heis1172;			/* True if he is speaking rfc1172 */
51 };
52 
53 struct compreq {
54   u_short proto;
55   u_char slots;
56   u_char compcid;
57 };
58 
59 struct in_range {
60   struct in_addr ipaddr;
61   struct in_addr mask;
62   int width;
63 };
64 
65 extern struct ipcpstate IpcpInfo;
66 extern struct in_range DefMyAddress;
67 extern struct in_range DefHisAddress;
68 extern struct in_addr TriggerAddress;
69 extern int HaveTriggerAddress;
70 extern struct fsm IpcpFsm;
71 extern struct pppTimer IpcpReportTimer;
72 
73 extern void IpcpInit(void);
74 extern void IpcpDefAddress(void);
75 extern void IpcpUp(void);
76 extern void IpcpOpen(void);
77 extern int ReportIpcpStatus(void);
78