| // Copyright 2022 The Pigweed Authors |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| // use this file except in compliance with the License. You may obtain a copy of |
| // the License at |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| // License for the specific language governing permissions and limitations under |
| // the License. |
| syntax = "proto3"; |
| |
| package pw.transfer; |
| |
| option java_package = "pw.transfer"; |
| option java_outer_classname = "ConfigProtos"; |
| |
| // Configuration for the integration test client. |
| message ClientConfig { |
| // Transfer resource ID to use. |
| uint32 resource_id = 1; |
| |
| // Path to the file containing the data to write to the server. |
| string file = 2; |
| |
| // The maximum number of times a packet will attempt to be sent before the |
| // transfer aborts due to a lack of response. |
| uint32 max_retries = 3; |
| |
| // The maximum time to wait for a response to the first packet sent to the |
| // pw_transfer server before attempting to retry. Extending this can help |
| // work around cases where transfer initialization takes a long time. |
| // |
| // Note: This parameter is only supported on Java transfer clients. |
| // TODO(tpudlik): google.protobuf.Duration? |
| uint32 initial_chunk_timeout_ms = 4; |
| |
| // The maximum time to wait for a response to a sent packet before attempting |
| // to re-send the packet. |
| // |
| // TODO(tpudlik): google.protobuf.Duration? |
| uint32 chunk_timeout_ms = 5; |
| } |
| |
| // Configuration for the integration test server. |
| message ServerConfig { |
| // Transfer ID to use. |
| uint32 resource_id = 1; |
| // Path to the file to which the server should write out data it receives from |
| // the client. |
| string file = 2; |
| // Size of the chunk buffer used by the transfer thread, in bytes. |
| uint32 chunk_size_bytes = 3; |
| // Window size, in bytes. |
| uint32 pending_bytes = 4; |
| // TODO(tpudlik): google.protobuf.Duration? |
| uint32 chunk_timeout_seconds = 5; |
| uint32 transfer_service_retries = 6; |
| uint32 extend_window_divisor = 7; |
| } |
| |
| // Configuration for the HdlcPacketizer proxy filter. |
| message HdlcPacketizerConfig {} |
| |
| // Configuration for the DataDropper proxy filter. |
| message DataDropperConfig { |
| // Rate at which to drop data |
| float rate = 1; |
| |
| // Seed to use for the rand number generator used for determining |
| // when data is dropped. |
| int64 seed = 2; |
| } |
| |
| // Configuration for the RateLimiter proxy filter. |
| message RateLimiterConfig { |
| // Rate limit, in bytes/sec. |
| float rate = 1; |
| } |
| |
| // Configuration for the DataTransposer proxy filter. |
| message DataTransposerConfig { |
| // Rate at which to transpose data. Probability of transposition |
| // between 0.0 and 1.0. |
| float rate = 1; |
| |
| // Maximum time a chunk of data will be held for Transposition. After this |
| // time has elapsed, the packet is sent in order. |
| float timeout = 2; |
| |
| // Seed to use for the rand number generator used for determining |
| // when data is transposed. |
| int64 seed = 3; |
| } |
| |
| // Configuration for a single stage in the proxy filter stack. |
| message FilterConfig { |
| oneof filter { |
| HdlcPacketizerConfig hdlc_packetizer = 1; |
| DataDropperConfig data_dropper = 2; |
| RateLimiterConfig rate_limiter = 3; |
| DataTransposerConfig data_transposer = 4; |
| } |
| } |
| |
| message ProxyConfig { |
| // Filters are listed in order of execution. I.e. the first filter listed |
| // will get the received data first then pass it on the the second listed |
| // filter. That process repeats until the last filter send the data to the |
| // other side of the proxy. |
| repeated FilterConfig client_filter_stack = 1; |
| repeated FilterConfig server_filter_stack = 2; |
| } |