Generated by GPT-5-mini| libyang | |
|---|---|
| Name | libyang |
| Developer | sysrepo developers |
| Released | 2013 |
| Operating system | Linux, FreeBSD, macOS |
| License | GNU Lesser General Public License |
libyang is a C library that implements the YANG (data modeling language) specification and provides parsing, validation, and manipulation of YANG schemas and corresponding YANG-encoded data. It serves as a core component in several network configuration and management projects, offering an API used by connection managers, orchestration tools, and control plane daemons. Widely adopted in open-source networking ecosystems, libyang interoperates with schema repositories, NETCONF clients, and RESTCONF implementations.
libyang was created to support projects relying on the IETF YANG standard for modeling configuration and state data. It provides capabilities for parsing YANG modules, resolving imports and includes, and validating instances encoded in XML or JSON. Implementations using libyang include control plane agents, monitoring collectors, and orchestration platforms that integrate with protocols such as NETCONF and RESTCONF. The project has contributors from groups involved with OpenDaylight, FRRouting, sysrepo, and several academic and industry teams working on programmable networking and intent-based networking.
The library is implemented in portable C and designed for integration into network daemons and management tools running on Linux, FreeBSD, and macOS platforms. Its modular architecture separates schema parsing, data tree management, and validation logic. The schema engine supports module parsing, type system management, and feature/identity resolution and exposes abstract syntax tree structures that other components can traverse. libyang’s internal design emphasizes memory efficiency for embedded targets and thread-safety for multi-threaded servers such as those used by Juniper Networks-influenced tooling or Cisco-compatible agents. The project follows common open-source practices adopted by communities around GitHub and GitLab and integrates with build systems like CMake and Autotools.
libyang implements the YANG 1.0 and YANG 1.1 specifications, including constructs such as modules, submodules, typedefs, groupings, and augmentations. It supports the IETF NETMOD working group’s model conventions, validation rules for leafrefs, must-expressions, and XPath as used in RFC 7950 and related documents. The library also handles identity and defaulting semantics as specified in revisions from IETF drafts and working group decisions. Validation covers instance data semantics for containers, lists, and key constraints, enabling compliance checks essential to management systems employed by vendors like Arista Networks and projects such as OpenConfig.
libyang exposes a C API that provides functions to load modules, parse instance trees, serialize data, and perform schema-aware queries. The API enables applications to manipulate data trees programmatically and integrate with storage backends or runtime state repositories. Language bindings and wrappers exist to facilitate use from higher-level runtimes, including bindings for Python and adapters used in systems built with Go and Rust via foreign function interfaces. These bindings make libyang accessible to automation frameworks employed by Ansible playbooks, continuous integration pipelines in Jenkins environments, and telemetry collectors that interoperate with Prometheus exporters or InfluxDB agents.
Development of libyang is driven by a mix of corporate contributors, independent maintainers, and users who integrate the library into orchestration stacks, management agents, and testing harnesses. It is commonly integrated with configuration datastore libraries such as sysrepo and with management protocols like NETCONF servers and RESTCONF adapters. The project includes utilities for schema compilation, module dependency analysis, and example tools demonstrating usage with HTTP-based northbound interfaces. Continuous integration and testing use platforms and services popular in open-source ecosystems, including Travis CI, GitLab CI/CD, and containerization with Docker for reproducible test environments.
libyang is distributed under the GNU Lesser General Public License allowing linking from proprietary and open-source software while ensuring collaborative contributions to the library itself. The licensing choice has facilitated adoption in both vendor projects and community-driven platforms. Notable adoptions include integrations in control plane projects associated with OpenConfig efforts, management solutions used by Telefónica-scale deployments, and research prototypes developed by academic groups at institutions collaborating with standards bodies like IETF and IEEE. The library’s combination of standards compliance, extensible API, and permissive linking terms has made it a de facto component in modern model-driven network management stacks.
Category:Software libraries Category:Network management Category:C (programming language) libraries