mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-17 01:32:37 +02:00
add "7" as a netstat raw state
This commit is contained in:
@ -378,4 +378,4 @@ Returns:
|
|||||||
### Parser Information
|
### Parser Information
|
||||||
Compatibility: linux, darwin, freebsd, win32
|
Compatibility: linux, darwin, freebsd, win32
|
||||||
|
|
||||||
Version 1.14 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
Version 1.15 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||||
|
@ -355,7 +355,7 @@ import jc.utils
|
|||||||
|
|
||||||
class info():
|
class info():
|
||||||
"""Provides parser metadata (version, author, etc.)"""
|
"""Provides parser metadata (version, author, etc.)"""
|
||||||
version = '1.14'
|
version = '1.15'
|
||||||
description = '`netstat` command parser'
|
description = '`netstat` command parser'
|
||||||
author = 'Kelly Brazil'
|
author = 'Kelly Brazil'
|
||||||
author_email = 'kellyjonbrazil@gmail.com'
|
author_email = 'kellyjonbrazil@gmail.com'
|
||||||
|
@ -31,7 +31,11 @@ def normalize_interface_headers(header):
|
|||||||
|
|
||||||
|
|
||||||
def parse_network(headers, entry):
|
def parse_network(headers, entry):
|
||||||
LIST_OF_STATES = ["ESTABLISHED", "SYN_SENT", "SYN_RECV", "FIN_WAIT1", "FIN_WAIT2", "TIME_WAIT", "CLOSED", "CLOSE_WAIT", "LAST_ACK", "LISTEN", "CLOSING", "UNKNOWN"]
|
LIST_OF_STATES = [
|
||||||
|
"ESTABLISHED", "SYN_SENT", "SYN_RECV", "FIN_WAIT1", "FIN_WAIT2",
|
||||||
|
"TIME_WAIT", "CLOSED", "CLOSE_WAIT", "LAST_ACK", "LISTEN", "CLOSING",
|
||||||
|
"UNKNOWN", "7"
|
||||||
|
]
|
||||||
|
|
||||||
# split entry based on presence of value in "State" column
|
# split entry based on presence of value in "State" column
|
||||||
contains_state = any(state in entry for state in LIST_OF_STATES)
|
contains_state = any(state in entry for state in LIST_OF_STATES)
|
||||||
|
2
man/jc.1
2
man/jc.1
@ -1,4 +1,4 @@
|
|||||||
.TH jc 1 2023-10-02 1.23.5 "JSON Convert"
|
.TH jc 1 2023-10-12 1.23.5 "JSON Convert"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
||||||
and strings
|
and strings
|
||||||
|
Reference in New Issue
Block a user