Create common parent for extensions families
[bgpcep.git] / bgp / extensions / l3vpn / src / main / yang / bgp-l3vpn-mcast.yang
1 module bgp-l3vpn-mcast {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:bgp:l3vpn:mcast";
4     prefix "bgp-l3vpn-mcast";
5
6     import bgp-rib { prefix bgp-rib; revision-date 2018-03-29; }
7     import bgp-multiprotocol { prefix bgp-mp; revision-date 2018-03-29; }
8     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
9     import bgp-message { prefix bgp-msg; revision-date 2018-03-29; }
10     import bmp-monitor { prefix bmp-mon; revision-date 2018-03-29; }
11     import bgp-types { prefix bgp-t; revision-date 2018-03-29; }
12
13     organization "AT&T Services, Inc.";
14
15     contact "Claudio D. Gasparini <claudio.gasparini@pantheon.tech>";
16
17     description
18         "This module contains the base data model of a BGP message.
19         It rolls up the definitions contained in RFC6513, RFC6514.
20
21         Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
22
23         This program and the accompanying materials are made available
24         under the terms of the Eclipse Public License v1.0 which
25         accompanies this distribution, and is available at
26         http://www.eclipse.org/legal/epl-v10.html";
27
28     revision 2018-04-17 {
29         description "Initial version";
30     }
31
32     identity mcast-mpls-labeled-vpn-subsequent-address-family {
33         description "SAFI 129 multicast l3vpn";
34         reference "https://www.iana.org/assignments/safi-namespace/safi-namespace.xhtml";
35
36         base bgp-t:subsequent-address-family;
37     }
38
39     grouping l3vpn-mcast-route {
40         leaf prefix {
41             type inet:ip-prefix;
42         }
43         uses bgp-t:route-distinguisher-grouping;
44     }
45
46     grouping l3vpn-mcast-destination {
47         list l3vpn-mcast-destination {
48             uses l3vpn-mcast-route;
49             uses bgp-msg:path-id-grouping;
50         }
51     }
52
53     grouping l3vpn-mcast-routes {
54         list l3vpn-mcast-route {
55             key "route-key path-id";
56             uses bgp-rib:route;
57             uses l3vpn-mcast-route;
58         }
59     }
60
61     grouping l3vpn-mcast-routes-ipv4 {
62         container l3vpn-mcast-routes-ipv4 {
63             uses l3vpn-mcast-routes;
64         }
65     }
66
67     grouping l3vpn-mcast-routes-ipv6 {
68         container l3vpn-mcast-routes-ipv6 {
69             uses l3vpn-mcast-routes;
70         }
71     }
72
73     augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
74         case destination-l3vpn-mcast-ipv4-advertized-case {
75             when "../../afi = ipv4";
76             container destination-ipv4-l3vpn-mcast {
77                 uses l3vpn-mcast-destination;
78             }
79         }
80         case destination-l3vpn-mcast-ipv6-advertized-case {
81             when "../../afi = ipv6";
82             container destination-ipv6-l3vpn-mcast {
83                 uses l3vpn-mcast-destination;
84             }
85         }
86     }
87
88     augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
89         case destination-l3vpn-mcast-ipv4-withdrawn-case {
90             when "../../afi = ipv4";
91             container destination-ipv4-l3vpn-mcast {
92                 uses l3vpn-mcast-destination;
93             }
94         }
95         case destination-l3vpn-mcast-ipv6-withdrawn-case {
96             when "../../afi = ipv6";
97             container destination-ipv6-l3vpn-mcast {
98                 uses l3vpn-mcast-destination;
99             }
100         }
101     }
102
103     augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
104         case l3vpn-mcast-routes-ipv4-case {
105             uses l3vpn-mcast-routes-ipv4;
106         }
107
108         case l3vpn-mcast-routes-ipv6-case {
109             uses l3vpn-mcast-routes-ipv6;
110         }
111     }
112
113     augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
114         case l3vpn-mcast-routes-ipv4-case {
115             uses l3vpn-mcast-routes-ipv4;
116         }
117
118         case l3vpn-mcast-routes-ipv6-case {
119             uses l3vpn-mcast-routes-ipv6;
120         }
121     }
122
123     augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
124         case l3vpn-mcast-routes-ipv4-case {
125             uses l3vpn-mcast-routes-ipv4;
126         }
127
128         case l3vpn-mcast-routes-ipv6-case {
129             uses l3vpn-mcast-routes-ipv6;
130         }
131     }
132
133     augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
134         case l3vpn-mcast-routes-ipv4-case {
135             uses l3vpn-mcast-routes-ipv4;
136         }
137
138         case l3vpn-mcast-routes-ipv6-case {
139             uses l3vpn-mcast-routes-ipv6;
140         }
141     }
142
143     augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
144         case l3vpn-mcast-routes-ipv4-case {
145             uses l3vpn-mcast-routes-ipv4;
146         }
147
148         case l3vpn-mcast-routes-ipv6-case {
149             uses l3vpn-mcast-routes-ipv6;
150         }
151     }
152
153     augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:pre-policy-rib/bmp-mon:tables/bmp-mon:routes" {
154         case l3vpn-mcast-routes-ipv4-case {
155             uses l3vpn-mcast-routes-ipv4;
156         }
157
158         case l3vpn-mcast-routes-ipv6-case {
159             uses l3vpn-mcast-routes-ipv6;
160         }
161     }
162
163     augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:post-policy-rib/bmp-mon:tables/bmp-mon:routes" {
164         case l3vpn-mcast-routes-ipv4-case {
165             uses l3vpn-mcast-routes-ipv4;
166         }
167
168         case l3vpn-mcast-routes-ipv6-case {
169             uses l3vpn-mcast-routes-ipv6;
170         }
171     }
172 }