eec7c648ef2f4ae02895d8f59d1f9ee20577e123
[bgpcep.git] / bgp / rib-impl / src / main / yang / bgp-peer.yang
1 module bgp-peer {
2     namespace "urn:opendaylight:params:xml:ns:yang:controller:bgp:peer:config";
3     prefix "bgp-peer";
4
5     import bgp-rib { prefix rib; revision-date 2013-09-25; }
6     import bgp-types { prefix bgp-t; revision-date 2013-09-19; }
7     import bgp-multiprotocol { prefix bgp-mp; revision-date 2013-09-19; }
8     import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
9     import opendaylight-md-sal-binding {prefix mdsb; revision-date 2013-10-28; }
10     import rfc2385 { prefix rfc2385; revision-date 2016-03-24; }
11
12     organization "Brocade Communications Systems, Inc.";
13     contact "Kevin Wang <kwang@brocade.com>";
14
15     description
16         "This module contains the base data model of BGP peer.
17
18         Copyright (c) 2016 Brocade Communications Systems, Inc. All rights reserved.
19
20         This program and the accompanying materials are made available
21         under the terms of the Eclipse Public License v1.0 which
22         accompanies this distribution, and is available at
23         http://www.eclipse.org/legal/epl-v10.html";
24
25     revision 2016-06-06 {
26         description "Initial revision";
27     }
28
29     grouping bgp-peer-config-attributes {
30         leaf host {
31             description "Host IP address of BGP connection";
32             type inet:ip-address;
33             mandatory true;
34         }
35
36         leaf port {
37             description "The port for connection between the BGP peers.";
38             type inet:port-number;
39             default 179;
40         }
41
42         leaf holdtimer {
43             description "Time interval (in seconds) for HoldTimer proposed by the peer.";
44             type uint16;
45             default 180;
46         }
47     }
48
49     grouping bgp-peer-config {
50         uses bgp-peer-config-attributes;
51
52         leaf retrytimer {
53             type uint16;
54             default 10;
55         }
56
57         leaf peer-role {
58             type rib:peer-role;
59             default ibgp;
60         }
61
62         leaf simple-routing-policy {
63             type rib:simple-routing-policy;
64         }
65
66         leaf initiate-connection {
67             description "If true, connection will be initiated right away from current device.
68                 If not, the peer will only be registered to peer registry and available for incomming bgp connections.";
69             type boolean;
70             default true;
71         }
72
73         leaf route-refresh {
74             type boolean;
75             default "true";
76         }
77
78         leaf remote-as {
79             description
80                 "Expected remote AS number. If not present, it is assumed
81                 to be the same as our local AS number.";
82             type inet:as-number;
83         }
84
85         leaf password {
86             type rfc2385:rfc2385-key;
87             description "RFC2385 shared secret";
88         }
89     }
90
91     grouping bgp-peer-preferences {
92         leaf bgp-id {
93             description "The BGP Identifier.";
94             type bgp-t:bgp-id;
95         }
96
97         uses bgp-peer-config-attributes;
98
99         leaf as {
100             description "Autonomous system number.";
101             type inet:as-number;
102             default 0;
103         }
104
105         leaf four-octet-as-capability {
106             description "The BGP peer 4 byte AS numbers support capability.";
107             type boolean;
108             default "false";
109         }
110
111         leaf bgp-extended-message-capability {
112             description "The bgp extended message support capability.";
113             type boolean;
114             default "false";
115         }
116
117         leaf gr-capability {
118             description "BGP graceful restart support capability.";
119             type boolean;
120             default "false";
121         }
122
123         leaf route-refresh-capability {
124             reference "https://tools.ietf.org/html/rfc2918";
125             type boolean;
126             default "false";
127         }
128
129         list advertized-table-types {
130             description "The BGP Table-type capabilities advertized by the BGP peer.";
131             key "afi safi";
132             uses bgp-mp:bgp-table-type;
133         }
134
135         list advertised-add-path-table-types {
136             description "The BGP Table-type capabilities advertized by the BGP peer.";
137             key "afi safi";
138             uses bgp-mp:bgp-add-path-table-type;
139         }
140     }
141 }