3f64f2f3bdf7ca36d40124a83ba160ad873e4cf1
[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
12         organization "Cisco Systems, Inc.";
13         contact "Dana Kutenicsova <dkutenic@cisco.com>";
14
15         description
16                 "This module contains the base data model of a BGP message.
17                 It rolls up the definitions contained in RFC4271
18                 and draft-ietf-idr-ls-distribution-03.
19
20                 Copyright (c)2013 Cisco Systems, Inc. All rights reserved.
21
22                 This program and the accompanying materials are made available
23                 under the terms of the Eclipse Public License v1.0 which
24                 accompanies this distribution, and is available at
25                 http://www.eclipse.org/legal/epl-v10.html";
26
27         revision "2013-09-18" {
28                 description
29                         "Initial revision.";
30                 reference "RFC4760";
31         }
32
33         typedef bgp-address-family {
34                 reference "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xhtml#address-family-numbers-2";
35                 type enumeration {
36                         enum ipv4 {
37                                 value 1;
38                         }
39                         enum ipv6 {
40                                 value 2;
41                         }
42                         enum linkstate {
43                                 value 16388;
44                         }
45                 }
46         }
47
48         typedef bgp-subsequent-address-family {
49                 reference "http://tools.ietf.org/html/rfc4760#section-6
50                 http://tools.ietf.org/html/rfc4364#section-16
51                 http://tools.ietf.org/html/draft-ietf-idr-ls-distribution-03#section-3.2";
52                 type enumeration {
53                         enum unicast {
54                                 value 1;
55                         }
56                         enum mpls-labeled-vpn {
57                                 value 128;
58                         }
59                         enum linkstate {
60                                 value 71;
61                         }
62                 }
63         }
64
65         grouping bgp-table-type {
66                 leaf afi {
67                         type bgp-address-family;
68                 }
69                 leaf safi {
70                         type bgp-subsequent-address-family;
71                 }
72         }
73
74         augment "/bgp-msg:open/bgp-msg:optional-parameters/bgp-msg:parameters" {
75                 case multiprotocol {
76                         list capabilities {
77                                 container multiprotocol-capability {
78                                         reference "http://tools.ietf.org/html/rfc4760#section-8";
79                                         container table-type {
80                                                 uses bgp-table-type;
81                                         }
82                                 }
83                         }
84                 }
85         }
86
87         augment "/bgp-msg:update/bgp-msg:path-attributes" {
88                 container mp-unreach-nlri {
89                         reference "http://tools.ietf.org/html/rfc4760#section-4";
90                         uses bgp-table-type;
91                         container withdrawn-routes {
92                                 leaf-list withdrawn-routes {
93                                         type inet:ip-prefix;
94                                 }
95                         }
96                 }
97         }
98
99         augment "/bgp-msg:update/bgp-msg:path-attributes" {
100                 container mp-reach-nlri {
101                         reference "http://tools.ietf.org/html/rfc4760#section-4";
102                         uses bgp-table-type;
103                         leaf hop {
104                                 type inet:ip-address;
105                         }
106                         container nlri {
107                                 choice nlri-type {
108                                         leaf-list nlri {
109                                                 type inet:ip-prefix;
110                                         }
111                                 }
112                         }
113                 }
114         }
115 }