Project import generated by Copybara.
PiperOrigin-RevId: 237361882
Change-Id: I109a68f44db867b20f8c6a7732b0ce657133e52a
diff --git a/quic/core/proto/cached_network_parameters.proto b/quic/core/proto/cached_network_parameters.proto
new file mode 100644
index 0000000..d609be9
--- /dev/null
+++ b/quic/core/proto/cached_network_parameters.proto
@@ -0,0 +1,43 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package quic;
+
+// CachedNetworkParameters contains data that can be used to choose appropriate
+// connection parameters (initial RTT, initial CWND, etc.) in new connections.
+// Next id: 8
+message CachedNetworkParameters {
+ // Describes the state of the connection during which the supplied network
+ // parameters were calculated.
+ enum PreviousConnectionState {
+ SLOW_START = 0;
+ CONGESTION_AVOIDANCE = 1;
+ }
+
+ // serving_region is used to decide whether or not the bandwidth estimate and
+ // min RTT are reasonable and if they should be used.
+ // For example a group of geographically close servers may share the same
+ // serving_region string if they are expected to have similar network
+ // performance.
+ optional string serving_region = 1;
+ // The server can supply a bandwidth estimate (in bytes/s) which it may re-use
+ // on receipt of a source-address token with this field set.
+ optional int32 bandwidth_estimate_bytes_per_second = 2;
+ // The maximum bandwidth seen to the client, not necessarily the latest.
+ optional int32 max_bandwidth_estimate_bytes_per_second = 5;
+ // Timestamp (seconds since UNIX epoch) that indicates when the max bandwidth
+ // was seen by the server.
+ optional int64 max_bandwidth_timestamp_seconds = 6;
+ // The min RTT seen on a previous connection can be used by the server to
+ // inform initial connection parameters for new connections.
+ optional int32 min_rtt_ms = 3;
+ // Encodes the PreviousConnectionState enum.
+ optional int32 previous_connection_state = 4;
+ // UNIX timestamp when this bandwidth estimate was created.
+ optional int64 timestamp = 7;
+};
diff --git a/quic/core/proto/crypto_server_config.proto b/quic/core/proto/crypto_server_config.proto
new file mode 100644
index 0000000..06db4a7
--- /dev/null
+++ b/quic/core/proto/crypto_server_config.proto
@@ -0,0 +1,34 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package quic;
+
+// QuicServerConfigProtobuf contains QUIC server config block and the private
+// keys needed to prove ownership.
+message QuicServerConfigProtobuf {
+ // config is a serialised config in QUIC wire format.
+ required bytes config = 1;
+
+ // PrivateKey contains a QUIC tag of a key exchange algorithm and a
+ // serialised private key for that algorithm. The format of the serialised
+ // private key is specific to the algorithm in question.
+ message PrivateKey {
+ required uint32 tag = 1;
+ required string private_key = 2;
+ }
+ repeated PrivateKey key = 2;
+
+ // primary_time contains a UNIX epoch seconds value that indicates when this
+ // config should become primary.
+ optional int64 primary_time = 3;
+
+ // Relative priority of this config vs other configs with the same
+ // primary time. For use as a secondary sort key when selecting the
+ // primary config.
+ optional uint64 priority = 4;
+};
diff --git a/quic/core/proto/source_address_token.proto b/quic/core/proto/source_address_token.proto
new file mode 100644
index 0000000..1897a25
--- /dev/null
+++ b/quic/core/proto/source_address_token.proto
@@ -0,0 +1,32 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+import "cached_network_parameters.proto";
+
+package quic;
+
+// A SourceAddressToken is serialised, encrypted and sent to clients so that
+// they can prove ownership of an IP address.
+message SourceAddressToken {
+ // ip contains either 4 (IPv4) or 16 (IPv6) bytes of IP address in network
+ // byte order.
+ required bytes ip = 1;
+ // timestamp contains a UNIX timestamp value of the time when the token was
+ // created.
+ required int64 timestamp = 2;
+ // The server can provide estimated network parameters to be used for
+ // initial parameter selection in future connections.
+ optional CachedNetworkParameters cached_network_parameters = 3;
+};
+
+// SourceAddressTokens are simply lists of SourceAddressToken messages.
+message SourceAddressTokens {
+ // This field has id 4 to avoid ambiguity between the serialized form of
+ // SourceAddressToken vs SourceAddressTokens.
+ repeated SourceAddressToken tokens = 4;
+};