1// 2// Copyright 2022 gRPC authors. 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15// 16 17syntax = "proto3"; 18 19package xds_client_fuzzer; 20 21import "envoy/service/discovery/v3/discovery.proto"; 22import "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.proto"; 23 24// We'd ideally like to use google.rpc.Status instead of creating our 25// own proto for this, but that winds up causing all sorts of dependency 26// headaches. 27message Status { 28 int32 code = 1; 29 string message = 2; 30} 31 32// 33// interactions with XdsClient API 34// 35 36// Use a oneof instead of an enum so that we can ensure that the code 37// will fail to build if we add a type here and don't handle it in the 38// fuzzer code. 39message ResourceType { 40 message EmptyMessage {} 41 oneof resource_type { 42 EmptyMessage listener = 1; 43 EmptyMessage route_config = 2; 44 EmptyMessage cluster = 3; 45 EmptyMessage endpoint = 4; 46 } 47} 48 49message StartWatch { 50 ResourceType resource_type = 1; 51 string resource_name = 2; 52} 53 54message StopWatch { 55 ResourceType resource_type = 1; 56 string resource_name = 2; 57} 58 59// TODO(roth): add LRS methods on XdsClient 60 61message DumpCsdsData {} 62 63message ReportResourceCounts {} 64 65message ReportServerConnections {} 66 67// 68// interactions with fake transport 69// 70 71message TriggerConnectionFailure { 72 string authority = 1; 73 Status status = 2; 74} 75 76message StreamId { 77 string authority = 1; 78 79 // Use a oneof instead of an enum so that we can ensure that the code 80 // will fail to build if we add a type here and don't handle it in the 81 // fuzzer code. 82 message EmptyMessage {} 83 oneof method { 84 EmptyMessage ads = 2; 85 EmptyMessage lrs = 3; 86 } 87} 88 89message ReadMessageFromClient { 90 StreamId stream_id = 1; 91 bool ok = 2; 92} 93 94message SendMessageToClient { 95 StreamId stream_id = 1; 96 envoy.service.discovery.v3.DiscoveryResponse response = 2; 97} 98 99message SendStatusToClient { 100 StreamId stream_id = 1; 101 Status status = 2; 102} 103 104// Next free field: 10 105message Action { 106 oneof action_type { 107 // interactions with XdsClient API 108 StartWatch start_watch = 1; 109 StopWatch stop_watch = 2; 110 DumpCsdsData dump_csds_data = 3; 111 ReportResourceCounts report_resource_counts = 8; 112 ReportServerConnections report_server_connections = 9; 113 // interactions with fake transport 114 TriggerConnectionFailure trigger_connection_failure = 4; 115 ReadMessageFromClient read_message_from_client = 5; 116 SendMessageToClient send_message_to_client = 6; 117 SendStatusToClient send_status_to_client = 7; 118 } 119} 120 121message Msg { 122 string bootstrap = 1; 123 repeated Action actions = 2; 124 fuzzing_event_engine.Actions fuzzing_event_engine_actions = 3; 125} 126