summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsongyanchao <[email protected]>2023-10-08 14:46:51 +0000
committersongyanchao <[email protected]>2023-10-09 03:05:27 +0000
commit75ca8377f63e0717b53cdffc2eb6634be3cbee1a (patch)
treef74015bf7c2401ed424945e7d28602154436f108
parente3685cba177619bbc844e45f91885e4b6825877d (diff)
🐎 ci: add el7 build task
add el7 build task
-rw-r--r--.gitlab-ci.yml118
-rw-r--r--infra/test/TestPacketParser.cc525
2 files changed, 386 insertions, 257 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b55b2d0..b706541 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,6 +1,7 @@
variables:
GIT_STRATEGY: "clone"
BUILD_IMAGE_CENTOS8: "git.mesalab.cn:7443/mesa_platform/marsio-build-env:dpdk-21-11-mlx5-el8"
+ BUILD_IMAGE_CENTOS7: "git.mesalab.cn:7443/mesa_platform/marsio-build-env:dpdk-21-11-mlx5-el7"
stages:
- build
@@ -322,3 +323,120 @@ testing-package-release-for-centos8-generic:
- build/*.rpm
only:
- /^dev.*$/i
+
+.build_mrzcpd_for_centos7:
+ image: $BUILD_IMAGE_CENTOS7
+ extends: .build_before_script
+ script:
+ - mkdir -p build
+ - cd build
+ - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH=$BUILD_PREFIX -DMACHINE=$MACHINE
+ - make VERBOSE=1
+
+.package_mrzcpd_for_centos7:
+ image: $BUILD_IMAGE_CENTOS7
+ extends: .build_before_script
+ script:
+ - yum install -y rpm-build
+ - mkdir -p build
+ - cd build
+ - cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH=$BUILD_PREFIX -DMACHINE=$MACHINE
+ - make package VERBOSE=1
+ - cp ~/rpm_upload_tools.py ./
+ - python3 rpm_upload_tools.py ${PULP3_REPO_NAME} ${PULP3_DIST_NAME} *.rpm
+
+build-debug-for-centos7-generic:
+ stage: build
+ extends: .build_mrzcpd_for_centos7
+ tags:
+ - share
+ variables:
+ BUILD_TYPE: "Debug"
+ BUILD_PREFIX: "/opt/dpdk-21.11.4-debug-generic"
+ MACHINE: "corei7"
+ except:
+ - tags
+
+build-release-for-centos7-generic:
+ stage: build
+ extends: .build_mrzcpd_for_centos7
+ tags:
+ - share
+ variables:
+ BUILD_TYPE: "RelWithDebInfo"
+ BUILD_PREFIX: "/opt/dpdk-21.11.4-rel-generic"
+ MACHINE: "corei7"
+ except:
+ - tags
+
+stable-package-debug-for-centos7-generic:
+ stage: package
+ extends: .package_mrzcpd_for_centos7
+ tags:
+ - share
+ variables:
+ BUILD_TYPE: "Debug"
+ BUILD_PREFIX: "/opt/dpdk-21.11.4-debug-generic"
+ PULP3_REPO_NAME: platform-stable-x86_64.el7
+ PULP3_DIST_NAME: platform-stable-x86_64.el7
+ MACHINE: "corei7"
+ artifacts:
+ name: "mrzcpd-debug-$CI_COMMIT_REF_NAME-binary"
+ paths:
+ - build/*.rpm
+ only:
+ - tags
+
+stable-package-release-for-centos7-generic:
+ stage: package
+ extends: .package_mrzcpd_for_centos7
+ tags:
+ - share
+ variables:
+ BUILD_TYPE: "RelWithDebInfo"
+ BUILD_PREFIX: "/opt/dpdk-21.11.4-rel-generic"
+ PULP3_REPO_NAME: platform-stable-x86_64.el7
+ PULP3_DIST_NAME: platform-stable-x86_64.el7
+ MACHINE: "corei7"
+ artifacts:
+ name: "mrzcpd-$CI_COMMIT_REF_NAME-binary"
+ paths:
+ - build/*.rpm
+ only:
+ - tags
+
+testing-package-debug-for-centos7-generic:
+ stage: package
+ extends: .package_mrzcpd_for_centos7
+ tags:
+ - share
+ variables:
+ BUILD_TYPE: "Debug"
+ BUILD_PREFIX: "/opt/dpdk-21.11.4-debug-generic"
+ PULP3_REPO_NAME: platform-testing-x86_64.el7
+ PULP3_DIST_NAME: platform-testing-x86_64.el7
+ MACHINE: "corei7"
+ artifacts:
+ name: "mrzcpd-debug-$CI_COMMIT_REF_NAME-binary"
+ paths:
+ - build/*.rpm
+ only:
+ - /^dev.*$/i
+
+testing-package-release-for-centos7-generic:
+ stage: package
+ extends: .package_mrzcpd_for_centos7
+ tags:
+ - share
+ variables:
+ BUILD_TYPE: "RelWithDebInfo"
+ BUILD_PREFIX: "/opt/dpdk-21.11.4-rel-generic"
+ PULP3_REPO_NAME: platform-testing-x86_64.el7
+ PULP3_DIST_NAME: platform-testing-x86_64.el7
+ MACHINE: "corei7"
+ artifacts:
+ name: "mrzcpd-$CI_COMMIT_REF_NAME-binary"
+ paths:
+ - build/*.rpm
+ only:
+ - /^dev.*$/i
diff --git a/infra/test/TestPacketParser.cc b/infra/test/TestPacketParser.cc
index 1e7a596..bff8cf1 100644
--- a/infra/test/TestPacketParser.cc
+++ b/infra/test/TestPacketParser.cc
@@ -1,128 +1,128 @@

extern "C"
{
-#include <rte_mbuf.h>
+#include <arpa/inet.h>
+#include <ldbc.h>
#include <rte_ip.h>
+#include <rte_mbuf.h>
#include <rte_tcp.h>
#include <rte_udp.h>
-#include <arpa/inet.h>
-#include <ldbc.h>
}
#include <gtest/gtest.h>
+#include <memory>
/*31 Ether/IPv4/TCP
- 192.168.11.169 202.157.180.190 TCP 78
- 64161→1443[SYN] Seq = 2421401215 Win = 65535 Len = 0 MSS = 1460 WS = 16
- TSval = 1409022517 TSecr = 0 SACK_PERM = 1
+ 192.168.11.169 202.157.180.190 TCP 78
+ 64161→1443[SYN] Seq = 2421401215 Win = 65535 Len = 0 MSS = 1460 WS = 16
+ TSval = 1409022517 TSecr = 0 SACK_PERM = 1
*/
static const unsigned char pkt_031[78] = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0x9b, /* ........ */
- 0x9c, 0xb2, 0x90, 0x51, 0x08, 0x00, 0x45, 0x00, /* ...Q..E. */
- 0x00, 0x40, 0x74, 0x13, 0x40, 0x00, 0x40, 0x06, /* .@t.@.@. */
- 0x7a, 0xf7, 0xc0, 0xa8, 0x0b, 0xa9, 0xca, 0x9d, /* z....... */
- 0xb4, 0xbe, 0xfa, 0xa1, 0x05, 0xa3, 0x90, 0x53, /* .......S */
- 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x02, /* ........ */
- 0xff, 0xff, 0x66, 0x07, 0x00, 0x00, 0x02, 0x04, /* ..f..... */
- 0x05, 0xb4, 0x01, 0x03, 0x03, 0x04, 0x01, 0x01, /* ........ */
- 0x08, 0x0a, 0x53, 0xfb, 0xfa, 0x35, 0x00, 0x00, /* ..S..5.. */
- 0x00, 0x00, 0x04, 0x02, 0x00, 0x00 /* ...... */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0x9b, /* ........ */
+ 0x9c, 0xb2, 0x90, 0x51, 0x08, 0x00, 0x45, 0x00, /* ...Q..E. */
+ 0x00, 0x40, 0x74, 0x13, 0x40, 0x00, 0x40, 0x06, /* .@t.@.@. */
+ 0x7a, 0xf7, 0xc0, 0xa8, 0x0b, 0xa9, 0xca, 0x9d, /* z....... */
+ 0xb4, 0xbe, 0xfa, 0xa1, 0x05, 0xa3, 0x90, 0x53, /* .......S */
+ 0xa6, 0x7f, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x02, /* ........ */
+ 0xff, 0xff, 0x66, 0x07, 0x00, 0x00, 0x02, 0x04, /* ..f..... */
+ 0x05, 0xb4, 0x01, 0x03, 0x03, 0x04, 0x01, 0x01, /* ........ */
+ 0x08, 0x0a, 0x53, 0xfb, 0xfa, 0x35, 0x00, 0x00, /* ..S..5.. */
+ 0x00, 0x00, 0x04, 0x02, 0x00, 0x00 /* ...... */
};
/* 16 Ether/IPv6/TCP
- 16.124364 3ffe:507:0:1:200:86ff:fe05:80da 3ffe:501:410:0:2c0:dfff:fe47:33e TCP 94
- 1022→22[SYN] Seq = 3598119713 Win = 8192 Len = 0 MSS = 1440 WS = 1 TSval = 576087 TSecr = 0
+ 16.124364 3ffe:507:0:1:200:86ff:fe05:80da 3ffe:501:410:0:2c0:dfff:fe47:33e TCP 94
+ 1022→22[SYN] Seq = 3598119713 Win = 8192 Len = 0 MSS = 1440 WS = 1 TSval = 576087 TSecr = 0
*/
/* Frame (94 bytes) */
static const unsigned char pkt_16[94] = {
- 0x00, 0x60, 0x97, 0x07, 0x69, 0xea, 0x00, 0x00, /* .`..i... */
- 0x86, 0x05, 0x80, 0xda, 0x86, 0xdd, 0x60, 0x00, /* ......`. */
- 0x00, 0x00, 0x00, 0x28, 0x06, 0x40, 0x3f, 0xfe, /* ...(.@?. */
- 0x05, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, /* ........ */
- 0x86, 0xff, 0xfe, 0x05, 0x80, 0xda, 0x3f, 0xfe, /* ......?. */
- 0x05, 0x01, 0x04, 0x10, 0x00, 0x00, 0x02, 0xc0, /* ........ */
- 0xdf, 0xff, 0xfe, 0x47, 0x03, 0x3e, 0x03, 0xfe, /* ...G.>.. */
- 0x00, 0x16, 0xd6, 0x76, 0xf3, 0x21, 0x00, 0x00, /* ...v.!.. */
- 0x00, 0x00, 0xa0, 0x02, 0x20, 0x00, 0x18, 0xd5, /* .... ... */
- 0x00, 0x00, 0x02, 0x04, 0x05, 0xa0, 0x01, 0x03, /* ........ */
- 0x03, 0x00, 0x01, 0x01, 0x08, 0x0a, 0x00, 0x08, /* ........ */
- 0xca, 0x57, 0x00, 0x00, 0x00, 0x00 /* .W.... */
+ 0x00, 0x60, 0x97, 0x07, 0x69, 0xea, 0x00, 0x00, /* .`..i... */
+ 0x86, 0x05, 0x80, 0xda, 0x86, 0xdd, 0x60, 0x00, /* ......`. */
+ 0x00, 0x00, 0x00, 0x28, 0x06, 0x40, 0x3f, 0xfe, /* ...(.@?. */
+ 0x05, 0x07, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, /* ........ */
+ 0x86, 0xff, 0xfe, 0x05, 0x80, 0xda, 0x3f, 0xfe, /* ......?. */
+ 0x05, 0x01, 0x04, 0x10, 0x00, 0x00, 0x02, 0xc0, /* ........ */
+ 0xdf, 0xff, 0xfe, 0x47, 0x03, 0x3e, 0x03, 0xfe, /* ...G.>.. */
+ 0x00, 0x16, 0xd6, 0x76, 0xf3, 0x21, 0x00, 0x00, /* ...v.!.. */
+ 0x00, 0x00, 0xa0, 0x02, 0x20, 0x00, 0x18, 0xd5, /* .... ... */
+ 0x00, 0x00, 0x02, 0x04, 0x05, 0xa0, 0x01, 0x03, /* ........ */
+ 0x03, 0x00, 0x01, 0x01, 0x08, 0x0a, 0x00, 0x08, /* ........ */
+ 0xca, 0x57, 0x00, 0x00, 0x00, 0x00 /* .W.... */
};
-
/*200 Ether/IPv4/IPv6/TCP
- 2001:410:90ff::6 2401:8d00:1::1 TCP 106
- 40527→53[SYN] Seq = 2032252526 Win = 28800 Len = 0 MSS = 1440 SACK_PERM = 1 WS = 128
+ 2001:410:90ff::6 2401:8d00:1::1 TCP 106
+ 40527→53[SYN] Seq = 2032252526 Win = 28800 Len = 0 MSS = 1440 SACK_PERM = 1 WS = 128
*/
/* Frame (106 bytes) */
static const unsigned char pkt_200[106] = {
- 0x2c, 0x6b, 0xf5, 0x45, 0x88, 0x00, 0x5c, 0x5e, /* ,k.E..\^ */
- 0xab, 0x27, 0xa8, 0x00, 0x08, 0x00, 0x45, 0x00, /* .'....E. */
- 0x00, 0x5c, 0x5f, 0x96, 0x00, 0x00, 0xf3, 0x29, /* .\_....) */
- 0xd4, 0x6b, 0xd8, 0x42, 0x54, 0x32, 0x01, 0x08, /* .k.BT2.. */
- 0x65, 0xfa, 0x60, 0x00, 0x00, 0x00, 0x00, 0x20, /* e.`.... */
- 0x06, 0x38, 0x20, 0x01, 0x04, 0x10, 0x90, 0xff, /* .8 ..... */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
- 0x00, 0x06, 0x24, 0x01, 0x8d, 0x00, 0x00, 0x01, /* ..$..... */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
- 0x00, 0x01, 0x9e, 0x4f, 0x00, 0x35, 0x79, 0x21, /* ...O.5y! */
- 0xb6, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, /* .n...... */
- 0x70, 0x80, 0xca, 0x76, 0x00, 0x00, 0x02, 0x04, /* p..v.... */
- 0x05, 0xa0, 0x01, 0x01, 0x04, 0x02, 0x01, 0x03, /* ........ */
- 0x03, 0x07 /* .. */
+ 0x2c, 0x6b, 0xf5, 0x45, 0x88, 0x00, 0x5c, 0x5e, /* ,k.E..\^ */
+ 0xab, 0x27, 0xa8, 0x00, 0x08, 0x00, 0x45, 0x00, /* .'....E. */
+ 0x00, 0x5c, 0x5f, 0x96, 0x00, 0x00, 0xf3, 0x29, /* .\_....) */
+ 0xd4, 0x6b, 0xd8, 0x42, 0x54, 0x32, 0x01, 0x08, /* .k.BT2.. */
+ 0x65, 0xfa, 0x60, 0x00, 0x00, 0x00, 0x00, 0x20, /* e.`.... */
+ 0x06, 0x38, 0x20, 0x01, 0x04, 0x10, 0x90, 0xff, /* .8 ..... */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
+ 0x00, 0x06, 0x24, 0x01, 0x8d, 0x00, 0x00, 0x01, /* ..$..... */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
+ 0x00, 0x01, 0x9e, 0x4f, 0x00, 0x35, 0x79, 0x21, /* ...O.5y! */
+ 0xb6, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, /* .n...... */
+ 0x70, 0x80, 0xca, 0x76, 0x00, 0x00, 0x02, 0x04, /* p..v.... */
+ 0x05, 0xa0, 0x01, 0x01, 0x04, 0x02, 0x01, 0x03, /* ........ */
+ 0x03, 0x07 /* .. */
};
/*
- 30 Ether/IPv4/UDP/DNS
- 192.168.11.169 202.106.0.20 DNS 87 Standard query 0xdf66 A 750cnchannel.digisocial.com
- 51435->53 UDP
+ 30 Ether/IPv4/UDP/DNS
+ 192.168.11.169 202.106.0.20 DNS 87 Standard query 0xdf66 A 750cnchannel.digisocial.com
+ 51435->53 UDP
*/
/* Frame (87 bytes) */
static const unsigned char pkt30[87] = {
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0x9b, /* ........ */
- 0x9c, 0xb2, 0x90, 0x51, 0x08, 0x00, 0x45, 0x00, /* ...Q..E. */
- 0x00, 0x49, 0x24, 0x04, 0x00, 0x00, 0xff, 0x11, /* .I$..... */
- 0x00, 0xd0, 0xc0, 0xa8, 0x0b, 0xa9, 0xca, 0x6a, /* .......j */
- 0x00, 0x14, 0xc8, 0xeb, 0x00, 0x35, 0x00, 0x35, /* .....5.5 */
- 0x02, 0x27, 0xdf, 0x66, 0x01, 0x00, 0x00, 0x01, /* .'.f.... */
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x37, /* .......7 */
- 0x35, 0x30, 0x63, 0x6e, 0x63, 0x68, 0x61, 0x6e, /* 50cnchan */
- 0x6e, 0x65, 0x6c, 0x0a, 0x64, 0x69, 0x67, 0x69, /* nel.digi */
- 0x73, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x03, 0x63, /* social.c */
- 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01 /* om..... */
+ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdc, 0x9b, /* ........ */
+ 0x9c, 0xb2, 0x90, 0x51, 0x08, 0x00, 0x45, 0x00, /* ...Q..E. */
+ 0x00, 0x49, 0x24, 0x04, 0x00, 0x00, 0xff, 0x11, /* .I$..... */
+ 0x00, 0xd0, 0xc0, 0xa8, 0x0b, 0xa9, 0xca, 0x6a, /* .......j */
+ 0x00, 0x14, 0xc8, 0xeb, 0x00, 0x35, 0x00, 0x35, /* .....5.5 */
+ 0x02, 0x27, 0xdf, 0x66, 0x01, 0x00, 0x00, 0x01, /* .'.f.... */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x37, /* .......7 */
+ 0x35, 0x30, 0x63, 0x6e, 0x63, 0x68, 0x61, 0x6e, /* 50cnchan */
+ 0x6e, 0x65, 0x6c, 0x0a, 0x64, 0x69, 0x67, 0x69, /* nel.digi */
+ 0x73, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x03, 0x63, /* social.c */
+ 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01 /* om..... */
};
/* 73 Ether/IPv4/UDP/G-VxLan/Ether/VLAN/IPv4/TCP
-
- Outer IPv4
- 1.1.15.100 10.0.4.120 UDP
- 60014->4789
-
- Inner IPv4
- 125.33.49.137 39.66.162.89 TCP 114
- 28402→11235[ACK] Seq = 2772490367 Ack = 2640082106 Win = 64440 Len = 0
+
+ Outer IPv4
+ 1.1.15.100 10.0.4.120 UDP
+ 60014->4789
+
+ Inner IPv4
+ 125.33.49.137 39.66.162.89 TCP 114
+ 28402→11235[ACK] Seq = 2772490367 Ack = 2640082106 Win = 64440 Len = 0
*/
/* Frame (114 bytes) */
static const unsigned char pkt73[114] = {
- 0xe8, 0x4d, 0xd0, 0xca, 0x3a, 0x1f, 0x58, 0x69, /* .M..:.Xi */
- 0x6c, 0x6f, 0x96, 0xf3, 0x08, 0x00, 0x45, 0x00, /* lo....E. */
- 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x11, /* .d...... */
- 0x9e, 0xac, 0x01, 0x01, 0x0f, 0x64, 0x0a, 0x00, /* .....d.. */
- 0x04, 0x78, 0xea, 0x6e, 0x12, 0xb5, 0x00, 0x50, /* .x.n...P */
- 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x50, /* .......P */
- 0x01, 0x00, 0x64, 0xf6, 0x9d, 0x5f, 0xb9, 0x76, /* ..d.._.v */
- 0xa4, 0x93, 0x4c, 0xc6, 0xe5, 0x5f, 0x81, 0x00, /* ..L.._.. */
- 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, 0x00, 0x28, /* ....E..( */
- 0x59, 0x6f, 0x40, 0x00, 0x7b, 0x06, 0x2e, 0x1b, /* Yo@.{... */
- 0x7d, 0x21, 0x31, 0x89, 0x27, 0x42, 0xa2, 0x59, /* }!1.'B.Y */
- 0x6e, 0xf2, 0x2b, 0xe3, 0xa5, 0x40, 0xd8, 0x7f, /* n.+..@.. */
- 0x9d, 0x5c, 0x74, 0xba, 0x50, 0x10, 0xfb, 0xb8, /* .\t.P... */
- 0x11, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .)...... */
- 0x00, 0x00 /* .. */
+ 0xe8, 0x4d, 0xd0, 0xca, 0x3a, 0x1f, 0x58, 0x69, /* .M..:.Xi */
+ 0x6c, 0x6f, 0x96, 0xf3, 0x08, 0x00, 0x45, 0x00, /* lo....E. */
+ 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0xfd, 0x11, /* .d...... */
+ 0x9e, 0xac, 0x01, 0x01, 0x0f, 0x64, 0x0a, 0x00, /* .....d.. */
+ 0x04, 0x78, 0xea, 0x6e, 0x12, 0xb5, 0x00, 0x50, /* .x.n...P */
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x50, /* .......P */
+ 0x01, 0x00, 0x64, 0xf6, 0x9d, 0x5f, 0xb9, 0x76, /* ..d.._.v */
+ 0xa4, 0x93, 0x4c, 0xc6, 0xe5, 0x5f, 0x81, 0x00, /* ..L.._.. */
+ 0x00, 0x01, 0x08, 0x00, 0x45, 0x00, 0x00, 0x28, /* ....E..( */
+ 0x59, 0x6f, 0x40, 0x00, 0x7b, 0x06, 0x2e, 0x1b, /* Yo@.{... */
+ 0x7d, 0x21, 0x31, 0x89, 0x27, 0x42, 0xa2, 0x59, /* }!1.'B.Y */
+ 0x6e, 0xf2, 0x2b, 0xe3, 0xa5, 0x40, 0xd8, 0x7f, /* n.+..@.. */
+ 0x9d, 0x5c, 0x74, 0xba, 0x50, 0x10, 0xfb, 0xb8, /* .\t.P... */
+ 0x11, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* .)...... */
+ 0x00, 0x00 /* .. */
};
/*47 Ether/IPv4/UDP/G-Vxlan/Cisco HDLC/IPv4/TCP
@@ -131,8 +131,8 @@ static const unsigned char pkt73[114] = {
172.26.127.189->172.26.78.1 UDP
User Datagram Protocol, Src Port: 50909 (50909), Dst Port: 4789 (4789)
- 173.194.31.248 36.149.130.101 TCP 114 I->C
- 443 → 21274[SYN, ACK] Seq = 0 Ack = 1 Win = 28400 Len = 0 MSS = 1432
+ 173.194.31.248 36.149.130.101 TCP 114 I->C
+ 443 → 21274[SYN, ACK] Seq = 0 Ack = 1 Win = 28400 Len = 0 MSS = 1432
SACK_PERM = 1 TSval = 3227044076 TSecr = 33726894 WS = 256 cert_Vxlan
*/
@@ -155,9 +155,9 @@ static const unsigned char pkt47[114] = {
0x03, 0x08 /* .. */
};
-/*
+/*
94 Ether/IPv4/UDP/G-Vxlan/PPP/IPv4/TCP
-
+
Outer IPv4
Internet Protocol Version 4, Src: 172.30.127.188 (172.30.127.188), Dst: NFJD302_V78.9 (172.30.78.9)
User Datagram Protocol, Src Port: 10000 (10000), Dst Port: 4789 (4789)
@@ -271,26 +271,26 @@ User Datagram Protocol, Src Port: 64541, Dst Port: 53
Domain Name System (query)
*/
static const unsigned char pkt_gtp_u_ext_v6_v4[159] = {
-0x74, 0x4a, 0xa4, 0x0e, 0xf5, 0x14, 0xac, 0xb3, /* tJ...... */
-0xb5, 0x40, 0xe9, 0xc3, 0x81, 0x00, 0x41, 0xf8, /* [email protected]. */
-0x86, 0xdd, 0x64, 0x80, 0x00, 0x00, 0x00, 0x65, /* ..d....e */
-0x11, 0xfc, 0x24, 0x09, 0x80, 0x34, 0x40, 0x25, /* ..$..4@% */
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* ........ */
-0x01, 0x71, 0x24, 0x09, 0x80, 0x34, 0x40, 0x40, /* .q$..4@@ */
-0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* S....... */
-0x02, 0x06, 0x08, 0x68, 0x08, 0x68, 0x00, 0x65, /* ...h.h.e */
-0x52, 0x42, 0x36, 0xff, 0x00, 0x55, 0x00, 0x1b, /* RB6..U.. */
-0x5d, 0x7d, 0x02, 0xc1, 0x00, 0x85, 0x01, 0x10, /* ]}...... */
-0x01, 0x00, 0x45, 0x00, 0x00, 0x4d, 0xc2, 0x7f, /* ..E..M.. */
-0x40, 0x00, 0x40, 0x11, 0x5a, 0xd3, 0x0a, 0x19, /* @[email protected]... */
-0xbc, 0xf8, 0x70, 0x05, 0xe6, 0x36, 0xfc, 0x1d, /* ..p..6.. */
-0x00, 0x35, 0x00, 0x39, 0xc2, 0xed, 0x19, 0x9a, /* .5.9.... */
-0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */
-0x00, 0x00, 0x11, 0x70, 0x75, 0x6c, 0x6c, 0x2d, /* ...pull- */
-0x72, 0x74, 0x6d, 0x70, 0x2d, 0x6c, 0x32, 0x36, /* rtmp-l26 */
-0x2d, 0x63, 0x6e, 0x79, 0x09, 0x64, 0x6f, 0x75, /* -cny.dou */
-0x79, 0x69, 0x6e, 0x63, 0x64, 0x6e, 0x03, 0x63, /* yincdn.c */
-0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01 /* om..... */
+ 0x74, 0x4a, 0xa4, 0x0e, 0xf5, 0x14, 0xac, 0xb3, /* tJ...... */
+ 0xb5, 0x40, 0xe9, 0xc3, 0x81, 0x00, 0x41, 0xf8, /* [email protected]. */
+ 0x86, 0xdd, 0x64, 0x80, 0x00, 0x00, 0x00, 0x65, /* ..d....e */
+ 0x11, 0xfc, 0x24, 0x09, 0x80, 0x34, 0x40, 0x25, /* ..$..4@% */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* ........ */
+ 0x01, 0x71, 0x24, 0x09, 0x80, 0x34, 0x40, 0x40, /* .q$..4@@ */
+ 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* S....... */
+ 0x02, 0x06, 0x08, 0x68, 0x08, 0x68, 0x00, 0x65, /* ...h.h.e */
+ 0x52, 0x42, 0x36, 0xff, 0x00, 0x55, 0x00, 0x1b, /* RB6..U.. */
+ 0x5d, 0x7d, 0x02, 0xc1, 0x00, 0x85, 0x01, 0x10, /* ]}...... */
+ 0x01, 0x00, 0x45, 0x00, 0x00, 0x4d, 0xc2, 0x7f, /* ..E..M.. */
+ 0x40, 0x00, 0x40, 0x11, 0x5a, 0xd3, 0x0a, 0x19, /* @[email protected]... */
+ 0xbc, 0xf8, 0x70, 0x05, 0xe6, 0x36, 0xfc, 0x1d, /* ..p..6.. */
+ 0x00, 0x35, 0x00, 0x39, 0xc2, 0xed, 0x19, 0x9a, /* .5.9.... */
+ 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, /* ........ */
+ 0x00, 0x00, 0x11, 0x70, 0x75, 0x6c, 0x6c, 0x2d, /* ...pull- */
+ 0x72, 0x74, 0x6d, 0x70, 0x2d, 0x6c, 0x32, 0x36, /* rtmp-l26 */
+ 0x2d, 0x63, 0x6e, 0x79, 0x09, 0x64, 0x6f, 0x75, /* -cny.dou */
+ 0x79, 0x69, 0x6e, 0x63, 0x64, 0x6e, 0x03, 0x63, /* yincdn.c */
+ 0x6f, 0x6d, 0x00, 0x00, 0x01, 0x00, 0x01 /* om..... */
};
/*
@@ -335,74 +335,85 @@ User Datagram Protocol, Src Port: 53, Dst Port: 36680
Domain Name System (response)
*/
static const unsigned char pkt_gtp_u_ext_v6_v6[174] = {
-0x60, 0xd7, 0x55, 0x62, 0xe5, 0xc0, 0x74, 0x4a, /* `.Ub..tJ */
-0xa4, 0x0e, 0xf5, 0x40, 0x81, 0x00, 0x01, 0xf7, /* ...@.... */
-0x86, 0xdd, 0x60, 0x00, 0x00, 0x00, 0x00, 0x74, /* ..`....t */
-0x11, 0x7f, 0x24, 0x09, 0x80, 0x34, 0x40, 0x40, /* ..$..4@@ */
-0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* S....... */
-0x01, 0x02, 0x24, 0x09, 0x80, 0x34, 0x40, 0x25, /* ..$..4@% */
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* ........ */
-0x00, 0x61, 0x08, 0x68, 0x08, 0x68, 0x00, 0x74, /* .a.h.h.t */
-0x96, 0xc3, 0x34, 0xff, 0x00, 0x64, 0x90, 0x00, /* ..4..d.. */
-0x00, 0xcf, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, /* ........ */
-0x01, 0x00, 0x60, 0x40, 0x00, 0x00, 0x00, 0x34, /* ..`@...4 */
-0x11, 0x38, 0x24, 0x09, 0x80, 0x34, 0x20, 0x00, /* .8$..4 . */
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
-0x00, 0x04, 0x24, 0x09, 0x89, 0x34, 0x44, 0x84, /* ..$..4D. */
-0x12, 0x36, 0x60, 0xa5, 0xd6, 0xff, 0xfe, 0xfc, /* .6`..... */
-0x9c, 0x59, 0x00, 0x35, 0x8f, 0x48, 0x00, 0x34, /* .Y.5.H.4 */
-0x51, 0x52, 0xe2, 0x9f, 0x81, 0x82, 0x00, 0x01, /* QR...... */
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x39, /* .......9 */
-0x39, 0x03, 0x31, 0x38, 0x37, 0x02, 0x34, 0x38, /* 9.187.48 */
-0x03, 0x31, 0x31, 0x32, 0x07, 0x69, 0x6e, 0x2d, /* .112.in- */
-0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, 0x70, /* addr.arp */
-0x61, 0x00, 0x00, 0x0c, 0x00, 0x01 /* a..... */
+ 0x60, 0xd7, 0x55, 0x62, 0xe5, 0xc0, 0x74, 0x4a, /* `.Ub..tJ */
+ 0xa4, 0x0e, 0xf5, 0x40, 0x81, 0x00, 0x01, 0xf7, /* ...@.... */
+ 0x86, 0xdd, 0x60, 0x00, 0x00, 0x00, 0x00, 0x74, /* ..`....t */
+ 0x11, 0x7f, 0x24, 0x09, 0x80, 0x34, 0x40, 0x40, /* ..$..4@@ */
+ 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* S....... */
+ 0x01, 0x02, 0x24, 0x09, 0x80, 0x34, 0x40, 0x25, /* ..$..4@% */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* ........ */
+ 0x00, 0x61, 0x08, 0x68, 0x08, 0x68, 0x00, 0x74, /* .a.h.h.t */
+ 0x96, 0xc3, 0x34, 0xff, 0x00, 0x64, 0x90, 0x00, /* ..4..d.. */
+ 0x00, 0xcf, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, /* ........ */
+ 0x01, 0x00, 0x60, 0x40, 0x00, 0x00, 0x00, 0x34, /* ..`@...4 */
+ 0x11, 0x38, 0x24, 0x09, 0x80, 0x34, 0x20, 0x00, /* .8$..4 . */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
+ 0x00, 0x04, 0x24, 0x09, 0x89, 0x34, 0x44, 0x84, /* ..$..4D. */
+ 0x12, 0x36, 0x60, 0xa5, 0xd6, 0xff, 0xfe, 0xfc, /* .6`..... */
+ 0x9c, 0x59, 0x00, 0x35, 0x8f, 0x48, 0x00, 0x34, /* .Y.5.H.4 */
+ 0x51, 0x52, 0xe2, 0x9f, 0x81, 0x82, 0x00, 0x01, /* QR...... */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x39, /* .......9 */
+ 0x39, 0x03, 0x31, 0x38, 0x37, 0x02, 0x34, 0x38, /* 9.187.48 */
+ 0x03, 0x31, 0x31, 0x32, 0x07, 0x69, 0x6e, 0x2d, /* .112.in- */
+ 0x61, 0x64, 0x64, 0x72, 0x04, 0x61, 0x72, 0x70, /* addr.arp */
+ 0x61, 0x00, 0x00, 0x0c, 0x00, 0x01 /* a..... */
};
-#define TestCheckIPv4Addr(__ptr, __str_src_addr, __str_dst_addr) \
-do { \
- struct rte_ipv4_hdr * _ipv4_hdr = (struct rte_ipv4_hdr *)__ptr; \
- struct in_addr _src_in_addr{}; \
- struct in_addr _dst_in_addr{}; \
- \
- inet_aton(__str_src_addr, &_src_in_addr); \
- inet_aton(__str_dst_addr, &_dst_in_addr); \
- \
- EXPECT_EQ(_ipv4_hdr->src_addr, _src_in_addr.s_addr); \
- EXPECT_EQ(_ipv4_hdr->dst_addr, _dst_in_addr.s_addr); \
- \
-} while(0)
-
-#define TestCheckIPv6Addr(__ptr, __str_src_addr, __str_dst_addr) \
-do { \
- struct rte_ipv6_hdr * _ipv6_hdr = (struct rte_ipv6_hdr *)__ptr; \
- struct in6_addr _src_in6_addr{}; \
- struct in6_addr _dst_in6_addr{}; \
- \
- inet_pton(AF_INET6, __str_src_addr, &_src_in6_addr); \
- inet_pton(AF_INET6, __str_dst_addr, &_dst_in6_addr); \
- \
- EXPECT_TRUE(IN6_ARE_ADDR_EQUAL(_ipv6_hdr->src_addr, &_src_in6_addr)); \
- EXPECT_TRUE(IN6_ARE_ADDR_EQUAL(_ipv6_hdr->dst_addr, &_dst_in6_addr)); \
- \
-} while(0)
-
-#define TestCheckTCPPort(__ptr, __s_port, __d_port) \
-do { \
- struct rte_tcp_hdr * _tcp_hdr = (struct rte_tcp_hdr *)__ptr; \
- EXPECT_EQ(_tcp_hdr->src_port, ntohs(__s_port)); \
- EXPECT_EQ(_tcp_hdr->dst_port, ntohs(__d_port)); \
-} while(0)
-
-#define TestCheckUDPPort(__ptr, __s_port, __d_port) \
-do { \
- struct rte_udp_hdr * _udp_hdr = (struct rte_udp_hdr *)__ptr; \
- EXPECT_EQ(_udp_hdr->src_port, ntohs(__s_port)); \
- EXPECT_EQ(_udp_hdr->dst_port, ntohs(__d_port)); \
-} while(0)
-
-
-#define TO_PKT_PARSER_RESULT(_handler) (&_handler.result)
+#define TestCheckIPv4Addr(__ptr, __str_src_addr, __str_dst_addr) \
+ do \
+ { \
+ struct rte_ipv4_hdr * _ipv4_hdr = (struct rte_ipv4_hdr *)__ptr; \
+ struct in_addr _src_in_addr \
+ { \
+ }; \
+ struct in_addr _dst_in_addr \
+ { \
+ }; \
+ \
+ inet_aton(__str_src_addr, &_src_in_addr); \
+ inet_aton(__str_dst_addr, &_dst_in_addr); \
+ \
+ EXPECT_EQ(_ipv4_hdr->src_addr, _src_in_addr.s_addr); \
+ EXPECT_EQ(_ipv4_hdr->dst_addr, _dst_in_addr.s_addr); \
+ \
+ } while (0)
+
+#define TestCheckIPv6Addr(__ptr, __str_src_addr, __str_dst_addr) \
+ do \
+ { \
+ struct rte_ipv6_hdr * _ipv6_hdr = (struct rte_ipv6_hdr *)__ptr; \
+ struct in6_addr _src_in6_addr \
+ { \
+ }; \
+ struct in6_addr _dst_in6_addr \
+ { \
+ }; \
+ \
+ inet_pton(AF_INET6, __str_src_addr, &_src_in6_addr); \
+ inet_pton(AF_INET6, __str_dst_addr, &_dst_in6_addr); \
+ \
+ EXPECT_TRUE(IN6_ARE_ADDR_EQUAL(_ipv6_hdr->src_addr, &_src_in6_addr)); \
+ EXPECT_TRUE(IN6_ARE_ADDR_EQUAL(_ipv6_hdr->dst_addr, &_dst_in6_addr)); \
+ \
+ } while (0)
+
+#define TestCheckTCPPort(__ptr, __s_port, __d_port) \
+ do \
+ { \
+ struct rte_tcp_hdr * _tcp_hdr = (struct rte_tcp_hdr *)__ptr; \
+ EXPECT_EQ(_tcp_hdr->src_port, ntohs(__s_port)); \
+ EXPECT_EQ(_tcp_hdr->dst_port, ntohs(__d_port)); \
+ } while (0)
+
+#define TestCheckUDPPort(__ptr, __s_port, __d_port) \
+ do \
+ { \
+ struct rte_udp_hdr * _udp_hdr = (struct rte_udp_hdr *)__ptr; \
+ EXPECT_EQ(_udp_hdr->src_port, ntohs(__s_port)); \
+ EXPECT_EQ(_udp_hdr->dst_port, ntohs(__d_port)); \
+ } while (0)
+
+#define TO_PKT_PARSER_RESULT(_handler) (&_handler.result)
std::unique_ptr<struct rte_mbuf> mock_rte_mbuf_create(const char * pkt, unsigned int pktlen)
{
@@ -538,7 +549,7 @@ TEST(PacketParseOuterL4, EtherIPv4UDP)
TEST(PacketParseInnerL3, EtherIPv4UDPVxlanEther)
{
- struct pkt_parser _pkt_73_handler;
+ struct pkt_parser _pkt_73_handler;
struct pkt_parser_result _pkt_73_result;
auto mock_mbuf_ptr = mock_rte_mbuf_create((const char *)pkt73, sizeof(pkt73));
@@ -549,25 +560,25 @@ TEST(PacketParseInnerL3, EtherIPv4UDPVxlanEther)
EXPECT_EQ(parser_result->nr_layers, 2);
/* ---------------------------------------------------------------------- */
- struct pkt_layer_result * layer_result = &parser_result->layers[0];
- EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
- EXPECT_TRUE(layer_result->offset != 0);
+ struct pkt_layer_result * layer_result = &parser_result->layers[0];
+ EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
+ EXPECT_TRUE(layer_result->offset != 0);
void * layer_data = RTE_PTR_ADD(pkt73, layer_result->offset);
- TestCheckIPv4Addr(layer_data, "1.1.15.100", "10.0.4.120");
+ TestCheckIPv4Addr(layer_data, "1.1.15.100", "10.0.4.120");
/* ---------------------------------------------------------------------- */
layer_result = &parser_result->layers[1];
- EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
- EXPECT_TRUE(layer_result->offset != 0);
+ EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
+ EXPECT_TRUE(layer_result->offset != 0);
layer_data = RTE_PTR_ADD(pkt73, layer_result->offset);
- TestCheckIPv4Addr(layer_data, "125.33.49.137", "39.66.162.89");
+ TestCheckIPv4Addr(layer_data, "125.33.49.137", "39.66.162.89");
}
TEST(PacketParseInnerL4, EtherIPv4UDPVxlanEther)
{
- struct pkt_parser _pkt_73_handler;
+ struct pkt_parser _pkt_73_handler;
struct pkt_parser_result _pkt_73_result;
auto mock_mbuf_ptr = mock_rte_mbuf_create((const char *)pkt73, sizeof(pkt73));
@@ -578,20 +589,20 @@ TEST(PacketParseInnerL4, EtherIPv4UDPVxlanEther)
EXPECT_EQ(parser_result->nr_layers, 2);
/* ---------------------------------------------------------------------- */
- struct pkt_layer_result * layer_result = &parser_result->layers[0];
- EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_UDP);
- EXPECT_TRUE(layer_result->offset != 0);
+ struct pkt_layer_result * layer_result = &parser_result->layers[0];
+ EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_UDP);
+ EXPECT_TRUE(layer_result->offset != 0);
void * layer_data = RTE_PTR_ADD(pkt73, layer_result->offset);
- TestCheckUDPPort(layer_data, 60014, 4789);
+ TestCheckUDPPort(layer_data, 60014, 4789);
/* ---------------------------------------------------------------------- */
layer_result = &parser_result->layers[1];
- EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_TCP);
- EXPECT_TRUE(layer_result->offset != 0);
+ EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_TCP);
+ EXPECT_TRUE(layer_result->offset != 0);
layer_data = RTE_PTR_ADD(pkt73, layer_result->offset);
- TestCheckTCPPort(layer_data, 28402, 11235);
+ TestCheckTCPPort(layer_data, 28402, 11235);
}
TEST(PacketParseInnerL3, EtherIPv4UDPVxlanCHDLC)
@@ -710,7 +721,6 @@ TEST(PacketParserInnerL4, EtherIPv4UDPVxlanPPP)
TestCheckTCPPort(layer_data, 443, 18470);
}
-
/* Frame (111 bytes)
*
* Internet Protocol Version 4, Src: 10.7.84.136, Dst: 2.78.63.108
@@ -718,25 +728,25 @@ TEST(PacketParserInnerL4, EtherIPv4UDPVxlanPPP)
* GTP <GQUIC> 111 40565 → 443 Len=29, PKN: 73, CID: 10917641376885890260
*/
static const unsigned char pkt83[111] = {
- 0x18, 0x10, 0x04, 0x00, 0x03, 0x26, 0x00, 0x00, /* .....&.. */
- 0x00, 0x00, 0x04, 0x25, 0x88, 0x47, 0x10, 0x03, /* ...%.G.. */
- 0xfb, 0x3d, 0x45, 0xb8, 0x00, 0x5d, 0x7b, 0x75, /* .=E..]{u */
- 0x00, 0x00, 0x3e, 0x11, 0x60, 0x1a, 0x0a, 0x07, /* ..>.`... */
- 0x54, 0x88, 0x02, 0x4e, 0x3f, 0x6c, 0x22, 0x3c, /* T..N?l"< */
- 0x08, 0x68, 0x00, 0x49, 0x04, 0x70, 0x30, 0xff, /* .h.I.p0. */
- 0x00, 0x39, 0x25, 0x10, 0xe0, 0x50, 0x45, 0x00, /* .9%..PE. */
- 0x00, 0x39, 0x0e, 0xda, 0x40, 0x00, 0x40, 0x11, /* .9..@.@. */
- 0x25, 0x77, 0x64, 0x50, 0x71, 0xf9, 0x02, 0x4e, /* %wdPq..N */
- 0x2d, 0xcc, 0x9e, 0x75, 0x01, 0xbb, 0x00, 0x25, /* -..u...% */
- 0x56, 0xfa, 0x0c, 0xd4, 0xdc, 0x63, 0xf6, 0xfc, /* V....c.. */
- 0x40, 0x83, 0x97, 0x49, 0xea, 0x93, 0x91, 0x0b, /* @..I.... */
- 0xd1, 0x87, 0xeb, 0x48, 0xa5, 0xf4, 0x25, 0xb5, /* ...H..%. */
- 0x32, 0x26, 0x05, 0x4d, 0x8f, 0x86, 0x7f /* 2&.M... */
+ 0x18, 0x10, 0x04, 0x00, 0x03, 0x26, 0x00, 0x00, /* .....&.. */
+ 0x00, 0x00, 0x04, 0x25, 0x88, 0x47, 0x10, 0x03, /* ...%.G.. */
+ 0xfb, 0x3d, 0x45, 0xb8, 0x00, 0x5d, 0x7b, 0x75, /* .=E..]{u */
+ 0x00, 0x00, 0x3e, 0x11, 0x60, 0x1a, 0x0a, 0x07, /* ..>.`... */
+ 0x54, 0x88, 0x02, 0x4e, 0x3f, 0x6c, 0x22, 0x3c, /* T..N?l"< */
+ 0x08, 0x68, 0x00, 0x49, 0x04, 0x70, 0x30, 0xff, /* .h.I.p0. */
+ 0x00, 0x39, 0x25, 0x10, 0xe0, 0x50, 0x45, 0x00, /* .9%..PE. */
+ 0x00, 0x39, 0x0e, 0xda, 0x40, 0x00, 0x40, 0x11, /* .9..@.@. */
+ 0x25, 0x77, 0x64, 0x50, 0x71, 0xf9, 0x02, 0x4e, /* %wdPq..N */
+ 0x2d, 0xcc, 0x9e, 0x75, 0x01, 0xbb, 0x00, 0x25, /* -..u...% */
+ 0x56, 0xfa, 0x0c, 0xd4, 0xdc, 0x63, 0xf6, 0xfc, /* V....c.. */
+ 0x40, 0x83, 0x97, 0x49, 0xea, 0x93, 0x91, 0x0b, /* @..I.... */
+ 0xd1, 0x87, 0xeb, 0x48, 0xa5, 0xf4, 0x25, 0xb5, /* ...H..%. */
+ 0x32, 0x26, 0x05, 0x4d, 0x8f, 0x86, 0x7f /* 2&.M... */
};
TEST(PacketParseInnerL3, EtherIPv4UDPGTPv1)
{
- struct pkt_parser _pkt_83_handler;
+ struct pkt_parser _pkt_83_handler;
struct pkt_parser_result _pkt_83_result;
auto mock_mbuf_ptr = mock_rte_mbuf_create((const char *)pkt83, sizeof(pkt83));
@@ -747,20 +757,20 @@ TEST(PacketParseInnerL3, EtherIPv4UDPGTPv1)
EXPECT_EQ(parser_result->nr_layers, 2);
/* ----------------------------------------------------------------------- */
- struct pkt_layer_result * layer_result = &parser_result->layers[0];
- EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
- EXPECT_TRUE(layer_result->offset != 0);
+ struct pkt_layer_result * layer_result = &parser_result->layers[0];
+ EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
+ EXPECT_TRUE(layer_result->offset != 0);
void * layer_data = RTE_PTR_ADD(pkt83, layer_result->offset);
- TestCheckIPv4Addr(layer_data, "10.7.84.136", "2.78.63.108");
+ TestCheckIPv4Addr(layer_data, "10.7.84.136", "2.78.63.108");
/* ----------------------------------------------------------------------- */
layer_result = &parser_result->layers[1];
- EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
- EXPECT_TRUE(layer_result->offset != 0);
+ EXPECT_EQ(layer_result->type_id, LAYER_TYPE_ID_IPV4);
+ EXPECT_TRUE(layer_result->offset != 0);
layer_data = RTE_PTR_ADD(pkt83, layer_result->offset);
- TestCheckIPv4Addr(layer_data, "100.80.113.249", "2.78.45.204");
+ TestCheckIPv4Addr(layer_data, "100.80.113.249", "2.78.45.204");
}
TEST(PacketParseInnerL3, EtherIPv6UDPGTPv1EXTIPv4)
@@ -821,7 +831,7 @@ TEST(PacketParseInnerL3, EtherIPv6UDPGTPv1EXTIPv6)
TestCheckIPv6Addr(layer_data, "2409:8034:2000::4", "2409:8934:4484:1236:60a5:d6ff:fefc:9c59");
}
-/*
+/*
Frame 33857: 318 bytes on wire (2544 bits), 318 bytes captured (2544 bits)
Ethernet II, Src: 0a:0a:0a:0a:00:10 (0a:0a:0a:0a:00:10), Dst: 90:00:00:91:40:46 (90:00:00:91:40:46)
Internet Protocol Version 4, Src: 10.10.0.16, Dst: 10.252.22.1
@@ -837,46 +847,46 @@ TEST(PacketParseInnerL3, EtherIPv6UDPGTPv1EXTIPv6)
Transport Layer Security
*/
static const unsigned char _pkt_gtp_u_over_vxlan_tls_1[318] = {
-0x90, 0x00, 0x00, 0x91, 0x40, 0x46, 0x0a, 0x0a, /* ....@F.. */
-0x0a, 0x0a, 0x00, 0x10, 0x08, 0x00, 0x45, 0x00, /* ......E. */
-0x01, 0x30, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, /* .0..@.@. */
-0x0e, 0xa7, 0x0a, 0x0a, 0x00, 0x10, 0x0a, 0xfc, /* ........ */
-0x16, 0x01, 0xea, 0x97, 0x12, 0xb5, 0x01, 0x1c, /* ........ */
-0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
-0x39, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 9....... */
-0x10, 0x51, 0x72, 0x2a, 0xdc, 0x03, 0x81, 0x00, /* .Qr*.... */
-0x02, 0x58, 0x08, 0x00, 0x45, 0x00, 0x00, 0xfa, /* .X..E... */
-0xde, 0x40, 0x00, 0x00, 0x3d, 0x11, 0xfa, 0x9c, /* .@..=... */
-0x0a, 0xca, 0x00, 0x4a, 0x0a, 0xfe, 0x8e, 0x04, /* ...J.... */
-0x08, 0x68, 0x08, 0x68, 0x00, 0xe6, 0x00, 0x00, /* .h.h.... */
-0x30, 0xff, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x8d, /* 0....... */
-0x45, 0x00, 0x00, 0xd6, 0x8d, 0x70, 0x00, 0x00, /* E....p.. */
-0x39, 0x06, 0x51, 0x76, 0xd8, 0x3a, 0xd1, 0x84, /* 9.Qv.:.. */
-0x0a, 0x3b, 0xee, 0x41, 0x01, 0xbb, 0x93, 0x52, /* .;.A...R */
-0xed, 0xc0, 0xfd, 0x50, 0x97, 0x79, 0xf8, 0x1f, /* ...P.y.. */
-0x80, 0x19, 0x01, 0x05, 0xf7, 0x13, 0x00, 0x00, /* ........ */
-0x01, 0x01, 0x08, 0x0a, 0x77, 0xe8, 0x07, 0x3f, /* ....w..? */
-0x00, 0x22, 0xac, 0xc2, 0x16, 0x03, 0x03, 0x00, /* ."...... */
-0x6a, 0x02, 0x00, 0x00, 0x66, 0x03, 0x03, 0x61, /* j...f..a */
-0x92, 0x5a, 0x25, 0x9c, 0xf5, 0x72, 0xba, 0x26, /* .Z%..r.& */
-0x90, 0xdd, 0xb7, 0xdb, 0x28, 0xad, 0xb3, 0xc7, /* ....(... */
-0x84, 0xd1, 0xac, 0x58, 0x44, 0x46, 0x51, 0x44, /* ...XDFQD */
-0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x01, 0x20, /* OWNGRD. */
-0xca, 0xcb, 0x30, 0xe4, 0x4a, 0x36, 0x14, 0x93, /* ..0.J6.. */
-0x1e, 0x53, 0x67, 0xa6, 0xa2, 0xc7, 0x94, 0xca, /* .Sg..... */
-0x41, 0xd7, 0x05, 0xf9, 0xed, 0x97, 0xcc, 0x8b, /* A....... */
-0xb5, 0x66, 0xbe, 0x9f, 0x54, 0x7f, 0xdd, 0x5e, /* .f..T..^ */
-0xc0, 0x2b, 0x00, 0x00, 0x1e, 0x00, 0x17, 0x00, /* .+...... */
-0x00, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x0b, /* ........ */
-0x00, 0x02, 0x01, 0x00, 0x00, 0x10, 0x00, 0x0b, /* ........ */
-0x00, 0x09, 0x08, 0x68, 0x74, 0x74, 0x70, 0x2f, /* ...http/ */
-0x31, 0x2e, 0x31, 0x14, 0x03, 0x03, 0x00, 0x01, /* 1.1..... */
-0x01, 0x16, 0x03, 0x03, 0x00, 0x28, 0x00, 0x00, /* .....(.. */
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3d, /* ......>= */
-0x1c, 0x7f, 0xe0, 0xdd, 0x4e, 0x13, 0x81, 0xd5, /* ....N... */
-0x78, 0xc8, 0x3c, 0xe6, 0x6d, 0xa6, 0xfe, 0xbf, /* x.<.m... */
-0x00, 0x02, 0xb0, 0x6c, 0xd7, 0x76, 0xa4, 0x30, /* ...l.v.0 */
-0x16, 0xf7, 0xb1, 0x51, 0x3d, 0x54 /* ...Q=T */
+ 0x90, 0x00, 0x00, 0x91, 0x40, 0x46, 0x0a, 0x0a, /* ....@F.. */
+ 0x0a, 0x0a, 0x00, 0x10, 0x08, 0x00, 0x45, 0x00, /* ......E. */
+ 0x01, 0x30, 0x00, 0x00, 0x40, 0x00, 0x40, 0x11, /* .0..@.@. */
+ 0x0e, 0xa7, 0x0a, 0x0a, 0x00, 0x10, 0x0a, 0xfc, /* ........ */
+ 0x16, 0x01, 0xea, 0x97, 0x12, 0xb5, 0x01, 0x1c, /* ........ */
+ 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, /* ........ */
+ 0x39, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 9....... */
+ 0x10, 0x51, 0x72, 0x2a, 0xdc, 0x03, 0x81, 0x00, /* .Qr*.... */
+ 0x02, 0x58, 0x08, 0x00, 0x45, 0x00, 0x00, 0xfa, /* .X..E... */
+ 0xde, 0x40, 0x00, 0x00, 0x3d, 0x11, 0xfa, 0x9c, /* .@..=... */
+ 0x0a, 0xca, 0x00, 0x4a, 0x0a, 0xfe, 0x8e, 0x04, /* ...J.... */
+ 0x08, 0x68, 0x08, 0x68, 0x00, 0xe6, 0x00, 0x00, /* .h.h.... */
+ 0x30, 0xff, 0x00, 0xd6, 0x00, 0x00, 0x00, 0x8d, /* 0....... */
+ 0x45, 0x00, 0x00, 0xd6, 0x8d, 0x70, 0x00, 0x00, /* E....p.. */
+ 0x39, 0x06, 0x51, 0x76, 0xd8, 0x3a, 0xd1, 0x84, /* 9.Qv.:.. */
+ 0x0a, 0x3b, 0xee, 0x41, 0x01, 0xbb, 0x93, 0x52, /* .;.A...R */
+ 0xed, 0xc0, 0xfd, 0x50, 0x97, 0x79, 0xf8, 0x1f, /* ...P.y.. */
+ 0x80, 0x19, 0x01, 0x05, 0xf7, 0x13, 0x00, 0x00, /* ........ */
+ 0x01, 0x01, 0x08, 0x0a, 0x77, 0xe8, 0x07, 0x3f, /* ....w..? */
+ 0x00, 0x22, 0xac, 0xc2, 0x16, 0x03, 0x03, 0x00, /* ."...... */
+ 0x6a, 0x02, 0x00, 0x00, 0x66, 0x03, 0x03, 0x61, /* j...f..a */
+ 0x92, 0x5a, 0x25, 0x9c, 0xf5, 0x72, 0xba, 0x26, /* .Z%..r.& */
+ 0x90, 0xdd, 0xb7, 0xdb, 0x28, 0xad, 0xb3, 0xc7, /* ....(... */
+ 0x84, 0xd1, 0xac, 0x58, 0x44, 0x46, 0x51, 0x44, /* ...XDFQD */
+ 0x4f, 0x57, 0x4e, 0x47, 0x52, 0x44, 0x01, 0x20, /* OWNGRD. */
+ 0xca, 0xcb, 0x30, 0xe4, 0x4a, 0x36, 0x14, 0x93, /* ..0.J6.. */
+ 0x1e, 0x53, 0x67, 0xa6, 0xa2, 0xc7, 0x94, 0xca, /* .Sg..... */
+ 0x41, 0xd7, 0x05, 0xf9, 0xed, 0x97, 0xcc, 0x8b, /* A....... */
+ 0xb5, 0x66, 0xbe, 0x9f, 0x54, 0x7f, 0xdd, 0x5e, /* .f..T..^ */
+ 0xc0, 0x2b, 0x00, 0x00, 0x1e, 0x00, 0x17, 0x00, /* .+...... */
+ 0x00, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x0b, /* ........ */
+ 0x00, 0x02, 0x01, 0x00, 0x00, 0x10, 0x00, 0x0b, /* ........ */
+ 0x00, 0x09, 0x08, 0x68, 0x74, 0x74, 0x70, 0x2f, /* ...http/ */
+ 0x31, 0x2e, 0x31, 0x14, 0x03, 0x03, 0x00, 0x01, /* 1.1..... */
+ 0x01, 0x16, 0x03, 0x03, 0x00, 0x28, 0x00, 0x00, /* .....(.. */
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x3d, /* ......>= */
+ 0x1c, 0x7f, 0xe0, 0xdd, 0x4e, 0x13, 0x81, 0xd5, /* ....N... */
+ 0x78, 0xc8, 0x3c, 0xe6, 0x6d, 0xa6, 0xfe, 0xbf, /* x.<.m... */
+ 0x00, 0x02, 0xb0, 0x6c, 0xd7, 0x76, 0xa4, 0x30, /* ...l.v.0 */
+ 0x16, 0xf7, 0xb1, 0x51, 0x3d, 0x54 /* ...Q=T */
};
TEST(PacketParseOuterL3, EtherVxlanGTPIPv4TCP)
@@ -884,7 +894,8 @@ TEST(PacketParseOuterL3, EtherVxlanGTPIPv4TCP)
struct pkt_parser _pkt_gtp_u_over_vxlan_tls_1_handler;
struct pkt_parser_result _pkt_gtp_u_over_vxlan_tls_1_result;
- auto mock_mbuf_ptr = mock_rte_mbuf_create((const char *)_pkt_gtp_u_over_vxlan_tls_1, sizeof(_pkt_gtp_u_over_vxlan_tls_1));
+ auto mock_mbuf_ptr =
+ mock_rte_mbuf_create((const char *)_pkt_gtp_u_over_vxlan_tls_1, sizeof(_pkt_gtp_u_over_vxlan_tls_1));
pkt_parser_init(&_pkt_gtp_u_over_vxlan_tls_1_handler, &_pkt_gtp_u_over_vxlan_tls_1_result, LAYER_TYPE_L3, 1);
pkt_parser_exec(&_pkt_gtp_u_over_vxlan_tls_1_handler, mock_mbuf_ptr.get());
@@ -904,7 +915,8 @@ TEST(PacketParseInnerL3, EtherVxlanGTPIPv4TCP)
struct pkt_parser _pkt_gtp_u_over_vxlan_tls_1_handler;
struct pkt_parser_result _pkt_gtp_u_over_vxlan_tls_1_result;
- auto mock_mbuf_ptr = mock_rte_mbuf_create((const char *)_pkt_gtp_u_over_vxlan_tls_1, sizeof(_pkt_gtp_u_over_vxlan_tls_1));
+ auto mock_mbuf_ptr =
+ mock_rte_mbuf_create((const char *)_pkt_gtp_u_over_vxlan_tls_1, sizeof(_pkt_gtp_u_over_vxlan_tls_1));
pkt_parser_init(&_pkt_gtp_u_over_vxlan_tls_1_handler, &_pkt_gtp_u_over_vxlan_tls_1_result, LAYER_TYPE_L3, 4);
pkt_parser_exec(&_pkt_gtp_u_over_vxlan_tls_1_handler, mock_mbuf_ptr.get());
@@ -936,7 +948,6 @@ TEST(PacketParseInnerL3, EtherVxlanGTPIPv4TCP)
TestCheckIPv4Addr(layer_data, "216.58.209.132", "10.59.238.65");
}
-
/*
* 1599 04:11:59.446706 85.202.75.36 103.153.116.110 DNS 1029
* Standard query response 0x4567 ANY aoc.gov DNSKEY DNSKEY DNSKEY DNSKEY