Go to the documentation of this file.
14 static int initialized = 0;
17 static int MimeParserDataFromFileCB(
const uint8_t *chunk, uint32_t
len,
20 if (
len > 0 && chunk[
len-1] == 0) {
29 if (initialized == 0) {
31 setenv(
"SC_LOG_OP_IFACE",
"file", 0);
32 setenv(
"SC_LOG_FILE",
"/dev/null", 0);
39 uint32_t line_count = 0;
43 const uint8_t * buffer = data;
45 uint8_t *
next = memchr(buffer,
'\n', size);
52 if (buffer + size <
next + 1) {
55 size -=
next - buffer + 1;
int MimeDecParseComplete(MimeDecParseState *state)
Called to indicate that the last message line has been processed and the parsing operation is complet...
int MimeDecParseLine(const uint8_t *line, const uint32_t len, const uint8_t delim_len, MimeDecParseState *state)
Parse a line of a MIME message and update the parser state.
struct HtpBodyChunk_ * next
void SCRunmodeSet(int run_mode)
Set the current run mode.
MimeDecParseState * MimeDecInitParser(void *data, int(*DataChunkProcessorFunc)(const uint8_t *chunk, uint32_t len, MimeDecParseState *state))
Init the parser by allocating memory for the state and top-level entity.
void setenv(const char *name, const char *value, int overwrite)
Structure contains the current state of the MIME parser.
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
void MimeDecFreeEntity(MimeDecEntity *entity)
Frees a mime entity tree.
int InitGlobal(void)
Global initialization common to all runmodes.
void MimeDecDeInitParser(MimeDecParseState *state)
De-Init parser by freeing up any residual memory.
This represents the MIME Entity (or also top level message) in a child-sibling tree.