From defa40768d3fff28d3304c647caa71ec8f11e1da Mon Sep 17 00:00:00 2001 From: Jose Rodriguez Date: Mon, 21 Oct 2024 14:16:27 -0400 Subject: [PATCH] fix: resolve merge conflicts --- CHANGELOG | 4 +- README.md | 1 + jc/parsers/bluetoothctl.py | 18 +- jc/parsers/ipconfig.py | 87 +++-- jc/utils.py | 1 + man/jc.1 | 12 +- .../fixtures/windows/windows-10/ipconfig.json | 134 +------ .../fixtures/windows/windows-11/ipconfig.json | 327 +----------------- .../fixtures/windows/windows-7/ipconfig.json | 83 +---- .../fixtures/windows/windows-xp/ipconfig.json | 52 +-- 10 files changed, 89 insertions(+), 630 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b6396c11..575407f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,11 @@ jc changelog -20240922 v1.25.4 +20241018 v1.25.4 +- Add `ipconfig` command parser (`ipconfig` for Windows) - Enhance `ping-s` streaming parser to support error replies - Enhance `ethtool` parser to support `link_partner_advertised_link_modes` - Enhance `ifconfig` parser to support `utun` interfaces with assigned IPv4 addresses on macOS +- Fix `bluetoothctl` parser when extra attributes like `manufacturer` and `version` exist - Fix `df` parser to correctly output binary vs. decimal size outputs - Fix `mount` parser for cases where there are spaces in the filesystem name - Fix `ip-address` parser for Python 3.13 changes to IPv4 mapped IPv6 addresses diff --git a/README.md b/README.md index b81ca7dc..555b908f 100644 --- a/README.md +++ b/README.md @@ -218,6 +218,7 @@ option. | `--iostat` | `iostat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat) | | `--iostat-s` | `iostat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat_s) | | `--ip-address` | IPv4 and IPv6 Address string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_address) | +| `--ipconfig` | `ipconfig` Windows command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ipconfig) | | `--iptables` | `iptables` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iptables) | | `--ip-route` | `ip route` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_route) | | `--iw-scan` | `iw dev [device] scan` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iw_scan) | diff --git a/jc/parsers/bluetoothctl.py b/jc/parsers/bluetoothctl.py index 84de1528..3d241334 100644 --- a/jc/parsers/bluetoothctl.py +++ b/jc/parsers/bluetoothctl.py @@ -28,6 +28,8 @@ Controller: [ { + "manufacturer": string, + "version": string, "name": string, "is_default": boolean, "is_public": boolean, @@ -110,7 +112,7 @@ class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`bluetoothctl` command parser' author = 'Jake Ob' author_email = 'iakopap at gmail.com' @@ -127,6 +129,8 @@ class info(): Controller = TypedDict( "Controller", { + "manufacturer": str, + "version": str, "name": str, "is_default": bool, "is_public": bool, @@ -175,7 +179,9 @@ class info(): _controller_head_pattern = r"Controller (?P
([0-9A-F]{2}:){5}[0-9A-F]{2}) (?P.+)" _controller_line_pattern = ( - r"(\s*Name:\s*(?P.+)" + r"(\s*Manufacturer:\s*(?P.+)" + + r"|\s*Version:\s*(?P.+)" + + r"|\s*Name:\s*(?P.+)" + r"|\s*Alias:\s*(?P.+)" + r"|\s*Class:\s*(?P.+)" + r"|\s*Powered:\s*(?P.+)" @@ -203,6 +209,8 @@ def _parse_controller(next_lines: List[str]) -> Optional[Controller]: return None controller: Controller = { + "manufacturer": '', + "version": '', "name": '', "is_default": False, "is_public": False, @@ -241,7 +249,11 @@ def _parse_controller(next_lines: List[str]) -> Optional[Controller]: matches = result.groupdict() - if matches["name"]: + if matches["manufacturer"]: + controller["manufacturer"] = matches["manufacturer"] + elif matches["version"]: + controller["version"] = matches["version"] + elif matches["name"]: controller["name"] = matches["name"] elif matches["alias"]: controller["alias"] = matches["alias"] diff --git a/jc/parsers/ipconfig.py b/jc/parsers/ipconfig.py index c35d9f84..4687cea8 100644 --- a/jc/parsers/ipconfig.py +++ b/jc/parsers/ipconfig.py @@ -1,10 +1,10 @@ -r"""jc - JSON Convert `ipconfig` command output parser - +r"""jc - JSON Convert `ipconfig` Windows command output parser Usage (cli): $ ipconfig /all | jc --ipconfig $ ipconfig | jc --ipconfig + $ jc ipconfig /all Usage (module): @@ -20,7 +20,7 @@ "ip_routing_enabled": boolean, "wins_proxy_enabled": boolean, "dns_suffix_search_list": [ - string + string ], "adapters": [ { @@ -51,7 +51,7 @@ { "address": string, "status": string, - "prefix_length": int, + "prefix_length": integer, } ], "ipv4_addresses": [ @@ -72,12 +72,16 @@ string ], "primary_wins_server": string, - "lease_expires": string, # [0] - "lease_obtained": string, # [0] + "lease_expires": string, + "lease_expires_epoch": integer, # [0] + "lease_expires_iso": string, + "lease_obtained": string, + "lease_obtained_epoch": integer, # [0] + "lease_obtained_iso": string, "netbios_over_tcpip": boolean, "media_state": string, "extras": [ - string: string + : string ] } ], @@ -85,12 +89,14 @@ } Notes: - [0] - 'lease_expires' and 'lease_obtained' are parsed to ISO8601 format date strings. if the value was unable - to be parsed by datetime, the fields will be in their raw form - [1] - 'autoconfigured' under 'ipv4_address' is only providing indication if the ipv4 address was labeled as - "Autoconfiguration IPv4 Address" vs "IPv4 Address". It does not infer any information from other fields - [2] - Windows XP uses 'IP Address' instead of 'IPv4 Address'. Both values are parsed to the 'ipv4_address' - object for consistency + [0] - The epoch calculated timestamp field is naive. (i.e. based on + the local time of the system the parser is run on) + [1] - 'autoconfigured' under 'ipv4_address' is only providing + indication if the ipv4 address was labeled as "Autoconfiguration + IPv4 Address" vs "IPv4 Address". It does not infer any + information from other fields + [2] - Windows XP uses 'IP Address' instead of 'IPv4 Address'. Both + values are parsed to the 'ipv4_address' object for consistency Examples: @@ -421,7 +427,6 @@ ], "extras": [] } - """ from datetime import datetime import re @@ -431,7 +436,7 @@ class info(): """Provides parser metadata (version, author, etc.)""" version = '1.0' - description = '`ipconfig` command parser' + description = '`ipconfig` Windows command parser' author = 'joehacksalot' author_email = 'joehacksalot@gmail.com' compatible = ['windows'] @@ -466,6 +471,7 @@ def parse(data, raw=False, quiet=False): return raw_output if raw else _process(raw_output) + def _process_ipv6_address(ip_address): address_split = ip_address["address"].split('%') try: @@ -484,6 +490,7 @@ def _process_ipv6_address(ip_address): "status": ip_address["status"] } + def _process_ipv4_address(ip_address): autoconfigured = True if ip_address.get("autoconfigured","") is not None and 'autoconfigured' in ip_address.get("autoconfigured","") else False subnet_mask = ip_address["subnet_mask"] @@ -494,6 +501,7 @@ def _process_ipv4_address(ip_address): "autoconfigured": autoconfigured } + def _process(proc_data): """ Final processing to conform to the schema. @@ -507,8 +515,7 @@ def _process(proc_data): Processed Dictionary. Structured data to conform to the schema. """ processed = proc_data - - + if "ip_routing_enabled" in processed and processed["ip_routing_enabled"] is not None: processed["ip_routing_enabled"] = (processed["ip_routing_enabled"].lower() == "yes") @@ -518,38 +525,47 @@ def _process(proc_data): for adapter in processed["adapters"]: if "dhcp_enabled" in adapter and adapter["dhcp_enabled"] is not None: adapter["dhcp_enabled"] = (adapter["dhcp_enabled"].lower() == "yes") + if "autoconfiguration_enabled" in adapter and adapter["autoconfiguration_enabled"] is not None: adapter["autoconfiguration_enabled"] = (adapter["autoconfiguration_enabled"].lower() == "yes") + if "netbios_over_tcpip" in adapter and adapter["netbios_over_tcpip"] is not None: adapter["netbios_over_tcpip"] = (adapter["netbios_over_tcpip"].lower() == "enabled") - if "lease_expires" in adapter and adapter["lease_expires"] is not None and adapter["lease_expires"] != "": - try: - adapter["lease_expires"] = datetime.strptime(adapter["lease_expires"], "%A, %B %d, %Y %I:%M:%S %p").isoformat() - except: - pass # Leave date in raw format if not parseable - if "lease_obtained" in adapter and adapter["lease_obtained"] is not None and adapter["lease_obtained"] != "": - try: - adapter["lease_obtained"] = datetime.strptime(adapter["lease_obtained"], "%A, %B %d, %Y %I:%M:%S %p").isoformat() - except: - pass # Leave date in raw format if not parseable + + if "lease_expires" in adapter and adapter["lease_expires"]: + ts = jc.utils.timestamp(adapter['lease_expires'], format_hint=(1720,)) + adapter["lease_expires_epoch"] = ts.naive + adapter["lease_expires_iso"] = ts.iso + + if "lease_obtained" in adapter and adapter["lease_obtained"]: + ts = jc.utils.timestamp(adapter['lease_obtained'], format_hint=(1720,)) + adapter["lease_obtained_epoch"] = ts.naive + adapter["lease_obtained_iso"] = ts.iso + adapter["link_local_ipv6_addresses"] = [_process_ipv6_address(address) for address in adapter.get("link_local_ipv6_addresses", [])] adapter["ipv4_addresses"] = [_process_ipv4_address(address) for address in adapter.get("ipv4_addresses", [])] + return processed + class _PushbackIterator: def __init__(self, iterator): self.iterator = iterator self.pushback_stack = [] + def __iter__(self): return self + def __next__(self): if self.pushback_stack: return self.pushback_stack.pop() else: return next(self.iterator) + def pushback(self, value): self.pushback_stack.append(value) + def _parse(data): # Initialize the parsed output dictionary with all fields set to None or empty lists parse_output = { @@ -609,10 +625,12 @@ def _parse(data): return parse_output + def _is_adapter_start_line(line): # Detect adapter start lines, e.g., "Ethernet adapter Ethernet:" return re.match(r"^[^\s].*adapter.*:", line, re.IGNORECASE) + def _initialize_adapter(adapter_name): adapter_name_split = adapter_name.split(" adapter ", 1) if len(adapter_name_split) > 1: @@ -650,6 +668,7 @@ def _initialize_adapter(adapter_name): "extras": [] # To store unrecognized fields } + def _parse_line(line): # Split the line into key and value using ':' or multiple spaces key_value = re.split(r":", line.strip(), 1) @@ -662,6 +681,7 @@ def _parse_line(line): else: return None, None + def _parse_header_line(result, key, value, line_iter): if key in ["host_name", "primary_dns_suffix", "node_type", "ip_routing_enabled", "wins_proxy_enabled"]: result[key] = value @@ -674,11 +694,13 @@ def _parse_header_line(result, key, value, line_iter): # Store unrecognized fields in extras result["extras"].append({key: value}) + def _parse_adapter_line(adapter, key, value, line_iter): if key in ["connection_specific_dns_suffix","media_state", "description", "physical_address", "dhcp_enabled", "autoconfiguration_enabled", "dhcpv6_iaid", "dhcpv6_client_duid", "netbios_over_tcpip", "dhcp_server", "lease_obtained", "lease_expires", "primary_wins_server"]: adapter[key] = value + elif key in ["ipv6_address", "temporary_ipv6_address", "link_local_ipv6_address"]: address_dict = _parse_ipv6_address(value) if key == "ipv6_address": @@ -687,32 +709,39 @@ def _parse_adapter_line(adapter, key, value, line_iter): adapter["temporary_ipv6_addresses"].append(address_dict) elif key == "link_local_ipv6_address": adapter["link_local_ipv6_addresses"].append(address_dict) + elif key in ["ipv4_address", "autoconfiguration_ipv4_address", "ip_address", "autoconfiguration_ip_address"]: ipv4_address_dict = _parse_ipv4_address(value, key, line_iter) adapter["ipv4_addresses"].append(ipv4_address_dict) + elif key == "connection_specific_dns_suffix_search_list": if value: adapter["connection_specific_dns_suffix_search_list"].append(value) # Process additional connection specific dns suffix search list entries _parse_additional_entries(adapter["connection_specific_dns_suffix_search_list"], line_iter) + elif key == "default_gateway": if value: adapter["default_gateways"].append(value) # Process additional gateways _parse_additional_entries(adapter["default_gateways"], line_iter) + elif key == "dns_servers": if value: adapter["dns_servers"].append(value) # Process additional DNS servers _parse_additional_entries(adapter["dns_servers"], line_iter) + elif key == "subnet_mask": # Subnet Mask should be associated with the last IPv4 address if adapter["ipv4_addresses"]: adapter["ipv4_addresses"][-1]["subnet_mask"] = value + else: # Store unrecognized fields in extras adapter["extras"].append({key: value}) + def _parse_ipv6_address(value): # Handle multiple status indicators match = re.match(r"([^\(]+)\((.*)\)", value) if value else None @@ -727,6 +756,7 @@ def _parse_ipv6_address(value): "status": status } + def _parse_ipv4_address(value, key, line_iter): # Handle autoconfigured status match = re.match(r"([^\(]+)\((.*)\)", value) if value else None @@ -758,6 +788,7 @@ def _parse_ipv4_address(value, key, line_iter): "status": status } + def _parse_additional_entries(entry_list, line_iter): # Process additional lines that belong to the current entry (e.g., additional DNS servers, DNS Suffix Search List) while True: @@ -775,4 +806,4 @@ def _parse_additional_entries(entry_list, line_iter): line_iter.pushback(next_line) break except StopIteration: - break \ No newline at end of file + break diff --git a/jc/utils.py b/jc/utils.py index cdd26e52..4b190142 100644 --- a/jc/utils.py +++ b/jc/utils.py @@ -696,6 +696,7 @@ def _parse_dt( {'id': 1700, 'format': '%m/%d/%Y, %I:%M:%S %p', 'locale': None}, # Windows english format wint non-UTC tz (found in systeminfo cli output): 3/22/2021, 1:15:51 PM (UTC-0600) {'id': 1705, 'format': '%m/%d/%Y, %I:%M:%S %p %Z', 'locale': None}, # Windows english format with UTC tz (found in systeminfo cli output): 3/22/2021, 1:15:51 PM (UTC) {'id': 1710, 'format': '%m/%d/%Y, %I:%M:%S %p UTC%z', 'locale': None}, # Windows english format with UTC tz (found in systeminfo cli output): 3/22/2021, 1:15:51 PM (UTC+0000) + {'id': 1720, 'format': '%A, %B %d, %Y %I:%M:%S %p', 'locale': None}, # ipconfig cli output format: Thursday, June 22, 2023 10:39:04 AM {'id': 1750, 'format': '%Y/%m/%d-%H:%M:%S.%f', 'locale': None}, # Google Big Table format with no timezone: 1970/01/01-01:00:00.000000 {'id': 1755, 'format': '%Y/%m/%d-%H:%M:%S.%f%z', 'locale': None}, # Google Big Table format with timezone: 1970/01/01-01:00:00.000000+00:00 {'id': 1760, 'format': '%Y-%m-%d %H:%M:%S%z', 'locale': None}, # certbot format with timezone: 2023-06-12 01:35:30+00:00 diff --git a/man/jc.1 b/man/jc.1 index 9049d40d..a5f2efcb 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -1,4 +1,4 @@ -.TH jc 1 2024-09-22 1.25.4 "JSON Convert" +.TH jc 1 2024-10-18 1.25.4 "JSON Convert" .SH NAME \fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types, and strings @@ -347,6 +347,11 @@ INI with duplicate key file parser \fB--ip-address\fP IPv4 and IPv6 Address string parser +.TP +.B +\fB--ipconfig\fP +`ipconfig` Windows command parser + .TP .B \fB--iptables\fP @@ -507,11 +512,6 @@ openvpn-status.log file parser \fB--os-release\fP `/etc/os-release` file parser -.TP -.B -\fB--pacman\fP -`pacman` command parser - .TP .B \fB--passwd\fP diff --git a/tests/fixtures/windows/windows-10/ipconfig.json b/tests/fixtures/windows/windows-10/ipconfig.json index e9fbd94c..942de7f0 100644 --- a/tests/fixtures/windows/windows-10/ipconfig.json +++ b/tests/fixtures/windows/windows-10/ipconfig.json @@ -1,133 +1 @@ -{ - "host_name": "DESKTOP-WIN10-PRO", - "primary_dns_suffix": null, - "node_type": "Hybrid", - "ip_routing_enabled": false, - "wins_proxy_enabled": false, - "dns_suffix_search_list": [ - "tailff123.ts.net", - "internal.companyname.com" - ], - "adapters": [ - { - "name_long": "Unknown adapter Tailscale", - "name": "Tailscale", - "type": "Unknown", - "connection_specific_dns_suffix": "tailff123.ts.net", - "connection_specific_dns_suffix_search_list": [ - "tailff123.ts.net" - ], - "description": "Tailscale Tunnel", - "physical_address": null, - "dhcp_enabled": false, - "autoconfiguration_enabled": true, - "ipv6_addresses": [ - { - "address": "fd7a:115c:a1e0:ab12:4843:cd96:6293:47b2", - "status": "Preferred" - } - ], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [ - { - "address": "fe80::99d0:ec2d:b2e7:536b", - "prefix_length": 8, - "status": "Preferred" - } - ], - "ipv4_addresses": [ - { - "address": "100.115.71.66", - "subnet_mask": "255.255.255.255", - "status": "Preferred", - "autoconfigured": false - } - ], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [ - "fec0:0:0:ffff::1%1", - "fec0:0:0:ffff::2%1", - "fec0:0:0:ffff::3%1" - ], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": true, - "media_state": null, - "extras": [] - }, - { - "name_long": "Ethernet adapter Ethernet 2", - "name": "Ethernet 2", - "type": "Ethernet", - "connection_specific_dns_suffix": "internal.companyname.com", - "connection_specific_dns_suffix_search_list": [], - "description": "ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter #2", - "physical_address": "F8-E4-3B-AD-F2-6D", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [ - { - "address": "fe80::c936:c2db:79ad:e1c6", - "prefix_length": 16, - "status": "Preferred" - } - ], - "ipv4_addresses": [ - { - "address": "10.50.13.132", - "subnet_mask": "255.255.255.0", - "status": "Preferred", - "autoconfigured": false - } - ], - "default_gateways": [ - "10.50.13.1" - ], - "dhcp_server": "10.50.13.1", - "dhcpv6_iaid": "351866565", - "dhcpv6_client_duid": "00-01-00-01-2A-15-C3-11-1C-D3-05-F1-58-E1", - "dns_servers": [ - "10.50.13.1" - ], - "primary_wins_server": null, - "lease_expires": "2024-09-23T02:31:46", - "lease_obtained": "2023-06-22T10:39:04", - "netbios_over_tcpip": true, - "media_state": null, - "extras": [] - }, - { - "name_long": "Ethernet adapter Bluetooth Network Connection", - "name": "Bluetooth Network Connection", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Bluetooth Device (Personal Area Network)", - "physical_address": "1C-C1-0C-C3-25-B4", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - } - ], - "extras": [] -} +{"host_name":"DESKTOP-WIN10-PRO","primary_dns_suffix":null,"node_type":"Hybrid","ip_routing_enabled":false,"wins_proxy_enabled":false,"dns_suffix_search_list":["tailff123.ts.net","internal.companyname.com"],"adapters":[{"name_long":"Unknown adapter Tailscale","name":"Tailscale","type":"Unknown","connection_specific_dns_suffix":"tailff123.ts.net","connection_specific_dns_suffix_search_list":["tailff123.ts.net"],"description":"Tailscale Tunnel","physical_address":null,"dhcp_enabled":false,"autoconfiguration_enabled":true,"ipv6_addresses":[{"address":"fd7a:115c:a1e0:ab12:4843:cd96:6293:47b2","status":"Preferred"}],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[{"address":"fe80::99d0:ec2d:b2e7:536b","prefix_length":8,"status":"Preferred"}],"ipv4_addresses":[{"address":"100.115.71.66","subnet_mask":"255.255.255.255","status":"Preferred","autoconfigured":false}],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":["fec0:0:0:ffff::1%1","fec0:0:0:ffff::2%1","fec0:0:0:ffff::3%1"],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":true,"media_state":null,"extras":[]},{"name_long":"Ethernet adapter Ethernet 2","name":"Ethernet 2","type":"Ethernet","connection_specific_dns_suffix":"internal.companyname.com","connection_specific_dns_suffix_search_list":[],"description":"ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter #2","physical_address":"F8-E4-3B-AD-F2-6D","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[{"address":"fe80::c936:c2db:79ad:e1c6","prefix_length":16,"status":"Preferred"}],"ipv4_addresses":[{"address":"10.50.13.132","subnet_mask":"255.255.255.0","status":"Preferred","autoconfigured":false}],"default_gateways":["10.50.13.1"],"dhcp_server":"10.50.13.1","dhcpv6_iaid":"351866565","dhcpv6_client_duid":"00-01-00-01-2A-15-C3-11-1C-D3-05-F1-58-E1","dns_servers":["10.50.13.1"],"primary_wins_server":null,"lease_expires":"Monday, September 23, 2024 2:31:46 AM","lease_obtained":"Thursday, June 22, 2023 10:39:04 AM","netbios_over_tcpip":true,"media_state":null,"extras":[],"lease_expires_epoch":1727083906,"lease_expires_iso":"2024-09-23T02:31:46","lease_obtained_epoch":1687455544,"lease_obtained_iso":"2023-06-22T10:39:04"},{"name_long":"Ethernet adapter Bluetooth Network Connection","name":"Bluetooth Network Connection","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Bluetooth Device (Personal Area Network)","physical_address":"1C-C1-0C-C3-25-B4","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]}],"extras":[]} diff --git a/tests/fixtures/windows/windows-11/ipconfig.json b/tests/fixtures/windows/windows-11/ipconfig.json index 5976d916..3a1257ec 100644 --- a/tests/fixtures/windows/windows-11/ipconfig.json +++ b/tests/fixtures/windows/windows-11/ipconfig.json @@ -1,326 +1 @@ -{ - "host_name": "DESKTOP-WIN11-HOME", - "primary_dns_suffix": null, - "node_type": "Hybrid", - "ip_routing_enabled": false, - "wins_proxy_enabled": false, - "dns_suffix_search_list": [ - "localdomain" - ], - "adapters": [ - { - "name_long": "Ethernet adapter Ethernet", - "name": "Ethernet", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Intel(R) I211 Gigabit Network Connection", - "physical_address": "24-4B-FE-AB-43-C3", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - }, - { - "name_long": "Ethernet adapter Ethernet 2", - "name": "Ethernet 2", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Realtek PCIe 2.5GbE Family Controller", - "physical_address": "24-4B-FE-57-3D-F2", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - }, - { - "name_long": "Unknown adapter OpenVPN Data Channel Offload for NordVPN", - "name": "OpenVPN Data Channel Offload for NordVPN", - "type": "Unknown", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "OpenVPN Data Channel Offload", - "physical_address": null, - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - }, - { - "name_long": "Unknown adapter Local Area Connection", - "name": "Local Area Connection", - "type": "Unknown", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "TAP-NordVPN Windows Adapter V9", - "physical_address": "00-FF-4C-F4-5E-49", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - }, - { - "name_long": "Wireless LAN adapter Local Area Connection* 1", - "name": "Local Area Connection* 1", - "type": "Wireless LAN", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Microsoft Wi-Fi Direct Virtual Adapter", - "physical_address": "A8-7E-EA-5A-7F-DE", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - }, - { - "name_long": "Wireless LAN adapter Local Area Connection* 2", - "name": "Local Area Connection* 2", - "type": "Wireless LAN", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Microsoft Wi-Fi Direct Virtual Adapter #2", - "physical_address": "AA-7E-EA-F3-64-C3", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - }, - { - "name_long": "Ethernet adapter VMware Network Adapter VMnet1", - "name": "VMware Network Adapter VMnet1", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "VMware Virtual Ethernet Adapter for VMnet1", - "physical_address": "00-50-56-CC-27-73", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [ - { - "address": "fe80::f47d:9c7f:69dc:591e", - "prefix_length": 8, - "status": "Preferred" - } - ], - "ipv4_addresses": [ - { - "address": "192.168.181.1", - "subnet_mask": "255.255.255.0", - "status": "Preferred", - "autoconfigured": false - } - ], - "default_gateways": [], - "dhcp_server": "192.168.181.254", - "dhcpv6_iaid": "771772502", - "dhcpv6_client_duid": "00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6", - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": "2024-09-19T18:01:29", - "lease_obtained": "2024-09-19T08:31:29", - "netbios_over_tcpip": true, - "media_state": null, - "extras": [] - }, - { - "name_long": "Ethernet adapter VMware Network Adapter VMnet8", - "name": "VMware Network Adapter VMnet8", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "VMware Virtual Ethernet Adapter for VMnet8", - "physical_address": "00-50-56-C9-A3-78", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [ - { - "address": "fe80::4551:bf0d:59dd:a4f0", - "prefix_length": 10, - "status": "Preferred" - } - ], - "ipv4_addresses": [ - { - "address": "192.168.213.1", - "subnet_mask": "255.255.255.0", - "status": "Preferred", - "autoconfigured": false - } - ], - "default_gateways": [], - "dhcp_server": "192.168.213.254", - "dhcpv6_iaid": "788549718", - "dhcpv6_client_duid": "00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6", - "dns_servers": [], - "primary_wins_server": "192.168.213.2", - "lease_expires": "2024-09-19T18:01:29", - "lease_obtained": "2024-09-19T08:31:29", - "netbios_over_tcpip": true, - "media_state": null, - "extras": [] - }, - { - "name_long": "Wireless LAN adapter Wi-Fi", - "name": "Wi-Fi", - "type": "Wireless LAN", - "connection_specific_dns_suffix": "localdomain", - "connection_specific_dns_suffix_search_list": [], - "description": "Intel(R) Wi-Fi 6 AX200 160MHz", - "physical_address": "A8-7E-EA-55-26-B0", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [ - { - "address": "fd63:cc9c:65eb:3f95:57c2:aa:10d8:db08", - "status": "Preferred" - } - ], - "temporary_ipv6_addresses": [ - { - "address": "fd63:cc9c:65eb:3f95:8928:348e:d692:b7ef", - "status": "Preferred" - } - ], - "link_local_ipv6_addresses": [ - { - "address": "fe80::4fae:1380:5a1b:8b6b", - "prefix_length": 11, - "status": "Preferred" - } - ], - "ipv4_addresses": [ - { - "address": "192.168.1.169", - "subnet_mask": "255.255.255.0", - "status": "Preferred", - "autoconfigured": false - } - ], - "default_gateways": [ - "192.168.1.1" - ], - "dhcp_server": "192.168.1.1", - "dhcpv6_iaid": "162037482", - "dhcpv6_client_duid": "00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6", - "dns_servers": [ - "192.168.1.1" - ], - "primary_wins_server": null, - "lease_expires": "2024-09-20T08:31:30", - "lease_obtained": "2024-09-19T08:31:30", - "netbios_over_tcpip": true, - "media_state": null, - "extras": [] - }, - { - "name_long": "Ethernet adapter Bluetooth Network Connection", - "name": "Bluetooth Network Connection", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Bluetooth Device (Personal Area Network)", - "physical_address": "A8-7E-EA-43-23-14", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - } - ], - "extras": [] -} +{"host_name":"DESKTOP-WIN11-HOME","primary_dns_suffix":null,"node_type":"Hybrid","ip_routing_enabled":false,"wins_proxy_enabled":false,"dns_suffix_search_list":["localdomain"],"adapters":[{"name_long":"Ethernet adapter Ethernet","name":"Ethernet","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Intel(R) I211 Gigabit Network Connection","physical_address":"24-4B-FE-AB-43-C3","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]},{"name_long":"Ethernet adapter Ethernet 2","name":"Ethernet 2","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Realtek PCIe 2.5GbE Family Controller","physical_address":"24-4B-FE-57-3D-F2","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]},{"name_long":"Unknown adapter OpenVPN Data Channel Offload for NordVPN","name":"OpenVPN Data Channel Offload for NordVPN","type":"Unknown","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"OpenVPN Data Channel Offload","physical_address":null,"dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]},{"name_long":"Unknown adapter Local Area Connection","name":"Local Area Connection","type":"Unknown","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"TAP-NordVPN Windows Adapter V9","physical_address":"00-FF-4C-F4-5E-49","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]},{"name_long":"Wireless LAN adapter Local Area Connection* 1","name":"Local Area Connection* 1","type":"Wireless LAN","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Microsoft Wi-Fi Direct Virtual Adapter","physical_address":"A8-7E-EA-5A-7F-DE","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]},{"name_long":"Wireless LAN adapter Local Area Connection* 2","name":"Local Area Connection* 2","type":"Wireless LAN","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Microsoft Wi-Fi Direct Virtual Adapter #2","physical_address":"AA-7E-EA-F3-64-C3","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]},{"name_long":"Ethernet adapter VMware Network Adapter VMnet1","name":"VMware Network Adapter VMnet1","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"VMware Virtual Ethernet Adapter for VMnet1","physical_address":"00-50-56-CC-27-73","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[{"address":"fe80::f47d:9c7f:69dc:591e","prefix_length":8,"status":"Preferred"}],"ipv4_addresses":[{"address":"192.168.181.1","subnet_mask":"255.255.255.0","status":"Preferred","autoconfigured":false}],"default_gateways":[],"dhcp_server":"192.168.181.254","dhcpv6_iaid":"771772502","dhcpv6_client_duid":"00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6","dns_servers":[],"primary_wins_server":null,"lease_expires":"Thursday, September 19, 2024 6:01:29 PM","lease_obtained":"Thursday, September 19, 2024 8:31:29 AM","netbios_over_tcpip":true,"media_state":null,"extras":[],"lease_expires_epoch":1726794089,"lease_expires_iso":"2024-09-19T18:01:29","lease_obtained_epoch":1726759889,"lease_obtained_iso":"2024-09-19T08:31:29"},{"name_long":"Ethernet adapter VMware Network Adapter VMnet8","name":"VMware Network Adapter VMnet8","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"VMware Virtual Ethernet Adapter for VMnet8","physical_address":"00-50-56-C9-A3-78","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[{"address":"fe80::4551:bf0d:59dd:a4f0","prefix_length":10,"status":"Preferred"}],"ipv4_addresses":[{"address":"192.168.213.1","subnet_mask":"255.255.255.0","status":"Preferred","autoconfigured":false}],"default_gateways":[],"dhcp_server":"192.168.213.254","dhcpv6_iaid":"788549718","dhcpv6_client_duid":"00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6","dns_servers":[],"primary_wins_server":"192.168.213.2","lease_expires":"Thursday, September 19, 2024 6:01:29 PM","lease_obtained":"Thursday, September 19, 2024 8:31:29 AM","netbios_over_tcpip":true,"media_state":null,"extras":[],"lease_expires_epoch":1726794089,"lease_expires_iso":"2024-09-19T18:01:29","lease_obtained_epoch":1726759889,"lease_obtained_iso":"2024-09-19T08:31:29"},{"name_long":"Wireless LAN adapter Wi-Fi","name":"Wi-Fi","type":"Wireless LAN","connection_specific_dns_suffix":"localdomain","connection_specific_dns_suffix_search_list":[],"description":"Intel(R) Wi-Fi 6 AX200 160MHz","physical_address":"A8-7E-EA-55-26-B0","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[{"address":"fd63:cc9c:65eb:3f95:57c2:aa:10d8:db08","status":"Preferred"}],"temporary_ipv6_addresses":[{"address":"fd63:cc9c:65eb:3f95:8928:348e:d692:b7ef","status":"Preferred"}],"link_local_ipv6_addresses":[{"address":"fe80::4fae:1380:5a1b:8b6b","prefix_length":11,"status":"Preferred"}],"ipv4_addresses":[{"address":"192.168.1.169","subnet_mask":"255.255.255.0","status":"Preferred","autoconfigured":false}],"default_gateways":["192.168.1.1"],"dhcp_server":"192.168.1.1","dhcpv6_iaid":"162037482","dhcpv6_client_duid":"00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6","dns_servers":["192.168.1.1"],"primary_wins_server":null,"lease_expires":"Friday, September 20, 2024 8:31:30 AM","lease_obtained":"Thursday, September 19, 2024 8:31:30 AM","netbios_over_tcpip":true,"media_state":null,"extras":[],"lease_expires_epoch":1726846290,"lease_expires_iso":"2024-09-20T08:31:30","lease_obtained_epoch":1726759890,"lease_obtained_iso":"2024-09-19T08:31:30"},{"name_long":"Ethernet adapter Bluetooth Network Connection","name":"Bluetooth Network Connection","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Bluetooth Device (Personal Area Network)","physical_address":"A8-7E-EA-43-23-14","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]}],"extras":[]} diff --git a/tests/fixtures/windows/windows-7/ipconfig.json b/tests/fixtures/windows/windows-7/ipconfig.json index 53b15bed..a16abe8f 100644 --- a/tests/fixtures/windows/windows-7/ipconfig.json +++ b/tests/fixtures/windows/windows-7/ipconfig.json @@ -1,82 +1 @@ -{ - "host_name": "DESKTOP-WIN7", - "primary_dns_suffix": "somecompany.corp", - "node_type": "Hybrid", - "ip_routing_enabled": false, - "wins_proxy_enabled": false, - "dns_suffix_search_list": [ - "somecompany.corp" - ], - "adapters": [ - { - "name_long": "Ethernet adapter Local Area Connection", - "name": "Local Area Connection", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Intel(R) PRO/1000 MT Network Connection", - "physical_address": "00-0C-29-37-3B-4E", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [ - { - "address": "fe80::c447:d1ef:c29f:c44c", - "prefix_length": 10, - "status": "Preferred" - } - ], - "ipv4_addresses": [ - { - "address": "192.168.22.33", - "subnet_mask": "255.255.255.0", - "status": "Preferred", - "autoconfigured": false - } - ], - "default_gateways": [ - "192.168.22.1" - ], - "dhcp_server": "192.168.22.1", - "dhcpv6_iaid": "234881473", - "dhcpv6_client_duid": "00-01-00-01-29-4E-8F-8A-00-0C-29-88-1B-1F", - "dns_servers": [ - "192.168.22.151" - ], - "primary_wins_server": null, - "lease_expires": "2024-09-24T07:02:58", - "lease_obtained": "2024-09-20T12:13:59", - "netbios_over_tcpip": true, - "media_state": null, - "extras": [] - }, - { - "name_long": "Tunnel adapter isatap.{E24F3EA8-436E-3B26-8BB9-CED33928744B}", - "name": "isatap.{E24F3EA8-436E-3B26-8BB9-CED33928744B}", - "type": "Tunnel", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Microsoft ISATAP Adapter", - "physical_address": "00-00-00-00-00-00-00-E0", - "dhcp_enabled": false, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [], - "default_gateways": [], - "dhcp_server": null, - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [], - "primary_wins_server": null, - "lease_expires": null, - "lease_obtained": null, - "netbios_over_tcpip": null, - "media_state": "Media disconnected", - "extras": [] - } - ], - "extras": [] -} +{"host_name":"DESKTOP-WIN7","primary_dns_suffix":"somecompany.corp","node_type":"Hybrid","ip_routing_enabled":false,"wins_proxy_enabled":false,"dns_suffix_search_list":["somecompany.corp"],"adapters":[{"name_long":"Ethernet adapter Local Area Connection","name":"Local Area Connection","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Intel(R) PRO/1000 MT Network Connection","physical_address":"00-0C-29-37-3B-4E","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[{"address":"fe80::c447:d1ef:c29f:c44c","prefix_length":10,"status":"Preferred"}],"ipv4_addresses":[{"address":"192.168.22.33","subnet_mask":"255.255.255.0","status":"Preferred","autoconfigured":false}],"default_gateways":["192.168.22.1"],"dhcp_server":"192.168.22.1","dhcpv6_iaid":"234881473","dhcpv6_client_duid":"00-01-00-01-29-4E-8F-8A-00-0C-29-88-1B-1F","dns_servers":["192.168.22.151"],"primary_wins_server":null,"lease_expires":"Tuesday, September 24, 2024 7:02:58 AM","lease_obtained":"Friday, September 20, 2024 12:13:59 PM","netbios_over_tcpip":true,"media_state":null,"extras":[],"lease_expires_epoch":1727186578,"lease_expires_iso":"2024-09-24T07:02:58","lease_obtained_epoch":1726859639,"lease_obtained_iso":"2024-09-20T12:13:59"},{"name_long":"Tunnel adapter isatap.{E24F3EA8-436E-3B26-8BB9-CED33928744B}","name":"isatap.{E24F3EA8-436E-3B26-8BB9-CED33928744B}","type":"Tunnel","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Microsoft ISATAP Adapter","physical_address":"00-00-00-00-00-00-00-E0","dhcp_enabled":false,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[],"default_gateways":[],"dhcp_server":null,"dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":[],"primary_wins_server":null,"lease_expires":null,"lease_obtained":null,"netbios_over_tcpip":null,"media_state":"Media disconnected","extras":[]}],"extras":[]} diff --git a/tests/fixtures/windows/windows-xp/ipconfig.json b/tests/fixtures/windows/windows-xp/ipconfig.json index 5cf60b4a..d0c9a9db 100644 --- a/tests/fixtures/windows/windows-xp/ipconfig.json +++ b/tests/fixtures/windows/windows-xp/ipconfig.json @@ -1,51 +1 @@ -{ - "host_name": "DESKTOP-PC4", - "primary_dns_suffix": "somecompany.corp", - "node_type": "Unknown", - "ip_routing_enabled": false, - "wins_proxy_enabled": false, - "dns_suffix_search_list": [ - "somecompany.corp", - "somecompany.xyz" - ], - "adapters": [ - { - "name_long": "Ethernet adapter Local Area Connection", - "name": "Local Area Connection", - "type": "Ethernet", - "connection_specific_dns_suffix": null, - "connection_specific_dns_suffix_search_list": [], - "description": "Intel(R) PRO/1000 MT Network Connection", - "physical_address": "00-0C-29-25-B6-4D", - "dhcp_enabled": true, - "autoconfiguration_enabled": true, - "ipv6_addresses": [], - "temporary_ipv6_addresses": [], - "link_local_ipv6_addresses": [], - "ipv4_addresses": [ - { - "address": "192.168.22.135", - "subnet_mask": "255.255.255.0", - "status": null, - "autoconfigured": false - } - ], - "default_gateways": [ - "192.168.22.1" - ], - "dhcp_server": "192.168.22.1", - "dhcpv6_iaid": null, - "dhcpv6_client_duid": null, - "dns_servers": [ - "192.168.22.151" - ], - "primary_wins_server": null, - "lease_expires": "2024-09-22T22:31:26", - "lease_obtained": "2024-09-21T22:31:26", - "netbios_over_tcpip": null, - "media_state": null, - "extras": [] - } - ], - "extras": [] -} +{"host_name":"DESKTOP-PC4","primary_dns_suffix":"somecompany.corp","node_type":"Unknown","ip_routing_enabled":false,"wins_proxy_enabled":false,"dns_suffix_search_list":["somecompany.corp","somecompany.xyz"],"adapters":[{"name_long":"Ethernet adapter Local Area Connection","name":"Local Area Connection","type":"Ethernet","connection_specific_dns_suffix":null,"connection_specific_dns_suffix_search_list":[],"description":"Intel(R) PRO/1000 MT Network Connection","physical_address":"00-0C-29-25-B6-4D","dhcp_enabled":true,"autoconfiguration_enabled":true,"ipv6_addresses":[],"temporary_ipv6_addresses":[],"link_local_ipv6_addresses":[],"ipv4_addresses":[{"address":"192.168.22.135","subnet_mask":"255.255.255.0","status":null,"autoconfigured":false}],"default_gateways":["192.168.22.1"],"dhcp_server":"192.168.22.1","dhcpv6_iaid":null,"dhcpv6_client_duid":null,"dns_servers":["192.168.22.151"],"primary_wins_server":null,"lease_expires":"Sunday, September 22, 2024 10:31:26 PM","lease_obtained":"Saturday, September 21, 2024 10:31:26 PM","netbios_over_tcpip":null,"media_state":null,"extras":[],"lease_expires_epoch":1727069486,"lease_expires_iso":"2024-09-22T22:31:26","lease_obtained_epoch":1726983086,"lease_obtained_iso":"2024-09-21T22:31:26"}],"extras":[]}