1// Copyright 2021 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 event_engine_client_channel_resolver;
18
19import "test/core/util/fuzzing_channel_args.proto";
20import "test/core/util/fuzz_config_vars.proto";
21
22message Error {
23    uint32 code = 1;
24    string message = 2;
25}
26
27message ResolvedAddress {
28    uint32 port = 1;
29}
30message ResolvedAddresses {
31    repeated ResolvedAddress addresses = 1;
32}
33
34message SRVRecord {
35    string host = 1;
36    uint32 port = 2;
37    uint32 priority = 3;
38    uint32 weight = 4;
39}
40message SRVRecords {
41    repeated SRVRecord srv_records = 1;
42}
43
44enum TXTRecordType {
45    TXT_UNDEFINED = 0;
46    TXT_VALID = 1;
47    TXT_RANDOM_NON_CONFIG = 2;
48    TXT_RANDOM_PREFIXED_CONFIG = 3;
49}
50message TXTRecord {
51    oneof record {
52        TXTRecordType enumerated_value = 1;
53        // TODO(hork): add a ServiceConfig fuzzer when the proto definitions
54        // are worked out. See https://github.com/grpc/grpc/pull/32956 for the
55        // implementation.
56    }
57    // Random TXT record content, used for some TXTRecordTypes.
58    string arbitrary_value = 2;
59}
60message TXTRecords {
61    repeated TXTRecord txt_records = 1;
62}
63
64enum ExecutionStep {
65    NEVER = 0;
66    DURING_LOOKUP_HOSTNAME = 1;
67    AFTER_LOOKUP_HOSTNAME_CALLBACK = 2;
68    DURING_LOOKUP_SRV = 3;
69    AFTER_LOOKUP_SRV_CALLBACK = 4;
70    DURING_LOOKUP_TXT = 5;
71    AFTER_LOOKUP_TXT_CALLBACK = 6;
72}
73
74message Msg {
75    grpc.testing.FuzzingChannelArgs channel_args = 1;
76    grpc.testing.FuzzConfigVars config_vars = 9;
77    oneof hostname {
78        ResolvedAddresses hostname_response = 2;
79        Error hostname_error = 3;
80    }
81    oneof srv {
82        SRVRecords srv_response = 4;
83        Error srv_error = 5;
84    }
85    oneof txt {
86        TXTRecords txt_response = 6;
87        Error txt_error = 7;
88    }
89    ExecutionStep should_orphan_at_step = 8;
90}
91