curl-fuzzer C++ reference
Loading...
Searching...
No Matches
option_apply.h
Go to the documentation of this file.
1/*
2 * Copyright (C) Max Dymond, <cmeister2@gmail.com>, et al.
3 *
4 * SPDX-License-Identifier: curl
5 */
6
10
11#ifndef PROTO_FUZZER_OPTION_APPLY_H_
12#define PROTO_FUZZER_OPTION_APPLY_H_
13
14#include <curl/curl.h>
15
16#include <cstddef>
17#include <cstdint>
18#include <string>
19
20#include "curl_fuzzer.pb.h"
23
24namespace proto_fuzzer {
25
35class ScopedTraceReset final {
36 public:
37 ScopedTraceReset() { (void)curl_global_trace("-all"); }
38 ~ScopedTraceReset() { (void)curl_global_trace("-all"); }
39
40 ScopedTraceReset(const ScopedTraceReset&) = delete;
41 ScopedTraceReset& operator=(const ScopedTraceReset&) = delete;
42 ScopedTraceReset(ScopedTraceReset&&) = delete;
43 ScopedTraceReset& operator=(ScopedTraceReset&&) = delete;
44};
45
46CurlSlistPtr ApplyBaselineOptions(CURL* easy, curl::fuzzer::proto::Scheme scheme, bool trace_ids = false,
47 const std::string& trace_config = {});
48
49CURLcode ApplySetOption(CURL* easy, const curl::fuzzer::proto::SetOption& option);
50
51CURLcode ApplyTlsClientCredentialProfile(CURL* easy, curl::fuzzer::proto::TlsClientCredentialProfile profile);
52
53std::size_t RuntimeOptionCount(const curl::fuzzer::proto::Scenario& scenario);
54
55std::size_t ApplyScenarioOptions(CURL* easy, const curl::fuzzer::proto::Scenario& scenario);
56
57} // namespace proto_fuzzer
58
59#endif // PROTO_FUZZER_OPTION_APPLY_H_
Common ownership types for independently cleaned-up curl handles.
std::unique_ptr< curl_slist, CurlSlistDeleter > CurlSlistPtr
Unique ownership of a caller-owned curl_slist.
Definition curl_raii.h:60
CurlSlistPtr ApplyBaselineOptions(CURL *easy, curl::fuzzer::proto::Scheme scheme, bool trace_ids, const std::string &trace_config)
Apply deterministic routing, timeout, output, and persistence defaults.
Pure interpretation and normalization of structured curl options.