BUG-45 : migrated linkstate to generated source code.
[bgpcep.git] / bgp / parser-api / src / main / yang / bgp-multiprotocol.yang
1 module bgp-multiprotocol {
2         yang-version 1;
3         namespace "urn:opendaylight:params:xml:ns:yang:bgp-multiprotocol";
4         prefix "bgp-mp";
5
6         import  ietf-inet-types {
7                 prefix inet;
8                 revision-date 2010-09-24;
9         }
10         import bgp-message { prefix bgp-msg; }
11         import bgp-types { prefix bgp-t; }
12
13         organization "Cisco Systems, Inc.";
14         contact "Dana Kutenicsova <dkutenic@cisco.com>";
15
16         description
17                 "This module contains the base data model of a BGP message.
18                 It rolls up the definitions contained in RFC4271
19                 and draft-ietf-idr-ls-distribution-03.
20
21                 Copyright (c)2013 Cisco Systems, Inc. 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 "2013-09-18" {
29                 description
30                         "Initial revision.";
31                 reference "RFC4760";
32         }
33
34         grouping bgp-table-type {
35                 leaf afi {
36                         type identityref {
37                                 base bgp-t:address-family;
38                         }
39                 }
40                 leaf safi {
41                         type identityref {
42                                 base bgp-t:subsequent-address-family;
43                         }
44                 }
45         }
46
47         grouping destination {
48                 choice nlri {
49                         case ipv4 {
50                                 when "../../afi = ipv4";
51                                 leaf-list ipv4-prefixes {
52                                         type inet:ipv4-prefix;
53                                 }
54                         }
55                         case ipv6 {
56                                 when "../../afi = ipv6";
57                                 leaf-list ipv6-prefixes {
58                                         type inet:ipv6-prefix;
59                                 }
60                         }
61                 }
62         }
63
64         augment "/bgp-msg:open/bgp-msg:bgp-parameters/bgp-msg:c-parameters" {
65                 case c-multiprotocol {
66                         container multiprotocol-capability {
67                                 reference "http://tools.ietf.org/html/rfc4760#section-8";
68                                 uses bgp-table-type;
69                         }
70                 }
71         }
72
73         augment "/bgp-msg:update/bgp-msg:path-attributes" {
74                 container mp-unreach-nlri {
75                         reference "http://tools.ietf.org/html/rfc4760#section-4";
76
77                         uses bgp-table-type;
78
79                         container withdrawn-routes {
80                                 uses destination;
81                         }
82                 }
83         }
84
85         augment "/bgp-msg:update/bgp-msg:path-attributes" {
86                 container mp-reach-nlri {
87                         reference "http://tools.ietf.org/html/rfc4760#section-3";
88
89                         uses bgp-table-type;
90                         uses bgp-t:next-hop;
91
92                         container advertized-routes {
93                                 uses destination;
94                         }
95                 }
96         }
97 }
98