Deleted Added
full compact
ipcp.h (40665) ipcp.h (43313)
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 *
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.21 1998/10/22 02:32:49 brian Exp $
18 * $Id: ipcp.h,v 1.22 1998/10/26 19:07:39 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/* Domain NameServer and NetBIOS NameServer options */
30
31#define TY_PRIMARY_DNS 129
32#define TY_PRIMARY_NBNS 130
33#define TY_SECONDARY_DNS 131
34#define TY_SECONDARY_NBNS 132
35#define TY_ADJUST_NS 119 /* subtract from NS val for REJECT bit */
36
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/* Domain NameServer and NetBIOS NameServer options */
30
31#define TY_PRIMARY_DNS 129
32#define TY_PRIMARY_NBNS 130
33#define TY_SECONDARY_DNS 131
34#define TY_SECONDARY_NBNS 132
35#define TY_ADJUST_NS 119 /* subtract from NS val for REJECT bit */
36
37#define addr2mask(addr) ( \
38 IN_CLASSA(addr) ? \
39 htonl(IN_CLASSA_NET) : \
40 IN_CLASSB(addr) ? \
41 htonl(IN_CLASSB_NET) : htonl(IN_CLASSC_NET) \
42)
43
44
37struct sticky_route;
38
39struct in_range {
40 struct in_addr ipaddr;
41 struct in_addr mask;
42 int width;
43};
44
45struct ipcp {
46 struct fsm fsm; /* The finite state machine */
47
48 struct {
49 struct {
50 int slots; /* Maximum VJ slots */
51 unsigned slotcomp : 1; /* Slot compression */
52 unsigned neg : 2; /* VJ negotiation */
53 } vj;
54
55 struct in_range my_range; /* MYADDR spec */
45struct sticky_route;
46
47struct in_range {
48 struct in_addr ipaddr;
49 struct in_addr mask;
50 int width;
51};
52
53struct ipcp {
54 struct fsm fsm; /* The finite state machine */
55
56 struct {
57 struct {
58 int slots; /* Maximum VJ slots */
59 unsigned slotcomp : 1; /* Slot compression */
60 unsigned neg : 2; /* VJ negotiation */
61 } vj;
62
63 struct in_range my_range; /* MYADDR spec */
56 struct in_addr netmask; /* netmask (unused by most OSs) */
64 struct in_addr netmask; /* Iface netmask (unused by most OSs) */
57 struct in_range peer_range; /* HISADDR spec */
58 struct iplist peer_list; /* Ranges of HISADDR values */
59
60 u_long sendpipe; /* route sendpipe size */
61 u_long recvpipe; /* route recvpipe size */
62
63 struct in_addr TriggerAddress; /* Address to suggest in REQ */
64 unsigned HaveTriggerAddress : 1; /* Trigger address specified */

--- 14 unchanged lines hidden (view full) ---

79
80 struct sticky_route *route; /* List of dynamic routes */
81
82 unsigned heis1172 : 1; /* True if he is speaking rfc1172 */
83
84 struct in_addr peer_ip; /* IP address he's willing to use */
85 u_int32_t peer_compproto; /* VJ params he's willing to use */
86
65 struct in_range peer_range; /* HISADDR spec */
66 struct iplist peer_list; /* Ranges of HISADDR values */
67
68 u_long sendpipe; /* route sendpipe size */
69 u_long recvpipe; /* route recvpipe size */
70
71 struct in_addr TriggerAddress; /* Address to suggest in REQ */
72 unsigned HaveTriggerAddress : 1; /* Trigger address specified */

--- 14 unchanged lines hidden (view full) ---

87
88 struct sticky_route *route; /* List of dynamic routes */
89
90 unsigned heis1172 : 1; /* True if he is speaking rfc1172 */
91
92 struct in_addr peer_ip; /* IP address he's willing to use */
93 u_int32_t peer_compproto; /* VJ params he's willing to use */
94
95 struct in_addr ifmask; /* Interface netmask */
96
87 struct in_addr my_ip; /* IP address I'm willing to use */
88 u_int32_t my_compproto; /* VJ params I'm willing to use */
89
90 u_int32_t peer_reject; /* Request codes rejected by peer */
91 u_int32_t my_reject; /* Request codes I have rejected */
92
93 struct pppThroughput throughput; /* throughput statistics */
94 struct mqueue Queue[PRI_FAST + 1]; /* Output packet queues */
95};
96
97#define fsm2ipcp(fp) (fp->proto == PROTO_IPCP ? (struct ipcp *)fp : NULL)
98
99struct bundle;
100struct link;
101struct cmdargs;
102
103extern void ipcp_Init(struct ipcp *, struct bundle *, struct link *,
104 const struct fsm_parent *);
97 struct in_addr my_ip; /* IP address I'm willing to use */
98 u_int32_t my_compproto; /* VJ params I'm willing to use */
99
100 u_int32_t peer_reject; /* Request codes rejected by peer */
101 u_int32_t my_reject; /* Request codes I have rejected */
102
103 struct pppThroughput throughput; /* throughput statistics */
104 struct mqueue Queue[PRI_FAST + 1]; /* Output packet queues */
105};
106
107#define fsm2ipcp(fp) (fp->proto == PROTO_IPCP ? (struct ipcp *)fp : NULL)
108
109struct bundle;
110struct link;
111struct cmdargs;
112
113extern void ipcp_Init(struct ipcp *, struct bundle *, struct link *,
114 const struct fsm_parent *);
105extern void ipcp_Setup(struct ipcp *);
115extern void ipcp_Setup(struct ipcp *, u_int32_t);
106extern void ipcp_SetLink(struct ipcp *, struct link *);
107
108extern int ipcp_Show(struct cmdargs const *);
109extern void ipcp_Input(struct ipcp *, struct bundle *, struct mbuf *);
110extern void ipcp_AddInOctets(struct ipcp *, int);
111extern void ipcp_AddOutOctets(struct ipcp *, int);
116extern void ipcp_SetLink(struct ipcp *, struct link *);
117
118extern int ipcp_Show(struct cmdargs const *);
119extern void ipcp_Input(struct ipcp *, struct bundle *, struct mbuf *);
120extern void ipcp_AddInOctets(struct ipcp *, int);
121extern void ipcp_AddOutOctets(struct ipcp *, int);
122extern int ipcp_UseHisIPaddr(struct bundle *, struct in_addr);
112extern int ipcp_UseHisaddr(struct bundle *, const char *, int);
113extern int ipcp_vjset(struct cmdargs const *);
114extern void ipcp_CleanInterface(struct ipcp *);
115extern int ipcp_InterfaceUp(struct ipcp *);
123extern int ipcp_UseHisaddr(struct bundle *, const char *, int);
124extern int ipcp_vjset(struct cmdargs const *);
125extern void ipcp_CleanInterface(struct ipcp *);
126extern int ipcp_InterfaceUp(struct ipcp *);