From 0ea114f8ce7eb57d18eccab2179b4990172c99bb Mon Sep 17 00:00:00 2001 From: Peter Haag Date: Mon, 1 Jan 2018 14:20:39 +0100 Subject: [PATCH] IPFIX add fwd status tag #89 compatible to v9 (1byte) --- ChangeLog | 1 + bin/ipfix.c | 3 ++- bin/ipfix.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 04000bd..90dd5b3 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2018-01-01 - IPFIX time stamps - Fix elements #21,#22 offset calculation, but timestamps not yet evaluated. (#160) +- IPFIX add fwd status tag #89 compatible to v9 (1byte) 2017-12-31 - IPFIX sampling - sampling algorithm no longer required for tag #34 diff --git a/bin/ipfix.c b/bin/ipfix.c index 2318f03..9029da6 100644 --- a/bin/ipfix.c +++ b/bin/ipfix.c @@ -209,6 +209,7 @@ static struct ipfix_element_map_s { { IPFIX_octetTotalCount, _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, { IPFIX_packetTotalCount, _8bytes, _8bytes, move64_sampling, zero64, COMMON_BLOCK }, { IPFIX_packetTotalCount, _4bytes, _8bytes, move32_sampling, zero64, COMMON_BLOCK }, + { IPFIX_forwardingStatus, _1byte, _1byte, move8, zero8, COMMON_BLOCK }, { IPFIX_protocolIdentifier, _1byte, _1byte, move8, zero8, COMMON_BLOCK }, { IPFIX_ipClassOfService, _1byte, _1byte, move8, zero8, COMMON_BLOCK }, { IPFIX_tcpControlBits, _1byte, _1byte, move8, zero8, COMMON_BLOCK }, @@ -685,7 +686,7 @@ size_t size_required; dbg_printf("Time stamp: No known format found\n"); offset = BYTE_OFFSET_first + 8; } - offset +=1; // Skip netflow v9 fwd status + PushSequence( table, IPFIX_forwardingStatus, &offset, NULL); PushSequence( table, IPFIX_tcpControlBits, &offset, NULL); PushSequence( table, IPFIX_protocolIdentifier, &offset, NULL); PushSequence( table, IPFIX_ipClassOfService, &offset, NULL); diff --git a/bin/ipfix.h b/bin/ipfix.h index 4f96d79..b9df130 100644 --- a/bin/ipfix.h +++ b/bin/ipfix.h @@ -269,6 +269,7 @@ typedef struct ipfix_template_elements_e_s { #define IPFIX_postSourceMacAddress 81 #define IPFIX_octetTotalCount 85 #define IPFIX_packetTotalCount 86 +#define IPFIX_forwardingStatus 89 #define IPFIX_flowStartMilliseconds 152 #define IPFIX_flowEndMilliseconds 153 #define IPFIX_flowStartDeltaMicroseconds 158