ios-config 0.1.0

Zero-dependency Cisco IOS configuration parser. Parses show running-config output into a typed IR.
Documentation

ios-config

A Cisco IOS show running-config parser that produces a typed intermediate representation (IR) covering interfaces, routing (OSPF, BGP, static), ACLs, NAT, VLANs, SNMP, AAA, STP, and more.

Quick start

use ios_config::parse;

let raw = r#"
hostname CORE-RTR-01
!
interface GigabitEthernet0/0
 description WAN
 ip address 203.0.113.1 255.255.255.252
 no shutdown
!
router ospf 1
 router-id 1.1.1.1
 network 203.0.113.0 0.0.0.3 area 0
"#;

let config = parse(raw).unwrap();
assert_eq!(config.hostname.as_deref(), Some("CORE-RTR-01"));
assert_eq!(config.interfaces.len(), 1);
assert_eq!(config.routing.ospf.len(), 1);

What gets parsed

Section Types
Interfaces GigabitEthernet, FastEthernet, TenGigabitEthernet, Loopback, Vlan, Tunnel, Serial
L2 switchport access/trunk, voice vlan, storm-control, STP per-interface
Routing static routes, OSPF (multi-process), BGP (neighbors, peer-groups, address-families), EIGRP
ACL standard and extended, named and numbered
NAT dynamic, PAT/overload, static
Management NTP, DNS, SNMP, AAA, SSH, line vty, local users, banner
Global STP mode, loopguard, portfast/bpduguard defaults, per-VLAN priority
Unknown unrecognized commands preserved in unknown_blocks