Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GTPv2 layer #1634

Merged
merged 11 commits into from
Nov 9, 2024
Merged

Add GTPv2 layer #1634

merged 11 commits into from
Nov 9, 2024

Conversation

seladb
Copy link
Owner

@seladb seladb commented Nov 5, 2024

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 95.82278% with 33 lines in your changes missing coverage. Please review.

Project coverage is 83.34%. Comparing base (eaf6133) to head (4eb20a9).
Report is 5 commits behind head on dev.

Files with missing lines Patch % Lines
Packet++/src/GtpLayer.cpp 93.93% 30 Missing and 1 partial ⚠️
Packet++/header/GtpLayer.h 96.77% 0 Missing and 1 partial ⚠️
Tests/Packet++Test/Tests/GtpTests.cpp 99.56% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1634      +/-   ##
==========================================
+ Coverage   83.14%   83.34%   +0.20%     
==========================================
  Files         276      276              
  Lines       47315    48086     +771     
  Branches     9528     9686     +158     
==========================================
+ Hits        39339    40078     +739     
- Misses       7089     7115      +26     
- Partials      887      893       +6     
Flag Coverage Δ
fedora40 75.38% <86.06%> (+0.13%) ⬆️
macos-13 80.86% <91.49%> (+0.18%) ⬆️
macos-14 80.86% <91.49%> (+0.18%) ⬆️
macos-15 80.83% <91.49%> (+0.18%) ⬆️
mingw32 70.92% <73.87%> (+0.06%) ⬆️
mingw64 70.88% <73.42%> (+0.06%) ⬆️
npcap 85.31% <90.74%> (+0.10%) ⬆️
rhel94 75.24% <86.64%> (+0.16%) ⬆️
ubuntu2004 58.75% <67.21%> (+0.08%) ⬆️
ubuntu2004-zstd 58.89% <67.21%> (+0.10%) ⬆️
ubuntu2204 75.19% <86.52%> (+0.16%) ⬆️
ubuntu2204-icpx 61.41% <57.86%> (-0.12%) ⬇️
ubuntu2404 75.42% <86.20%> (+0.14%) ⬆️
unittest 83.34% <95.82%> (+0.20%) ⬆️
windows-2019 85.34% <90.74%> (+0.10%) ⬆️
windows-2022 85.36% <90.74%> (+0.10%) ⬆️
winpcap 85.32% <90.74%> (+0.10%) ⬆️
xdp 50.64% <86.52%> (+0.42%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seladb seladb changed the title DRAFT - Add GTPv2 layer Add GTPv2 layer Nov 6, 2024
@seladb seladb linked an issue Nov 6, 2024 that may be closed by this pull request
@seladb seladb marked this pull request as ready for review November 6, 2024 07:25
Packet++/src/GtpLayer.cpp Outdated Show resolved Hide resolved
Packet++/src/GtpLayer.cpp Outdated Show resolved Hide resolved
}

auto teidOffset = sizeof(gtpv2_basic_header);
if (!shortenLayer(static_cast<int>(teidOffset), sizeof(uint32_t)))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (!shortenLayer(static_cast<uint32_t>(teidOffset), sizeof(uint32_t)))?

Copy link
Owner Author

@seladb seladb Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I thought the first and the second arguments should be the same types.


// clang-format off
auto expectedIEValues = std::vector<std::tuple<pcpp::GtpV2InformationElement::Type, size_t, size_t, uint8_t, uint8_t, uint8_t, uint8_t>> {
std::tuple<pcpp::GtpV2InformationElement::Type, size_t, size_t, uint8_t, uint8_t, uint8_t, uint8_t>{ pcpp::GtpV2InformationElement::Type::Uli, 17, 13, 0, 0, 0x18, 0x64 },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider giveing this std::tuple<pcpp::GtpV2InformationElement::Type, size_t, size_t, uint8_t, uint8_t, uint8_t, uint8_t> a shorthand.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4f24ebd

Packet++/src/GtpLayer.cpp Outdated Show resolved Hide resolved
Packet++/src/GtpLayer.cpp Outdated Show resolved Hide resolved
Packet++/src/GtpLayer.cpp Outdated Show resolved Hide resolved
@seladb
Copy link
Owner Author

seladb commented Nov 8, 2024

@tigercosmos do you want to re-review the PR before I merge it? Or should I go ahead and merge?

@tigercosmos tigercosmos merged commit 573effc into dev Nov 9, 2024
41 checks passed
@tigercosmos tigercosmos deleted the gtpv2 branch November 9, 2024 08:00
@seladb seladb mentioned this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GTPv2 Support
3 participants