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 10, 2019
1 parent a5f271c commit 62c7633
Show file tree
Hide file tree
Showing 10 changed files with 2,376 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,15 @@ lib_libfrr_la_SOURCES = \
nodist_lib_libfrr_la_SOURCES = \
yang/frr-interface.yang.c \
yang/frr-route-types.yang.c \
yang/frr-staticd.yang.c \
yang/ietf/ietf-routing-types.yang.c \
yang/frr-module-translator.yang.c \
yang/ietf/ietf-ipv4-unicast-routing.yang.c \
yang/ietf/ietf-ipv6-unicast-routing.yang.c \
yang/ietf/ietf-rib-extension.yang.c \
yang/ietf/frr-deviations-ietf-rib-extension.yang.c \
yang/ietf/frr-deviations-ietf-ipv4-unicast-routing.yang.c \
yang/ietf/frr-deviations-ietf-ipv6-unicast-routing.yang.c \
# end

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

prefix frr-staticd;

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

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

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

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

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

import frr-vrf {
prefix "frr-vrf";
}

import frr-interface {
prefix "frr-interface";
}

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 ietf-rt-types:mpls-label;
description
"Nexthop's MPLS label stack.";
}
leaf nexthop-vrf {
type string {
length "1..16";
}
description
"The nexthop vrf name, if different from the route.";
}
}

grouping frr-staticd-ipv4-nexthop {

choice next-hop-type {
case gateway {
leaf next-hop-address {
type ietf-inet:ipv4-address;
description
"IPv4 address of the next hop.";
}
leaf gw-interface {
type frr-interface:interface-ref;
description
"Name of the outgoing interface.";
}
leaf onlink {
type boolean;
default false;
description
"Nexthop is directly connected.";
}
}
case ifname {
leaf outgoing-interface {
type frr-interface:interface-ref;
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;

}


grouping frr-staticd-ipv6-nexthop {

choice next-hop-type {
case gateway {
leaf next-hop-address {
type ietf-inet:ipv6-address;
description
"IPv6 address of the next hop.";
}
leaf gw-interface {
type string {
length "1..16";
}
description
"Name of the outgoing interface.";
}
leaf onlink {
type boolean;
default false;
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"
+ "/ietf-rt:routing/ietf-rt:control-plane-protocols/"
+ "ietf-rt:control-plane-protocol/ietf-rt:static-routes/ietf-v4ur:ipv4/"
+ "ietf-v4ur:route/ietf-v4ur:next-hop/ietf-v4ur:next-hop-options/"
+ "ietf-v4ur:next-hop-list/ietf-v4ur:next-hop-list/ietf-v4ur:next-hop"
{
description
"Augment static route configuration 'next-hop-list'.";
uses frr-staticd-ipv4-nexthop;
}
augment "/frr-vrf:lib/frr-vrf:vrf"
+ "/ietf-rt:routing/ietf-rt:control-plane-protocols/"
+ "ietf-rt:control-plane-protocol/ietf-rt:static-routes/ietf-v6ur:ipv6/"
+ "ietf-v6ur:route/ietf-v6ur:next-hop/ietf-v6ur:next-hop-options/"
+ "ietf-v6ur:next-hop-list/ietf-v6ur:next-hop-list/ietf-v6ur:next-hop"
{
description
"Augment static route configuration 'next-hop-list'.";
uses frr-staticd-ipv6-nexthop;
}
}
Loading

0 comments on commit 62c7633

Please sign in to comment.