Go to the documentation of this file.
19 #define PROTO_DETECT_MAX_LEN 1024
57 f =
TestHelperBuildFlow(AF_INET,
"1.2.3.4",
"5.6.7.8", (uint16_t)((data[2] << 8) | data[3]),
58 (uint16_t)((data[4] << 8) | data[5]));
67 uint8_t
flags = STREAM_TOCLIENT;
68 if (data[0] & STREAM_TOSERVER) {
69 flags = STREAM_TOSERVER;
85 printf(
"Failed with input length %" PRIuMAX
" versus %" PRIuMAX
86 ", found %s instead of %s\n",
int AppLayerProtoDetectSetup(void)
The first function to be called. This initializes a global protocol detection context.
#define SC_ATOMIC_SET(name, val)
Set the value for the atomic variable.
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
void SCRunmodeSet(int run_mode)
Set the current run mode.
void AppLayerParserRegisterProtocolParsers(void)
#define PROTO_DETECT_MAX_LEN
The app layer protocol detection thread context.
void EngineModeSetIDS(void)
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
void AppLayerProtoDetectReset(Flow *f)
Reset proto detect for flow.
AppLayerProtoDetectThreadCtx * alpd_tctx
int ConfYamlLoadString(const char *string, size_t len)
Load configuration from a YAML string.
int AppLayerParserSetup(void)
uint8_t FlowGetProtoMapping(uint8_t proto)
Function to map the protocol to the defined FLOW_PROTO_* enumeration.
void FlowFree(Flow *f)
cleanup & free the memory of a flow
SC_ATOMIC_EXTERN(unsigned int, engine_stage)
const char * configNoChecksum
AppProto AppLayerProtoDetectGetProto(AppLayerProtoDetectThreadCtx *tctx, Flow *f, const uint8_t *buf, uint32_t buflen, uint8_t ipproto, uint8_t flags, bool *reverse_flow)
Returns the app layer protocol given a buffer.
AppLayerProtoDetectThreadCtx * AppLayerProtoDetectGetCtxThread(void)
Inits and returns an app layer protocol detection thread context.
Flow * TestHelperBuildFlow(int family, const char *src, const char *dst, Port sp, Port dp)
int InitGlobal(void)
Global initialization common to all runmodes.