Print this page
dccp: clock_t
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/inet/dccp_impl.h
+++ new/usr/src/uts/common/inet/dccp_impl.h
1 1 /*
2 2 * This file and its contents are supplied under the terms of the
3 3 * Common Development and Distribution License ("CDDL"), version 1.0.
4 4 * You may only use this file in accordance with the terms of version
5 5 * 1.0 of the CDDL.
6 6 *
7 7 * A full copy of the text of the CDDL should have accompanied this
8 8 * source. A copy of the CDDL is also available via the Internet at
9 9 * http://www.illumos.org/license/CDDL.
10 10 */
11 11
12 12 /*
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 * Copyright 2012 David Hoeppner. All rights reserved.
14 14 */
15 15
16 16 #ifndef _INET_DCCP_IMPL_H
17 17 #define _INET_DCCP_IMPL_H
18 18
19 19 #include <sys/int_types.h>
20 20 #include <sys/netstack.h>
21 21 #include <sys/socket.h>
22 22 #include <sys/socket_proto.h>
23 +#include <sys/clock_impl.h>
23 24
24 25 #include <netinet/in.h>
25 26 #include <netinet/ip6.h>
26 27 #include <netinet/dccp.h>
27 28
28 29 #include <inet/common.h>
29 30 #include <inet/dccp.h>
30 31 #include <inet/ip.h>
31 32 #include <inet/ip6.h>
32 33 #include <inet/optcom.h>
33 34 #include <inet/tunables.h>
34 35
35 36 #include <inet/dccp_stack.h>
36 37
37 38 #ifdef __cplusplus
38 39 extern "C" {
39 40 #endif
40 41
41 42 #ifdef _KERNEL
42 43
43 44 #define DCCP_MOD_ID 5999 /* XXX */
44 45
45 46 extern struct qinit dccp_sock_winit;
46 47 extern struct qinit dccp_winit;
47 48
48 49 extern sock_downcalls_t sock_dccp_downcalls;
49 50
50 51 #define DCCP_XMIT_LOWATER (4 * 1024)
51 52 #define DCCP_XMIT_HIWATER 49152
52 53 #define DCCP_RECV_LOWATER (2 * 1024)
53 54 #define DCCP_RECV_HIWATER 128000
54 55
55 56 #define TIDUSZ 4096 /* transport interface data unit size */
56 57
57 58 /*
58 59 * Bind hash array size and hash function.
59 60 */
60 61 #define DCCP_BIND_FANOUT_SIZE 128
61 62 #define DCCP_BIND_HASH(lport, size) ((ntohs((uint16_t)lport)) & (size - 1))
62 63
63 64 /*
64 65 * Was this tcp created via socket() interface?
65 66 */
66 67 #define DCCP_IS_SOCKET(dccp) ((dccp)->dccp_issocket)
67 68
68 69 /* Packet types (RFC 4340, Section 5.1.) */
69 70 #define DCCP_PKT_REQUEST 0
70 71 #define DCCP_PKT_RESPONSE 1
71 72 #define DCCP_PKT_DATA 2
72 73 #define DCCP_PKT_ACK 3
73 74 #define DCCP_PKT_DATAACK 4
74 75 #define DCCP_PKT_CLOSEREQ 5
75 76 #define DCCP_PKT_CLOSE 6
76 77 #define DCCP_PKT_RESET 7
77 78 #define DCCP_PKT_SYNC 8
78 79 #define DCCP_PKT_SYNCACK 9
79 80
80 81 /*
81 82 * DCCP options and features.
82 83 */
83 84
84 85 /*
85 86 * Options types (RFC 4340, Section 5.8.)
86 87 */
87 88 #define DCCP_OPTION_PADDING 0
88 89 #define DCCP_OPTION_MANDATORY 1
89 90 #define DCCP_OPTION_SLOW_RECEIVER 2
90 91 #define DCCP_OPTION_CHANGE_L 32
91 92 #define DCCP_OPTION_CONFIRM_L 33
92 93 #define DCCP_OPTION_CHANGE_R 34
93 94 #define DCCP_OPTION_CONFIRM_R 35
94 95 #define DCCP_OPTION_INIT_COOKIE 36
95 96 #define DCCP_OPTION_NDP_COUNT 37
96 97 #define DCCP_OPTION_ACK_VECTOR_1 38
97 98 #define DCCP_OPTION_ACK_VECTOR_2 39
98 99 #define DCCP_OPTION_DATA_DROPPED 40
99 100 #define DCCP_OPTION_TIMESTAMP 41
100 101 #define DCCP_OPTION_TIMESTAMP_ECHO 42
101 102 #define DCCP_OPTION_ELAPSED_TIME 43
102 103 #define DCCP_OPTION_DATA_CHECKSUM 44
103 104
104 105 /*
105 106 * Feature types (RFC 4340, Section 6.4.)
106 107 */
107 108 #define DCCP_FEATURE_CCID 1
108 109 #define DCCP_FEATURE_ALLOW_SHORT_SEQNOS 2
109 110 #define DCCP_FEATURE_SEQUENCE_WINDOW 3
110 111 #define DCCP_FEATURE_ECN_INCAPABLE 4
111 112 #define DCCP_FEATURE_ACK_RATIO 5
112 113 #define DCCP_FEATURE_SEND_ACK_VECTOR 6
113 114 #define DCCP_FEATURE_SEND_NDP_COUNT 7
114 115 #define DCCP_FEATURE_MIN_CHECKSUM_COVERAGE 8
115 116 #define DCCP_FEATURE_CHECK_DATA_CHECKSUM 9
116 117
117 118 /*
118 119 * Feature negotation states (RFC 4340, Section 6.6.2.)
119 120 */
120 121 #define DCCP_FEATURE_STATE_CHANGING 0
121 122 #define DCCP_FEATURE_STATE_UNSTABLE 1
122 123 #define DCCP_FEATURE_STATE_STABLE 2
123 124
124 125 /*
125 126 * Reset types (RFC 4230, Section 5.6.)
126 127 */
127 128 #define DCCP_RESET_UNSPECIFIED 0
128 129 #define DCCP_RESET_CLOSED 1
129 130 #define DCCP_RESET_ABORTED 2
130 131 #define DCCP_RESET_NO_CONNECTION 3
131 132 #define DCCP_RESET_PACKET_ERROR 4
132 133 #define DCCP_RESET_OPTION_ERROR 5
133 134 #define DCCP_RESET_MANDATORY_ERROR 6
134 135 #define DCCP_RESET_CONNECTION_REFUSED 7
135 136 #define DCCP_RESET_BAD_SERVICE_CODE 8
136 137 #define DCCP_RESET_TOO_BUSY 9
137 138 #define DCCP_RESET_BAD_INIT_COOKIE 10
138 139 #define DCCP_RESET_AGGRESSION_PENALTY 11
139 140 #define DCCP_RESET_RESERVED 12
140 141
141 142 typedef struct dccp_feature_s {
142 143 list_node_t df_next;
143 144 uint8_t df_option;
144 145 uint8_t df_type;
145 146 uint8_t df_state;
146 147 uint64_t df_value;
147 148 boolean_t df_mandatory;
148 149 } dccp_feature_t;
149 150
150 151 /* Options in DCCP header */
151 152 typedef struct dccp_opt_s {
152 153 int type;
153 154 boolean_t mandatory;
154 155 } dccp_opt_t;
155 156
156 157
157 158 #define dccps_smallest_nonpriv_port dccps_propinfo_tbl[0].prop_cur_uval
158 159 #define dccps_smallest_anon_port dccps_propinfo_tbl[1].prop_cur_uval
159 160 #define dccps_largest_anon_port dccps_propinfo_tbl[2].prop_cur_uval
160 161
161 162 #define dccps_dbg dccps_propinfo_tbl[4].prop_cur_uval
162 163 #define dccps_rst_sent_rate_enabled dccps_propinfo_tbl[5].prop_cur_uval
163 164 #define dccps_rst_sent_rate dccps_propinfo_tbl[6].prop_cur_uval
164 165
165 166 /*
166 167 * Timers.
167 168 */
168 169 typedef struct dccp_timer_s {
169 170 conn_t *connp;
170 171 void (*dccpt_proc)(void *);
171 172 callout_id_t dccpt_tid;
172 173 } dccp_timer_t;
173 174
174 175 extern kmem_cache_t *dccp_timercache;
175 176
176 177 #define DCCP_TIMER(dccp, f, tim) \
177 178 dccp_timeout(dccp->dccp_connp, f, tim)
178 179
179 180 #define DCCP_TIMER_CANCEL(dccp, id) \
180 181 dccp_timeout_cancel(dccp->dccp_connp, id)
181 182
182 183 #define DCCP_TIMER_RESTART(dccp, intvl) { \
183 184 if ((dccp)->dccp_timer_tid != 0) \
184 185 (void) DCCP_TIMER_CANCEL((dccp), (dccp)->dccp_timer_tid); \
185 186 (dccp)->dccp_timer_tid = DCCP_TIMER((dccp), dccp_timer, (intvl)); \
186 187 }
187 188
188 189 extern struct qinit dccp_rinitv4, dccp_rinitv6;
189 190
190 191 extern optdb_obj_t dccp_opt_obj;
191 192 extern uint_t dccp_max_optsize;
192 193
193 194 extern int dccp_squeue_flag;
194 195
195 196 /*
196 197 * Functions in dccp.c
197 198 */
198 199 extern int dccp_build_hdrs(dccp_t *);
199 200 extern conn_t *dccp_create_common(cred_t *, boolean_t, boolean_t, int *);
200 201 extern void dccp_close_common(conn_t *, int);
201 202 extern int dccp_do_bind(conn_t *, struct sockaddr *, socklen_t, cred_t *,
202 203 boolean_t);
203 204 extern int dccp_do_unbind(conn_t *);
204 205 extern int dccp_do_listen(conn_t *, struct sockaddr *, socklen_t, int,
205 206 cred_t *, boolean_t);
206 207 extern int dccp_do_connect(conn_t *, const struct sockaddr *, socklen_t,
207 208 cred_t *, pid_t);
208 209 extern void dccp_init_values(dccp_t *, dccp_t *);
209 210 extern void dccp_free(dccp_t *);
210 211 extern void *dccp_get_conn(void *, dccp_stack_t *);
211 212 extern int dccp_set_destination(dccp_t *dccp);
212 213
213 214 /*
214 215 * Functions in dccp_bind.c
215 216 */
216 217 extern void dccp_bind_hash_insert(dccp_df_t *, dccp_t *, int);
217 218 extern void dccp_bind_hash_remove(dccp_t *);
218 219 extern int dccp_bind_check(conn_t *, struct sockaddr *, socklen_t,
219 220 cred_t *cr, boolean_t);
220 221 extern in_port_t dccp_bindi(dccp_t *, in_port_t, const in6_addr_t *, int,
221 222 boolean_t, boolean_t, boolean_t);
222 223 extern in_port_t dccp_update_next_port(in_port_t, const dccp_t *, boolean_t);
223 224
224 225 /*
225 226 * Functions in dccp_features.c
226 227 */
227 228 extern void dccp_parse_feature(dccp_t *, uint8_t, uint8_t, uchar_t *,
228 229 boolean_t);
229 230
230 231 /*
231 232 * Functions in dccp_stats.c
232 233 */
233 234 extern mblk_t *dccp_snmp_get(queue_t *, mblk_t *, boolean_t);
234 235 extern void *dccp_kstat_init(netstackid_t);
235 236 extern void dccp_kstat_fini(netstackid_t, kstat_t *);
236 237 extern void *dccp_kstat2_init(netstackid_t);
237 238 extern void dccp_kstat2_fini(netstackid_t, kstat_t *);
238 239
239 240 /*
240 241 * Functions in dccp_socket.c
241 242 */
242 243 extern sock_lower_handle_t dccp_create(int, int, int, sock_downcalls_t **,
243 244 uint_t *, int *, int, cred_t *);
244 245 extern int dccp_fallback(sock_lower_handle_t, queue_t *, boolean_t,
245 246 so_proto_quiesced_cb_t, sock_quiesce_arg_t *);
246 247 extern boolean_t dccp_newconn_notify(dccp_t *, ip_recv_attr_t *);
247 248
248 249 /*
249 250 * Functions in dccp_input.c
250 251 */
251 252 extern void dccp_icmp_input(void *, mblk_t *, void *, ip_recv_attr_t *);
252 253 extern void dccp_input_data(void *, mblk_t *, void *, ip_recv_attr_t *);
253 254 extern void dccp_rsrv(queue_t *);
254 255 extern void dccp_input_listener_unbound(void *, mblk_t *, void *,
255 256 ip_recv_attr_t *);
256 257 extern boolean_t dccp_verifyicmp(conn_t *, void *, icmph_t *, icmp6_t *,
257 258 ip_recv_attr_t *);
258 259
259 260 /*
260 261 * Functions in dccp_misc.c
261 262 */
262 263 extern void dccp_stack_cpu_add(dccp_stack_t *, processorid_t);
263 264
264 265 /*
265 266 * Functions in dccp_options.c
266 267 */
267 268 extern int dccp_parse_options(dccp_t *, dccpha_t *);
268 269 extern void dccp_process_options(dccp_t *, dccpha_t *);
269 270 extern int dccp_generate_options(dccp_t *, void **, size_t *);
270 271
271 272 /*
272 273 * Functions in dccp_output.c
273 274 */
274 275 extern void dccp_wput(queue_t *, mblk_t *);
275 276 extern void dccp_wput_data(dccp_t *, mblk_t *, boolean_t);
276 277 extern void dccp_wput_sock(queue_t *, mblk_t *);
277 278 extern void dccp_wput_fallback(queue_t *, mblk_t *);
278 279 extern void dccp_output(void *, mblk_t *, void *, ip_recv_attr_t *);
279 280 extern void dccp_output_urgent(void *, mblk_t *, void *, ip_recv_attr_t *);
280 281 extern void dccp_close_output(void *, mblk_t *, void *, ip_recv_attr_t *);
281 282 extern void dccp_send_data(dccp_t *, mblk_t *);
282 283 extern void dccp_xmit_listeners_reset(mblk_t *, ip_recv_attr_t *,
283 284 ip_stack_t *, conn_t *);
284 285 extern void dccp_send_synack(void *, mblk_t *, void *, ip_recv_attr_t *);
285 286 extern mblk_t *dccp_xmit_mp(dccp_t *, mblk_t *, int32_t, int32_t *,
286 287 mblk_t **, uint32_t, boolean_t, uint32_t *, boolean_t);
287 288 /* XXX following functions should be redone */
288 289 extern mblk_t *dccp_generate_response(conn_t *, mblk_t *);
289 290 extern mblk_t *dccp_generate_request(conn_t *);
290 291 extern mblk_t *dccp_generate_reset(conn_t *);
291 292
292 293 /*
293 294 * Functions in dccp_opt_data.c
294 295 */
295 296 extern int dccp_opt_get(conn_t *, int, int, uchar_t *);
296 297 extern int dccp_opt_set(conn_t *, uint_t, int, int, uint_t, uchar_t *,
297 298 uint_t *, uchar_t *, void *, cred_t *);
298 299
299 300 /*
300 301 * Functions in dccp_timers.c
301 302 */
302 303 extern timeout_id_t dccp_timeout(conn_t *, void (*)(void *), hrtime_t);
303 304 extern clock_t dccp_timeout_cancel(conn_t *, timeout_id_t);
304 305 extern mblk_t *dccp_timermp_alloc(int);
305 306 extern void dccp_timermp_free(dccp_t *);
306 307 extern void dccp_timer(void *);
307 308
308 309 /*
309 310 * Functions in dccp_tpi.c
310 311 */
311 312 extern void dccp_do_capability_ack(dccp_t *, struct T_capability_ack *,
312 313 t_uscalar_t);
313 314 extern void dccp_capability_req(dccp_t *, mblk_t *);
314 315 extern void dccp_err_ack(dccp_t *, mblk_t *, int, int);
315 316 extern void dccp_tpi_connect(dccp_t *, mblk_t *);
316 317 extern int dccp_tpi_close(queue_t *, int);
317 318 extern int dccp_tpi_close_accept(queue_t *);
318 319 extern boolean_t dccp_conn_con(dccp_t *, uchar_t *, mblk_t *, mblk_t **,
319 320 ip_recv_attr_t *);
320 321 extern int dccp_tpi_opt_get(queue_t *, t_scalar_t, t_scalar_t, uchar_t *);
321 322 extern int dccp_tpi_opt_set(queue_t *, uint_t, int, int, uint_t, uchar_t *,
322 323 uint_t *, uchar_t *, void *, cred_t *);
323 324 extern void dccp_tpi_accept(queue_t *, mblk_t *);
324 325
325 326 #endif /* _KERNEL */
326 327
327 328 #ifdef __cplusplus
328 329 }
329 330 #endif
330 331
331 332 #endif /* _INET_DCCP_IMPL_H */
↓ open down ↓ |
299 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX