CESNET / ipfixcol

IPFIXcol is an implementation of an IPFIX (RFC 7011) collector
Other
64 stars 37 forks source link

Fastbit storage: fix static exporter IP address in od_infos #180

Closed ghost closed 7 years ago

ghost commented 7 years ago

In addition, this pull request features a fix for two invalid debug log messages.

thorgrin commented 7 years ago

Is there any reason for not setting up the crc correctly and using a string instead? I quess that since this lookup happens quite often, the uint comparison would be much faster, would it not?

ghost commented 7 years ago

As can be observed in the old code, there was an error that caused the CRC to always be set to 512. This was merely an intermediate value that was 'forgotten' to be fixed. Initially, I wanted to use CRC32 indeed, but in the end I abandoned this idea to not need to include any more third-party libraries. Then, I investigated the use of OpenSSL/MD5. The only motivation for using a hashing mechanism is to ensure that, regardless of the length of the input value (e.g., IPv4 or IPv6 addresses), the length of the output value can be guaranteed. Since C++ provides std::string, this solution will do without relying on external libraries -- albeit not as fast as using uint comparison.

In any case, what do you propose? We may take this strategy:

thorgrin commented 7 years ago

OK, let us go with the proposed strategy.