Skip to content
jc-rs
GitHub

route-print

--route-printv1.0.0

Converts Windows `route print` command output to JSON

Windowscommand
$ cat input.txt | jc-rs --route-print

A real pair

From the reference corpus (windows/windows-xp/route_print.json). The left pane is the input the fixture ships; the right pane is the corpus's expected JSON. The coverage note below explains why this pair does not enter the measured comparison. Hover a value to see where it came from.

route_printwindows-xp
IPv4 Route Table
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 0c 29 21 f9 3e ...... Intel(R) PRO/1000 MT Network Connection - Packet Scheduler Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0     192.168.22.1   192.168.22.135     10
         10.0.4.0    255.255.255.0     192.168.22.1   192.168.22.135      1
        127.0.0.0        255.0.0.0        127.0.0.1        127.0.0.1      1
     192.168.22.0    255.255.255.0   192.168.22.135   192.168.22.135     10
   192.168.22.135  255.255.255.255        127.0.0.1        127.0.0.1     10
   192.168.22.255  255.255.255.255   192.168.22.135   192.168.22.135     10
        224.0.0.0        240.0.0.0   192.168.22.135   192.168.22.135     10
  255.255.255.255  255.255.255.255   192.168.22.135   192.168.22.135      1
Default Gateway:      192.168.22.1
===========================================================================
Persistent Routes:
  Network Address          Netmask  Gateway Address  Metric
         10.0.4.0    255.255.255.0     192.168.22.1       1
expected outputjson
Use the Left and Right arrow keys to highlight the matching value in the input.
{
  "interface_list": [
    {
      "interface_index": 1,
      "mac_address": null,
      "description": ". MS TCP Loopback interface"
    },
    {
      "interface_index": 2,
      "mac_address": "00:0c:29:21:f9:3e",
      "description": ". Intel(R) PRO/1000 MT Network Connection - Packet Scheduler Miniport"
    }
  ],
  "ipv4_route_table": {
    "active_routes": [
      {
        "network_destination": "0.0.0.0",
        "netmask": "0.0.0.0",
        "gateway": "192.168.22.1",
        "interface": "192.168.22.135",
        "metric": 10,
        "metric_set_to_default": false
      },
      {
        "network_destination": "10.0.4.0",
        "netmask": "255.255.255.0",
        "gateway": "192.168.22.1",
        "interface": "192.168.22.135",
        "metric": 1,
        "metric_set_to_default": false
      },
      {
        "network_destination": "127.0.0.0",
        "netmask": "255.0.0.0",
        "gateway": "127.0.0.1",
        "interface": "127.0.0.1",
        "metric": 1,
        "metric_set_to_default": false
      },
      {
        "network_destination": "192.168.22.0",
        "netmask": "255.255.255.0",
        "gateway": "192.168.22.135",
        "interface": "192.168.22.135",
        "metric": 10,
        "metric_set_to_default": false
      },
      {
        "network_destination": "192.168.22.135",
        "netmask": "255.255.255.255",
        "gateway": "127.0.0.1",
        "interface": "127.0.0.1",
        "metric": 10,
        "metric_set_to_default": false
      },
      {
        "network_destination": "192.168.22.255",
        "netmask": "255.255.255.255",
        "gateway": "192.168.22.135",
        "interface": "192.168.22.135",
        "metric": 10,
        "metric_set_to_default": false
      },
      {
        "network_destination": "224.0.0.0",
        "netmask": "240.0.0.0",
        "gateway": "192.168.22.135",
        "interface": "192.168.22.135",
        "metric": 10,
        "metric_set_to_default": false
      },
      {
        "network_destination": "255.255.255.255",
        "netmask": "255.255.255.255",
        "gateway": "192.168.22.135",
        "interface": "192.168.22.135",
        "metric": 1,
        "metric_set_to_default": false
      }
    ],
    "persistent_routes": [
      {
        "network_address": "10.0.4.0",
        "netmask": "255.255.255.0",
        "gateway_address": "192.168.22.1",
        "metric": 1,
        "metric_set_to_default": false
      }
    ]
  },
  "ipv6_route_table": {
    "active_routes": [],
    "persistent_routes": []
  }
}

Fixture coverage

noneThe reference corpus ships no oracle-valid fixture for this parser, so the differential cannot speak for it. That is reported, not hidden.

Magic syntax

not availableThis parser reads a file or a string rather than a command, so there is nothing for jc-rs to run. Pipe it in.

Source: crates/jc-rs-parsers/src/network/route_print.rs. jc-rs targets the schemas defined by the original Python tool. Fixture coverage above is the measured evidence for this parser; test the inputs your pipeline depends on. Compare