1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
|
/*
* ng_ppp.h
*
* Copyright (c) 1996-1999 Whistle Communications, Inc.
* All rights reserved.
*
* Subject to the following obligations and disclaimer of warranty, use and
* redistribution of this software, in source or object code forms, with or
* without modifications are expressly permitted by Whistle Communications;
* provided, however, that:
* 1. Any and all reproductions of the source or object code must include the
* copyright notice above and the following disclaimer of warranties; and
* 2. No rights are granted, in any manner or form, to use Whistle
* Communications, Inc. trademarks, including the mark "WHISTLE
* COMMUNICATIONS" on advertising, endorsements, or otherwise except as
* such appears in the above copyright notice or in the software.
*
* THIS SOFTWARE IS BEING PROVIDED BY WHISTLE COMMUNICATIONS "AS IS", AND
* TO THE MAXIMUM EXTENT PERMITTED BY LAW, WHISTLE COMMUNICATIONS MAKES NO
* REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS SOFTWARE,
* INCLUDING WITHOUT LIMITATION, ANY AND ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
* WHISTLE COMMUNICATIONS DOES NOT WARRANT, GUARANTEE, OR MAKE ANY
* REPRESENTATIONS REGARDING THE USE OF, OR THE RESULTS OF THE USE OF THIS
* SOFTWARE IN TERMS OF ITS CORRECTNESS, ACCURACY, RELIABILITY OR OTHERWISE.
* IN NO EVENT SHALL WHISTLE COMMUNICATIONS BE LIABLE FOR ANY DAMAGES
* RESULTING FROM OR ARISING OUT OF ANY USE OF THIS SOFTWARE, INCLUDING
* WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* Author: Archie Cobbs <archie@whistle.com>
*
* $FreeBSD$
* $Whistle: ng_ppp.h,v 1.8 1999/01/25 02:40:02 archie Exp $
*/
#ifndef _NETGRAPH_PPP_H_
#define _NETGRAPH_PPP_H_
/* Node type name and magic cookie */
#define NG_PPP_NODE_TYPE "ppp"
#define NGM_PPP_COOKIE 940897793
/* Maximum number of supported links */
#define NG_PPP_MAX_LINKS 16
/* Pseudo-link number representing the multi-link bundle */
#define NG_PPP_BUNDLE_LINKNUM 0xffff
/* Max allowable link latency (miliseconds) and bandwidth (bytes/second/10) */
#define NG_PPP_MAX_LATENCY 1000 /* 1 second */
#define NG_PPP_MAX_BANDWIDTH 125000 /* 10 Mbits / second */
/* Hook names */
#define NG_PPP_HOOK_BYPASS "bypass" /* unknown protocols */
#define NG_PPP_HOOK_COMPRESS "compress" /* outgoing compression */
#define NG_PPP_HOOK_DECOMPRESS "decompress" /* incoming decompression */
#define NG_PPP_HOOK_ENCRYPT "encrypt" /* outgoing encryption */
#define NG_PPP_HOOK_DECRYPT "decrypt" /* incoming decryption */
#define NG_PPP_HOOK_VJC_IP "vjc_ip" /* VJC raw IP */
#define NG_PPP_HOOK_VJC_COMP "vjc_vjcomp" /* VJC compressed TCP */
#define NG_PPP_HOOK_VJC_UNCOMP "vjc_vjuncomp" /* VJC uncompressed TCP */
#define NG_PPP_HOOK_VJC_VJIP "vjc_vjip" /* VJC uncompressed IP */
#define NG_PPP_HOOK_INET "inet" /* IP packet data */
#define NG_PPP_HOOK_ATALK "atalk" /* AppleTalk packet data */
#define NG_PPP_HOOK_IPX "ipx" /* IPX packet data */
#define NG_PPP_HOOK_LINK_PREFIX "link" /* append decimal link number */
/* Netgraph commands */
enum {
NGM_PPP_SET_CONFIG = 1, /* takes struct ng_ppp_bundle_config */
NGM_PPP_GET_CONFIG, /* returns ng_ppp_bundle_config */
NGM_PPP_GET_LINK_STATS, /* takes link #, returns stats struct */
NGM_PPP_CLR_LINK_STATS, /* takes link #, clears link stats */
NGM_PPP_GETCLR_LINK_STATS, /* takes link #, returns & clrs stats */
};
/* Per-link config structure */
struct ng_ppp_link_config {
u_char enableLink; /* enable this link */
u_char enableProtoComp;/* enable protocol field compression */
u_char enableACFComp; /* enable addr/ctrl field compression */
u_int16_t mru; /* peer MRU */
u_int32_t latency; /* link latency (in milliseconds) */
u_int32_t bandwidth; /* link bandwidth (in bytes/second) */
};
/* Keep this in sync with the above structure definition */
#define NG_PPP_LINK_TYPE_INFO { \
{ \
{ "enable", &ng_parse_int8_type }, \
{ "protocomp", &ng_parse_int8_type }, \
{ "acfcomp", &ng_parse_int8_type }, \
{ "mru", &ng_parse_int16_type }, \
{ "latency", &ng_parse_int32_type }, \
{ "bandwidth", &ng_parse_int32_type }, \
{ NULL }, \
} \
}
/* Node config structure */
struct ng_ppp_node_config {
u_int16_t mrru; /* multilink peer MRRU */
u_char enableMultilink; /* enable multilink */
u_char recvShortSeq; /* recv multilink short seq # */
u_char xmitShortSeq; /* xmit multilink short seq # */
u_char enableRoundRobin; /* xmit whole packets */
u_char enableIP; /* enable IP data flow */
u_char enableAtalk; /* enable AppleTalk data flow */
u_char enableIPX; /* enable IPX data flow */
u_char enableCompression; /* enable PPP compression */
u_char enableDecompression; /* enable PPP decompression */
u_char enableEncryption; /* enable PPP encryption */
u_char enableDecryption; /* enable PPP decryption */
u_char enableVJCompression; /* enable VJ compression */
u_char enableVJDecompression; /* enable VJ decompression */
struct ng_ppp_link_config /* per link config params */
links[NG_PPP_MAX_LINKS];
};
/* Keep this in sync with the above structure definition */
#define NG_PPP_CONFIG_TYPE_INFO(arytype) { \
{ \
{ "mrru", &ng_parse_int16_type }, \
{ "multilink", &ng_parse_int8_type }, \
{ "recvShortSeq", &ng_parse_int8_type }, \
{ "xmitShortSeq", &ng_parse_int8_type }, \
{ "roundRobin", &ng_parse_int8_type }, \
{ "ip", &ng_parse_int8_type }, \
{ "appletalk", &ng_parse_int8_type }, \
{ "ipx", &ng_parse_int8_type }, \
{ "comp", &ng_parse_int8_type }, \
{ "decomp", &ng_parse_int8_type }, \
{ "encryption", &ng_parse_int8_type }, \
{ "decryption", &ng_parse_int8_type }, \
{ "vjcomp", &ng_parse_int8_type }, \
{ "vjdecomp", &ng_parse_int8_type }, \
{ "links", (arytype) }, \
{ NULL }, \
} \
}
/* Statistics struct for a link (or the bundle if NG_PPP_BUNDLE_LINKNUM) */
struct ng_ppp_link_stat {
u_int32_t xmitFrames; /* xmit frames on link */
u_int32_t xmitOctets; /* xmit octets on link */
u_int32_t recvFrames; /* recv frames on link */
u_int32_t recvOctets; /* recv octets on link */
u_int32_t badProtos; /* frames rec'd with bogus protocol */
u_int32_t dupFragments; /* MP frames with duplicate seq # */
};
/* Keep this in sync with the above structure definition */
#define NG_PPP_STATS_TYPE_INFO { \
{ \
{ "xmitFrames", &ng_parse_int32_type }, \
{ "xmitOctets", &ng_parse_int32_type }, \
{ "recvFrames", &ng_parse_int32_type }, \
{ "recvOctets", &ng_parse_int32_type }, \
{ "badProtos", &ng_parse_int32_type }, \
{ "dupFragments", &ng_parse_int32_type }, \
{ NULL }, \
} \
}
#endif /* _NETGRAPH_PPP_H_ */
|