LCOV - code coverage report
Current view: top level - waltz/quic/templ - fd_quic_frames_templ.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 62 115 53.9 %
Date: 2025-01-08 12:08:44 Functions: 20 1368 1.5 %

          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     1599112 : FD_TEMPL_DEF_STRUCT_BEGIN(padding_frame)
      10     1599097 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x00,0x00 )
      11     1599097 : 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          27 : FD_TEMPL_DEF_STRUCT_BEGIN(ping_frame)
      22          12 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x01,0x01 )
      23          12 : 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     3205619 : FD_TEMPL_DEF_STRUCT_BEGIN(ack_frame)
      40     3205604 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x02,0x03 )
      41             :   //FD_TEMPL_MBR_ELEM(type,uchar)
      42     3205601 :   FD_TEMPL_MBR_ELEM_VARINT( largest_ack,     ulong )
      43     3205589 :   FD_TEMPL_MBR_ELEM_VARINT( ack_delay,       ulong )
      44     3205589 :   FD_TEMPL_MBR_ELEM_VARINT( ack_range_count, ulong )
      45     3205589 :   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     3205586 : 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          15 : 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          15 : 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       42141 : FD_TEMPL_DEF_STRUCT_BEGIN(crypto_frame)
      96       42126 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x06,0x06 )
      97       42126 :   FD_TEMPL_MBR_ELEM_VARINT ( offset, ulong )
      98       42126 :   FD_TEMPL_MBR_ELEM_VARINT ( length, ulong )
      99       42126 : 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          15 : 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          15 : FD_TEMPL_DEF_STRUCT_BEGIN(stream_8_frame)
     146           0 :   FD_TEMPL_MBR_ELEM( type, uchar )
     147           0 :   FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
     148           0 : FD_TEMPL_DEF_STRUCT_END(stream_8_frame)
     149             : 
     150    92029743 : FD_TEMPL_DEF_STRUCT_BEGIN(stream_a_frame)
     151    92029728 :   FD_TEMPL_MBR_ELEM( type, uchar )
     152    92029728 :   FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
     153    92029728 :   FD_TEMPL_MBR_ELEM_VARINT( length,    ulong )
     154    92029728 : FD_TEMPL_DEF_STRUCT_END(stream_a_frame)
     155             : 
     156          15 : FD_TEMPL_DEF_STRUCT_BEGIN(stream_c_frame)
     157           0 :   FD_TEMPL_MBR_ELEM( type, uchar )
     158           0 :   FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
     159           0 :   FD_TEMPL_MBR_ELEM_VARINT( offset,    ulong )
     160           0 : FD_TEMPL_DEF_STRUCT_END(stream_c_frame)
     161             : 
     162       16884 : FD_TEMPL_DEF_STRUCT_BEGIN(stream_e_frame)
     163       16869 :   FD_TEMPL_MBR_ELEM( type, uchar )
     164       16869 :   FD_TEMPL_MBR_ELEM_VARINT( stream_id, ulong )
     165       16869 :   FD_TEMPL_MBR_ELEM_VARINT( offset,    ulong )
     166       16869 :   FD_TEMPL_MBR_ELEM_VARINT( length,    ulong )
     167       16869 : FD_TEMPL_DEF_STRUCT_END(stream_e_frame)
     168             : 
     169             : 
     170             : /* Max Data Frame
     171             : 
     172             :    MAX_DATA Frame {
     173             :      Type (i) = 0x10,
     174             :      Maximum Data (i),
     175             :    }
     176             :    Figure 33: MAX_DATA Frame Format */
     177             : 
     178          15 : FD_TEMPL_DEF_STRUCT_BEGIN(max_data_frame)
     179           0 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x10,0x10 )
     180           0 :   FD_TEMPL_MBR_ELEM_VARINT( max_data, ulong )
     181           0 : FD_TEMPL_DEF_STRUCT_END(max_data_frame)
     182             : 
     183             : 
     184             : /* Max Stream Data Frame
     185             : 
     186             :    MAX_STREAM_DATA Frame {
     187             :      Type (i) = 0x11,
     188             :      Stream ID (i),
     189             :      Maximum Stream Data (i),
     190             :    }
     191             :    Figure 34: MAX_STREAM_DATA Frame Format */
     192             : 
     193          15 : FD_TEMPL_DEF_STRUCT_BEGIN(max_stream_data_frame)
     194           0 :   FD_TEMPL_MBR_FRAME_TYPE( type,0x11,0x11 )
     195           0 :   FD_TEMPL_MBR_ELEM_VARINT( stream_id,       ulong )
     196           0 :   FD_TEMPL_MBR_ELEM_VARINT( max_stream_data, ulong )
     197           0 : FD_TEMPL_DEF_STRUCT_END(max_stream_data_frame)
     198             : 
     199             : 
     200             : /* Max Streams Frame
     201             : 
     202             :    MAX_STREAMS Frame {
     203             :      Type (i) = 0x12..0x13,
     204             :      Maximum Streams (i),
     205             :    }
     206             :    Figure 35: MAX_STREAMS Frame Format */
     207             : 
     208          15 : FD_TEMPL_DEF_STRUCT_BEGIN(max_streams_frame)
     209           0 :   FD_TEMPL_MBR_ELEM( type, uchar )
     210           0 :   FD_TEMPL_MBR_ELEM_VARINT( max_streams, ulong )
     211           0 : FD_TEMPL_DEF_STRUCT_END(max_streams_frame)
     212             : 
     213             : 
     214             : /* Data Blocked Frame
     215             : 
     216             :    DATA_BLOCKED Frame {
     217             :      Type (i) = 0x14,
     218             :      Maximum Data (i),
     219             :    }
     220             :    Figure 36: DATA_BLOCKED Frame Format */
     221             : 
     222          15 : FD_TEMPL_DEF_STRUCT_BEGIN(data_blocked_frame)
     223           0 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x14,0x14 )
     224           0 :   FD_TEMPL_MBR_ELEM_VARINT( max_data, ulong )
     225           0 : FD_TEMPL_DEF_STRUCT_END(data_blocked_frame)
     226             : 
     227             : 
     228             : /* Stream Data Blocked Frame
     229             : 
     230             :    STREAM_DATA_BLOCKED Frame {
     231             :      Type (i) = 0x15,
     232             :      Stream ID (i),
     233             :      Maximum Stream Data (i),
     234             :    }
     235             :    Figure 37: STREAM_DATA_BLOCKED Frame Format */
     236             : 
     237          15 : FD_TEMPL_DEF_STRUCT_BEGIN(stream_data_blocked_frame)
     238           0 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x15,0x15 )
     239           0 :   FD_TEMPL_MBR_ELEM_VARINT( stream_id,       ulong )
     240           0 :   FD_TEMPL_MBR_ELEM_VARINT( max_stream_data, ulong )
     241           0 : FD_TEMPL_DEF_STRUCT_END(stream_data_blocked_frame)
     242             : 
     243             : 
     244             : /* Streams Blocked Frame
     245             : 
     246             :    STREAMS_BLOCKED Frame {
     247             :      Type (i) = 0x16..0x17,
     248             :      Maximum Streams (i),
     249             :    }
     250             :    Figure 38: STREAMS_BLOCKED Frame Format */
     251             : 
     252          15 : FD_TEMPL_DEF_STRUCT_BEGIN(streams_blocked_frame)
     253           0 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x16,0x17 )
     254           0 :   FD_TEMPL_MBR_ELEM_VARINT( max_streams, ulong )
     255           0 : FD_TEMPL_DEF_STRUCT_END(streams_blocked_frame)
     256             : 
     257             : 
     258             : /* New Connection ID Frame
     259             : 
     260             :    NEW_CONNECTION_ID Frame {
     261             :      Type (i) = 0x18,
     262             :      Sequence Number (i),
     263             :      Retire Prior To (i),
     264             :      Length (8),
     265             :      Connection ID (8..160),
     266             :      Stateless Reset Token (128),
     267             :    }
     268             :    Figure 39: NEW_CONNECTION_ID Frame Format */
     269             : 
     270          15 : FD_TEMPL_DEF_STRUCT_BEGIN(new_conn_id_frame)
     271           0 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x18,0x18 )
     272           0 :   FD_TEMPL_MBR_ELEM_VARINT ( seq_nbr,               ulong              )
     273           0 :   FD_TEMPL_MBR_ELEM_VARINT ( retire_prior_to,       ulong              )
     274           0 :   FD_TEMPL_MBR_ELEM        ( conn_id_len,           uchar              )
     275           0 :   FD_TEMPL_MBR_ELEM_VAR_RAW( conn_id,               0,160, conn_id_len )
     276           0 :   FD_TEMPL_MBR_ELEM_RAW    ( stateless_reset_token, 16                 )
     277           0 : FD_TEMPL_DEF_STRUCT_END(new_conn_id_frame)
     278             : 
     279             : 
     280             : /* Retire Connection ID Frame
     281             : 
     282             :    RETIRE_CONNECTION_ID Frame {
     283             :      Type (i) = 0x19,
     284             :      Sequence Number (i),
     285             :    }
     286             :    Figure 40: RETIRE_CONNECTION_ID Frame Format */
     287             : 
     288          15 : FD_TEMPL_DEF_STRUCT_BEGIN(retire_conn_id_frame)
     289           0 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x19,0x19 )
     290           0 :   FD_TEMPL_MBR_ELEM_VARINT( seq_nbr, ulong )
     291           0 : FD_TEMPL_DEF_STRUCT_END(retire_conn_id_frame)
     292             : 
     293             : 
     294             : /* Path Challenge Frame
     295             : 
     296             :    PATH_CHALLENGE Frame {
     297             :      Type (i) = 0x1a,
     298             :      Data (64),
     299             :    }
     300             :    Figure 41: PATH_CHALLENGE Frame Format */
     301             : 
     302          15 : FD_TEMPL_DEF_STRUCT_BEGIN(path_challenge_frame)
     303           0 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x1a,0x1a )
     304           0 :   FD_TEMPL_MBR_ELEM( data, ulong )
     305           0 : FD_TEMPL_DEF_STRUCT_END(path_challenge_frame)
     306             : 
     307             : 
     308             : /* Path Response Frame
     309             : 
     310             :    PATH_RESPONSE Frame {
     311             :      Type (i) = 0x1b,
     312             :      Data (64),
     313             :    }
     314             :    Figure 42: PATH_RESPONSE Frame Format */
     315             : 
     316          21 : FD_TEMPL_DEF_STRUCT_BEGIN(path_response_frame)
     317           6 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x1b,0x1b )
     318           6 :   FD_TEMPL_MBR_ELEM( data, ulong )
     319           6 : FD_TEMPL_DEF_STRUCT_END(path_response_frame)
     320             : 
     321             : 
     322             : /* Connection Close Frame
     323             : 
     324             :    CONNECTION_CLOSE Frame {
     325             :      Type (i) = 0x1c..0x1d,
     326             :      Error Code (i),
     327             :      [Frame Type (i)],
     328             :      Reason Phrase Length (i),
     329             :      Reason Phrase (..),
     330             :    }
     331             :    Figure 43: CONNECTION_CLOSE Frame Format */
     332             : 
     333        6096 : FD_TEMPL_DEF_STRUCT_BEGIN(conn_close_0_frame)
     334        6081 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x1c,0x1c )
     335        6081 :   FD_TEMPL_MBR_ELEM_VARINT( error_code,           ulong )
     336        6081 :   FD_TEMPL_MBR_ELEM_VARINT( frame_type,           ulong )
     337        6081 :   FD_TEMPL_MBR_ELEM_VARINT( reason_phrase_length, ulong )
     338             : 
     339             :   /* phrase follows */
     340        6081 : FD_TEMPL_DEF_STRUCT_END(conn_close_0_frame)
     341             : 
     342             : 
     343       12054 : FD_TEMPL_DEF_STRUCT_BEGIN(conn_close_1_frame)
     344       12039 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x1d,0x1d )
     345       12039 :   FD_TEMPL_MBR_ELEM_VARINT( error_code,           ulong )
     346       12039 :   FD_TEMPL_MBR_ELEM_VARINT( reason_phrase_length, ulong )
     347             : 
     348             :   /* phrase follows */
     349       12039 : FD_TEMPL_DEF_STRUCT_END(conn_close_1_frame)
     350             : 
     351             : 
     352             : /* Handshake Done Frame
     353             : 
     354             :    HANDSHAKE_DONE Frame {
     355             :      Type (i) = 0x1e,
     356             :    }
     357             :    Figure 44: HANDSHAKE_DONE Frame Format */
     358             : 
     359        6030 : FD_TEMPL_DEF_STRUCT_BEGIN(handshake_done_frame)
     360        6015 :   FD_TEMPL_MBR_FRAME_TYPE( type, 0x1e,0x1e )
     361        6015 : FD_TEMPL_DEF_STRUCT_END(handshake_done_frame)
     362             : 

Generated by: LCOV version 1.14