25RCSID(
"$Id: a94361a62c0da22ceb13848e4bb081e5d4923ce2 $")
27#include <freeradius-devel/fuzzer/common.h>
60 void *decode_ctx = NULL;
69 fr_perror(
"fuzzer: Failed initializing test point decode_ctx");
75 fr_perror(
"fuzzer: Failed initializing test point encode_ctx");
93 if (tp_decode->
func(ctx, &vps, buf, len, decode_ctx) < 0)
goto cleanup;
120 fr_perror(
"fuzzer_XX_PROTOCOL_XX: Failed encoding data");
138 fr_perror(
"fuzzer_XX_PROTOCOL_XX: Failed re-initializing test point decode_ctx");
int fuzzer_common_init(int *argc, char ***argv, bool load_proto)
Perform all bootstrapping for the fuzzer.
fr_dict_attr_t const * root_da
#define fr_exit_now(_x)
Exit without calling atexit() handlers, producing a log message in debug builds.
fr_test_point_proto_decode_t XX_PROTOCOL_XX_tp_decode_proto
int LLVMFuzzerInitialize(int *argc, char ***argv)
fr_test_point_proto_encode_t XX_PROTOCOL_XX_tp_encode_proto
static uint8_t encoded_data[65536]
int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
void fr_pair_list_init(fr_pair_list_t *list)
Initialise a pair list header.
static fr_internal_encode_ctx_t encode_ctx
static TALLOC_CTX * talloc_init_const(char const *name)
Allocate a top level chunk with a constant name.
fr_tp_proto_decode_t func
Decoder for proto layer.
fr_tp_proto_encode_t func
Encoder for proto layer.
fr_test_point_ctx_alloc_t test_ctx
Allocate a test ctx for the encoder.
fr_test_point_ctx_alloc_t test_ctx
Allocate a test ctx for the encoder.
Entry point for protocol decoders.
Entry point for protocol encoders.
void fr_pair_list_debug(FILE *fp, fr_pair_list_t const *list)
Dumps a list to the default logging destination - Useful for calling from debuggers.
#define PAIR_LIST_VERIFY_WITH_CTX(_c, _x)
#define FR_PROTO_HEX_DUMP(_data, _data_len, _fmt,...)
#define FR_PROTO_TRACE(_fmt,...)
void fr_perror(char const *fmt,...)
Print the current error to stderr with a prefix.
void fr_strerror_clear(void)
Clears all pending messages from the talloc pools.