Go to the documentation of this file.
   37 const uint8_t 
separator[] = {0x01, 0xD5, 0xCA, 0x7A};
 
   57     const uint8_t * albuffer;
 
   62     uint8_t * isolatedBuffer;
 
   66         setenv(
"SC_LOG_OP_IFACE", 
"file", 0);
 
   67         setenv(
"SC_LOG_FILE", 
"/dev/null", 0);
 
  109     f->
src.addr_data32[0] = 0x01020304;
 
  110     f->
dst.addr_data32[0] = 0x05060708;
 
  111     f->
sp = (uint16_t)((data[2] << 8) | data[3]);
 
  112     f->
dp = (uint16_t)((data[4] << 8) | data[5]);
 
  132     uint8_t 
flags = STREAM_START;
 
  134     alnext = memmem(albuffer, alsize, 
separator, 4);
 
  137             flags |= STREAM_TOCLIENT;
 
  138             flags &= ~(STREAM_TOSERVER);
 
  141             flags |= STREAM_TOSERVER;
 
  142             flags &= ~(STREAM_TOCLIENT);
 
  146         if (alnext != albuffer) {
 
  148             isolatedBuffer = malloc(alnext - albuffer);
 
  149             if (isolatedBuffer == NULL) {
 
  152             memcpy(isolatedBuffer, albuffer, alnext - albuffer);
 
  154                     (uint32_t)(alnext - albuffer));
 
  155             free(isolatedBuffer);
 
  161             flags &= ~(STREAM_START);
 
  165                             ((
flags & STREAM_TOCLIENT) != 0 &&
 
  175         alsize -= alnext - albuffer + 4;
 
  176         albuffer = alnext + 4;
 
  180         alnext = memmem(albuffer, alsize, 
separator, 4);
 
  184             flags |= STREAM_TOCLIENT;
 
  185             flags &= ~(STREAM_TOSERVER);
 
  188             flags |= STREAM_TOSERVER;
 
  189             flags &= ~(STREAM_TOCLIENT);
 
  193         isolatedBuffer = malloc(alsize);
 
  194         if (isolatedBuffer == NULL) {
 
  197         memcpy(isolatedBuffer, albuffer, alsize);
 
  200         free(isolatedBuffer);
 
  
 
int SCConfYamlLoadString(const char *string, size_t len)
Load configuration from a YAML string.
uint16_t SCAppLayerParserStateIssetFlag(AppLayerParserState *pstate, uint16_t flag)
#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
#define FLOW_SGH_TOCLIENT
int LLVMFuzzerInitialize(int *argc, char ***argv)
const char * configNoChecksum
const char * AppProtoToString(AppProto alproto)
Maps the ALPROTO_*, to its string equivalent.
void GlobalsInitPreConfig(void)
#define APP_LAYER_PARSER_EOF_TS
#define FLOWLOCK_UNLOCK(fb)
void SCRunmodeSet(SCRunMode run_mode)
Set the current run mode.
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 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)
#define FLOW_SGH_TOSERVER
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
AppProto alproto
application level protocol
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)