GRPC C++  1.39.1
frame_data.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2015 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H
20 #define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H
21 
22 /* Parser for GRPC streams embedded in DATA frames */
23 
25 
26 #include <grpc/slice.h>
27 #include <grpc/slice_buffer.h>
31 
32 typedef enum {
41 
42 namespace grpc_core {
43 class Chttp2IncomingByteStream;
44 } // namespace grpc_core
45 
49 
51  uint8_t frame_type = 0;
52  uint32_t frame_size = 0;
54 
55  bool is_frame_compressed = false;
57 };
58 
59 /* start processing a new data frame */
61  grpc_chttp2_data_parser* parser, uint8_t flags, uint32_t stream_id,
63 
64 /* handle a slice of a data frame - is_last indicates the last slice of a
65  frame */
69  const grpc_slice& slice,
70  int is_last);
71 
72 void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer* inbuf,
73  uint32_t write_bytes, int is_eof,
75  grpc_slice_buffer* outbuf);
76 
79  grpc_slice_buffer* slices, grpc_slice* slice_out,
81 
82 #endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_FRAME_DATA_H */
Definition: internal.h:211
#define GRPC_ERROR_NONE
The following "special" errors can be propagated without allocating memory.
Definition: error.h:228
grpc_chttp2_stream_state
Definition: frame_data.h:32
@ GRPC_CHTTP2_DATA_FH_3
Definition: frame_data.h:36
@ GRPC_CHTTP2_DATA_FH_4
Definition: frame_data.h:37
@ GRPC_CHTTP2_DATA_FH_0
Definition: frame_data.h:33
@ GRPC_CHTTP2_DATA_ERROR
Definition: frame_data.h:39
@ GRPC_CHTTP2_DATA_FRAME
Definition: frame_data.h:38
@ GRPC_CHTTP2_DATA_FH_1
Definition: frame_data.h:34
@ GRPC_CHTTP2_DATA_FH_2
Definition: frame_data.h:35
void grpc_chttp2_encode_data(uint32_t id, grpc_slice_buffer *inbuf, uint32_t write_bytes, int is_eof, grpc_transport_one_way_stats *stats, grpc_slice_buffer *outbuf)
Definition: frame_data.cc:64
grpc_error_handle grpc_chttp2_data_parser_begin_frame(grpc_chttp2_data_parser *parser, uint8_t flags, uint32_t stream_id, grpc_chttp2_stream *s)
Definition: frame_data.cc:44
grpc_error_handle grpc_deframe_unprocessed_incoming_frames(grpc_chttp2_data_parser *p, grpc_chttp2_stream *s, grpc_slice_buffer *slices, grpc_slice *slice_out, grpc_core::OrphanablePtr< grpc_core::ByteStream > *stream_out)
Definition: frame_data.cc:92
grpc_error_handle grpc_chttp2_data_parser_parse(void *parser, grpc_chttp2_transport *t, grpc_chttp2_stream *s, const grpc_slice &slice, int is_last)
Definition: frame_data.cc:278
Round Robin Policy.
Definition: backend_metric.cc:26
std::unique_ptr< T, Deleter > OrphanablePtr
Definition: orphanable.h:67
grpc_slice slice
Definition: server.cc:461
Definition: frame_data.h:46
uint32_t frame_size
Definition: frame_data.h:52
grpc_error_handle error
Definition: frame_data.h:53
grpc_chttp2_stream_state state
Definition: frame_data.h:50
~grpc_chttp2_data_parser()
Definition: frame_data.cc:36
grpc_core::Chttp2IncomingByteStream * parsing_frame
Definition: frame_data.h:56
grpc_chttp2_data_parser()=default
uint8_t frame_type
Definition: frame_data.h:51
bool is_frame_compressed
Definition: frame_data.h:55
Definition: internal.h:509
Definition: internal.h:288
Definition: error_internal.h:41
Represents an expandable array of slices, to be interpreted as a single item.
Definition: slice.h:78
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60
Definition: transport.h:122