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

On-wire algorithm in pseudo code #204

Open
avtobiff opened this issue Apr 24, 2023 · 1 comment
Open

On-wire algorithm in pseudo code #204

avtobiff opened this issue Apr 24, 2023 · 1 comment
Labels
schema-comparison Issues related to the YANG schema comparison draft

Comments

@avtobiff
Copy link
Collaborator

avtobiff commented Apr 24, 2023

Starting point for discussion about pseudo code for the on-wire algorithm.

// collect analysis rules
rules = common rules + encoding rules  // encoding may override common
verbosity = verbosity level from user
skips = skip-analysis from user

// the subset of the schema to be analyzed
filters = yang artifact filters from user
paths-old = instance-identifiers for all nodes in old yang artifact - filters
paths-new = instance-identifiers for all nodes in new yang artifact - filters
yang-nodes-old = get old yang-artifact for all paths-old
yang-nodes-new = get new yang-artifact for all paths-new

// initialize empty analysis-result
analysis-result = []

// perform analysis
for each p-new in paths-new:

    // node removed in new model
    if p-new is not in paths-old:
        append p-new as removed to analysis-result

    // node exists in both models, p-old == p-new
    else:
        yang-node-old = yang-nodes-old[p-new]
        yang-node-new = yang-nodes-new[p-new]
        for each rule in rules:
            analyze(rule, yang-node-old, yang-node-new) and \
                append result to analysis-result

// report
for result in analysis-result:

    if result[rule] is not in skips AND result[rule] is above verbosity:

        print result
@avtobiff avtobiff added the schema-comparison Issues related to the YANG schema comparison draft label Apr 24, 2023
@avtobiff
Copy link
Collaborator Author

Should we capture additions in the new YANG artifact?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
schema-comparison Issues related to the YANG schema comparison draft
Projects
None yet
Development

No branches or pull requests

1 participant