Skip to content

Commit

Permalink
pimd: yang definition
Browse files Browse the repository at this point in the history
Defined frr-pim.yang, frr-pim-rp.yang files for PIM protocol.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Sarita Patra <saritap@vmware.com>
Co-authored-by: vishaldhingra <vdhingra@vmware.com>
Signed-off-by: Sarita Patra <saritap@vmware.com>
  • Loading branch information
3 people committed Dec 20, 2019
1 parent a5f271c commit 976e56e
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ 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/frr-pim.yang.c \
yang/frr-pim-rp.yang.c \
# end

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

prefix pim-rp;

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

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

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

organization
"Free Range Routing";

contact
"FRR Users List: <mailto:frog@lists.frrouting.org>
FRR Development List: <mailto:dev@lists.frrouting.org>";

description
"The module defines a collection of YANG definitions common for
all PIM (Protocol Independent Multicast) RP (Rendezvous Point) model.";
revision 2017-03-09 {
description
"Initial revision.";
reference
"RFC XXXX: A YANG Data Model for PIM RP";
}

/*
* Typedefs
*/
typedef ipv4-multicast-group-address {
type inet:ipv4-prefix {
pattern '(2((2[4-9])|(3[0-9]))\.).*';
}
description
"This type represents an IPv4 multicast group address,
which is in the range of 224.0.0.0 to 239.255.255.255.
The range of values for the prefix-length is 0 to 32.";
reference
"RFC 1112: Host Extensions for IP Multicasting.";
}

/*
* Groupings
*/
grouping static-rp-container {
description
"Grouping of static RP container.";
container static-rp {
description
"Containing static RP attributes.";
list ipv4-rp {
when "../../../frr-pim:address-family = 'frr-rt:ipv4'" {
description
"Only applicable to IPv4 address family.";
}
key "ipv4-address";
description
"A list of IPv4 RP addresses.";
leaf ipv4-address {
type inet:ipv4-address;
description
"Specifies a static RP address.";
}
choice group-list-or-prefix-list {
description "Use group-list or prefix-list";
case group-list {
leaf-list group-list {
type ipv4-multicast-group-address;
description
"List of multicast group address.";
}
}
case prefix-list {
leaf prefix-list {
type string;
description
"Group prefix-list filter";
}
}
}
}

leaf rp-keep-alive-timer {
type uint16 {
range "31..60000";
}
default "210";
description
"RP keep alive Timer in seconds.";
}
} // static-rp
} // static-rp-container

/*
* Configuration data nodes
*/
augment "/frr-rt:routing/frr-rt:control-plane-protocols/frr-pim:pim/"
+ "frr-pim:address-family" {
description "PIM RP augmentation.";
container rp {
description
"PIM RP configuration data.";
uses static-rp-container;
} // rp
} // augment
}
259 changes: 259 additions & 0 deletions yang/frr-pim.yang
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
module frr-pim {
yang-version "1.1";
namespace "http://frrouting.org/yang/pim";

prefix frr-pim;

import frr-interface {
prefix frr-interface;
}

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

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

organization
"Free Range Routing";

contact
"FRR Users List: <mailto:frog@lists.frrouting.org>
FRR Development List: <mailto:dev@lists.frrouting.org>";

description
"The module defines a collection of YANG definitions common for
PIM (Protocol Independent Multicast) model.";

revision 2017-03-09 {
description
"Initial revision.";
reference
"RFC XXXX: A YANG Data Model for PIM";
}

/*
* Groupings
*/

grouping sm_common-config-attributes {
description
"A grouping defining sm common attributes.";
leaf ecmp {
type boolean;
default "false";
description
"Enable PIM ECMP.";
}

leaf ecmp-rebalance {
type boolean;
default "false";
description
"Enable PIM ECMP Rebalance.";
}

leaf join-prune-interval {
type uint16 {
range "60..600";
}
default "60";
description
"Join Prune Send Interval in seconds.";
}

leaf keep-alive-timer {
type uint16 {
range "31..60000";
}
default "210";
description
"Keep alive Timer in seconds.";
}

leaf packets {
type uint8 {
range "1..100";
}
default "3";
description
"Number of packets.";
}
leaf register-suppress-time {
type uint16 {
range "5..60000";
}
default "60";
description
"Register Suppress Timer.";
}

leaf send-v6-secondary {
type boolean;
default "false";
description
"Send v6 secondary addresses.";
}
}//sm_common-config-attributes

grouping interface-config-attributes {
description
"A grouping defining interface attributes.";
leaf pim-sm {
type boolean;
default "false";
description
"Enables PIM SM support on the interface.";
}

leaf dr-priority {
type uint32 {
range "1..4294967295";
}
default 1;
description "DR (Designated Router) priority";
}

leaf hello-interval {
type uint16 {
range "1..180";
}
default "30";
description "Hello interval";
}

leaf hello-holdtime {
type uint16 {
range "1..180";
}
description "Hello holdtime";
}

leaf bfd {
type boolean;
default "false";
description
"'true' to suppport BFD for the interface.";
}

leaf bsm {
type boolean;
default "false";
description
"Enables BSM support on the interface.";
}

leaf unicast-bsm {
type boolean;
default "false";
description
"Accept/Send unicast BSM on the interface.";
}

leaf use-source {
type inet:ipv4-address;
description
"Primary address of the interface set by user.";
}
} // interface-config-attributes

grouping af-sm-container {
description
"Grouping of address family SM container.";
container sm {
description
"PIM SM configuration data.";
uses sm_common-config-attributes;

container asm {
description
"ASM (Any Source Multicast) attributes.";
container spt-switch {
description
"SPT (Shortest Path Tree) switching attributes.";
container infinity {
presence
"Present if SPT switchover threshold is set to
infinity, according to the policy specified below.";
description
"The receiver's DR (Designated Router) never triggers
the switchover from the RPT to the SPT.";
leaf policy-name {
type string;
description
"Switch policy.";
}
} // infinity
}
} // asm

container ssm {
presence
"Present to enable SSM (Source-Specific Multicast).";
description
"SSM (Source-Specific Multicast) attributes.";
leaf range-policy {
type string;
description
"Policy used to define SSM address range.";
}
} // ssm
} // sm
} // af-sm-container

grouping interface-sm-container {
description
"Grouping of interface SM container.";
container sm {
presence "Present to enable sparse-mode.";
description
"PIM SM configuration data.";
} // sm
} // interface-sm-container

/*
* Configuration data nodes
*/

augment "/frr-rt:routing/frr-rt:control-plane-protocols" {
description
"PIM augmentation to routing instance configuration.";
container pim {
presence "Container for PIM protocol.";
description
"PIM configuration data.";
list address-family {
key "address-family";
description
"Each list entry for one address family.";
uses frr-rt:address-family;
uses af-sm-container;
} // address-family
container interfaces {
description
"Containing a list of interfaces.";
list interface {
key "interface-name";
description
"List of pim interfaces.";
leaf interface-name {
type frr-interface:interface-ref;
description
"Reference to an entry in the global interface
list.";
}
list address-family {
key "address-family";
description
"Each list entry for one address family.";
uses frr-rt:address-family;
uses interface-config-attributes;
} // address-family
} // interface
} // interfaces
} // pim
} // augment
}

2 changes: 2 additions & 0 deletions yang/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ dist_yangmodels_DATA += yang/frr-test-module.yang
dist_yangmodels_DATA += yang/frr-interface.yang
dist_yangmodels_DATA += yang/frr-route-types.yang
dist_yangmodels_DATA += yang/ietf/ietf-routing-types.yang
dist_yangmodels_DATA += yang/frr-pim.yang
dist_yangmodels_DATA += yang/frr-pim_rp.yang

if BFDD
dist_yangmodels_DATA += yang/frr-bfdd.yang
Expand Down

0 comments on commit 976e56e

Please sign in to comment.