Skip to content

Commit 0471ad7

Browse files
mikemiles-devmikemiles-dev
and
mikemiles-dev
authored
042 (#80)
* Readme and security --------- Co-authored-by: mikemiles-dev <[email protected]>
1 parent 13ed849 commit 0471ad7

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
# netflow_parser
22

3-
A netflow_parser library for Cisco V5, V7, V9, IPFIX written in Rust.
3+
A Netflow Parser library for Cisco V5, V7, V9, IPFIX written in Rust.
44
Supports chaining of multple versions in the same stream. ({v5 packet}, {v7packet}, {v5packet}, {v9packet}, etc.)
55

66
# References
77
See: <https://en.wikipedia.org/wiki/NetFlow>
88

9-
# Example:
9+
# Description
1010

11-
## V5:
11+
## Example
12+
13+
### V5
1214

1315
```rust
1416
use netflow_parser::{NetflowParser, NetflowPacket};
@@ -31,8 +33,6 @@ let v5_packet = [0, 5, 2, 0, 3, 0, 4, 0, 5, 0, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6,
3133
println!("{}", json!(NetflowParser::default().parse_bytes(&v5_packet)).to_string());
3234
```
3335

34-
## Output:
35-
3636
```json
3737
[{"V5":{"header":{"count":1,"engine_id":7,"engine_type":6,"flow_sequence":33752069,"sampling_interval":2057,"sys_up_time":{"nanos":672000000,"secs":50332},"unix_nsecs":134807553,"unix_secs":83887623,"version":5},"sets":[{"d_octets":66051,"d_pkts":101124105,"dst_addr":"4.5.6.7","dst_as":515,"dst_mask":5,"dst_port":1029,"first":{"nanos":87000000,"secs":67438},"input":515,"last":{"nanos":553000000,"secs":134807},"next_hop":"8.9.0.1","output":1029,"pad1":6,"pad2":1543,"protocol_number":8,"protocol_type":"Egp","src_addr":"0.1.2.3","src_as":1,"src_mask":4,"src_port":515,"tcp_flags":7,"tos":9}]}}]
3838
```
@@ -119,7 +119,7 @@ To access templates flowset of a processed V9/IPFix flowset you can find the `fl
119119

120120
* `parse_unknown_fields` - When enabled fields not listed in this library will attempt to be parsed as a Vec of bytes and the field_number listed. When disabled an error is thrown when attempting to parse those fields. Enabled by default.
121121

122-
## Examples
122+
## Included Examples
123123

124124
Some examples has been included mainly for those who want to use this parser to read from a Socket and parse netflow. In those cases with V9/IPFix it is best to create a new parser for each router. There are both single threaded and multi-threaded examples in the examples directory.
125125

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# 0.4.2
22
* Increased coverage.
3+
* Reworked Readme.
34

45
# 0.4.1
56
* Added NetflowCommon structure. This acts as a helper for common Netflow Fields (like src_ip, src_port, etc).

SECURITY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
| Version | Supported |
66
| ------- | ------------------ |
7+
| 0.4.2 | :white_check_mark: |
8+
| 0.4.1 | :white_check_mark: |
79
| 0.4.0 | :white_check_mark: |
810
| 0.3.6 | :white_check_mark: |
911
| 0.3.5 | :white_check_mark: |

src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
//! # netflow_parser
22
//!
3-
//! A netflow_parser library for Cisco V5, V7, V9, IPFIX written in Rust.
3+
//! A Netflow Parser library for Cisco V5, V7, V9, IPFIX written in Rust.
44
//! Supports chaining of multple versions in the same stream. ({v5 packet}, {v7packet}, {v5packet}, {v9packet}, etc.)
55
//!
66
//! # References
77
//! See: <https://en.wikipedia.org/wiki/NetFlow>
88
//!
9-
//! # Example:
9+
//! # Description
1010
//!
11-
//! ## V5:
11+
//! ## Example
12+
//!
13+
//! ### V5
1214
//!
1315
//! ```rust
1416
//! use netflow_parser::{NetflowParser, NetflowPacket};
@@ -31,8 +33,6 @@
3133
//! println!("{}", json!(NetflowParser::default().parse_bytes(&v5_packet)).to_string());
3234
//! ```
3335
//!
34-
//! ## Output:
35-
//!
3636
//! ```json
3737
//! [{"V5":{"body":{"d_octets":66051,"d_pkts":101124105,"dst_addr":"4.5.6.7","dst_as":515,"dst_mask":5,"dst_port":1029,"first":67438087,"input":515,"last":134807553,"next_hop":"8.9.0.1","output":1029,"pad1":6,"pad2":1543,"protocol":"EGP","src_addr":"0.1.2.3","src_as":1,"src_mask":4,"src_port":515,"tcp_flags":7,"tos":9},"header":{"count":512,"engine_id":7,"engine_type":6,"flow_sequence":33752069,"sampling_interval":2057,"sys_up_time":50332672,"unix_nsecs":134807553,"unix_secs":83887623,"unix_time":{"nanos_since_epoch":134807553,"secs_since_epoch":83887623},"version":5}}}]
3838
//! ```
@@ -118,7 +118,7 @@
118118
//!
119119
//! * `parse_unknown_fields` - When enabled fields not listed in this library will attempt to be parsed as a Vec of bytes and the field_number listed. When disabled an error is thrown when attempting to parse those fields. Enabled by default.
120120
//!
121-
//! ## Examples
121+
//! ## Included Examples
122122
//! Some examples has been included mainly for those who want to use this parser to read from a Socket and parse netflow. In those cases with V9/IPFix it is best to create a new parser for each router. There are both single threaded and multi-threaded examples in the examples directory.
123123
//!
124124
//! To run:

0 commit comments

Comments
 (0)