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
|
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* sppptun_impl.h - Internal sppptun data exposed for adb/mdb macros.
*/
#ifndef _SPPPTUN_IMPL_H
#define _SPPPTUN_IMPL_H
#ifdef __cplusplus
extern "C" {
#endif
/* For use with insque/remque (belongs in a system header!) */
struct qelem {
struct qelem *q_forw;
struct qelem *q_back;
};
typedef struct tunll_s tunll_t;
typedef struct tuncl_s tuncl_t;
typedef struct {
kstat_named_t lks_octrls; /* sent control messages */
kstat_named_t lks_octrl_drop; /* dropped control messages */
kstat_named_t lks_clients; /* number of clients (tcls) */
kstat_named_t lks_walks; /* PPPoE tcl walks */
kstat_named_t lks_in_nomatch; /* input without match */
kstat_named_t lks_indata; /* input data packets */
kstat_named_t lks_indata_drops; /* input data packet drops */
kstat_named_t lks_inctrls; /* input control packets */
kstat_named_t lks_inctrl_drops; /* input control pkt drops */
} tll_kstats_t;
#define TLL_KSTATS_NAMES \
"octrls", "octrl_drop", "clients", "walks", "in_nomatch", \
"indata", "indata_drops", "inctrls", "inctrl_drops"
typedef struct {
kstat_named_t cks_octrls; /* sent control messages */
kstat_named_t cks_octrl_drop; /* dropped control messages */
kstat_named_t cks_octrl_spec; /* special control messages */
kstat_named_t cks_walks; /* PPPoE tcl walks */
kstat_named_t cks_inctrls; /* input control messages */
kstat_named_t cks_inctrl_drops; /* input control pkt drops */
} tcl_kstats_t;
#define TCL_KSTATS_NAMES \
"octrls", "octrl_drop", "octrl_spec", "walks", "inctrls", \
"inctrl_drops"
/*
* Tunnel lower layer structure; module open; connects to output device.
*
* Note: tll_flags member carefully aligned to match with tcl_flags in
* following structure so that we don't have to continually look at
* q_next to determine context. Do not move these around.
*
* Note: this is also defined in uts/adb/common/tunll.dbg; if you change
* this structure, don't forget to change the adb/mdb macro.
*/
struct tunll_s {
uint32_t tll_flags; /* See TLLF_* below */
void *tll_next, *tll_prev;
int tll_error;
queue_t *tll_wq; /* Output data sent here */
tuncl_t *tll_defcl; /* Default client (daemon) */
ppptun_atype tll_lcladdr; /* Local address */
tuncl_t *tll_lastcl; /* Silly PPPoE optimization */
ppptun_lname tll_name;
int tll_index;
int tll_muxid;
int tll_style; /* Interface type; PTS_* */
int tll_alen; /* Address length */
int tll_msg_pending;
mblk_t *tll_msg_deferred;
mblk_t *tll_onclose;
tll_kstats_t tll_kstats; /* current statistics */
kstat_t *tll_ksp; /* pointer to kstats allocation */
uint_t tll_sap; /* SAP for PPPoE */
zoneid_t tll_zoneid;
};
/*
* Tunnel client structure; used for each device open.
*
* There is one of these for each PPP session plus (perhaps) one for
* each tunneling protocol server daemon.
*
* Note: this is also defined in uts/adb/common/tuncl.dbg; if you change
* this structure, don't forget to change the adb/mdb macro.
*/
struct tuncl_s {
uint32_t tcl_flags; /* TCLF_ flags below */
tunll_t *tcl_data_tll; /* Pointer to data interface */
tunll_t *tcl_ctrl_tll; /* Pointer to control */
queue_t *tcl_rq; /* Received data sent here. */
uint32_t tcl_seq;
uint32_t tcl_ctlval; /* Control distinguisher */
uint_t tcl_style; /* Saved style */
uint_t tcl_ltunid; /* Local Tunnel ID (L2F/L2TP) */
uint_t tcl_rtunid; /* Remote Tunnel ID (L2F/L2TP) */
uint_t tcl_lsessid; /* Local Session ID (minor node) */
uint_t tcl_rsessid; /* Remote Session ID */
ppptun_atype tcl_address;
int tcl_unit; /* PPP unit number (for debug) */
struct pppstat64 tcl_stats; /* Standard PPP statistics */
tcl_kstats_t tcl_kstats; /* current statistics */
kstat_t *tcl_ksp; /* pointer to kstats allocation */
zoneid_t tcl_zoneid;
};
#define TO_TLL(p) \
((tunll_t *)((uintptr_t)(p) - offsetof(tunll_t, tll_next)))
#define TLLF_NOTLOWER 0x00000001 /* never set */
#define TLLF_CLOSING 0x00000002 /* driver detach initiated */
#define TLLF_CLOSE_DONE 0x00000004 /* detach sent; waiting */
#define TLLF_SHUTDOWN_DONE 0x00000008 /* detach done */
#define TCLF_ISCLIENT 0x00000001 /* always set */
#define TCLF_FASTPATH 0x00000004 /* enable fast path recv */
#define TCLF_DAEMON 0x00000010 /* server side; session 0 */
#define TCLF_SPEER_DONE 0x00000020 /* SPEER ioctl done */
#ifdef __cplusplus
}
#endif
#endif /* _SPPPTUN_IMPL_H */
|