Line data Source code
1 : /* Padding Frame
2 :
3 : PADDING Frame {
4 : Type (i) = 0x00,
5 : }
6 : Figure 23: PADDING Frame Format
7 : 19.2. PING Frames */
8 :
9 24780 : FD_TEMPL_DEF_STRUCT_BEGIN(padding_frame)
10 24768 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x00,0x00 )
11 24768 : FD_TEMPL_DEF_STRUCT_END(padding_frame)
12 :
13 :
14 : /* Ping Frame
15 :
16 : PING Frame {
17 : Type (i) = 0x01,
18 : }
19 : Figure 24: PING Frame Format */
20 :
21 45 : FD_TEMPL_DEF_STRUCT_BEGIN(ping_frame)
22 33 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x01,0x01 )
23 33 : FD_TEMPL_DEF_STRUCT_END(ping_frame)
24 :
25 :
26 : /* Acknowledgement Frame
27 :
28 : ACK Frame {
29 : Type (i) = 0x02..0x03,
30 : Largest Acknowledged (i),
31 : ACK Delay (i),
32 : ACK Range Count (i),
33 : First ACK Range (i),
34 : ACK Range (..) ...,
35 : [ECN Counts (..)],
36 : }
37 : Figure 25: ACK Frame Format */
38 :
39 5484089 : FD_TEMPL_DEF_STRUCT_BEGIN(ack_frame)
40 5484077 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x02,0x03 )
41 : //FD_TEMPL_MBR_ELEM(type,uchar)
42 5484074 : FD_TEMPL_MBR_ELEM_VARINT( largest_ack, ulong )
43 5484059 : FD_TEMPL_MBR_ELEM_VARINT( ack_delay, ulong )
44 5484056 : FD_TEMPL_MBR_ELEM_VARINT( ack_range_count, ulong )
45 5484050 : FD_TEMPL_MBR_ELEM_VARINT( first_ack_range, ulong )
46 : /* N ack_range_frag (ack_range_count) */
47 : /* opt ecn_counts_frag if type == 0x03 */
48 5484038 : FD_TEMPL_DEF_STRUCT_END(ack_frame)
49 :
50 :
51 : /* Reset Stream Frame
52 :
53 : RESET_STREAM Frame {
54 : Type (i) = 0x04,
55 : Stream ID (i),
56 : Application Protocol Error Code (i),
57 : Final Size (i),
58 : }
59 : Figure 28: RESET_STREAM Frame Format */
60 :
61 12 : FD_TEMPL_DEF_STRUCT_BEGIN(reset_stream_frame)
62 0 : FD_TEMPL_MBR_FRAME_TYPE ( type, 0x04,0x04 )
63 0 : FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
64 0 : FD_TEMPL_MBR_ELEM_VARINT( app_proto_err_code, ulong )
65 0 : FD_TEMPL_MBR_ELEM_VARINT( final_size, ulong )
66 0 : FD_TEMPL_DEF_STRUCT_END(reset_stream_frame)
67 :
68 :
69 : /* Stop Sending Frame
70 :
71 : STOP_SENDING Frame {
72 : Type (i) = 0x05,
73 : Stream ID (i),
74 : Application Protocol Error Code (i),
75 : }
76 : Figure 29: STOP_SENDING Frame Format */
77 :
78 12 : FD_TEMPL_DEF_STRUCT_BEGIN(stop_sending_frame)
79 0 : FD_TEMPL_MBR_FRAME_TYPE ( type, 0x05,0x05 )
80 0 : FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
81 0 : FD_TEMPL_MBR_ELEM_VARINT( app_proto_err_code, ulong )
82 0 : FD_TEMPL_DEF_STRUCT_END(stop_sending_frame)
83 :
84 :
85 : /* Crypto Frame
86 :
87 : CRYPTO Frame {
88 : Type (i) = 0x06,
89 : Offset (i), // byte offset in the stream
90 : Length (i),
91 : Crypto Data (..),
92 : }
93 : Figure 30: CRYPTO Frame Format */
94 :
95 42168 : FD_TEMPL_DEF_STRUCT_BEGIN(crypto_frame)
96 42156 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x06,0x06 )
97 42156 : FD_TEMPL_MBR_ELEM_VARINT ( offset, ulong )
98 42156 : FD_TEMPL_MBR_ELEM_VARINT ( length, ulong )
99 42156 : FD_TEMPL_DEF_STRUCT_END(crypto_frame)
100 :
101 :
102 : /* New Token Frame
103 :
104 : NEW_TOKEN Frame {
105 : Type (i) = 0x07,
106 : Token Length (i),
107 : Token (..),
108 : }
109 : Figure 31: NEW_TOKEN Frame Format */
110 :
111 12 : FD_TEMPL_DEF_STRUCT_BEGIN(new_token_frame)
112 0 : FD_TEMPL_MBR_FRAME_TYPE ( type, 0x07,0x07 )
113 0 : FD_TEMPL_MBR_ELEM_VARINT ( token_len, uint )
114 0 : FD_TEMPL_MBR_ELEM_VAR_RAW( token, 0,8192, token_len )
115 0 : FD_TEMPL_DEF_STRUCT_END(new_token_frame)
116 :
117 :
118 : /* Stream Frame
119 :
120 : STREAM Frame {
121 : Type (i) = 0x08..0x0f,
122 : Stream ID (i),
123 : [Offset (i)],
124 : [Length (i)],
125 : Stream Data (..),
126 : }
127 : Figure 32: STREAM Frame Format */
128 :
129 : /* The Type field in the STREAM frame takes the form 0b00001XXX (or the set of
130 : values from 0x08 to 0x0f). The three low-order bits of the frame type determine
131 : the fields that are present in the frame:
132 :
133 : The OFF bit (0x04) in the frame type is set to indicate that there is an Offset
134 : field present. When set to 1, the Offset field is present. When set to 0, the
135 : Offset field is absent and the Stream Data starts at an offset of 0 (that is,
136 : the frame contains the first bytes of the stream, or the end of a stream that
137 : includes no data).
138 : The LEN bit (0x02) in the frame type is set to indicate that there is a Length
139 : field present. If this bit is set to 0, the Length field is absent and the
140 : Stream Data field extends to the end of the packet. If this bit is set to 1,
141 : the Length field is present.
142 : The FIN bit (0x01) indicates that the frame marks the end of the stream. The
143 : final size of the stream is the sum of the offset and the length of this frame. */
144 :
145 101595540 : FD_TEMPL_DEF_STRUCT_BEGIN(stream_frame)
146 101595528 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x08,0x0f )
147 :
148 101595528 : FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
149 :
150 : // optional data processed in code
151 101595528 : FD_TEMPL_MBR_OPT( type, offset, 0x04,
152 84504835 : FD_TEMPL_MBR_ELEM_VARINT( offset, ulong ) )
153 :
154 126757248 : FD_TEMPL_MBR_OPT( type, length,0x02,
155 126757248 : FD_TEMPL_MBR_ELEM_VARINT( length, ulong ) )
156 :
157 126757248 : FD_TEMPL_MBR_OPT( type, fin, 0x01, )
158 126757248 : FD_TEMPL_DEF_STRUCT_END(stream_frame)
159 :
160 :
161 : /* Max Data Frame
162 :
163 : MAX_DATA Frame {
164 : Type (i) = 0x10,
165 : Maximum Data (i),
166 : }
167 : Figure 33: MAX_DATA Frame Format */
168 :
169 3339431 : FD_TEMPL_DEF_STRUCT_BEGIN(max_data_frame)
170 3339419 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x10,0x10 )
171 3339419 : FD_TEMPL_MBR_ELEM_VARINT( max_data, ulong )
172 3339419 : FD_TEMPL_DEF_STRUCT_END(max_data_frame)
173 :
174 :
175 : /* Max Stream Data Frame
176 :
177 : MAX_STREAM_DATA Frame {
178 : Type (i) = 0x11,
179 : Stream ID (i),
180 : Maximum Stream Data (i),
181 : }
182 : Figure 34: MAX_STREAM_DATA Frame Format */
183 :
184 12 : FD_TEMPL_DEF_STRUCT_BEGIN(max_stream_data_frame)
185 0 : FD_TEMPL_MBR_FRAME_TYPE( type,0x11,0x11 )
186 0 : FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
187 0 : FD_TEMPL_MBR_ELEM_VARINT( max_stream_data, ulong )
188 0 : FD_TEMPL_DEF_STRUCT_END(max_stream_data_frame)
189 :
190 :
191 : /* Max Streams Frame
192 :
193 : MAX_STREAMS Frame {
194 : Type (i) = 0x12..0x13,
195 : Maximum Streams (i),
196 : }
197 : Figure 35: MAX_STREAMS Frame Format */
198 :
199 222 : FD_TEMPL_DEF_STRUCT_BEGIN(max_streams_frame)
200 210 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x12,0x13 )
201 0 : FD_TEMPL_MBR_FRAME_TYPE_FLAG( stream_type, 0x01 )
202 210 : FD_TEMPL_MBR_ELEM_VARINT( max_streams, ulong )
203 207 : FD_TEMPL_DEF_STRUCT_END(max_streams_frame)
204 :
205 :
206 : /* Data Blocked Frame
207 :
208 : DATA_BLOCKED Frame {
209 : Type (i) = 0x14,
210 : Maximum Data (i),
211 : }
212 : Figure 36: DATA_BLOCKED Frame Format */
213 :
214 12 : FD_TEMPL_DEF_STRUCT_BEGIN(data_blocked_frame)
215 0 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x14,0x14 )
216 0 : FD_TEMPL_MBR_ELEM_VARINT( max_data, ulong )
217 0 : FD_TEMPL_DEF_STRUCT_END(data_blocked_frame)
218 :
219 :
220 : /* Stream Data Blocked Frame
221 :
222 : STREAM_DATA_BLOCKED Frame {
223 : Type (i) = 0x15,
224 : Stream ID (i),
225 : Maximum Stream Data (i),
226 : }
227 : Figure 37: STREAM_DATA_BLOCKED Frame Format */
228 :
229 12 : FD_TEMPL_DEF_STRUCT_BEGIN(stream_data_blocked_frame)
230 0 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x15,0x15 )
231 0 : FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
232 0 : FD_TEMPL_MBR_ELEM_VARINT( max_stream_data, ulong )
233 0 : FD_TEMPL_DEF_STRUCT_END(stream_data_blocked_frame)
234 :
235 :
236 : /* Streams Blocked Frame
237 :
238 : STREAMS_BLOCKED Frame {
239 : Type (i) = 0x16..0x17,
240 : Maximum Streams (i),
241 : }
242 : Figure 38: STREAMS_BLOCKED Frame Format */
243 :
244 69 : FD_TEMPL_DEF_STRUCT_BEGIN(streams_blocked_frame)
245 57 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x16,0x17 )
246 57 : FD_TEMPL_MBR_ELEM_VARINT( max_streams, ulong )
247 57 : FD_TEMPL_DEF_STRUCT_END(streams_blocked_frame)
248 :
249 :
250 : /* New Connection ID Frame
251 :
252 : NEW_CONNECTION_ID Frame {
253 : Type (i) = 0x18,
254 : Sequence Number (i),
255 : Retire Prior To (i),
256 : Length (8),
257 : Connection ID (8..160),
258 : Stateless Reset Token (128),
259 : }
260 : Figure 39: NEW_CONNECTION_ID Frame Format */
261 :
262 12 : FD_TEMPL_DEF_STRUCT_BEGIN(new_conn_id_frame)
263 0 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x18,0x18 )
264 0 : FD_TEMPL_MBR_ELEM_VARINT ( seq_nbr, ulong )
265 0 : FD_TEMPL_MBR_ELEM_VARINT ( retire_prior_to, ulong )
266 0 : FD_TEMPL_MBR_ELEM ( conn_id_len, uchar )
267 0 : FD_TEMPL_MBR_ELEM_VAR_RAW( conn_id, 0,160, conn_id_len )
268 0 : FD_TEMPL_MBR_ELEM_FIXED ( stateless_reset_token, uchar, 16 )
269 0 : FD_TEMPL_DEF_STRUCT_END(new_conn_id_frame)
270 :
271 :
272 : /* Retire Connection ID Frame
273 :
274 : RETIRE_CONNECTION_ID Frame {
275 : Type (i) = 0x19,
276 : Sequence Number (i),
277 : }
278 : Figure 40: RETIRE_CONNECTION_ID Frame Format */
279 :
280 12 : FD_TEMPL_DEF_STRUCT_BEGIN(retire_conn_id_frame)
281 0 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x19,0x19 )
282 0 : FD_TEMPL_MBR_ELEM_VARINT( seq_nbr, ulong )
283 0 : FD_TEMPL_DEF_STRUCT_END(retire_conn_id_frame)
284 :
285 :
286 : /* Path Challenge Frame
287 :
288 : PATH_CHALLENGE Frame {
289 : Type (i) = 0x1a,
290 : Data (64),
291 : }
292 : Figure 41: PATH_CHALLENGE Frame Format */
293 :
294 12 : FD_TEMPL_DEF_STRUCT_BEGIN(path_challenge_frame)
295 0 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x1a,0x1a )
296 0 : FD_TEMPL_MBR_ELEM_VARINT( data, ulong )
297 0 : FD_TEMPL_DEF_STRUCT_END(path_challenge_frame)
298 :
299 :
300 : /* Path Response Frame
301 :
302 : PATH_RESPONSE Frame {
303 : Type (i) = 0x1b,
304 : Data (64),
305 : }
306 : Figure 42: PATH_RESPONSE Frame Format */
307 :
308 12 : FD_TEMPL_DEF_STRUCT_BEGIN(path_response_frame)
309 0 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x1b,0x1b )
310 0 : FD_TEMPL_MBR_ELEM_VARINT( data, ulong )
311 0 : FD_TEMPL_DEF_STRUCT_END(path_response_frame)
312 :
313 :
314 : /* Connection Close Frame
315 :
316 : CONNECTION_CLOSE Frame {
317 : Type (i) = 0x1c..0x1d,
318 : Error Code (i),
319 : [Frame Type (i)],
320 : Reason Phrase Length (i),
321 : Reason Phrase (..),
322 : }
323 : Figure 43: CONNECTION_CLOSE Frame Format */
324 :
325 6663 : FD_TEMPL_DEF_STRUCT_BEGIN(conn_close_0_frame)
326 6651 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x1c,0x1c )
327 6651 : FD_TEMPL_MBR_ELEM_VARINT( error_code, ulong )
328 6651 : FD_TEMPL_MBR_ELEM_VARINT( frame_type, ulong )
329 6648 : FD_TEMPL_MBR_ELEM_VARINT( reason_phrase_length, ulong )
330 :
331 : /* phrase follows */
332 6645 : FD_TEMPL_DEF_STRUCT_END(conn_close_0_frame)
333 :
334 :
335 12045 : FD_TEMPL_DEF_STRUCT_BEGIN(conn_close_1_frame)
336 12033 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x1d,0x1d )
337 12033 : FD_TEMPL_MBR_ELEM_VARINT( error_code, ulong )
338 12033 : FD_TEMPL_MBR_ELEM_VARINT( reason_phrase_length, ulong )
339 :
340 : /* phrase follows */
341 12033 : FD_TEMPL_DEF_STRUCT_END(conn_close_1_frame)
342 :
343 :
344 : /* Handshake Done Frame
345 :
346 : HANDSHAKE_DONE Frame {
347 : Type (i) = 0x1e,
348 : }
349 : Figure 44: HANDSHAKE_DONE Frame Format */
350 :
351 6024 : FD_TEMPL_DEF_STRUCT_BEGIN(handshake_done_frame)
352 6012 : FD_TEMPL_MBR_FRAME_TYPE( type, 0x1e,0x1e )
353 6012 : FD_TEMPL_DEF_STRUCT_END(handshake_done_frame)
354 :
|