mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-23 00:29:59 +02:00
handle bluetooth section (ignore for now)
This commit is contained in:
@ -313,7 +313,7 @@ import jc.utils
|
|||||||
|
|
||||||
|
|
||||||
class info():
|
class info():
|
||||||
version = '1.3'
|
version = '1.4'
|
||||||
description = 'netstat command parser'
|
description = 'netstat command parser'
|
||||||
author = 'Kelly Brazil'
|
author = 'Kelly Brazil'
|
||||||
author_email = 'kellyjonbrazil@gmail.com'
|
author_email = 'kellyjonbrazil@gmail.com'
|
||||||
@ -536,6 +536,7 @@ def parse(data, raw=False, quiet=False):
|
|||||||
raw_output = []
|
raw_output = []
|
||||||
network = False
|
network = False
|
||||||
socket = False
|
socket = False
|
||||||
|
bluetooth = False
|
||||||
headers = ''
|
headers = ''
|
||||||
network_list = []
|
network_list = []
|
||||||
socket_list = []
|
socket_list = []
|
||||||
@ -546,12 +547,20 @@ def parse(data, raw=False, quiet=False):
|
|||||||
network_list = []
|
network_list = []
|
||||||
network = True
|
network = True
|
||||||
socket = False
|
socket = False
|
||||||
|
bluetooth = False
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if line.startswith('Active UNIX'):
|
if line.startswith('Active UNIX'):
|
||||||
socket_list = []
|
socket_list = []
|
||||||
network = False
|
network = False
|
||||||
socket = True
|
socket = True
|
||||||
|
bluetooth = False
|
||||||
|
continue
|
||||||
|
|
||||||
|
if line.startswith('Active Bluetooth'):
|
||||||
|
network = False
|
||||||
|
socket = False
|
||||||
|
bluetooth = True
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if line.startswith('Proto'):
|
if line.startswith('Proto'):
|
||||||
@ -567,6 +576,10 @@ def parse(data, raw=False, quiet=False):
|
|||||||
socket_list.append(parse_socket(header_text, headers, line))
|
socket_list.append(parse_socket(header_text, headers, line))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if bluetooth:
|
||||||
|
# maybe implement later if requested
|
||||||
|
continue
|
||||||
|
|
||||||
for item in [network_list, socket_list]:
|
for item in [network_list, socket_list]:
|
||||||
for entry in item:
|
for entry in item:
|
||||||
raw_output.append(entry)
|
raw_output.append(entry)
|
||||||
|
Reference in New Issue
Block a user