File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 5252
5353#include < sstream>
5454
55+ #include < ipfixprobe/utils.hpp>
56+
5557#include < ipfixprobe/process.hpp>
5658#include < ipfixprobe/flowifc.hpp>
5759#include < ipfixprobe/packet.hpp>
@@ -81,6 +83,7 @@ struct RecordExtICMP : public RecordExt {
8183#ifdef WITH_NEMEA
8284 virtual void fill_unirec (ur_template_t *tmplt, void *record)
8385 {
86+ ur_set (tmplt, record, F_L4_ICMP_TYPE_CODE, type_code);
8487 }
8588
8689 const char *get_unirec_tmplt () const
@@ -91,7 +94,15 @@ struct RecordExtICMP : public RecordExt {
9194
9295 virtual int fill_ipfix (uint8_t *buffer, int size)
9396 {
94- return 0 ;
97+ const int LEN = 2 ;
98+
99+ if (size < LEN) {
100+ return -1 ;
101+ }
102+
103+ *reinterpret_cast <uint16_t *>(buffer) = ntohs (type_code);
104+
105+ return LEN;
95106 }
96107
97108 const char **get_ipfix_tmplt () const
You can’t perform that action at this time.
0 commit comments