-
Notifications
You must be signed in to change notification settings - Fork 673
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
Porting HttpAnalyzer to C++11 #1196
Conversation
@jpcofr thank you for working on this!
You can find more details here on how to run the tests, what I think you're missing is run it from seladb@seladb:~/PcapPlusPlus/Tests/Packet++Test$ Bin/Packet++Test Let me know if it works now...
Unfortunately there is no code prettifier we're using at the moment (definitely a TODO for us), just make sure you're using the same conventions like tabs and not spaces,
The HTTPAnalyzer already has tests here: https://github.com/seladb/PcapPlusPlus/blob/master/Tests/ExamplesTest/tests/test_httpanalyzer.py These is part of a python test suite that runs most of the examples in different scenarios and tests them. Since this PR shouldn't add functionality, I think once the existing tests pass we should be good to merge
I'd like to avoid 3rd party libraries as much as possible, although we might consider using
This is the documentation for the latest release 22.11 which has a custom build system. Since then we moved to CMake which is more standard. But we haven't released a new version yet, so if you want to look at the documentation for the next release you should switch from "22.11" to "Next" version: Here is the link to the page you mentioned specifically: https://pcapplusplus.github.io/docs/next/install/macos
You may be right, let me take a look... |
@jpcofr please notice CI fails, can you please fix the compilation issues? |
Right now I cannot prioritise fixing the CI issue. Is it ok if I close the pull request and reopen it when I can spend some time on this PR? @seladb |
d12f5c3
to
c94f695
Compare
Codecov Report
@@ Coverage Diff @@
## dev #1196 +/- ##
==========================================
+ Coverage 82.64% 82.65% +0.01%
==========================================
Files 157 157
Lines 20180 20180
Branches 7624 7620 -4
==========================================
+ Hits 16677 16680 +3
+ Misses 2883 2876 -7
- Partials 620 624 +4
Flags with carried forward coverage won't be shown. Click here to find out more. |
4724c40
to
5b4e058
Compare
Tests/ExamplesTest/expected_output/httpanalyzer_manyprotocols.txt
Outdated
Show resolved
Hide resolved
@seladb Is it possible to execute all targets without needing to push them to GitHub? It was quite cumbersome to debug all the targets, especially after extended wait times for the CI to complete. |
0c5733f
to
4c76009
Compare
@jpcofr by all targets do you mean all platforms? |
@seladb Yes, by 'target' I meant platform. I can test locally but I noticed that other platforms in the CI pipeline have more strict (or simply different) code checking styles. It was time consuming to debug for all of these given that the compilation time takes ~20 min. |
89faa0b
to
8da31bf
Compare
Yes, I agree it's not always easy to write multi-platform code, but being multi-platform is one of the big "selling points" of this project and we get a lot of good feedback about it |
@jpcofr something is wrong because this PR contains a lot of changes that were done in previous PRs. Can you rebase your branch on top of |
e36e2f6
to
3721483
Compare
I branched from master instead of dev. I rebased the PR onto dev in this PR, still my fork's branch was not rebased. I think it is ok now... |
Tests/ExamplesTest/expected_output/httpanalyzer_manyprotocols.txt
Outdated
Show resolved
Hide resolved
Other: Updates to the documentation Ported HttpAnalyzer to C++11 Other: Updates to the documentation
89321cd
to
2f4de3e
Compare
Other: Updates to the documentation Ported HttpAnalyzer to C++11 Other: Updates to the documentation
... first criterion is 'count', then, the second criterion 'hostname'
the amount of packets
to this branch.
2f4de3e
to
c71894a
Compare
Apologies for the mess in this PR, I'm more used to Gerrit and the CI in my 8-to-5 to squash automatically etc. I created a squashed version of the changes in my fork under: dev_port_C11_HttpAnalizer_squashed. If you want I can request a PR for that and drop this one. I do think nothing worthy will be lost because most of the changes are meaningless... |
No worries at all! We can leave this PR as is because we merge PRs using "squash and merge" so these changes will eventually become 1 git commit after the merge |
@seladb This is still work in progress.
Comments
I tested HttpAnalyzer using an small HTTP trace from Packet Life, it seems to work fine.
While I did changes for the std::map, the only correctness tests I performed were to compile and execute a manual test with a small trace.
PcapPlusPlus/Tests/Packet++Test/Bin/Packet++Test
compiles correctly but fails in my machine.I believe that I am using a different OS version so I may need even to uplift this project to support my OS version if I want to run the tests.
I need some help setting up the code prettifier to match the project's style.
I still need to check if this commit needs more test coverage.
I noticed in the file that there are many opportunities to use a formatting library like std::fmt or perhaps the
std::format
library in C++20 (e.g. simplifyvoid printHostnames
).About the documentation
I noticed the following issues in the documentation:
In https://pcapplusplus.github.io/docs/install/macOS
./configure-mac_os_x.sh
is not there. Is it still a valid Document?https://pcapplusplus.github.io/docs/tests says "Run the tests from this directory. The executable is inside the Bin directory:..." What I found is that the examples get built to ./examples_bin/