Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Kea Kea
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 555
    • Issues 555
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 66
    • Merge requests 66
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source ProjectsISC Open Source Projects
  • KeaKea
  • Issues
  • #1994
Closed
Open
Issue created Jul 27, 2021 by Andrei Pavel@andreiMaintainer

automatic YANG translators

Universal/softcoded/automatic translators.

Turn this:

    ConstElementPtr networks = getSharedNetworks(xpath);
    if (networks && !networks->empty()) {
        result->set("shared-networks", networks);
    }
    ConstElementPtr classes = getClasses(xpath);
    if (classes && !classes->empty()) {
        result->set("client-classes", classes);
    }
    ConstElementPtr database = getDatabase(xpath + "/lease-database");
    if (database) {
        result->set("lease-database", database);
    }
[...]

into something like this pseudocode:

    ElementPtr result = Element::createMap();
    for (S_Data_Node i : module->dataNodes()) {
        result->set(i->xpath(), Element::from(i->valueStr()));
    }

It would work with any module out-of-the-box and no node would be left out. When a new node gets added in the configuration, on top of the usual bison parser diligences, we would only need to update the YANG module.

The nodes of the Kea YANG modules would be 1:1 with the JSON configuration. For the IETF model, indeed the data would require changing, but at least this automatic translator would get you the YANG data in ElementPtr form and you would start from there.

Benefits:

  • makes configuration maintenance easier
  • is less error-prone
  • improves performance because non-existing nodes are no longer checked
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking