10#ifndef PROTO_FUZZER_SMTP_MOCK_SERVER_H_
11#define PROTO_FUZZER_SMTP_MOCK_SERVER_H_
19namespace proto_fuzzer {
45 explicit SmtpMockServer(curl::fuzzer::proto::SmtpProbeMode mode = curl::fuzzer::proto::SMTP_PROBE_DEFAULT);
60 void HandleLine(std::string_view line)
override;
68 static constexpr std::string_view kEndOfBody =
"\r\n.\r\n";
71 static constexpr std::string_view kShutdownReply =
"221 mock closing SMTP connection\r\n";
73 static int FirstReplyCode(std::string_view response);
75 bool AllowsRecipientFailures()
const;
78 bool IsStartTlsMode()
const;
82 std::size_t recipient_count_;
84 std::size_t rcpt_command_count_;
88 bool auth_exchange_active_;
90 curl::fuzzer::proto::SmtpProbeMode mode_;
92 bool tls_upgrade_started_;
SmtpMockServer(curl::fuzzer::proto::SmtpProbeMode mode=curl::fuzzer::proto::SMTP_PROBE_DEFAULT)
Begin without a borrowed protobuf or open socketpair.
~SmtpMockServer() override
Release the server-owned socketpair half after curl has returned its client descriptor.
std::unique_ptr< MockConnection > CreateConnection() override
Create the default plaintext transport for the SMTP exchange.
void HandleLine(std::string_view line) override
Advance one reply for every complete command.
void ResetProtocolState() override
Reset SMTP's recipient bookkeeping for a new drive.
void ConfigureClient(CURL *easy) const
Apply only closed, harness-owned client controls.
void ObserveState() override
Retain protocol outcomes in coverage and introspector builds.
void QueueShutdownReply() override
Queue a 221 before the shared transport half-closes.
PingpongMockServer — shared line-oriented command/response transport for the mail-style protocol peer...