1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

add "7" as a netstat raw state

This commit is contained in:
Kelly Brazil
2023-10-12 17:25:40 -07:00
parent 041050ce28
commit d3489536a1
4 changed files with 8 additions and 4 deletions

View File

@ -378,4 +378,4 @@ Returns:
### Parser Information
Compatibility: linux, darwin, freebsd, win32
Version 1.14 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.15 by Kelly Brazil (kellyjonbrazil@gmail.com)

View File

@ -355,7 +355,7 @@ import jc.utils
class info():
"""Provides parser metadata (version, author, etc.)"""
version = '1.14'
version = '1.15'
description = '`netstat` command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'

View File

@ -31,7 +31,11 @@ def normalize_interface_headers(header):
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
contains_state = any(state in entry for state in LIST_OF_STATES)

View File

@ -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
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
and strings