Classes | Typedefs | Enumerations | Functions | Variables
api_fuzzer.cc File Reference
#include <string.h>
#include <memory>
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include "src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.h"
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/lib/address_utils/parse_address.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/event_engine/event_engine_factory.h"
#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/executor.h"
#include "src/core/lib/iomgr/resolve_address.h"
#include "src/core/lib/iomgr/tcp_client.h"
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/iomgr/timer_manager.h"
#include "src/core/lib/resolver/server_address.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/lib/surface/server.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/end2end/data/ssl_test_data.h"
#include "test/core/end2end/fuzzers/api_fuzzer.pb.h"
#include "test/core/event_engine/fuzzing_event_engine/fuzzing_event_engine.h"
#include "test/core/util/passthru_endpoint.h"
Include dependency graph for api_fuzzer.cc:

Go to the source code of this file.

Classes

struct  addr_req
 
class  Call
 
struct  future_connect
 
class  Validator
 

Typedefs

typedef struct addr_req addr_req
 

Enumerations

enum  CallType {
  CallType::CLIENT, CallType::SERVER, CallType::PENDING_SERVER, CallType::TOMBSTONED,
  CallType::kConstRef, CallType::kConstMove, CallType::kConstRef, CallType::kConstMove
}
 

Functions

static CallActiveCall ()
 
static ValidatorAssertSuccessAndDecrement (int *counter)
 
static ValidatorDecrement (int *counter)
 
 DEFINE_PROTO_FUZZER (const api_fuzzer::Msg &msg)
 
static void do_connect (void *arg, grpc_error_handle error)
 
static void dont_log (gpr_log_func_args *)
 
static void finish_resolve (void *arg, grpc_error_handle error)
 
static void free_non_null (void *p)
 
ValidatorMakeValidator (std::function< void(bool)> impl)
 
static void my_cancel_ares_request (grpc_ares_request *request)
 
grpc_ares_requestmy_dns_lookup_ares (const char *, const char *addr, const char *, grpc_pollset_set *, grpc_closure *on_done, std::unique_ptr< grpc_core::ServerAddressList > *addresses, std::unique_ptr< grpc_core::ServerAddressList > *, char **, int)
 
static bool my_tcp_cancel_connect (int64_t)
 
static int64_t my_tcp_client_connect (grpc_closure *closure, grpc_endpoint **ep, grpc_pollset_set *, const grpc_channel_args *, const grpc_resolved_address *, grpc_core::Timestamp deadline)
 
template<typename ChannelArgContainer >
grpc_channel_argsReadArgs (const ChannelArgContainer &args)
 
static grpc_call_credentialsReadCallCreds (const api_fuzzer::CallCreds &creds)
 
static grpc_channel_credentialsReadChannelCreds (const api_fuzzer::ChannelCreds &creds)
 
static const char * ReadCredArtifact (const api_fuzzer::CredArtifact &artifact, std::initializer_list< const char * > builtins)
 
static grpc_channel_credentialsReadSslChannelCreds (const api_fuzzer::SslChannelCreds &creds)
 
static void sched_connect (grpc_closure *closure, grpc_endpoint **ep, gpr_timespec deadline)
 
static ValidatorValidateConnectivityWatch (gpr_timespec deadline, int *counter)
 

Variables

grpc_tcp_client_vtable fuzz_tcp_client_vtable
 
static size_t g_active_call = 0
 
static std::vector< std::shared_ptr< Call > > g_calls
 
static grpc_channelg_channel
 
static std::vector< grpc_passthru_endpoint_channel_actiong_channel_actions
 
static std::atomic< boolg_channel_force_delete {false}
 
static grpc_resource_quotag_resource_quota
 
static grpc_serverg_server
 
static constexpr uint64_t kMaxAddNReadableBytes = (2 * 1024 * 1024)
 
static constexpr uint64_t kMaxAddNWritableBytes = (2 * 1024 * 1024)
 
static constexpr uint64_t kMaxWaitMs
 
bool leak_check = true
 
bool squelch = true
 

Typedef Documentation

◆ addr_req

typedef struct addr_req addr_req

Enumeration Type Documentation

◆ CallType

enum CallType
strong
Enumerator
CLIENT 
SERVER 
PENDING_SERVER 
TOMBSTONED 
kConstRef 
kConstMove 
kConstRef 
kConstMove 

Definition at line 317 of file api_fuzzer.cc.

Function Documentation

◆ ActiveCall()

static Call* ActiveCall ( )
static

Definition at line 565 of file api_fuzzer.cc.

◆ AssertSuccessAndDecrement()

static Validator* AssertSuccessAndDecrement ( int counter)
static

Definition at line 290 of file api_fuzzer.cc.

◆ Decrement()

static Validator* Decrement ( int counter)
static

Definition at line 297 of file api_fuzzer.cc.

◆ DEFINE_PROTO_FUZZER()

DEFINE_PROTO_FUZZER ( const api_fuzzer::Msg &  msg)

Definition at line 751 of file api_fuzzer.cc.

◆ do_connect()

static void do_connect ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 204 of file api_fuzzer.cc.

◆ dont_log()

static void dont_log ( gpr_log_func_args )
static

Definition at line 64 of file api_fuzzer.cc.

◆ finish_resolve()

static void finish_resolve ( void *  arg,
grpc_error_handle  error 
)
static

Definition at line 85 of file api_fuzzer.cc.

◆ free_non_null()

static void free_non_null ( void *  p)
static

Definition at line 312 of file api_fuzzer.cc.

◆ MakeValidator()

Validator* MakeValidator ( std::function< void(bool)>  impl)

Definition at line 286 of file api_fuzzer.cc.

◆ my_cancel_ares_request()

static void my_cancel_ares_request ( grpc_ares_request request)
static

Definition at line 188 of file api_fuzzer.cc.

◆ my_dns_lookup_ares()

grpc_ares_request* my_dns_lookup_ares ( const char *  ,
const char *  addr,
const char *  ,
grpc_pollset_set ,
grpc_closure on_done,
std::unique_ptr< grpc_core::ServerAddressList > *  addresses,
std::unique_ptr< grpc_core::ServerAddressList > *  ,
char **  ,
int   
)

Definition at line 171 of file api_fuzzer.cc.

◆ my_tcp_cancel_connect()

static bool my_tcp_cancel_connect ( int64_t  )
static

Definition at line 262 of file api_fuzzer.cc.

◆ my_tcp_client_connect()

static int64_t my_tcp_client_connect ( grpc_closure closure,
grpc_endpoint **  ep,
grpc_pollset_set ,
const grpc_channel_args ,
const grpc_resolved_address ,
grpc_core::Timestamp  deadline 
)
static

Definition at line 253 of file api_fuzzer.cc.

◆ ReadArgs()

template<typename ChannelArgContainer >
grpc_channel_args* ReadArgs ( const ChannelArgContainer &  args)

Definition at line 602 of file api_fuzzer.cc.

◆ ReadCallCreds()

static grpc_call_credentials* ReadCallCreds ( const api_fuzzer::CallCreds &  creds)
static

Definition at line 679 of file api_fuzzer.cc.

◆ ReadChannelCreds()

static grpc_channel_credentials* ReadChannelCreds ( const api_fuzzer::ChannelCreds &  creds)
static

Definition at line 716 of file api_fuzzer.cc.

◆ ReadCredArtifact()

static const char* ReadCredArtifact ( const api_fuzzer::CredArtifact &  artifact,
std::initializer_list< const char * >  builtins 
)
static

Definition at line 637 of file api_fuzzer.cc.

◆ ReadSslChannelCreds()

static grpc_channel_credentials* ReadSslChannelCreds ( const api_fuzzer::SslChannelCreds &  creds)
static

Definition at line 654 of file api_fuzzer.cc.

◆ sched_connect()

static void sched_connect ( grpc_closure closure,
grpc_endpoint **  ep,
gpr_timespec  deadline 
)
static

Definition at line 233 of file api_fuzzer.cc.

◆ ValidateConnectivityWatch()

static Validator* ValidateConnectivityWatch ( gpr_timespec  deadline,
int counter 
)
static

Definition at line 301 of file api_fuzzer.cc.

Variable Documentation

◆ fuzz_tcp_client_vtable

grpc_tcp_client_vtable fuzz_tcp_client_vtable
Initial value:

Definition at line 266 of file api_fuzzer.cc.

◆ g_active_call

size_t g_active_call = 0
static

Definition at line 563 of file api_fuzzer.cc.

◆ g_calls

std::vector<std::shared_ptr<Call> > g_calls
static

Definition at line 562 of file api_fuzzer.cc.

◆ g_channel

grpc_channel* g_channel
static

Definition at line 70 of file api_fuzzer.cc.

◆ g_channel_actions

std::vector<grpc_passthru_endpoint_channel_action> g_channel_actions
static

Definition at line 72 of file api_fuzzer.cc.

◆ g_channel_force_delete

std::atomic<bool> g_channel_force_delete {false}
static

Definition at line 73 of file api_fuzzer.cc.

◆ g_resource_quota

grpc_resource_quota* g_resource_quota
static

Definition at line 71 of file api_fuzzer.cc.

◆ g_server

grpc_server* g_server
static

Definition at line 69 of file api_fuzzer.cc.

◆ kMaxAddNReadableBytes

constexpr uint64_t kMaxAddNReadableBytes = (2 * 1024 * 1024)
staticconstexpr

Definition at line 54 of file api_fuzzer.cc.

◆ kMaxAddNWritableBytes

constexpr uint64_t kMaxAddNWritableBytes = (2 * 1024 * 1024)
staticconstexpr

Definition at line 56 of file api_fuzzer.cc.

◆ kMaxWaitMs

constexpr uint64_t kMaxWaitMs
staticconstexpr
Initial value:
=
31536000000

Definition at line 51 of file api_fuzzer.cc.

◆ leak_check

bool leak_check = true

Definition at line 62 of file api_fuzzer.cc.

◆ squelch

bool squelch = true

Definition at line 61 of file api_fuzzer.cc.

my_tcp_client_connect
static int64_t my_tcp_client_connect(grpc_closure *closure, grpc_endpoint **ep, grpc_pollset_set *, const grpc_channel_args *, const grpc_resolved_address *, grpc_core::Timestamp deadline)
Definition: api_fuzzer.cc:253
my_tcp_cancel_connect
static bool my_tcp_cancel_connect(int64_t)
Definition: api_fuzzer.cc:262


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:02