| 1 |
// Copyright (c) 2018, Google Inc. |
| 2 |
// SPDX-License-Identifier: ISC |
| 3 |
|
| 4 |
#ifndef HEADER_SETTINGS_WRITER |
| 5 |
#define HEADER_SETTINGS_WRITER |
| 6 |
|
| 7 |
#include <string> |
| 8 |
|
| 9 |
#include <openssl/bytestring.h> |
| 10 |
#include <openssl/ssl.h> |
| 11 |
|
| 12 |
#include "test_config.h" |
| 13 |
|
| 14 |
struct SettingsWriter { |
| 15 |
public: |
| 16 |
SettingsWriter(); |
| 17 |
|
| 18 |
// Init initializes the writer for a new connection, given by |i|. Each |
| 19 |
// connection gets a unique output file. |
| 20 |
bool Init(int i, const TestConfig *config, SSL_SESSION *session); |
| 21 |
|
| 22 |
// Commit writes the buffered data to disk. |
| 23 |
bool Commit(); |
| 24 |
|
| 25 |
bool WriteHandoff(bssl::Span<const uint8_t> handoff); |
| 26 |
bool WriteHandback(bssl::Span<const uint8_t> handback); |
| 27 |
bool WriteHints(bssl::Span<const uint8_t> hints); |
| 28 |
|
| 29 |
private: |
| 30 |
bool WriteData(uint16_t tag, bssl::Span<const uint8_t> data); |
| 31 |
|
| 32 |
std::string path_; |
| 33 |
bssl::ScopedCBB cbb_; |
| 34 |
}; |
| 35 |
|
| 36 |
#endif // HEADER_SETTINGS_WRITER |