blob: 2638a196d373517f96ac1a18e1f57be4a76ef7c4 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright (c) 2012 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.
4
5#ifndef QUICHE_QUIC_CORE_CRYPTO_CRYPTO_MESSAGE_PARSER_H_
6#define QUICHE_QUIC_CORE_CRYPTO_CRYPTO_MESSAGE_PARSER_H_
7
vasilvv872e7a32019-03-12 16:42:44 -07008#include <string>
9
QUICHE teama6ef0a62019-03-07 20:34:33 -050010#include "net/third_party/quiche/src/quic/core/quic_error_codes.h"
11#include "net/third_party/quiche/src/quic/core/quic_types.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050012#include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h"
13
14namespace quic {
15
16class QUIC_EXPORT_PRIVATE CryptoMessageParser {
17 public:
18 virtual ~CryptoMessageParser() {}
19
20 virtual QuicErrorCode error() const = 0;
vasilvvc48c8712019-03-11 13:38:16 -070021 virtual const std::string& error_detail() const = 0;
QUICHE teama6ef0a62019-03-07 20:34:33 -050022
23 // Processes input data, which must be delivered in order. The input data
24 // being processed was received at encryption level |level|. Returns
25 // false if there was an error, and true otherwise.
26 virtual bool ProcessInput(QuicStringPiece input, EncryptionLevel level) = 0;
27
28 // Returns the number of bytes of buffered input data remaining to be
29 // parsed.
30 virtual size_t InputBytesRemaining() const = 0;
31};
32
33} // namespace quic
34
35#endif // QUICHE_QUIC_CORE_CRYPTO_CRYPTO_MESSAGE_PARSER_H_