75 #define FLOW_PROTO_CHANGE_MAX_DEPTH 4096
77 #define MAX_COUNTER_SIZE 64
118 .valid_settings_ips = {
136 static inline int ProtoDetectDone(
const Flow *f,
const TcpSession *ssn, uint8_t direction) {
222 if (
flags & STREAM_TOSERVER) {
238 if (
flags & STREAM_TOSERVER) {
248 SCLogDebug(
"disable app layer for flow %p alproto %u ts %u tc %u",
255 AppLayerIncFlowCounter(
tv, f);
261 FlagPacketFlow(p, f, STREAM_TOCLIENT);
267 FlagPacketFlow(p, f, STREAM_TOSERVER);
269 SCLogDebug(
"disabled app layer for flow %p alproto %u ts %u tc %u",
292 static void TCPProtoDetectCheckBailConditions(
ThreadVars *
tv,
296 SCLogDebug(
"skip as long as TCP is not ESTABLISHED (TCP fast open)");
302 SCLogDebug(
"size_ts %" PRIu32
", size_tc %" PRIu32, size_ts, size_tc);
306 const uint32_t size_tc_limit =
308 const uint32_t size_ts_limit =
311 if (ProtoDetectDone(f, ssn, STREAM_TOSERVER) &&
312 ProtoDetectDone(f, ssn, STREAM_TOCLIENT))
318 }
else if (size_tc > 2 * size_tc_limit || size_ts > 2 * size_ts_limit) {
323 size_ts > size_ts_limit && size_tc == 0) {
329 size_tc > size_tc_limit && size_ts == 0) {
337 }
else if (size_tc > size_tc_limit &&
FLOW_IS_PP_DONE(f, STREAM_TOSERVER) &&
347 }
else if (size_ts > size_ts_limit &&
FLOW_IS_PP_DONE(f, STREAM_TOCLIENT) &&
357 DisableAppLayer(
tv, f, p);
364 if (stream == &ssn->
client) {
365 opposing_stream = &ssn->
server;
367 opposing_stream = &ssn->
client;
373 SCLogDebug(
"opposing dir has STREAMTCP_STREAM_FLAG_NOREASSEMBLY set");
381 opposing_stream, p, dir);
397 uint8_t direction = (
flags & STREAM_TOSERVER) ? 0 : 1;
399 if (
flags & STREAM_TOSERVER) {
407 SCLogDebug(
"Stream initializer (len %" PRIu32
")", data_len);
410 printf(
"=> Init Stream Data (app layer) -- start %s%s\n",
411 flags & STREAM_TOCLIENT ?
"toclient" :
"",
412 flags & STREAM_TOSERVER ?
"toserver" :
"");
414 printf(
"=> Init Stream Data -- end\n");
418 bool reverse_flow =
false;
423 IPPROTO_TCP,
flags, &reverse_flow);
425 SCLogDebug(
"alproto %u rev %s", *alproto, reverse_flow ?
"true" :
"false");
428 if (*alproto_otherdir !=
ALPROTO_UNKNOWN && *alproto_otherdir != *alproto) {
434 f->
alproto = *alproto_otherdir;
438 if (
flags & STREAM_TOCLIENT)
441 f->
alproto = *alproto_otherdir;
450 FlagPacketFlow(p, f,
flags);
460 SCLogDebug(
"reversing flow after proto detect told us so");
464 if (*stream == &ssn->
client) {
469 direction = 1 - direction;
477 AppLayerIncFlowCounter(
tv, f);
490 SCLogDebug(
"protocol %s needs first data in other direction",
493 if (TCPProtoDetectTriggerOpposingSide(
tv, ra_ctx,
494 p, ssn, *stream) != 0)
526 uint8_t first_data_dir;
541 if (first_data_dir && !(first_data_dir &
flags)) {
557 flags, data, data_len);
566 if (*stream == &ssn->
client) {
567 opposing_stream = &ssn->
server;
569 opposing_stream = &ssn->
client;
573 AppLayerIncFlowCounter(
tv, f);
601 DisableAppLayer(
tv, f, p);
607 uint8_t first_data_dir;
626 (first_data_dir) && !(first_data_dir &
flags))
657 *alproto = *alproto_otherdir;
658 SCLogDebug(
"packet %"PRIu64
": pd done(us %u them %u), parser called (r==%d), APPLAYER_DETECT_PROTOCOL_ONLY_ONE_DIRECTION set",
659 p->
pcap_cnt, *alproto, *alproto_otherdir, r);
666 AppLayerIncFlowCounter(
tv, f);
667 FlagPacketFlow(p, f,
flags);
669 }
else if (
flags & STREAM_EOF) {
672 AppLayerIncFlowCounter(
tv, f);
683 DisableAppLayer(
tv, f, p);
686 TCPProtoDetectCheckBailConditions(
tv, f, ssn, p);
696 DisableAppLayer(
tv, f, p);
723 SCLogDebug(
"STREAMTCP_FLAG_APP_LAYER_DISABLED is set");
727 const uint8_t direction = (
flags & STREAM_TOSERVER) ? 0 : 1;
729 if (
flags & STREAM_TOSERVER) {
737 if (
flags & STREAM_GAP) {
741 SCLogDebug(
"ALPROTO_UNKNOWN flow %p, due to GAP in stream start", f);
746 AppLayerIncFlowCounter(
tv, f);
750 SCLogDebug(
"Cannot handle gap while changing protocol");
755 flags, data, data_len);
776 if (TCPProtoDetect(
tv, ra_ctx, app_tctx, p, f, ssn, stream, data, data_len,
flags,
777 app_update_dir) != 0) {
782 void *alstate_orig = f->
alstate;
789 int rd = TCPProtoDetect(
790 tv, ra_ctx, app_tctx, p, f, ssn, stream, data, data_len,
flags, app_update_dir);
801 if (alstate_orig == f->
alstate) {
825 SCLogDebug(
"stream data (len %" PRIu32
" alproto "
826 "%"PRIu16
" (flow %p)", data_len, f->
alproto, f);
829 printf(
"=> Stream Data (app layer) -- start %s%s\n",
830 flags & STREAM_TOCLIENT ?
"toclient" :
"",
831 flags & STREAM_TOSERVER ?
"toserver" :
"");
833 printf(
"=> Stream Data -- end\n");
841 flags, data, data_len);
888 flags |= STREAM_TOSERVER;
892 flags |= STREAM_TOCLIENT;
901 SCLogDebug(
"Detecting AL proto on udp mesg (len %" PRIu32
")",
904 bool reverse_flow =
false;
914 f->
alproto = *alproto_otherdir;
916 *alproto = *alproto_otherdir;
928 f->
alproto = *alproto_otherdir;
937 if (*alproto_otherdir != *alproto) {
953 AppLayerIncFlowCounter(
tv, f);
959 SCLogDebug(
"reversing flow after proto detect told us so");
974 FlagPacketFlow(p, f, STREAM_TOSERVER);
975 FlagPacketFlow(p, f, STREAM_TOCLIENT);
977 SCLogDebug(
"data (len %" PRIu32
" ), alproto "
1022 printf(
"=========Supported App Layer Protocols=========\n");
1023 for (alproto = 0; alproto <
ALPROTO_MAX; alproto++) {
1024 if (alprotos[alproto] == 1)
1065 if (app_tctx == NULL)
1085 if (app_tctx == NULL)
1126 static bool IsAppLayerErrorExceptionPolicyStatsValid(
enum ExceptionPolicy policy)
1134 static void AppLayerSetupExceptionPolicyPerProtoCounters(
1135 uint8_t ipproto_map,
AppProto alproto,
const char *alproto_str,
const char *ipproto_suffix)
1140 if (IsAppLayerErrorExceptionPolicyStatsValid(i)) {
1143 "app_layer.error.%s%s.exception_policy.%s", alproto_str, ipproto_suffix,
1152 const uint8_t ipprotos[] = { IPPROTO_TCP, IPPROTO_UDP };
1154 const char *
str =
"app_layer.flow.";
1155 const char *estr =
"app_layer.error.";
1160 const char *eps_default_str =
"app_layer.error.exception_policy.";
1162 if (IsAppLayerErrorExceptionPolicyStatsValid(i)) {
1173 const uint8_t ipproto = ipprotos[p];
1175 const char *ipproto_suffix = (ipproto == IPPROTO_TCP) ?
"_tcp" :
"_udp";
1176 uint8_t ipprotos_all[256 / 8];
1179 if (alprotos[alproto] == 1) {
1180 const char *tx_str =
"app_layer.tx.";
1183 memset(ipprotos_all, 0,
sizeof(ipprotos_all));
1185 if ((ipprotos_all[IPPROTO_TCP / 8] & (1 << (IPPROTO_TCP % 8))) &&
1186 (ipprotos_all[IPPROTO_UDP / 8] & (1 << (IPPROTO_UDP % 8)))) {
1189 "%s%s%s",
str, alproto_str, ipproto_suffix);
1192 "%s%s%s", tx_str, alproto_str, ipproto_suffix);
1194 if (ipproto == IPPROTO_TCP) {
1197 "%s%s%s.gap", estr, alproto_str, ipproto_suffix);
1201 "%s%s%s.alloc", estr, alproto_str, ipproto_suffix);
1204 "%s%s%s.parser", estr, alproto_str, ipproto_suffix);
1207 "%s%s%s.internal", estr, alproto_str, ipproto_suffix);
1209 AppLayerSetupExceptionPolicyPerProtoCounters(
1210 ipproto_map, alproto, alproto_str, ipproto_suffix);
1214 "%s%s",
str, alproto_str);
1217 "%s%s", tx_str, alproto_str);
1219 if (ipproto == IPPROTO_TCP) {
1222 "%s%s.gap", estr, alproto_str);
1226 "%s%s.alloc", estr, alproto_str);
1229 "%s%s.parser", estr, alproto_str);
1232 "%s%s.internal", estr, alproto_str);
1233 AppLayerSetupExceptionPolicyPerProtoCounters(
1234 ipproto_map, alproto, alproto_str,
"");
1239 "%s%s%s",
str,
"failed", ipproto_suffix);
1240 if (ipproto == IPPROTO_TCP) {
1243 "%sfailed%s.gap", estr, ipproto_suffix);
1252 const uint8_t ipprotos[] = { IPPROTO_TCP, IPPROTO_UDP };
1260 if (IsAppLayerErrorExceptionPolicyStatsValid(i)) {
1268 const uint8_t ipproto = ipprotos[p];
1272 if (alprotos[alproto] == 1) {
1279 if (ipproto == IPPROTO_TCP) {
1294 if (IsAppLayerErrorExceptionPolicyStatsValid(i)) {
1305 if (ipproto == IPPROTO_TCP) {
1328 #define TEST_START \
1329 Packet *p = PacketGetFromAlloc(); \
1333 StreamTcpThread *stt = NULL; \
1335 PacketQueueNoLock pq; \
1336 memset(&pq, 0, sizeof(PacketQueueNoLock)); \
1337 memset(&f, 0, sizeof(Flow)); \
1338 memset(&tv, 0, sizeof(ThreadVars)); \
1339 memset(&tcph, 0, sizeof(TCPHdr)); \
1341 FLOW_INITIALIZE(&f); \
1342 f.flags = FLOW_IPV4; \
1343 f.proto = IPPROTO_TCP; \
1345 PacketSetTCP(p, (uint8_t *)&tcph); \
1347 StreamTcpInitConfig(true); \
1348 IPPairInitConfig(true); \
1349 StreamTcpThreadInit(&tv, NULL, (void **)&stt); \
1352 tcph.th_win = htons(5480); \
1353 tcph.th_flags = TH_SYN; \
1354 p->flowflags = FLOW_PKT_TOSERVER; \
1355 p->payload_len = 0; \
1356 p->payload = NULL; \
1357 FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); \
1358 TcpSession *ssn = (TcpSession *)f.protoctx; \
1360 FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); \
1361 FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); \
1362 FAIL_IF(f.alproto != ALPROTO_UNKNOWN); \
1363 FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN); \
1364 FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); \
1365 FAIL_IF(ssn->flags &STREAMTCP_FLAG_APP_LAYER_DISABLED); \
1366 FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); \
1367 FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); \
1368 FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT)); \
1369 FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT)); \
1370 FAIL_IF(ssn->data_first_seen_dir != 0); \
1373 tcph.th_ack = htonl(1); \
1374 tcph.th_flags = TH_SYN | TH_ACK; \
1375 p->flowflags = FLOW_PKT_TOCLIENT; \
1376 p->payload_len = 0; \
1377 p->payload = NULL; \
1378 FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); \
1379 FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); \
1380 FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); \
1381 FAIL_IF(f.alproto != ALPROTO_UNKNOWN); \
1382 FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN); \
1383 FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); \
1384 FAIL_IF(ssn->flags &STREAMTCP_FLAG_APP_LAYER_DISABLED); \
1385 FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); \
1386 FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); \
1387 FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT)); \
1388 FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT)); \
1389 FAIL_IF(ssn->data_first_seen_dir != 0); \
1392 tcph.th_ack = htonl(1); \
1393 tcph.th_seq = htonl(1); \
1394 tcph.th_flags = TH_ACK; \
1395 p->flowflags = FLOW_PKT_TOSERVER; \
1396 p->payload_len = 0; \
1397 p->payload = NULL; \
1398 FAIL_IF(StreamTcpPacket(&tv, p, stt, &pq) == -1); \
1399 FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->server)); \
1400 FAIL_IF(StreamTcpIsSetStreamFlagAppProtoDetectionCompleted(&ssn->client)); \
1401 FAIL_IF(f.alproto != ALPROTO_UNKNOWN); \
1402 FAIL_IF(f.alproto_ts != ALPROTO_UNKNOWN); \
1403 FAIL_IF(f.alproto_tc != ALPROTO_UNKNOWN); \
1404 FAIL_IF(ssn->flags &STREAMTCP_FLAG_APP_LAYER_DISABLED); \
1405 FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOSERVER)); \
1406 FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOSERVER)); \
1407 FAIL_IF(FLOW_IS_PM_DONE(&f, STREAM_TOCLIENT)); \
1408 FAIL_IF(FLOW_IS_PP_DONE(&f, STREAM_TOCLIENT)); \
1409 FAIL_IF(ssn->data_first_seen_dir != 0);
1411 StreamTcpSessionClear(p->flow->protoctx); \
1412 StreamTcpThreadDeinit(&tv, (void *)stt); \
1413 StreamTcpFreeConfig(true); \
1416 StatsThreadCleanup(&tv);
1421 static int AppLayerTest01(
void)
1426 uint8_t request[] = {
1427 0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64,
1428 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20,
1429 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30,
1430 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20,
1431 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
1432 0x74, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d,
1433 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41,
1434 0x70, 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e,
1435 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
1436 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20,
1437 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
1438 tcph.th_ack = htonl(1);
1439 tcph.th_seq = htonl(1);
1458 uint8_t response[] = {
1459 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
1460 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
1461 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
1462 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
1463 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
1464 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
1465 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
1466 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
1467 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
1468 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
1469 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
1470 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
1471 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
1472 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
1473 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
1474 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
1475 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
1476 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
1477 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
1478 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
1479 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
1480 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
1481 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
1482 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
1483 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
1484 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
1485 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
1486 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
1487 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
1488 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
1489 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
1490 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
1491 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
1492 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
1493 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
1494 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
1495 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
1496 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
1497 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
1498 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
1499 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
1500 tcph.th_ack = htonl(88);
1501 tcph.th_seq = htonl(1);
1520 tcph.th_ack = htonl(328);
1521 tcph.th_seq = htonl(88);
1546 static int AppLayerTest02(
void)
1551 uint8_t request1[] = { 0x47, 0x45, };
1552 tcph.th_ack = htonl(1);
1553 tcph.th_seq = htonl(1);
1572 tcph.th_ack = htonl(3);
1573 tcph.th_seq = htonl(1);
1592 uint8_t request2[] = {
1593 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64,
1594 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20,
1595 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30,
1596 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20,
1597 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
1598 0x74, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d,
1599 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41,
1600 0x70, 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e,
1601 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
1602 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20,
1603 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
1604 tcph.th_ack = htonl(1);
1605 tcph.th_seq = htonl(3);
1624 uint8_t response[] = {
1625 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
1626 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
1627 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
1628 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
1629 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
1630 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
1631 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
1632 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
1633 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
1634 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
1635 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
1636 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
1637 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
1638 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
1639 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
1640 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
1641 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
1642 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
1643 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
1644 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
1645 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
1646 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
1647 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
1648 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
1649 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
1650 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
1651 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
1652 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
1653 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
1654 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
1655 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
1656 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
1657 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
1658 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
1659 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
1660 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
1661 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
1662 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
1663 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
1664 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
1665 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
1666 tcph.th_ack = htonl(88);
1667 tcph.th_seq = htonl(1);
1686 tcph.th_ack = htonl(328);
1687 tcph.th_seq = htonl(88);
1712 static int AppLayerTest03(
void)
1717 uint8_t request[] = {
1718 0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64,
1719 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20,
1720 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30,
1721 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20,
1722 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
1723 0x74, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d,
1724 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41,
1725 0x70, 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e,
1726 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
1727 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20,
1728 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
1729 tcph.th_ack = htonl(1);
1730 tcph.th_seq = htonl(1);
1749 uint8_t response[] = {
1750 0x58, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
1751 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
1752 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
1753 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
1754 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
1755 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
1756 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
1757 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
1758 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
1759 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
1760 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
1761 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
1762 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
1763 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
1764 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
1765 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
1766 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
1767 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
1768 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
1769 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
1770 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
1771 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
1772 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
1773 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
1774 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
1775 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
1776 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
1777 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
1778 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
1779 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
1780 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
1781 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
1782 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
1783 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
1784 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
1785 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
1786 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
1787 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
1788 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
1789 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
1790 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
1791 tcph.th_ack = htonl(88);
1792 tcph.th_seq = htonl(1);
1811 tcph.th_ack = htonl(328);
1812 tcph.th_seq = htonl(88);
1837 static int AppLayerTest04(
void)
1842 uint8_t request[] = {
1843 0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64,
1844 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20,
1845 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30,
1846 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20,
1847 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
1848 0x74, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d,
1849 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41,
1850 0x70, 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e,
1851 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
1852 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20,
1853 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
1855 tcph.th_ack = htonl(1);
1856 tcph.th_seq = htonl(1);
1875 uint8_t response1[] = { 0x58, 0x54, 0x54, 0x50, };
1877 tcph.th_ack = htonl(88);
1878 tcph.th_seq = htonl(1);
1897 tcph.th_ack = htonl(5);
1898 tcph.th_seq = htonl(88);
1917 uint8_t response2[] = {
1918 0x2f, 0x31, 0x2e, 0x31,
1919 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
1920 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
1921 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
1922 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
1923 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
1924 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
1925 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
1926 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
1927 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
1928 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
1929 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
1930 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
1931 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
1932 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
1933 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
1934 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
1935 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
1936 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
1937 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
1938 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
1939 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
1940 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
1941 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
1942 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
1943 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
1944 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
1945 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
1946 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
1947 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
1948 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
1949 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
1950 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
1951 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
1952 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
1953 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
1954 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
1955 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
1956 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
1957 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
1958 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
1960 tcph.th_ack = htonl(88);
1961 tcph.th_seq = htonl(5);
1980 tcph.th_ack = htonl(328);
1981 tcph.th_seq = htonl(88);
2006 static int AppLayerTest05(
void)
2011 uint8_t request[] = {
2012 0x48, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64,
2013 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20,
2014 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30,
2015 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20,
2016 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
2017 0x74, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d,
2018 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41,
2019 0x70, 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e,
2020 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
2021 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20,
2022 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
2024 tcph.th_ack = htonl(1);
2025 tcph.th_seq = htonl(1);
2044 uint8_t response[] = {
2045 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
2046 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
2047 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
2048 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
2049 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
2050 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
2051 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
2052 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
2053 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
2054 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
2055 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
2056 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
2057 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
2058 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
2059 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
2060 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
2061 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
2062 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
2063 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
2064 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
2065 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
2066 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
2067 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
2068 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
2069 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
2070 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
2071 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
2072 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
2073 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
2074 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
2075 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
2076 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
2077 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
2078 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
2079 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
2080 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
2081 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
2082 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
2083 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
2084 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
2085 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
2087 tcph.th_ack = htonl(88);
2088 tcph.th_seq = htonl(1);
2107 tcph.th_ack = htonl(328);
2108 tcph.th_seq = htonl(88);
2133 static int AppLayerTest06(
void)
2138 uint8_t response[] = {
2139 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
2140 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
2141 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
2142 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
2143 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
2144 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
2145 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
2146 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
2147 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
2148 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
2149 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
2150 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
2151 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
2152 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
2153 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
2154 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
2155 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
2156 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
2157 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
2158 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
2159 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
2160 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
2161 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
2162 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
2163 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
2164 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
2165 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
2166 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
2167 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
2168 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
2169 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
2170 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
2171 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
2172 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
2173 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
2174 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
2175 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
2176 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
2177 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
2178 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
2179 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
2180 tcph.th_ack = htonl(1);
2181 tcph.th_seq = htonl(1);
2200 uint8_t request[] = {
2201 0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64,
2202 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20,
2203 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30,
2204 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20,
2205 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
2206 0x74, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d,
2207 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41,
2208 0x70, 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e,
2209 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
2210 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20,
2211 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
2212 tcph.th_ack = htonl(328);
2213 tcph.th_seq = htonl(1);
2231 tcph.th_ack = htonl(1 +
sizeof(request));
2232 tcph.th_seq = htonl(328);
2257 static int AppLayerTest07(
void)
2262 uint8_t request[] = {
2263 0x47, 0x45, 0x54, 0x20, 0x2f, 0x69, 0x6e, 0x64,
2264 0x65, 0x78, 0x2e, 0x68, 0x74, 0x6d, 0x6c, 0x20,
2265 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30,
2266 0x0d, 0x0a, 0x48, 0x6f, 0x73, 0x74, 0x3a, 0x20,
2267 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73,
2268 0x74, 0x0d, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d,
2269 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41,
2270 0x70, 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e,
2271 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
2272 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20,
2273 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
2274 tcph.th_ack = htonl(1);
2275 tcph.th_seq = htonl(1);
2294 uint8_t response[] = { 0x05, 0x00, 0x4d, 0x42, 0x00, 0x01, 0x2e, 0x31, 0x20, 0x32, 0x30, 0x30,
2295 0x20, 0x4f, 0x4b, 0x0d, 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46, 0x72, 0x69, 0x2c,
2296 0x20, 0x32, 0x33, 0x20, 0x53, 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20, 0x30, 0x36,
2297 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65, 0x72,
2298 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
2299 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69, 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f,
2300 0x32, 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65,
2301 0x64, 0x3a, 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x76, 0x20,
2302 0x32, 0x30, 0x31, 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a, 0x34, 0x36, 0x20, 0x47,
2303 0x4d, 0x54, 0x0d, 0x0a, 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61, 0x62, 0x38, 0x39,
2304 0x36, 0x35, 0x2d, 0x32, 0x63, 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61, 0x37, 0x66,
2305 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d, 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d, 0x52,
2306 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20, 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
2307 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20,
2308 0x34, 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a,
2309 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
2310 0x2d, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d,
2311 0x6c, 0x0d, 0x0a, 0x58, 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76, 0x6f, 0x69, 0x64,
2312 0x20, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d, 0x0a, 0x0d,
2313 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c, 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c, 0x68,
2314 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
2315 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
2316 tcph.th_ack = htonl(88);
2317 tcph.th_seq = htonl(1);
2336 tcph.th_ack = htonl(328);
2337 tcph.th_seq = htonl(88);
2362 static int AppLayerTest08(
void)
2367 uint8_t request[] = { 0x05, 0x00, 0x54, 0x20, 0x00, 0x01, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68,
2368 0x74, 0x6d, 0x6c, 0x20, 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x0d, 0x0a, 0x48,
2369 0x6f, 0x73, 0x74, 0x3a, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x0d,
2370 0x0a, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x41, 0x70,
2371 0x61, 0x63, 0x68, 0x65, 0x42, 0x65, 0x6e, 0x63, 0x68, 0x2f, 0x32, 0x2e, 0x33, 0x0d, 0x0a,
2372 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x3a, 0x20, 0x2a, 0x2f, 0x2a, 0x0d, 0x0a, 0x0d, 0x0a };
2373 tcph.th_ack = htonl(1);
2374 tcph.th_seq = htonl(1);
2393 uint8_t response[] = {
2394 0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
2395 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
2396 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
2397 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
2398 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
2399 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
2400 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
2401 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
2402 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
2403 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
2404 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
2405 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
2406 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
2407 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
2408 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
2409 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
2410 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
2411 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
2412 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
2413 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
2414 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
2415 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
2416 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
2417 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
2418 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
2419 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
2420 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
2421 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
2422 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
2423 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
2424 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
2425 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
2426 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
2427 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
2428 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
2429 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
2430 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
2431 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
2432 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
2433 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
2434 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
2435 tcph.th_ack = htonl(88);
2436 tcph.th_seq = htonl(1);
2455 tcph.th_ack = htonl(328);
2456 tcph.th_seq = htonl(88);
2483 static int AppLayerTest09(
void)
2488 uint8_t request1[] = {
2489 0x47, 0x47, 0x49, 0x20, 0x2f, 0x69, 0x6e, 0x64 };
2490 tcph.th_ack = htonl(1);
2491 tcph.th_seq = htonl(1);
2510 tcph.th_ack = htonl(9);
2511 tcph.th_seq = htonl(1);
2530 uint8_t request2[] = {
2531 0x44, 0x44, 0x45, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0xff };
2532 tcph.th_ack = htonl(1);
2533 tcph.th_seq = htonl(9);
2552 uint8_t response[] = {
2553 0x55, 0x74, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
2554 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
2555 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
2556 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
2557 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
2558 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
2559 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
2560 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
2561 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
2562 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
2563 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
2564 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
2565 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
2566 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
2567 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
2568 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
2569 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
2570 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
2571 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
2572 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
2573 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
2574 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
2575 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
2576 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
2577 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
2578 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
2579 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
2580 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
2581 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
2582 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
2583 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
2584 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
2585 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
2586 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
2587 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
2588 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
2589 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
2590 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
2591 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
2592 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
2593 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
2594 tcph.th_ack = htonl(18);
2595 tcph.th_seq = htonl(1);
2614 tcph.th_ack = htonl(328);
2615 tcph.th_seq = htonl(18);
2641 static int AppLayerTest10(
void)
2646 uint8_t request1[] = {
2647 0x47, 0x47, 0x49, 0x20, 0x2f, 0x69, 0x6e, 0x64,
2648 0x47, 0x47, 0x49, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0xff };
2649 tcph.th_ack = htonl(1);
2650 tcph.th_seq = htonl(1);
2669 tcph.th_ack = htonl(18);
2670 tcph.th_seq = htonl(1);
2689 uint8_t response[] = {
2690 0x55, 0x74, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x31,
2691 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
2692 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
2693 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
2694 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
2695 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
2696 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
2697 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
2698 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
2699 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
2700 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
2701 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
2702 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
2703 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
2704 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
2705 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
2706 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
2707 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
2708 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
2709 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
2710 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
2711 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
2712 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
2713 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
2714 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
2715 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
2716 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
2717 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
2718 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
2719 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
2720 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
2721 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
2722 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
2723 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
2724 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
2725 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
2726 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
2727 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
2728 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
2729 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
2730 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
2731 tcph.th_ack = htonl(18);
2732 tcph.th_seq = htonl(1);
2751 tcph.th_ack = htonl(328);
2752 tcph.th_seq = htonl(18);
2779 static int AppLayerTest11(
void)
2784 uint8_t request1[] = {
2785 0x47, 0x47, 0x49, 0x20, 0x2f, 0x69, 0x6e, 0x64,
2786 0x47, 0x47, 0x49, 0x20, 0x2f, 0x69, 0x6e, 0x64, 0xff };
2787 tcph.th_ack = htonl(1);
2788 tcph.th_seq = htonl(1);
2807 tcph.th_ack = htonl(18);
2808 tcph.th_seq = htonl(1);
2827 uint8_t response1[] = {
2828 0x55, 0x74, 0x54, 0x50, };
2829 tcph.th_ack = htonl(18);
2830 tcph.th_seq = htonl(1);
2849 tcph.th_ack = htonl(5);
2850 tcph.th_seq = htonl(18);
2868 uint8_t response2[] = {
2869 0x2f, 0x31, 0x2e, 0x31,
2870 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0x0d,
2871 0x0a, 0x44, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x46,
2872 0x72, 0x69, 0x2c, 0x20, 0x32, 0x33, 0x20, 0x53,
2873 0x65, 0x70, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20,
2874 0x30, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x33, 0x39,
2875 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a, 0x53, 0x65,
2876 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x41, 0x70,
2877 0x61, 0x63, 0x68, 0x65, 0x2f, 0x32, 0x2e, 0x32,
2878 0x2e, 0x31, 0x35, 0x20, 0x28, 0x55, 0x6e, 0x69,
2879 0x78, 0x29, 0x20, 0x44, 0x41, 0x56, 0x2f, 0x32,
2880 0x0d, 0x0a, 0x4c, 0x61, 0x73, 0x74, 0x2d, 0x4d,
2881 0x6f, 0x64, 0x69, 0x66, 0x69, 0x65, 0x64, 0x3a,
2882 0x20, 0x54, 0x68, 0x75, 0x2c, 0x20, 0x30, 0x34,
2883 0x20, 0x4e, 0x6f, 0x76, 0x20, 0x32, 0x30, 0x31,
2884 0x30, 0x20, 0x31, 0x35, 0x3a, 0x30, 0x34, 0x3a,
2885 0x34, 0x36, 0x20, 0x47, 0x4d, 0x54, 0x0d, 0x0a,
2886 0x45, 0x54, 0x61, 0x67, 0x3a, 0x20, 0x22, 0x61,
2887 0x62, 0x38, 0x39, 0x36, 0x35, 0x2d, 0x32, 0x63,
2888 0x2d, 0x34, 0x39, 0x34, 0x33, 0x62, 0x37, 0x61,
2889 0x37, 0x66, 0x37, 0x66, 0x38, 0x30, 0x22, 0x0d,
2890 0x0a, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x2d,
2891 0x52, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x3a, 0x20,
2892 0x62, 0x79, 0x74, 0x65, 0x73, 0x0d, 0x0a, 0x43,
2893 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x4c,
2894 0x65, 0x6e, 0x67, 0x74, 0x68, 0x3a, 0x20, 0x34,
2895 0x34, 0x0d, 0x0a, 0x43, 0x6f, 0x6e, 0x6e, 0x65,
2896 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63,
2897 0x6c, 0x6f, 0x73, 0x65, 0x0d, 0x0a, 0x43, 0x6f,
2898 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x54, 0x79,
2899 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
2900 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x58,
2901 0x2d, 0x50, 0x61, 0x64, 0x3a, 0x20, 0x61, 0x76,
2902 0x6f, 0x69, 0x64, 0x20, 0x62, 0x72, 0x6f, 0x77,
2903 0x73, 0x65, 0x72, 0x20, 0x62, 0x75, 0x67, 0x0d,
2904 0x0a, 0x0d, 0x0a, 0x3c, 0x68, 0x74, 0x6d, 0x6c,
2905 0x3e, 0x3c, 0x62, 0x6f, 0x64, 0x79, 0x3e, 0x3c,
2906 0x68, 0x31, 0x3e, 0x49, 0x74, 0x20, 0x77, 0x6f,
2907 0x72, 0x6b, 0x73, 0x21, 0x3c, 0x2f, 0x68, 0x31,
2908 0x3e, 0x3c, 0x2f, 0x62, 0x6f, 0x64, 0x79, 0x3e,
2909 0x3c, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x3e };
2910 tcph.th_ack = htonl(18);
2911 tcph.th_seq = htonl(5);
2930 tcph.th_ack = htonl(328);
2931 tcph.th_seq = htonl(18);