Skip to content

Commit 17a3371

Browse files
mikemiles-devmikemiles-dev
and
mikemiles-dev
authored
Added V9 fields 225-229 (#73)
* Added V9 fields 225-229 * More fields` --------- Co-authored-by: mikemiles-dev <[email protected]>
1 parent 8a31a2f commit 17a3371

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "netflow_parser"
33
description = "Parser for Netflow Cisco V5, V7, V9, IPFIX"
4-
version = "0.3.5"
4+
version = "0.3.6"
55
edition = "2021"
66
77
license = "MIT OR Apache-2.0"

RELEASES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 0.3.6
2+
* Added V9 Post NAT fields 225-228.
3+
14
# 0.3.5
25
* 3 Byte Data Numbers now correctly converts back to be_bytes.
36

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
| Version | Supported |
66
| ------- | ------------------ |
7+
| 0.3.6 | :white_check_mark: |
78
| 0.3.5 | :white_check_mark: |
89
| 0.3.4 | :white_check_mark: |
910
| 0.3.3 | :white_check_mark: |

src/variable_versions/v9_lookup.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,16 @@ pub enum V9Field {
125125
Layer2packetSectionOffset = 102,
126126
Layer2packetSectionSize = 103,
127127
Layer2packetSectionData = 104,
128+
IcmpTypeValue = 176,
129+
IcmpCodeValue = 177,
130+
IcmpIpv6TypeValue = 178,
131+
ImpIpv6CodeValue = 179,
132+
PostNATSourceIPv4Address = 225,
133+
PostNATDestinationIPv4Address = 226,
134+
PostNATTSourceTransportPort = 227,
135+
PostNATTDestinationTransportPort = 228,
136+
PostNATSourceIpv6Address = 281,
137+
PostNATDestinationIpv6Address = 282,
128138
Vendor,
129139
Unknown,
130140
}
@@ -222,6 +232,16 @@ impl From<V9Field> for FieldDataType {
222232
96 => FieldDataType::String,
223233
98 => FieldDataType::UnsignedDataNumber,
224234
99 => FieldDataType::UnsignedDataNumber,
235+
176 => FieldDataType::UnsignedDataNumber,
236+
177 => FieldDataType::UnsignedDataNumber,
237+
178 => FieldDataType::UnsignedDataNumber,
238+
179 => FieldDataType::UnsignedDataNumber,
239+
225 => FieldDataType::Ip4Addr,
240+
226 => FieldDataType::Ip4Addr,
241+
227 => FieldDataType::UnsignedDataNumber,
242+
228 => FieldDataType::UnsignedDataNumber,
243+
281 => FieldDataType::Ip6Addr,
244+
282 => FieldDataType::Ip6Addr,
225245
_ => FieldDataType::Unknown,
226246
}
227247
}
@@ -332,6 +352,16 @@ impl From<u16> for V9Field {
332352
102 => V9Field::Layer2packetSectionOffset,
333353
103 => V9Field::Layer2packetSectionSize,
334354
104 => V9Field::Layer2packetSectionData,
355+
176 => V9Field::IcmpTypeValue,
356+
177 => V9Field::IcmpCodeValue,
357+
178 => V9Field::IcmpIpv6TypeValue,
358+
179 => V9Field::ImpIpv6CodeValue,
359+
225 => V9Field::PostNATSourceIPv4Address,
360+
226 => V9Field::PostNATDestinationIPv4Address,
361+
227 => V9Field::PostNATTSourceTransportPort,
362+
228 => V9Field::PostNATTDestinationTransportPort,
363+
281 => V9Field::PostNATSourceIpv6Address,
364+
282 => V9Field::PostNATDestinationIpv6Address,
335365
_ => V9Field::Unknown,
336366
}
337367
}

0 commit comments

Comments
 (0)