xref: /freebsd/usr.sbin/ppp/ipcp.h (revision df7f5d4de4592a8948a25ce01e5bddfbb7ce39dc)
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$
19  *
20  *	TODO:
21  */
22 
23 #ifndef _IPCP_H_
24 #define _IPCP_H_
25 
26 #define	IPCP_MAXCODE	CODE_CODEREJ
27 
28 #define	TY_IPADDRS	1
29 #define	TY_COMPPROTO	2
30 #define	TY_IPADDR	3
31 
32 /* MS PPP NameServer and NetBIOS NameServer stuff */
33 
34 #ifdef MSEXT
35 
36 #define TY_PRIMARY_DNS		129
37 #define TY_PRIMARY_NBNS		130
38 #define TY_SECONDARY_DNS	131
39 #define TY_SECONDARY_NBNS	132
40 
41 #endif /* MSEXT */
42 
43 struct ipcpstate {
44   struct  in_addr his_ipaddr;	/* IP address he is willing to use */
45   u_long  his_compproto;
46 
47   struct  in_addr want_ipaddr;	/* IP address I'm willing to use */
48   u_long  want_compproto;
49 
50   u_long  his_reject;		/* Request codes rejected by peer */
51   u_long  my_reject;		/* Request codes I have rejected */
52   int	  heis1172;		/* True if he is speaking rfc1172 */
53 };
54 
55 struct compreq {
56   u_short proto;
57   u_char  slots;
58   u_char  compcid;
59 };
60 
61 struct in_range {
62   struct in_addr ipaddr;
63   struct in_addr mask;
64   int    width;
65 };
66 
67 extern struct ipcpstate IpcpInfo;
68 extern struct in_range DefMyAddress;
69 extern struct in_range DefHisAddress;
70 extern struct in_range DefTriggerAddress;
71 
72 #ifdef MSEXT
73 extern struct in_addr ns_entries[2];
74 extern struct in_addr nbns_entries[2];
75 #endif /* MSEXT */
76 
77 extern void IpcpInit __P((void));
78 extern void IpcpDefAddress __P((void));
79 #endif
80