Print this page
dccp: clock_t
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/inet/dccp.h
+++ new/usr/src/uts/common/inet/dccp.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 /*
13 13 * Copyright 2012 David Hoeppner. All rights reserved.
14 14 */
15 15
16 16 #ifndef _INET_DCCP_H
17 17 #define _INET_DCCP_H
18 18
19 19 #include <sys/inttypes.h>
20 20 #include <sys/socket.h>
21 21 #include <sys/socket_proto.h>
22 22
23 23 #include <netinet/in.h>
24 24 #include <netinet/ip6.h>
25 25 #include <netinet/dccp.h>
26 26
27 27 #include <inet/common.h>
28 28 #include <inet/dccp_stack.h>
29 29 #include <inet/ip.h>
30 30 #include <inet/ip6.h>
31 31 #include <inet/optcom.h>
32 32 #include <inet/tunables.h>
33 33
34 34 #ifdef __cplusplus
35 35 extern "C" {
36 36 #endif
37 37
38 38 /*
39 39 * DCCP states
40 40 */
41 41 #define DCCPS_CLOSED 1
42 42 #define DCCPS_BOUND 2
43 43 #define DCCPS_REQUEST 3
44 44 #define DCCPS_LISTEN 4
45 45 #define DCCPS_PARTOPEN 5
46 46 #define DCCPS_RESPOND 6
47 47 #define DCCPS_OPEN 7
48 48 #define DCCPS_CLOSING 8
49 49 #define DCCPS_CLOSEREQ 9
50 50 #define DCCPS_TIMEWAIT 10
51 51
52 52 /*
53 53 * DCCP header structures.
54 54 */
55 55
56 56 /* Generic protocol header (RFC 4340, Section 5.1.) */
57 57 typedef struct dccphdr_s {
58 58 uint8_t dh_lport[2];
59 59 uint8_t dh_fport[2];
60 60 uint8_t dh_offset;
61 61 uint8_t dh_ccval:4,
62 62 dh_cscov:4;
63 63 uint8_t db_sum[2];
64 64 uint8_t dh_reserved:3,
65 65 dh_type:4,
66 66 dh_x:1;
67 67 uint8_t dh_res_seq;
68 68 uint8_t dh_seq[2];
69 69 } dccph_t;
70 70
71 71 #define DCCP_HDR_LENGTH(dccph) \
72 72 (((dccph_t *)dccph)->dh_offset * 4) /* XXX >> 2 */
73 73 #define DCCP_MAX_HDR_LENGTH 1020
74 74 #define DCCP_MIN_HEADER_LENGTH 12
75 75
76 76 /* Generic protocol header aligned (RFC 4340, Section 5.1.) */
77 77 typedef struct dccphdra_s {
78 78 in_port_t dha_lport; /* Source port */
79 79 in_port_t dha_fport; /* Destination port */
80 80 uint8_t dha_offset; /* Data offset */
81 81 uint8_t dha_ccval:4, /* */
82 82 dha_cscov:4; /* */
83 83 uint16_t dha_sum; /* Checksum */
84 84 uint8_t dha_x:1, /* Reserved */
85 85 dha_type:4, /* Packet type */
86 86 dha_reserved:3; /* Header type */
87 87 uint8_t dha_res_seq;
88 88 uint16_t dha_seq; /* Partial sequence number */
89 89 } dccpha_t;
90 90
91 91 typedef struct dccphdra_ext_s {
92 92 uint32_t dha_ext_seq;
93 93 } dccpha_ext_t;
94 94
95 95 /* Acknowledgement number */
96 96 typedef struct dccphdra_ack {
97 97 uint16_t dha_ack_reserved;
98 98 uint16_t dha_ack_high;
99 99 uint32_t dha_ack_low;
100 100 } dccpha_ack_t;
101 101
102 102 /* Service number */
103 103 typedef struct dccphdra_srv {
104 104 uint32_t dha_srv_code;
105 105 } dccpha_srv_t;
106 106
107 107 /* Reset data */
108 108 typedef struct dccphdra_reset {
109 109 uint8_t dha_reset_code;
110 110 uint8_t dha_reset_data[3];
111 111 } dccpha_reset_t;
112 112
113 113 /*
114 114 * Control structure for each open TCP stream,
115 115 * defined only within the kernel or for a kmem user.
116 116 * NOTE: tcp_reinit_values MUST have a line for each field in this structure!
117 117 */
118 118 #if (defined(_KERNEL) || defined(_KMEMUSER))
119 119
120 120 /* Internal DCCP structure */
121 121 typedef struct dccp_s {
122 122
123 123 conn_t *dccp_connp; /* Backpointer to conn_t */
124 124 dccp_stack_t *dccp_dccps; /* Backpointer to dccp_stack_t */
125 125
126 126 int32_t dccp_state;
127 127
128 128 uint64_t dccp_last_rcv_lbolt;
129 129
130 130 uint32_t dccp_ibsegs; /* Inbound segments on this stream */
131 131 uint32_t dccp_obsegs; /* Outbound segments on this stream */
132 132
133 133 uint32_t
134 134 dccp_loopback: 1, /* Src and dst are the same machine */
135 135 dccp_localnet: 1, /* Src and dst are on the same subnet */
136 136 dccp_active_open: 1, /* This is a active open */
137 137 dccp_detached : 1, /* If we're detached from a stream */
138 138 dccp_dummy: 1;
↓ open down ↓ |
138 lines elided |
↑ open up ↑ |
139 139
140 140 uint32_t
141 141 dccp_allow_short_seqnos: 1,
142 142 dccp_ecn_incapable: 1;
143 143 /*
144 144 * Timers and timestamps.
145 145 */
146 146 mblk_t *dccp_timercache; /* Timer cache */
147 147 timeout_id_t dccp_timer_tid; /* Timer service id */
148 148
149 - int64_t dccp_timestamp_init; /* Time reference */
149 + clock_t dccp_timestamp_init; /* Time reference */
150 150 int32_t dccp_timestamp_echo; /* Timestamp found in options */
151 - int64_t dccp_timestamp;
151 + clock_t dccp_timestamp;
152 152
153 153 /*
154 154 * Bind related.
155 155 */
156 156 struct dccp_s *dccp_bind_hash; /* Bind hash chain */
157 157 struct dccp_s *dccp_bind_hash_port; /* Bound to the same port */
158 158 struct dccp_s **dccp_ptpbhn;
159 159
160 160 struct dccphdra_s *dccp_dccpha; /* Template header */
161 161
162 162 mblk_t *dccp_xmit_head;
163 163
164 164 /*
165 165 * Pointers into the header template.
166 166 */
167 167 ipha_t *dccp_ipha;
168 168 ip6_t *dccp_ip6h;
169 169
170 170 t_uscalar_t dccp_acceptor_id; /* ACCEPTOR_id */
171 171
172 172 sock_connid_t dccp_connid;
173 173
174 174 /* Incrementing pending conn req ID */
175 175 t_scalar_t dccp_conn_req_seqnum;
176 176
177 177 boolean_t dccp_issocket; /* This is a socket dccp */
178 178
179 179 /* List of features being negotiated */
180 180 list_t dccp_features;
181 181
182 182 struct dccp_s *dccp_listener; /* Our listener */
183 183 struct dccp_s *dccp_saved_listener; /* Saved listener */
184 184
185 185 /*
186 186 * Sequence numbers (Section 7.1.)
187 187 */
188 188 uint64_t dccp_swl; /* Sequence number window low */
189 189 uint64_t dccp_swh; /* Sequence number window high */
190 190 uint64_t dccp_awl; /* Ack number window low */
191 191 uint64_t dccp_awh; /* Ack number window high */
192 192 uint64_t dccp_iss; /* Initial sequence number sent */
193 193 uint64_t dccp_isr; /* Initial sequence number received */
194 194 uint64_t dccp_osr; /* First OPEN sequence number */
195 195 uint64_t dccp_gss; /* Greatest sequence number sent */
196 196 uint64_t dccp_gsr; /* Greatest sequence */
197 197 /* number received */
198 198 uint64_t dccp_gar; /* Greatest acknowledgement */
199 199 /* number received */
200 200
201 201 uint8_t dccp_reset_code;
202 202 uint8_t dccp_reset_data[3];
203 203 } dccp_t;
204 204
205 205 typedef struct dccp_df_s {
206 206 struct dccp_s *df_dccp;
207 207 kmutex_t df_lock;
208 208 uchar_t df_pad[TF_CACHEL_PAD - (sizeof (dccp_t *) +
209 209 sizeof (kmutex_t))];
210 210 } dccp_df_t;
211 211
212 212 #endif /* _KERNEL */
213 213
214 214 #ifdef __cplusplus
215 215 }
216 216 #endif
217 217
218 218 #endif /* _INET_DCCP_H */
↓ open down ↓ |
57 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX