diff options
| author | Renato Westphal <renato@opensourcerouting.org> | 2018-08-05 12:28:33 -0300 | 
|---|---|---|
| committer | Renato Westphal <renato@opensourcerouting.org> | 2018-10-27 16:16:12 -0200 | 
| commit | 65986799464e2d6da3d9aa4099ab1ba7eb09a8fe (patch) | |
| tree | ad8844d1f2ce1608912ad4c0c604d279ee084e5c /yang/ietf | |
| parent | fe339c9560ee3665c66033ccbbfc8b3eac02d035 (diff) | |
yang: add a module translator for ietf-rip.yang
As it can be seen below, this translator covers only ~13% of the
ietf-rip YANG module. Work must be done to increase that number.
ripd> en
ripd# conf t
ripd(config)# yang module-translator load /tmp/frr-ietf-translator.json
% Module translator "ietf" loaded successfully.
ripd(config)# do show yang module-translator
 Family  Module           Deviations                      Coverage (%)
 -----------------------------------------------------------------------
 ietf    ietf-interfaces  frr-deviations-ietf-interfaces  3.92
 ietf    ietf-routing     frr-deviations-ietf-routing     1.56
 ietf    ietf-rip         frr-deviations-ietf-rip         13.60
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'yang/ietf')
| -rw-r--r-- | yang/ietf/frr-deviations-ietf-interfaces.yang | 72 | ||||
| -rw-r--r-- | yang/ietf/frr-deviations-ietf-rip.yang | 197 | ||||
| -rw-r--r-- | yang/ietf/frr-deviations-ietf-routing.yang | 53 | ||||
| -rw-r--r-- | yang/ietf/frr-ietf-translator.json | 113 | 
4 files changed, 435 insertions, 0 deletions
diff --git a/yang/ietf/frr-deviations-ietf-interfaces.yang b/yang/ietf/frr-deviations-ietf-interfaces.yang new file mode 100644 index 0000000000..6528d66d22 --- /dev/null +++ b/yang/ietf/frr-deviations-ietf-interfaces.yang @@ -0,0 +1,72 @@ +module frr-deviations-ietf-interfaces { +  yang-version 1.1; +  namespace "http://frrouting.org/yang/frr-deviations-ietf-interfaces"; +  prefix frr-deviations-ietf-interfaces; + +  import ietf-interfaces { +    prefix ietf-interfaces; +  } + +  organization +    "Free Range Routing"; + +  contact +    "FRR Users List:       <mailto:frog@lists.frrouting.org> +     FRR Development List: <mailto:dev@lists.frrouting.org>"; + +  description +    "This module defines deviation statements for the ietf-interfaces +     module."; + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:type" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:enabled" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:link-up-down-trap-enable" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:admin-status" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:oper-status" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:last-change" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:if-index" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:phys-address" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:higher-layer-if" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:lower-layer-if" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:speed" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces/ietf-interfaces:interface/ietf-interfaces:statistics" { +    deviate not-supported; +  } + +  deviation "/ietf-interfaces:interfaces-state" { +    deviate not-supported; +  } +} diff --git a/yang/ietf/frr-deviations-ietf-rip.yang b/yang/ietf/frr-deviations-ietf-rip.yang new file mode 100644 index 0000000000..42ed8e3c09 --- /dev/null +++ b/yang/ietf/frr-deviations-ietf-rip.yang @@ -0,0 +1,197 @@ +module frr-deviations-ietf-rip { +  yang-version 1.1; +  namespace "http://frrouting.org/yang/frr-deviations-ietf-rip"; +  prefix frr-deviations-ietf-rip; + +  import ietf-routing { +    prefix ietf-routing; +  } + +  import ietf-rip { +    prefix ietf-rip; +  } + +  organization +    "Free Range Routing"; + +  contact +    "FRR Users List:       <mailto:frog@lists.frrouting.org> +     FRR Development List: <mailto:dev@lists.frrouting.org>"; + +  description +    "This module defines deviation statements for the ietf-rip +     module."; + +  deviation "/ietf-rip:clear-rip-route/ietf-rip:input" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:originate-default-route/ietf-rip:route-policy" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:distance" { +    deviate replace { +      type uint8 { +        range 0..255; +      } +    } +    deviate replace { +      default "0"; +    } +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:triggered-update-threshold" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:maximum-paths" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:output-delay" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:distribute-list" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:redistribute" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers" { +    deviate delete { +      must "invalid-interval >= (update-interval * 3)"; +    } +    deviate delete { +      must "flush-interval > invalid-interval"; +    } +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:update-interval" { +    deviate replace { +      type uint32; +    } +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:invalid-interval" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:holddown-interval" { +    deviate replace { +      type uint32; +    } +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:timers/ietf-rip:flush-interval" { +    deviate replace { +      default "120"; +    } +    deviate replace { +      type uint32; +    } +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:authentication" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:bfd" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:cost" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:neighbors" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:no-listen" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:passive" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:originate-default-route" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:summary-address" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:timers" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:oper-status" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:next-full-update" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:valid-address" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:interfaces/ietf-rip:interface/ietf-rip:statistics" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:next-triggered-update" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:num-of-routes" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:redistributed" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:route-type" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:expire-time" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:deleted" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:holddown" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:need-triggered-update" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:inactive" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv4/ietf-rip:routes/ietf-rip:route/ietf-rip:flush-expire-before-holddown" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:ipv6" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-rip:rip/ietf-rip:statistics" { +    deviate not-supported; +  } +} diff --git a/yang/ietf/frr-deviations-ietf-routing.yang b/yang/ietf/frr-deviations-ietf-routing.yang new file mode 100644 index 0000000000..62787e782c --- /dev/null +++ b/yang/ietf/frr-deviations-ietf-routing.yang @@ -0,0 +1,53 @@ +module frr-deviations-ietf-routing { +  yang-version 1.1; +  namespace "http://frrouting.org/yang/frr-deviations-ietf-routing"; +  prefix frr-deviations-ietf-routing; + +  import ietf-routing { +    prefix ietf-routing; +  } + +  organization +    "Free Range Routing"; + +  contact +    "FRR Users List:       <mailto:frog@lists.frrouting.org> +     FRR Development List: <mailto:dev@lists.frrouting.org>"; + +  description +    "This module defines deviation statements for the ietf-routing +     module."; + +  deviation "/ietf-routing:routing/ietf-routing:router-id" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:interfaces" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol" { +    deviate add { +      must '(type != "ietf-rip:ripv2") or (name = "main")' { +        description +          "ripd supports one RIP instance only"; +      } +    } +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-routing:description" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:control-plane-protocols/ietf-routing:control-plane-protocol/ietf-routing:static-routes" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing/ietf-routing:ribs" { +    deviate not-supported; +  } + +  deviation "/ietf-routing:routing-state" { +    deviate not-supported; +  } +} diff --git a/yang/ietf/frr-ietf-translator.json b/yang/ietf/frr-ietf-translator.json new file mode 100644 index 0000000000..9855480b45 --- /dev/null +++ b/yang/ietf/frr-ietf-translator.json @@ -0,0 +1,113 @@ +{ +  "frr-module-translator:frr-module-translator": { +    "family": "ietf", +    "module": [ +      { +        "name": "ietf-interfaces@2018-01-09", +        "deviations": "frr-deviations-ietf-interfaces", +        "mappings": [ +          { +            "custom": "/ietf-interfaces:interfaces/interface[name='KEY1']", +            "native": "/frr-interface:lib/interface[name='KEY1'][vrf='default']" +          }, +          { +            "custom": "/ietf-interfaces:interfaces/interface[name='KEY1']/description", +            "native": "/frr-interface:lib/interface[name='KEY1'][vrf='default']/description" +          } +        ] +      }, +      { +        "name": "ietf-routing@2018-01-25", +        "deviations": "frr-deviations-ietf-routing", +        "mappings": [ +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']", +            "native": "/frr-ripd:ripd/instance" +          } +        ] +      }, +      { +        "name": "ietf-rip@2018-02-03", +        "deviations": "frr-deviations-ietf-rip", +        "mappings": [ +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/default-metric", +            "native": "/frr-ripd:ripd/instance/default-metric" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/distance", +            "native": "/frr-ripd:ripd/instance/distance/default" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/originate-default-route/enabled", +            "native": "/frr-ripd:ripd/instance/default-information-originate" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/timers/update-interval", +            "native": "/frr-ripd:ripd/instance/timers/update-interval" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/timers/holddown-interval", +            "native": "/frr-ripd:ripd/instance/timers/holddown-interval" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/timers/flush-interval", +            "native": "/frr-ripd:ripd/instance/timers/flush-interval" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/interfaces/interface[interface='KEY1']", +            "native": "/frr-ripd:ripd/instance/interface[.='KEY1']" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/interfaces/interface[interface='KEY1']/split-horizon", +            "native": "/frr-interface:lib/interface[name='KEY1'][vrf='default']/frr-ripd:rip/split-horizon" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']", +            "native": "/frr-ripd:ripd/state/neighbors/neighbor[address='KEY1']" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/ipv4-address", +            "native": "/frr-ripd:ripd/state/neighbors/neighbor[address='KEY1']/address" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/last-update", +            "native": "/frr-ripd:ripd/state/neighbors/neighbor[address='KEY1']/last-update" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/bad-packets-rcvd", +            "native": "/frr-ripd:ripd/state/neighbors/neighbor[address='KEY1']/bad-packets-rcvd" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/neighbors/neighbor[ipv4-address='KEY1']/bad-routes-rcvd", +            "native": "/frr-ripd:ripd/state/neighbors/neighbor[address='KEY1']/bad-routes-rcvd" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']", +            "native": "/frr-ripd:ripd/state/routes/route[prefix='KEY1']" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/ipv4-prefix", +            "native": "/frr-ripd:ripd/state/routes/route[prefix='KEY1']/prefix" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/next-hop", +            "native": "/frr-ripd:ripd/state/routes/route[prefix='KEY1']/next-hop" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/interface", +            "native": "/frr-ripd:ripd/state/routes/route[prefix='KEY1']/interface" +          }, +          { +            "custom": "/ietf-routing:routing/control-plane-protocols/control-plane-protocol[type='ietf-rip:ripv2'][name='main']/ietf-rip:rip/ipv4/routes/route[ipv4-prefix='KEY1']/metric", +            "native": "/frr-ripd:ripd/state/routes/route[prefix='KEY1']/metric" +          }, +          { +            "custom": "/ietf-rip:clear-rip-route", +            "native": "/frr-ripd:clear-rip-route" +          } +        ] +      } +    ] +  } +}  | 
