Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YANG: using leaf-list #1204 #1214

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/lib/yang/test-schema-v1.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module test-schema-v1 {
namespace snabb:test;
prefix test;

import ietf-inet-types { prefix inet; }
import ietf-yang-types { prefix yang; }

container test-config {
container ports {
container port-range {
leaf start {type uint16; default 1025;}
leaf end {type uint16; default 32000;}
}
}
}
}
8 changes: 8 additions & 0 deletions src/program/test_yang/test_yang.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
test-config {
ports{
port-range{
start 1024;
end 32000;
}
}
}
14 changes: 14 additions & 0 deletions src/program/test_yang/test_yang.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module(..., package.seeall)

local schema = require("lib.yang.schema")
local yang = require('lib.yang.yang')

function run (parameters)
local schema_name = 'test-schema-v1'
local schema = schema.load_schema_by_name(schema_name)
local conf = yang.load_configuration(parameters[1],{schema_name=schema_name, verbose = true})

local c = config.new()
engine.configure(c)
engine.main({duration=1})
end