Skip to content

TerjeLafton/yang-rs

Repository files navigation

yang-rs

A collection of Rust libraries for working with YANG modules to manage network devices. This project is experimental and under active development.

Overview

yang-rs aims to provide a comprehensive set of tools for network automation using YANG modeling language in Rust. It enables parsing YANG modules, generating Rust code from YANG models, and interfacing with network devices using gNMI. Heavily inspired by the functionality provided by ygot provides for Go.

Current Status

Crate Status
yang-parser Initial implementation underway - sufficient for development of other crates to begin
yang-codegen Development just started
yang-gnmi Not started

Crates

yang-parser

The parser component converts YANG modules into Rust structs with resolved references. While primarily used by other crates in this repository, it's designed with a public API that allows others to build custom solutions on top of it.

The initial implementation takes a pragmatic approach, assuming YANG modules are well-formed. For more detailed information, please refer to the README in the yang-parser crate.

yang-codegen

This crate transforms the Rust structs returned by yang-parser into Rust code representing the data nodes in the YANG schema. For example:

  • Container nodes become Rust structs
  • Leaf nodes become struct fields

The primary goal is to generate structs that integrate seamlessly with yang-gnmi for network device management.

yang-gnmi

This crate provides the network interface functionality, allowing users to configure and subscribe to data on network devices. It leverages the structs generated by yang-codegen to create a type-safe experience, while focusing on providing:

  • A client for connecting to network devices
  • Utilities for creating and managing gNMI requests
  • A clean API for device configuration and monitoring

About

An experimental YANG parser written in Rust with pest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages