-
Notifications
You must be signed in to change notification settings - Fork 896
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
Change the way NDPI_API_VERSION generated. #1499
Conversation
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
src/include/ndpi_typedefs.h \ | ||
src/include/ndpi_protocol_ids.h \ | ||
src/include/ndpi_api.h.in \ | ||
| md5sum | cut -c1-16 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it better to be extra cautious here and add all the headers in src/include/
?
For example, ndpi_define.h.in
and ndpi_patricia_typedefs.h
are definitely needed, not sure about the others...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right that by replacing the time based approach with a checksum based one, the API version is now not constantly increasing? That may break (sooner or later) applications which use nDPI's dev branch for compilation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It always has been random. (by number of lines in files). So I did not make it worse.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- @IvanNardi Please give me comprehensive list of files to include.
- @lnslbrty Time-based logic does not work in presence of branches and backports. Or, we should use "epoch" increased by hand. Actually, this is not needed because backward-compatibiliy is absent, and also API versions are never compared in the code. (only == and not < or >).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this is not needed because backward-compatibiliy is absent, and also API versions are never compared in the code. (only == and not < or >).
The API version may not be used by libnDPI itself. But other developers may use it for their own applications. The current API version is pretty much obsolete. But making it even more obsolete shouldn't be the goal, instead I would pledge to remove the API version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, removing API version looks OK to me.
@@ -1108,7 +1109,7 @@ int main(int argc, char ** argv) | |||
printf("usage: %s [PCAP-FILE-OR-INTERFACE]\n" | |||
"----------------------------------\n" | |||
"nDPI version: %s\n" | |||
" API version: %u\n" | |||
" API version: %" PRIu64 "\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PRIu64
may not work for all Windows CCs.
Better use %llu
and cast (if necessary) the format param to (unsigned long long int)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is it possible it may not work? It's the standard. No? Also, what is Windows CC ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
%llu
should be the most portable way to print 64-bit uint's
src/include/ndpi_typedefs.h \ | ||
src/include/ndpi_protocol_ids.h \ | ||
src/include/ndpi_api.h.in \ | ||
| md5sum | cut -c1-16 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I right that by replacing the time based approach with a checksum based one, the API version is now not constantly increasing? That may break (sooner or later) applications which use nDPI's dev branch for compilation.
I am closing this PR due to inactivity.
|
…ocketpair). * Related to ntop#1545, ntop#1494 and ntop#1189 as well Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
…ocketpair). * Related to ntop#1545, ntop#1494 and ntop#1189 as well Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
…ocketpair). * Related to ntop#1545, ntop#1494 and ntop#1189 as well Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
No description provided.