-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Can now parse enterprise fields in non options templates for IPFIX.)
- Loading branch information
mikemiles-dev
authored and
mikemiles-dev
committed
Feb 24, 2025
1 parent
02285a4
commit ba14926
Showing
14 changed files
with
300 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,4 +103,3 @@ expression: "NetflowParser::default().parse_bytes(&packet)" | |
- 2 | ||
- 3 | ||
- 4 | ||
|
28 changes: 28 additions & 0 deletions
28
...ow_parser__tests__base_tests__it_parses_ipfix_enterprise_bit_in_non_options_template.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
source: src/tests.rs | ||
expression: "NetflowParser::default().parse_bytes(&packet)" | ||
--- | ||
- IPFix: | ||
header: | ||
version: 10 | ||
length: 42 | ||
export_time: 1670052913 | ||
sequence_number: 0 | ||
observation_domain_id: 0 | ||
flowsets: | ||
- header: | ||
header_id: 2 | ||
length: 26 | ||
body: | ||
templates: | ||
template_id: 260 | ||
field_count: 2 | ||
fields: | ||
- field_type_number: 32871 | ||
field_type: Unknown | ||
field_length: 65535 | ||
enterprise_number: 407732327 | ||
- field_type_number: 65535 | ||
field_type: Unknown | ||
field_length: 0 | ||
enterprise_number: 407732544 |
176 changes: 176 additions & 0 deletions
176
src/snapshots/netflow_parser__tests__base_tests__it_parses_ipfix_scappy_example.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
--- | ||
source: src/tests.rs | ||
expression: result | ||
--- | ||
- IPFix: | ||
header: | ||
version: 10 | ||
length: 116 | ||
export_time: 1480450135 | ||
sequence_number: 3791 | ||
observation_domain_id: 0 | ||
flowsets: | ||
- header: | ||
header_id: 2 | ||
length: 100 | ||
body: | ||
templates: | ||
template_id: 307 | ||
field_count: 23 | ||
fields: | ||
- field_type_number: 8 | ||
field_type: SourceIpv4address | ||
field_length: 4 | ||
- field_type_number: 12 | ||
field_type: DestinationIpv4address | ||
field_length: 4 | ||
- field_type_number: 5 | ||
field_type: IpClassOfService | ||
field_length: 1 | ||
- field_type_number: 4 | ||
field_type: ProtocolIdentifier | ||
field_length: 1 | ||
- field_type_number: 7 | ||
field_type: SourceTransportPort | ||
field_length: 2 | ||
- field_type_number: 11 | ||
field_type: DestinationTransportPort | ||
field_length: 2 | ||
- field_type_number: 32 | ||
field_type: IcmpTypeCodeIpv4 | ||
field_length: 2 | ||
- field_type_number: 10 | ||
field_type: IngressInterface | ||
field_length: 4 | ||
- field_type_number: 16 | ||
field_type: BgpSourceAsNumber | ||
field_length: 4 | ||
- field_type_number: 17 | ||
field_type: BgpDestinationAsNumber | ||
field_length: 4 | ||
- field_type_number: 18 | ||
field_type: BgpNextHopIpv4address | ||
field_length: 4 | ||
- field_type_number: 14 | ||
field_type: EgressInterface | ||
field_length: 4 | ||
- field_type_number: 1 | ||
field_type: OctetDeltaCount | ||
field_length: 4 | ||
- field_type_number: 2 | ||
field_type: PacketDeltaCount | ||
field_length: 4 | ||
- field_type_number: 22 | ||
field_type: FlowStartSysUpTime | ||
field_length: 4 | ||
- field_type_number: 21 | ||
field_type: FlowEndSysUpTime | ||
field_length: 4 | ||
- field_type_number: 15 | ||
field_type: IpNextHopIpv4address | ||
field_length: 4 | ||
- field_type_number: 9 | ||
field_type: SourceIpv4prefixLength | ||
field_length: 1 | ||
- field_type_number: 13 | ||
field_type: DestinationIpv4prefixLength | ||
field_length: 1 | ||
- field_type_number: 6 | ||
field_type: TcpControlBits | ||
field_length: 1 | ||
- field_type_number: 60 | ||
field_type: IpVersion | ||
field_length: 1 | ||
- field_type_number: 152 | ||
field_type: FlowStartMilliseconds | ||
field_length: 8 | ||
- field_type_number: 153 | ||
field_type: FlowEndMilliseconds | ||
field_length: 8 | ||
- IPFix: | ||
header: | ||
version: 10 | ||
length: 96 | ||
export_time: 1480450137 | ||
sequence_number: 3812 | ||
observation_domain_id: 0 | ||
flowsets: | ||
- header: | ||
header_id: 307 | ||
length: 80 | ||
body: | ||
data: | ||
data_fields: | ||
- 0: | ||
- SourceIpv4address | ||
- Ip4Addr: 70.1.115.1 | ||
1: | ||
- DestinationIpv4address | ||
- Ip4Addr: 50.0.71.1 | ||
2: | ||
- IpClassOfService | ||
- DataNumber: 0 | ||
3: | ||
- ProtocolIdentifier | ||
- DataNumber: 61 | ||
4: | ||
- SourceTransportPort | ||
- DataNumber: 0 | ||
5: | ||
- DestinationTransportPort | ||
- DataNumber: 0 | ||
6: | ||
- IcmpTypeCodeIpv4 | ||
- DataNumber: 0 | ||
7: | ||
- IngressInterface | ||
- DataNumber: 827 | ||
8: | ||
- BgpSourceAsNumber | ||
- DataNumber: 2 | ||
9: | ||
- BgpDestinationAsNumber | ||
- DataNumber: 3 | ||
10: | ||
- BgpNextHopIpv4address | ||
- Ip4Addr: 204.42.110.101 | ||
11: | ||
- EgressInterface | ||
- DataNumber: 854 | ||
12: | ||
- OctetDeltaCount | ||
- DataNumber: 1312 | ||
13: | ||
- PacketDeltaCount | ||
- DataNumber: 9 | ||
14: | ||
- FlowStartSysUpTime | ||
- DataNumber: 3019441902 | ||
15: | ||
- FlowEndSysUpTime | ||
- DataNumber: 3019616060 | ||
16: | ||
- IpNextHopIpv4address | ||
- Ip4Addr: 204.42.110.189 | ||
17: | ||
- SourceIpv4prefixLength | ||
- DataNumber: 24 | ||
18: | ||
- DestinationIpv4prefixLength | ||
- DataNumber: 24 | ||
19: | ||
- TcpControlBits | ||
- DataNumber: 0 | ||
20: | ||
- IpVersion | ||
- DataNumber: 4 | ||
21: | ||
- FlowStartMilliseconds | ||
- Duration: | ||
secs: 1480449931 | ||
nanos: 519000000 | ||
22: | ||
- FlowEndMilliseconds | ||
- Duration: | ||
secs: 1480450105 | ||
nanos: 677000000 |
30 changes: 30 additions & 0 deletions
30
...s/netflow_parser__tests__base_tests__it_parses_ipfix_scappy_example_options_template.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
source: src/tests.rs | ||
expression: result | ||
--- | ||
- IPFix: | ||
header: | ||
version: 10 | ||
length: 40 | ||
export_time: 1480450135 | ||
sequence_number: 3791 | ||
observation_domain_id: 0 | ||
flowsets: | ||
- header: | ||
header_id: 3 | ||
length: 24 | ||
body: | ||
options_templates: | ||
template_id: 308 | ||
field_count: 3 | ||
scope_field_count: 1 | ||
fields: | ||
- field_type_number: 32773 | ||
field_type: IpClassOfService | ||
field_length: 2 | ||
- field_type_number: 32804 | ||
field_type: FlowActiveTimeout | ||
field_length: 2 | ||
- field_type_number: 32805 | ||
field_type: FlowIdleTimeout | ||
field_length: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,3 @@ expression: parser.parse_bytes(&packet) | |
- 0 | ||
- 1 | ||
- 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,3 @@ expression: "NetflowParser::default().parse_bytes(&packet)" | |
- 1 | ||
- 1 | ||
- 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.