CESNET/Nemea-Modules

Module `sni_dataset_saver` is missing a `<cstdint>` include

Closed this issue · 1 comments

When building on Fedora Workstation 38, the <cstdint> seems not to be included in sampler.h, leading to compile errors.

After adding #include <cstdint> to modules/sni_dataset_saver/sampler.h, the compilation proceeds without further errors.

gcc version 13.2.1 20230728 (Red Hat 13.2.1-1) (GCC)

make[4]: Entering directory '/home/bpuser/sources/Nemea/modules/sni_dataset_saver'
  CXX      sni_dataset_saver-main.o
  CC       fields.o
  CXX      sni_dataset_saver-sampler.o
  CXX      sni_dataset_saver-sni.o
  GEN      sni_dataset_saver-nemea.1
In file included from sampler.cpp:48:
sampler.h:55:5: error: ‘uint16_t’ does not name a type
   55 |     uint16_t _rate; /* reverse sampling rate. Every 1:_rate flows should not be sampled. */
      |     ^~~~~~~~
sampler.h:48:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   47 | #include <ctime>
  +++ |+#include <cstdint>
   48 | #include <iostream>
sampler.h:59:5: error: ‘uint64_t’ does not name a type
   59 |     uint64_t _counter; /* of seen flows. */
      |     ^~~~~~~~
...
...
make[4]: *** [Makefile:601: sni_dataset_saver-sampler.o] Error 1

Can you provide PR? Yes, include should solve this issue.