# netconv-core
Vendor-agnostic IR (intermediate representation) types and traits for
network device configuration conversion — the shared foundation that
[`ios-config`](https://crates.io/crates/ios-config) (parser) and the
`netconv-render-*` crates (renderers) are built on.
## What's in it
- **`ir`** — the typed `NetworkConfig` model (interfaces, routing, ACLs,
NAT, VLANs, and more) that a vendor-specific parser fills in and a
vendor-specific renderer reads back out. Vendor-neutral by design:
the same `NetworkConfig` value can, in principle, come from any
parser and go to any renderer.
- **`traits::ConfigParser`** / **`traits::ConfigRenderer`** — the two
traits a parser and a renderer implement, plus `convert()` /
`convert_with_profile()`, which wire a `ConfigParser` + a
`ConfigRenderer` together into a single parse → render pipeline.
- **`report::ConversionReport`** — collects what a parser didn't
recognize and what a renderer had to skip or handle manually, instead
of either silently dropping input or silently emitting something
wrong.
- **`profile::DeviceProfile`** — the `L2Switch` / `L3Router` split, and
`detect_domain_mismatches()`, which flags IR content that doesn't
belong to the profile being converted for (e.g. routing config found
while converting for an L2 switch profile) before a renderer gets a
chance to render it anyway.
## Example
```rust
use netconv_core::{ConfigParser, ConfigRenderer, convert};
fn run<P: ConfigParser, R: ConfigRenderer>(parser: &P, renderer: &R, raw: &str) {
let output = convert(parser, renderer, raw).expect("conversion failed");
println!("{}", output.config_text);
if !output.report.items.is_empty() {
eprintln!("{} item(s) need review", output.report.items.len());
}
}
```
This crate has no parser or renderer of its own — see
[`ios-config`](https://crates.io/crates/ios-config) for an implementation
of `ConfigParser`, or the main
[netconv](https://github.com/casablanque-code/netconv) repository for
the CLI, web UI, and renderers.
## License
MIT