1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
6 #define NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_
10 #include "base/basictypes.h"
11 #include "base/strings/string_piece.h"
15 // TODO(rtenneti): sync with server more rationally.
16 class SourceAddressToken {
19 ~SourceAddressToken();
21 std::string SerializeAsString() const;
23 bool ParseFromArray(const char* plaintext, size_t plaintext_length);
25 std::string ip() const {
29 int64 timestamp() const {
33 void set_ip(base::StringPiece ip) {
37 void set_timestamp(int64 timestamp) {
38 timestamp_ = timestamp;
48 #endif // NET_QUIC_CRYPTO_SOURCE_ADDRESS_TOKEN_H_