51 const uint8_t *data, uint32_t data_len, uint8_t direction)
57 SCLogDebug(
"data %p data_len %"PRIu32, data, data_len);
59 if (direction & STREAM_TOCLIENT) {
71 data_len,
flags) != 0) {
75 if (direction & STREAM_TOCLIENT) {
98 uint32_t
len = (uint32_t)bstr_len(rawvalue);
99 return SCHttpParseContentRange(range, bstr_ptr(rawvalue),
len);
110static int HTPParseAndCheckContentRange(
117 SCLogDebug(
"parsing range failed, going back to normal file");
125 if (range->end <= 0 || range->size <= 0) {
128 }
else if (range->end == range->size - 1 && range->start == 0) {
131 }
else if (range->start > range->end || range->end > range->size - 1) {
150 uint16_t filename_len,
const uint8_t *data, uint32_t data_len,
const htp_tx_t *tx,
159 HTTPContentRange crparsed;
160 if (HTPParseAndCheckContentRange(rawvalue, &crparsed, s, htud) != 0) {
162 return HTPFileOpen(s, txud, filename, filename_len, data, data_len, STREAM_TOCLIENT);
169 data_len,
flags) != 0) {
177 if (
FileSetRange(files, crparsed.start, crparsed.end) < 0) {
184 if (htp_tx_request_hostname(tx) != NULL) {
185 uint32_t hlen = (uint32_t)bstr_len(htp_tx_request_hostname(tx));
186 if (hlen > UINT16_MAX) {
189 keylen = hlen + filename_len;
191 if (keyurl == NULL) {
194 memcpy(keyurl, bstr_ptr(htp_tx_request_hostname(tx)), hlen);
195 memcpy(keyurl + hlen, filename, filename_len);
202 filename, filename_len,
flags, data, data_len);
231 if (direction & STREAM_TOCLIENT) {
236 SCLogDebug(
"files %p data %p data_len %" PRIu32, files, data, data_len);
254 }
else if (result == -2) {
282 if (ranged && files) {
310 HtpTxUserData *tx,
const uint8_t *data, uint32_t data_len, uint8_t
flags, uint8_t direction)
320 if (direction & STREAM_TOCLIENT) {
326 SCLogDebug(
"files %p data %p data_len %" PRIu32, files, data, data_len);
336 }
else if (result == -2) {
360static int HTPFileParserTest01(
void)
362 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
363 "Host: www.server.lan\r\n"
364 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
365 "Content-Length: 215\r\n"
367 "-----------------------------277531038314945\r\n"
368 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
369 "Content-Type: image/jpeg\r\n"
372 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
373 uint8_t httpbuf2[] =
"filecontent\r\n"
374 "-----------------------------277531038314945--";
375 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
380 memset(&ssn, 0,
sizeof(ssn));
385 f->
proto = IPPROTO_TCP;
390 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
395 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
407 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
415static int HTPFileParserTest02(
void)
417 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
418 "Host: www.server.lan\r\n"
419 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
420 "Content-Length: 337\r\n"
422 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
424 uint8_t httpbuf2[] =
"-----------------------------277531038314945\r\n"
425 "Content-Disposition: form-data; name=\"email\"\r\n"
427 "someaddress@somedomain.lan\r\n";
428 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
430 uint8_t httpbuf3[] =
"-----------------------------277531038314945\r\n"
431 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
432 "Content-Type: image/jpeg\r\n"
434 uint32_t httplen3 =
sizeof(httpbuf3) - 1;
436 uint8_t httpbuf4[] =
"filecontent\r\n"
437 "-----------------------------277531038314945--";
438 uint32_t httplen4 =
sizeof(httpbuf4) - 1;
444 memset(&ssn, 0,
sizeof(ssn));
449 f->
proto = IPPROTO_TCP;
454 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
459 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
464 SCLogDebug(
"\n>>>> processing chunk 3 size %u <<<<\n", httplen3);
469 SCLogDebug(
"\n>>>> processing chunk 4 size %u <<<<\n", httplen4);
480 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
492static int HTPFileParserTest03(
void)
494 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
495 "Host: www.server.lan\r\n"
496 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
497 "Content-Length: 337\r\n"
499 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
501 uint8_t httpbuf2[] =
"-----------------------------277531038314945\r\n"
502 "Content-Disposition: form-data; name=\"email\"\r\n"
504 "someaddress@somedomain.lan\r\n";
505 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
507 uint8_t httpbuf3[] =
"-----------------------------277531038314945\r\n"
508 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
509 "Content-Type: image/jpeg\r\n"
511 uint32_t httplen3 =
sizeof(httpbuf3) - 1;
513 uint8_t httpbuf4[] =
"file";
514 uint32_t httplen4 =
sizeof(httpbuf4) - 1;
516 uint8_t httpbuf5[] =
"content\r\n";
517 uint32_t httplen5 =
sizeof(httpbuf5) - 1;
519 uint8_t httpbuf6[] =
"-----------------------------277531038314945--";
520 uint32_t httplen6 =
sizeof(httpbuf6) - 1;
526 memset(&ssn, 0,
sizeof(ssn));
531 f->
proto = IPPROTO_TCP;
536 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
541 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
546 SCLogDebug(
"\n>>>> processing chunk 3 size %u <<<<\n", httplen3);
551 SCLogDebug(
"\n>>>> processing chunk 4 size %u <<<<\n", httplen4);
556 SCLogDebug(
"\n>>>> processing chunk 5 size %u <<<<\n", httplen5);
561 SCLogDebug(
"\n>>>> processing chunk 6 size %u <<<<\n", httplen6);
573 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
588static int HTPFileParserTest04(
void)
590 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
591 "Host: www.server.lan\r\n"
592 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
593 "Content-Length: 373\r\n"
595 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
597 uint8_t httpbuf2[] =
"-----------------------------277531038314945\r\n"
598 "Content-Disposition: form-data; name=\"email\"\r\n"
600 "someaddress@somedomain.lan\r\n";
601 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
603 uint8_t httpbuf3[] =
"-----------------------------277531038314945\r\n"
604 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
605 "Content-Type: image/jpeg\r\n"
607 uint32_t httplen3 =
sizeof(httpbuf3) - 1;
609 uint8_t httpbuf4[] =
"file0123456789abcdefghijklmnopqrstuvwxyz";
610 uint32_t httplen4 =
sizeof(httpbuf4) - 1;
612 uint8_t httpbuf5[] =
"content\r\n";
613 uint32_t httplen5 =
sizeof(httpbuf5) - 1;
615 uint8_t httpbuf6[] =
"-----------------------------277531038314945--";
616 uint32_t httplen6 =
sizeof(httpbuf6) - 1;
622 memset(&ssn, 0,
sizeof(ssn));
627 f->
proto = IPPROTO_TCP;
632 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
637 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
642 SCLogDebug(
"\n>>>> processing chunk 3 size %u <<<<\n", httplen3);
647 SCLogDebug(
"\n>>>> processing chunk 4 size %u <<<<\n", httplen4);
652 SCLogDebug(
"\n>>>> processing chunk 5 size %u <<<<\n", httplen5);
657 SCLogDebug(
"\n>>>> processing chunk 6 size %u <<<<\n", httplen6);
669 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
683static int HTPFileParserTest05(
void)
685 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
686 "Host: www.server.lan\r\n"
687 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
688 "Content-Length: 544\r\n"
690 "-----------------------------277531038314945\r\n"
691 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
692 "Content-Type: image/jpeg\r\n"
695 "-----------------------------277531038314945\r\n";
696 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
697 uint8_t httpbuf2[] =
"Content-Disposition: form-data; name=\"uploadfile_1\"; filename=\"somepicture2.jpg\"\r\n"
698 "Content-Type: image/jpeg\r\n"
701 "-----------------------------277531038314945--";
702 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
708 memset(&ssn, 0,
sizeof(ssn));
713 f->
proto = IPPROTO_TCP;
718 SCLogDebug(
"\n>>>> processing chunk 1 size %u <<<<\n", httplen1);
723 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
735 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
758static int HTPFileParserTest06(
void)
760 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
761 "Host: www.server.lan\r\n"
762 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
763 "Content-Length: 544\r\n"
765 "-----------------------------277531038314945\r\n"
766 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
767 "Content-Type: image/jpeg\r\n"
770 "-----------------------------27753103831494";
771 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
772 uint8_t httpbuf2[] =
"5\r\nContent-Disposition: form-data; name=\"uploadfile_1\"; filename=\"somepicture2.jpg\"\r\n"
773 "Content-Type: image/jpeg\r\n"
776 "-----------------------------277531038314945--";
777 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
783 memset(&ssn, 0,
sizeof(ssn));
788 f->
proto = IPPROTO_TCP;
793 SCLogDebug(
"\n>>>> processing chunk 1 size %u <<<<\n", httplen1);
798 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
810 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
834static int HTPFileParserTest07(
void)
836 uint8_t httpbuf1[] =
"POST /filename HTTP/1.1\r\n"
837 "Host: www.server.lan\r\n"
838 "Content-Length: 11\r\n"
840 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
841 uint8_t httpbuf2[] =
"FILECONTENT";
842 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
848 memset(&ssn, 0,
sizeof(ssn));
853 f->
proto = IPPROTO_TCP;
858 SCLogDebug(
"\n>>>> processing chunk 1 size %u <<<<\n", httplen1);
863 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
874 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
891static int HTPFileParserTest08(
void)
893 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
894 "Host: www.server.lan\r\n"
895 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
896 "Content-Length: 215\r\n"
898 "-----------------------------277531038314945\r\n"
899 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
900 "Content-Type: image/jpeg\r\n";
902 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
903 uint8_t httpbuf2[] =
"filecontent\r\n\r\n"
904 "-----------------------------277531038314945--";
905 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
910 memset(&ssn, 0,
sizeof(ssn));
915 f->
proto = IPPROTO_TCP;
920 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
925 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
949static int HTPFileParserTest09(
void)
951 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
952 "Host: www.server.lan\r\n"
953 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
954 "Content-Length: 337\r\n"
956 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
958 uint8_t httpbuf2[] =
"-----------------------------277531038314945\r\n"
959 "Content-Disposition: form-data; name=\"email\"\r\n"
961 "someaddress@somedomain.lan\r\n";
962 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
964 uint8_t httpbuf3[] =
"-----------------------------277531038314945\r\n"
965 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
966 "Somereallylongheaderstr:\r\n"
968 uint32_t httplen3 =
sizeof(httpbuf3) - 1;
970 uint8_t httpbuf4[] =
"filecontent\r\n"
971 "-----------------------------277531038314945--";
972 uint32_t httplen4 =
sizeof(httpbuf4) - 1;
978 memset(&ssn, 0,
sizeof(ssn));
983 f->
proto = IPPROTO_TCP;
988 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
993 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
998 SCLogDebug(
"\n>>>> processing chunk 3 size %u <<<<\n", httplen3);
1003 SCLogDebug(
"\n>>>> processing chunk 4 size %u <<<<\n", httplen4);
1027static int HTPFileParserTest10(
void)
1029 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
1030 "Host: www.server.lan\r\n"
1031 "Content-Type: multipart/form-data; boundary=---------------------------277531038314945\r\n"
1032 "Content-Length: 337\r\n"
1034 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
1036 uint8_t httpbuf2[] =
"-----------------------------277531038314945\r\n"
1038 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
1040 uint8_t httpbuf3[] =
"-----------------------------277531038314945\r\n"
1041 "Content-Disposition: form-data; name=\"uploadfile_0\"; filename=\"somepicture1.jpg\"\r\n"
1042 "Somereallylongheaderstr: with a good value\r\n"
1044 uint32_t httplen3 =
sizeof(httpbuf3) - 1;
1046 uint8_t httpbuf4[] =
"filecontent\r\n"
1047 "-----------------------------277531038314945--";
1048 uint32_t httplen4 =
sizeof(httpbuf4) - 1;
1054 memset(&ssn, 0,
sizeof(ssn));
1059 f->
proto = IPPROTO_TCP;
1064 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
1069 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
1074 SCLogDebug(
"\n>>>> processing chunk 3 size %u <<<<\n", httplen3);
1079 SCLogDebug(
"\n>>>> processing chunk 4 size %u <<<<\n", httplen4);
1100static int HTPFileParserTest11(
void)
1102 uint8_t httpbuf1[] =
"POST /upload.cgi HTTP/1.1\r\n"
1103 "Host: www.server.lan\r\n"
1104 "Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1105 "Content-Length: 1102\r\n"
1107 uint32_t httplen1 =
sizeof(httpbuf1) - 1;
1109 uint8_t httpbuf2[] =
"------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n";
1110 uint32_t httplen2 =
sizeof(httpbuf2) - 1;
1112 uint8_t httpbuf3[] =
"Content-Disposition: form-data; name=\"PROGRESS_URL\"\r\n"
1114 "http://somserver.com/progress.php?UPLOAD_IDENTIFIER=XXXXXXXXX.XXXXXXXXXX.XXXXXXXX.XX.X\r\n"
1115 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1116 "Content-Disposition: form-data; name=\"DESTINATION_DIR\"\r\n"
1119 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1120 "Content-Disposition: form-data; name=\"js_enabled\"\r\n"
1123 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1124 "Content-Disposition: form-data; name=\"signature\"\r\n"
1126 "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\r\n"
1127 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1128 "Content-Disposition: form-data; name=\"upload_files\"\r\n"
1130 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1131 "Content-Disposition: form-data; name=\"terms\"\r\n"
1134 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1135 "Content-Disposition: form-data; name=\"file[]\"\r\n"
1137 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1138 "Content-Disposition: form-data; name=\"description[]\"\r\n"
1140 "------WebKitFormBoundaryBRDbP74mBhBxsIdo\r\n"
1141 "Content-Disposition: form-data; name=\"upload_file[]\"; filename=\"filename.doc\"\r\n"
1142 "Content-Type: application/msword\r\n"
1145 uint32_t httplen3 =
sizeof(httpbuf3) - 1;
1147 uint8_t httpbuf4[] =
"CONTENT\r\n"
1148 "------WebKitFormBoundaryBRDbP74mBhBxsIdo--";
1149 uint32_t httplen4 =
sizeof(httpbuf4) - 1;
1155 memset(&ssn, 0,
sizeof(ssn));
1160 f->
proto = IPPROTO_TCP;
1165 SCLogDebug(
"\n>>>> processing chunk 1 <<<<\n");
1170 SCLogDebug(
"\n>>>> processing chunk 2 size %u <<<<\n", httplen2);
1174 SCLogDebug(
"\n>>>> processing chunk 3 size %u <<<<\n", httplen3);
1178 SCLogDebug(
"\n>>>> processing chunk 4 size %u <<<<\n", httplen4);
1197 FAIL_IF(memcmp(bstr_util_strdup_to_c(htp_tx_request_method(tx)),
"POST", 4) != 0);
void AppLayerDecoderEventsSetEventRaw(AppLayerDecoderEvents **sevents, uint8_t event)
Set an app layer decoder event.
void AppLayerHtpFileRegisterTests(void)
this function registers unit tests for AppLayerHtpFile
bool HTPFileCloseHandleRange(const StreamingBufferConfig *sbcfg, FileContainer *files, const uint16_t flags, HttpRangeContainerBlock *c, const uint8_t *data, uint32_t data_len)
close range, add reassembled file if possible
int HTPFileOpenWithRange(HtpState *s, HtpTxUserData *txud, const uint8_t *filename, uint16_t filename_len, const uint8_t *data, uint32_t data_len, const htp_tx_t *tx, const bstr *rawvalue, HtpTxUserData *htud)
Sets range for a file.
int HTPFileOpen(HtpState *s, HtpTxUserData *tx, const uint8_t *filename, uint16_t filename_len, const uint8_t *data, uint32_t data_len, uint8_t direction)
Open the file with "filename" and pass the first chunk of data if any.
int HTPFileClose(HtpTxUserData *tx, const uint8_t *data, uint32_t data_len, uint8_t flags, uint8_t direction)
Close the file in the flow.
int HTPFileStoreChunk(HtpTxUserData *tx, const uint8_t *data, uint32_t data_len, uint8_t direction)
Store a chunk of data in the flow.
void HTPFileParserRegisterTests(void)
int HTPParseContentRange(const bstr *rawvalue, HTTPContentRange *range)
StreamingBufferConfig htp_sbcfg
void HttpRangeFreeBlock(HttpRangeContainerBlock *b)
File * HttpRangeClose(const StreamingBufferConfig *sbcfg, HttpRangeContainerBlock *c, uint16_t flags)
int HttpRangeAppendData(const StreamingBufferConfig *sbcfg, HttpRangeContainerBlock *c, const uint8_t *data, uint32_t len)
HttpRangeContainerBlock * HttpRangeContainerOpenFile(const uint8_t *key, uint32_t keylen, const Flow *f, const HTTPContentRange *crparsed, const StreamingBufferConfig *sbcfg, const uint8_t *name, uint16_t name_len, uint16_t flags, const uint8_t *data, uint32_t data_len)
AppLayerParserThreadCtx * AppLayerParserThreadCtxAlloc(void)
Gets a new app layer protocol's parser thread context.
void AppLayerParserThreadCtxFree(AppLayerParserThreadCtx *tctx)
Destroys the app layer parser thread context obtained using AppLayerParserThreadCtxAlloc().
int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *alp_tctx, Flow *f, AppProto alproto, uint8_t flags, const uint8_t *input, uint32_t input_len)
void * AppLayerParserGetTx(uint8_t ipproto, AppProto alproto, void *alstate, uint64_t tx_id)
AppLayerDecoderEvents * AppLayerParserGetEventsByTx(uint8_t ipproto, AppProto alproto, void *tx)
AppLayerParserThreadCtx * alp_tctx
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
#define PASS
Pass the test.
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
@ HTTP_DECODER_EVENT_RANGE_INVALID
void StreamTcpFreeConfig(bool quiet)
void StreamTcpInitConfig(bool)
To initialize the stream global configuration data.
Data structure to store app layer decoder events.
AppProto alproto
application level protocol
uint32_t inspect_min_size
const struct HTPCfgRec_ * cfg
HttpRangeContainerBlock * file_range
HttpRangeContainerFile * container
int FileAppendData(FileContainer *ffc, const StreamingBufferConfig *sbcfg, const uint8_t *data, uint32_t data_len)
Store/handle a chunk of file data in the File structure The last file in the FileContainer will be us...
uint64_t FileDataSize(const File *file)
get the size of the file data
uint16_t FileFlowFlagsToFlags(const uint16_t flow_file_flags, uint8_t direction)
void FileContainerAdd(FileContainer *ffc, File *ff)
int FileCloseFile(FileContainer *ffc, const StreamingBufferConfig *sbcfg, const uint8_t *data, uint32_t data_len, uint16_t flags)
Close a File.
void FileSetInspectSizes(File *file, const uint32_t win, const uint32_t min)
uint16_t FileFlowToFlags(const Flow *flow, uint8_t direction)
int FileSetRange(FileContainer *ffc, uint64_t start, uint64_t end)
Sets the offset range for a file.
int FileOpenFileWithId(FileContainer *ffc, const StreamingBufferConfig *sbcfg, uint32_t track_id, const uint8_t *name, uint16_t name_len, const uint8_t *data, uint32_t data_len, uint16_t flags)
Open a new File.
int StreamingBufferCompareRawData(const StreamingBuffer *sb, const uint8_t *rawdata, uint32_t rawdata_len)
void UTHFreeFlow(Flow *flow)
Flow * UTHBuildFlow(int family, const char *src, const char *dst, Port sp, Port dp)
#define DEBUG_VALIDATE_BUG_ON(exp)