• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2023 The gRPC authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package fuzzer_input;
18
19import "test/core/end2end/fuzzers/api_fuzzer.proto";
20import "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto";
21import "test/core/test_util/fuzz_config_vars.proto";
22import "test/core/test_util/fuzzing_channel_args.proto";
23import "src/core/ext/transport/chaotic_good/chaotic_good_frame.proto";
24
25message Empty{};
26
27message H2DataFrame {
28    uint32 stream_id = 1;
29    bool end_of_stream = 2;
30    bytes payload = 3;
31}
32
33message SimpleHeader {
34    // If key & value are set, then a literal unencoded header is added.
35    optional string key = 1;
36    optional string value = 2;
37    // If raw_bytes is set, then after the key/value pair (if emitted) the raw bytes are emitted.
38    optional bytes raw_bytes = 3;
39}
40
41message SimpleHeaders {
42    repeated SimpleHeader headers = 1;
43
44    optional string grpc_timeout = 2;
45    optional string te = 3;
46    optional string content_type = 4;
47    optional string scheme = 5;
48    optional string method = 6;
49    optional string grpc_encoding = 7;
50    optional string grpc_internal_encoding_request = 8;
51    optional string grpc_accept_encoding = 9;
52    optional string user_agent = 10;
53    optional string grpc_message = 11;
54    optional string host = 12;
55    optional string endpoint_load_metrics_bin = 13;
56    optional string grpc_server_stats_bin = 14;
57    optional string grpc_trace_bin = 15;
58    optional string grpc_tags_bin = 16;
59    optional string x_envoy_peer_metadata = 17;
60    optional string authority = 18;
61    optional string path = 19;
62    optional string grpc_status = 20;
63    optional string grpc_previous_rpc_attempts = 21;
64    optional string grpc_retry_pushback_ms = 22;
65    optional string status = 23;
66    optional string grpclb_client_stats = 24;
67    optional string lb_token = 25;
68    optional string lb_cost_bin = 26;
69
70    optional string chaotic_good_connection_type = 27;
71    optional string chaotic_good_connection_id = 28;
72    optional string chaotic_good_alignment = 29;
73}
74
75message H2HeaderFrame {
76    uint32 stream_id = 1;
77    bool end_headers =  2;
78    bool end_stream = 3;
79    oneof payload {
80        bytes raw_bytes = 5;
81        SimpleHeaders simple_header = 6;
82    }
83}
84
85message H2ContinuationFrame {
86    uint32 stream_id = 1;
87    bool end_headers =  2;
88    oneof payload {
89        bytes raw_bytes = 5;
90        SimpleHeaders simple_header = 6;
91    }
92}
93
94message H2RstStreamFrame {
95    uint32 stream_id = 1;
96    uint32 error_code = 2;
97}
98
99message H2Setting {
100    uint32 id = 1;
101    uint32 value = 2;
102}
103
104message H2SettingsFrame {
105    bool ack = 1;
106    repeated H2Setting settings = 2;
107}
108
109message H2PingFrame {
110    bool ack = 1;
111    uint64 opaque = 2;
112}
113
114message H2GoawayFrame {
115    uint32 last_stream_id = 1;
116    uint32 error_code = 2;
117    bytes debug_data = 3;
118}
119
120message H2WindowUpdateFrame {
121    uint32 stream_id = 1;
122    uint32 increment = 2;
123}
124
125message H2SecurityFrame {
126    bytes payload = 1;
127}
128
129message H2ClientPrefix {}
130
131message ChaoticGoodServerFragment {
132    uint32 stream_id = 1;
133    oneof headers {
134        Empty headers_none = 11;
135        bytes headers_raw_bytes = 12;
136        SimpleHeaders headers_simple_header = 13;
137    }
138    oneof data {
139        Empty none = 21;
140        uint32 length = 22;
141    }
142    oneof trailers {
143        Empty trailers_none = 31;
144        bytes trailers_raw_bytes = 32;
145        SimpleHeaders trailers_simple_header = 33;
146    }
147}
148
149message ChaoticGoodPayloadOtherConnection {
150    uint32 connection_id = 1;
151    uint32 length = 2;
152}
153
154message ChaoticGoodFrame {
155    enum FrameType {
156        SETTINGS = 0;
157        CLIENT_INITIAL_METADATA = 1;
158        MESSAGE = 2;
159        CLIENT_END_OF_STREAM = 3;
160        SERVER_INITIAL_METADATA = 4;
161        SERVER_TRAILING_METADATA = 5;
162        CANCEL = 6;
163    };
164    uint32 stream_id = 1;
165    oneof frame_type {
166        FrameType known_type = 2;
167        uint32 unknown_type = 3;
168    }
169    oneof payload {
170        ChaoticGoodPayloadOtherConnection payload_other_connection_id = 10;
171        Empty payload_none = 11;
172        bytes payload_raw_bytes = 12;
173        uint32 payload_empty_of_length = 13;
174        chaotic_good_frame.Settings settings = 14;
175        chaotic_good_frame.ClientMetadata client_metadata = 15;
176        chaotic_good_frame.ServerMetadata server_metadata = 16;
177    }
178}
179
180message FakeTransportFrame {
181    enum MessageString {
182        CLIENT_INIT = 0;
183        SERVER_INIT = 1;
184        CLIENT_FINISHED = 2;
185        SERVER_FINISHED = 3;
186    }
187
188    oneof payload {
189        bytes raw_bytes = 1;
190        MessageString message_string = 2;
191    }
192}
193
194message InputSegment {
195    int32 delay_ms = 1;
196    oneof payload {
197        bytes raw_bytes = 2;
198        H2DataFrame data = 3;
199        H2HeaderFrame header = 4;
200        H2ContinuationFrame continuation = 5;
201        H2RstStreamFrame rst_stream = 6;
202        H2SettingsFrame settings = 7;
203        H2PingFrame ping = 8;
204        H2GoawayFrame goaway = 9;
205        H2WindowUpdateFrame window_update = 10;
206        H2ClientPrefix client_prefix = 11;
207        uint32 repeated_zeros = 12;
208        ChaoticGoodFrame chaotic_good = 13;
209        FakeTransportFrame fake_transport_frame = 14;
210        H2SecurityFrame security_frame = 15;
211    }
212}
213
214message InputSegments {
215    repeated InputSegment segments = 1;
216}
217
218message NetworkInput {
219    int32 connect_delay_ms = 3;
220    int32 connect_timeout_ms = 4;
221    grpc.testing.FuzzingChannelArgs endpoint_config = 5;
222    oneof value {
223        bytes single_read_bytes = 1;
224        InputSegments input_segments = 2;
225    }
226}
227
228// Only for connector fuzzer, when to drop the connector
229message ShutdownConnector {
230    int32 delay_ms = 1;
231    int32 shutdown_status = 2;
232    string shutdown_message = 3;
233}
234
235message Msg {
236    repeated NetworkInput network_input = 1;
237    repeated api_fuzzer.Action api_actions = 2;
238    fuzzing_event_engine.Actions event_engine_actions = 3;
239    grpc.testing.FuzzConfigVars config_vars = 4;
240    grpc.testing.FuzzingChannelArgs channel_args = 5;
241    ShutdownConnector shutdown_connector = 6;
242}
243