GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - nsg-ethz/axiom: A logic programming language for analyzing and checking configuration files.

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
axiom-macros
axiom-macros
 
 
docs
docs
 
 
editor/emacs
editor/emacs
 
 
evaluation
evaluation
 
 
examples
examples
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
clippy.toml
clippy.toml
 
 
flake.lock
flake.lock
 
 
flake.nix
flake.nix
 
 

Repository files navigation

Axiom

Axiom is a static analyzer for router configurations. It checks a network against a design: .ax files describe which configuration commands matter, turn their values into typed facts, and state properties that must hold across devices. Axiom derives the facts to a fixed point, then reports failed assertions with source locations. Designs can also emit logs and non-failing warnings.

A design is a reusable template, not a script that runs over configuration lines. A configuration path activates the definitions that match it; the facts they derive can be queried anywhere in the network design. This separates the vendor-specific shape of router files from network-wide checks.

Example: two ends of a link

Suppose r0 configures 10.0.0.1/30 on eth0, and r1 configures 10.0.0.2/30. The same interface design is used for both devices:

rel Subnet(device: String, iface: String, net: IpNet);

def (device: String, "interface", iface: String) {
  def ("ip", "address", ip: IpNet):
    set Subnet(device, iface, trunc(ip));
}

Matching each router's ip address command produces a Subnet fact. trunc drops the host bits, so both addresses yield 10.0.0.0/30. A separate network design declares the link and checks that both endpoints have addresses in the same subnet:

rel Link(left: String, left_iface: String, right: String, right_iface: String);

set Link("r0", "eth0", "r1", "eth0");
set Link("r1", "eth0", "r0", "eth0");

for Link(left: String, left_iface: String, right: String, right_iface: String) {
  assert Subnet(left, left_iface, _): "a link endpoint needs an IP address";
  for Subnet(left, left_iface, net: IpNet):
    assert Subnet(right, right_iface, net): "link endpoints must share a subnet";
}

Changing one address to a different subnet fails the check; removing an address fails the presence assertion. Link is declared by this design, not built in. The complete runnable example includes network.toml and both router configurations.

Install with cargo install axiom and run axiom network.toml. From this source checkout, run cargo run -- docs/examples/first/network.toml instead.

Read the book for the tutorial, language reference, and grammar. The parser's grammar is src/frontend/design_lang/language.pest; the only built-in relation is Config.

License

Axiom is free software licensed under the GNU General Public License, version 3 or (at your option) any later version (GPL-3.0-or-later).

Running Axiom does not impose this license on user-supplied configurations or design files, or on ordinary analysis results and reports. Those inputs and outputs retain their own licensing; copying GPL-covered material into them may carry separate obligations.

About

A logic programming language for analyzing and checking configuration files.

Resources

Readme
GPL-3.0 license
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.