-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
reorg: modular file reorganization of C source code - v11 #10041
base: master
Are you sure you want to change the base?
Conversation
Add clang-format-14 as the preferred version, this is the default on Ubuntu 22.04.
Update the formatting CI job to Ubuntu 22.04 to get a newer version of clang-format, in this case clang-format-14.
Autoconf used to generate a config.h, but it doesn't anymore, and this ends up ignoring files like util/config.h, which we do not want to happen.
.dirstamp files are a build artifact created when GNU autoconf projects have files spread over multiple directories.
If a module has path separators, base the module name on the path. If only 1 "/" (util/ioctl) log the full path as the module. If more (app-layer/dnp3/parser) drop the last component so a module name might be something like "app-layer/dnp3", or "source/af-packet". This is primarily in prep of the modular re-organization. Additionally, actually use dn_len when building the log message to allow for truncation of names.
Disable clang-format around byte arrays, as they have likely been manually formatted into something that makes sense for humans. This has been scripted.
@jlucovsky Can you look at commit 419cb14 please. |
Information: QA ran without warnings. Pipeline 17023 |
I think this is a good idea globally. Is there something to do with compiling the different directories as different relatively independent libraries ? |
No. That is a style seen, but I think its more of a relic of the past. It just adds time to the build if not needed. |
😮 |
Perhaps if written that way from the start. I don't know if our code maps to that strategy very well though. There's also this: https://accu.org/journals/overload/14/71/miller_2004/#:~:text=The%20use%20of%20recursive%20make%20affects%20both%20phases%20of%20the,DAG%20in%20an%20inappropriate%20order. |
Something to keep in mind for new sub-systems I suppose.. Do they make sense to have as a standalone library? Same with Rust, does something new make sense as a standalone crate? |
Information: QA ran without warnings. Pipeline 17023 |
Now, I wonder if we just should move C code to rust where it is more organized... |
Previous PR: #10029
Changes from previous PR:
File reorganization tasks:
app-layer/
output/eve
output/
util/
util/mpm/
sources/
detect/engine
detect/
Module Name Logging
util/ioctl
->util/ioctl
. In current git master this would be logged asioctl
.source/af-packet/runmode
->source/af-packet
app-layer/dnp3/parser
->app-layer/dnp3
Known Failures