Go to the documentation of this file.
36 const uint8_t
separator[] = {0x01, 0xD5, 0xCA, 0x7A};
56 const uint8_t * albuffer;
61 uint8_t * isolatedBuffer;
65 setenv(
"SC_LOG_OP_IFACE",
"file", 0);
66 setenv(
"SC_LOG_FILE",
"/dev/null", 0);
108 f->
src.addr_data32[0] = 0x01020304;
109 f->
dst.addr_data32[0] = 0x05060708;
110 f->
sp = (uint16_t)((data[2] << 8) | data[3]);
111 f->
dp = (uint16_t)((data[4] << 8) | data[5]);
131 uint8_t
flags = STREAM_START;
133 alnext = memmem(albuffer, alsize,
separator, 4);
136 flags |= STREAM_TOCLIENT;
137 flags &= ~(STREAM_TOSERVER);
140 flags |= STREAM_TOSERVER;
141 flags &= ~(STREAM_TOCLIENT);
145 if (alnext != albuffer) {
147 isolatedBuffer = malloc(alnext - albuffer);
148 if (isolatedBuffer == NULL) {
151 memcpy(isolatedBuffer, albuffer, alnext - albuffer);
153 free(isolatedBuffer);
159 flags &= ~(STREAM_START);
161 (((
flags & STREAM_TOSERVER) != 0 &&
163 ((
flags & STREAM_TOCLIENT) != 0 &&
172 alsize -= alnext - albuffer + 4;
173 albuffer = alnext + 4;
177 alnext = memmem(albuffer, alsize,
separator, 4);
181 flags |= STREAM_TOCLIENT;
182 flags &= ~(STREAM_TOSERVER);
185 flags |= STREAM_TOSERVER;
186 flags &= ~(STREAM_TOCLIENT);
190 isolatedBuffer = malloc(alsize);
191 if (isolatedBuffer == NULL) {
194 memcpy(isolatedBuffer, albuffer, alsize);
196 free(isolatedBuffer);
#define SC_ATOMIC_SET(name, val)
Set the value for the atomic variable.
void AppLayerParserTransactionsCleanup(Flow *f, const uint8_t pkt_dir)
remove obsolete (inspected and logged) transactions
int LLVMFuzzerInitialize(int *argc, char ***argv)
const char * configNoChecksum
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
void SCRunmodeSet(int run_mode)
Set the current run mode.
void GlobalsInitPreConfig(void)
#define APP_LAYER_PARSER_EOF_TS
#define FLOWLOCK_UNLOCK(fb)
AppLayerParserState * alparser
const uint8_t separator[]
AppLayerParserThreadCtx * alp_tctx
AppProto StringToAppProto(const char *proto_name)
Maps a string to its ALPROTO_* equivalent.
#define FLOWLOCK_WRLOCK(fb)
int ConfYamlLoadString(const char *string, size_t len)
Load configuration from a YAML string.
int PostConfLoadedSetup(SCInstance *suri)
uint8_t FlowGetProtoMapping(uint8_t proto)
Function to map the protocol to the defined FLOW_PROTO_* enumeration.
#define APP_LAYER_PARSER_EOF_TC
void setenv(const char *name, const char *value, int overwrite)
AppLayerParserThreadCtx * AppLayerParserThreadCtxAlloc(void)
Gets a new app layer protocol's parser thread context.
int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *alp_tctx, Flow *f, AppProto alproto, uint8_t flags, const uint8_t *input, uint32_t input_len)
void FlowFree(Flow *f)
cleanup & free the memory of a flow
TmEcode ConfigSetLogDirectory(const char *name)
SC_ATOMIC_EXTERN(unsigned int, engine_stage)
int InitGlobal(void)
Global initialization common to all runmodes.
int FlowChangeProto(Flow *f)
Check if change proto flag is set for flow.
Flow * FlowAlloc(void)
allocate a flow
uint16_t AppLayerParserStateIssetFlag(AppLayerParserState *pstate, uint16_t flag)
AppProto alproto
application level protocol
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)