Skip to content

Commit

Permalink
staticd: yang defination
Browse files Browse the repository at this point in the history
Yang files for staticd to use northbound APIs

Signed-off-by: vishaldhingra vdhingra@vmware.com
               Santosh P K   sapk@vmware.com
  • Loading branch information
vishaldhingra committed Dec 4, 2019
1 parent a5f271c commit d2d8a29
Show file tree
Hide file tree
Showing 9 changed files with 2,001 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ nodist_lib_libfrr_la_SOURCES = \
yang/frr-route-types.yang.c \
yang/ietf/ietf-routing-types.yang.c \
yang/frr-module-translator.yang.c \
yang/ietf/ietf-ipv4-unicast-routing@2018-03-13.yang.c \
yang/ietf/ietf-ipv6-unicast-routing@2018-03-13.yang.c \
yang/ietf/ietf-rib-extension@2019-03-11.yang.c \
yang/ietf/ietf-routing@2018-03-13.yang.c \
# end

vtysh_scan += \
Expand Down
150 changes: 150 additions & 0 deletions yang/frr-staticd.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
module frr-staticd {
yang-version "1.1";
namespace "http://frrouting.org/yang/staticd";

prefix frr-staticd;

import ietf-routing-types {
prefix "rt-types";
}

import ietf-routing {
prefix "rt";
}

import ietf-ipv4-unicast-routing {
prefix "v4ur";
}

import ietf-ipv6-unicast-routing {
prefix "v6ur";
}

import frr-vrf {
prefix frr-vrf;
}

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 a model for managing FRR staticd information.
This YANG module augments the ietf-routing with additional
nexthop information";

revision 2019-12-03 {
description
"Initial revision.";
}

grouping nexthop-common-attributes {
leaf table-id {
type uint32 {
range "1..4294967295";
}
description
"Routing table id to retrieve.";
}
leaf distance {
type uint8 {
range "1..255";
}
description
"Admin distance based on routing protocol.";
}
leaf mpls-label {
type rt-types:mpls-label;
description
"Nexthop's MPLS label stack.";
}
leaf nexthop-vrf {
type string {
length "1..36";
}
description
"The nexthop vrf name, if different from the route.";
}
}

grouping frr-staticd-nexthop {

choice next-hop-type {
case gateway {
leaf gw-interface {
type string {
length "1..16";
}
description
"Name of the outgoing interface.";
}
leaf is-onlink {
type empty;
description
"Nexthop is directly connected.";
}
}
case ifname {
leaf outgoing-interface {
type string {
length "1..16";
}
description
"Name of the outgoing interface.";
}
}
case Null0 {
leaf Null0 {
type boolean;
default false;
description
"Null interface";
}
}
case reject {
leaf reject {
type boolean;
default false;
description
"Emit an ICMP unreachable when matched";
}
}
case blackhole {
leaf blackhole {
type boolean;
default false;
description
"Silently discard pkts when matched";
}
}
}

uses nexthop-common-attributes;

}


augment "/frr-vrf:lib/frr-vrf:vrf"
+ "/rt:routing/rt:control-plane-protocols/"
+ "rt:control-plane-protocol/rt:static-routes/v4ur:ipv4/"
+ "v4ur:route/v4ur:next-hop/v4ur:next-hop-options/"
+ "v4ur:next-hop-list/v4ur:next-hop-list/v4ur:next-hop"
{
description
"Augment static route configuration 'next-hop-list'.";
uses frr-staticd-nexthop;
}
augment "/frr-vrf:lib/frr-vrf:vrf"
+ "/rt:routing/rt:control-plane-protocols/"
+ "rt:control-plane-protocol/rt:static-routes/v6ur:ipv6/"
+ "v6ur:route/v6ur:next-hop/v6ur:next-hop-options/"
+ "v6ur:next-hop-list/v6ur:next-hop-list/v6ur:next-hop"
{
description
"Augment static route configuration 'next-hop-list'.";
uses frr-staticd-nexthop;
}
}
33 changes: 33 additions & 0 deletions yang/frr-vrf.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module frr-vrf {
yang-version 1.1;
namespace "http://frrouting.org/yang/vrf";
prefix frr-vrf;

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 a model for managing FRR VRFs.";

revision 2019-12-03 {
description
"Initial revision.";
}

container lib {
list vrf {
key "name";
description
"vrf name.";
leaf name {
type string {
length "1..36";
}
description
"VRF is associated with frr";
}
}
}
}
Loading

0 comments on commit d2d8a29

Please sign in to comment.