QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // 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 | |
vasilvv | 872e7a3 | 2019-03-12 16:42:44 -0700 | [diff] [blame] | 8 | #include <string> |
| 9 | |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 10 | #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 team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 12 | #include "net/third_party/quiche/src/quic/platform/api/quic_string_piece.h" |
| 13 | |
| 14 | namespace quic { |
| 15 | |
| 16 | class QUIC_EXPORT_PRIVATE CryptoMessageParser { |
| 17 | public: |
| 18 | virtual ~CryptoMessageParser() {} |
| 19 | |
| 20 | virtual QuicErrorCode error() const = 0; |
vasilvv | c48c871 | 2019-03-11 13:38:16 -0700 | [diff] [blame] | 21 | virtual const std::string& error_detail() const = 0; |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 22 | |
| 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_ |