]> git.proxmox.com Git - mirror_frr.git/blame - yang/frr-nexthop.yang
Merge pull request #5810 from donaldsharp/fix_yang_routemap
[mirror_frr.git] / yang / frr-nexthop.yang
CommitLineData
fdd5c6e8
MS
1module frr-nexthop {
2 yang-version 1.1;
3 namespace "http://frrouting.org/yang/nexthop";
4 prefix frr-nexthop;
5
6 import ietf-inet-types {
7 prefix inet;
8 }
9
10 import ietf-routing-types {
11 prefix rt-types;
12 }
1b9468cc
CS
13 import frr-interface {
14 prefix frr-interface;
15 }
fdd5c6e8
MS
16
17 organization
18 "Free Range Routing";
19 contact
20 "FRR Users List: <mailto:frog@lists.frrouting.org>
21 FRR Development List: <mailto:dev@lists.frrouting.org>";
22 description
23 "This module defines a model for managing FRR nexthop information.";
24
25 revision 2019-08-15 {
26 description
27 "Initial revision.";
28 }
29
30 typedef gateway-address {
3d2ab385 31 type inet:ip-address;
fdd5c6e8
MS
32 }
33
34 typedef nexthop-type {
35 type enumeration {
36 enum "ifindex" {
3d2ab385
CS
37 value 1;
38 description
39 "Specific interface.";
fdd5c6e8
MS
40 }
41 enum "ip4" {
3d2ab385
CS
42 value 2;
43 description
44 "IPv4 address.";
fdd5c6e8
MS
45 }
46 enum "ip4-ifindex" {
3d2ab385
CS
47 value 3;
48 description
49 "IPv4 address and interface.";
fdd5c6e8
MS
50 }
51 enum "ip6" {
3d2ab385
CS
52 value 4;
53 description
54 "IPv6 address.";
fdd5c6e8
MS
55 }
56 enum "ip6-ifindex" {
3d2ab385
CS
57 value 5;
58 description
59 "IPv6 address and interface.";
fdd5c6e8
MS
60 }
61 enum "blackhole" {
3d2ab385
CS
62 value 6;
63 description
64 "Unreachable or prohibited.";
fdd5c6e8
MS
65 }
66 }
67 description
68 "Nexthop types.";
69 }
70
71 typedef blackhole-type {
72 type enumeration {
73 enum "unspec" {
3d2ab385
CS
74 value 0;
75 description
76 "Generic unreachable.";
fdd5c6e8
MS
77 }
78 enum "null" {
3d2ab385
CS
79 value 1;
80 description
81 "Null type.";
fdd5c6e8
MS
82 }
83 enum "reject" {
3d2ab385
CS
84 value 2;
85 description
86 "ICMP unreachable.";
fdd5c6e8
MS
87 }
88 enum "prohibited" {
3d2ab385
CS
89 value 3;
90 description
91 "ICMP admin-prohibited.";
fdd5c6e8
MS
92 }
93 }
94 default "null";
95 description
96 "Nexthop blackhole types.";
97 }
98
99 /*
100 * Nexthop object
101 */
3d2ab385 102
fdd5c6e8
MS
103 grouping frr-nexthop {
104 leaf nh-type {
105 type nexthop-type;
106 mandatory true;
107 description
3d2ab385 108 "The nexthop type.";
fdd5c6e8
MS
109 }
110
111 leaf gateway {
112 type gateway-address;
113 description
3d2ab385 114 "The nexthop gateway address.";
fdd5c6e8
MS
115 }
116
117 leaf vrf {
1b9468cc
CS
118 type string {
119 length "1..36";
120 }
fdd5c6e8 121 description
3d2ab385 122 "The nexthop vrf name, if different from the route.";
fdd5c6e8
MS
123 }
124
125 leaf interface {
1b9468cc 126 type frr-interface:interface-ref;
fdd5c6e8 127 description
3d2ab385 128 "The nexthop egress interface.";
fdd5c6e8
MS
129 }
130
131 leaf bh-type {
132 type blackhole-type;
133 description
3d2ab385 134 "A blackhole sub-type, if the nexthop is a blackhole type.";
fdd5c6e8
MS
135 }
136
137 leaf flags {
138 type uint32;
139 description
3d2ab385 140 "The nexthop's raw flags value.";
fdd5c6e8
MS
141 }
142
143 leaf is-duplicate {
144 type empty;
145 description
3d2ab385 146 "Duplicate nexthop; will be ignored.";
fdd5c6e8 147 }
3d2ab385 148
fdd5c6e8
MS
149 leaf is-recursive {
150 type empty;
151 description
3d2ab385 152 "Nexthop must be resolved through another gateway.";
fdd5c6e8 153 }
3d2ab385 154
fdd5c6e8
MS
155 leaf is-onlink {
156 type empty;
157 description
3d2ab385 158 "Nexthop is directly connected.";
fdd5c6e8 159 }
3d2ab385 160
fdd5c6e8
MS
161 leaf is-active {
162 type empty;
163 description
3d2ab385 164 "Nexthop is active.";
fdd5c6e8
MS
165 }
166
167 uses rt-types:mpls-label-stack {
168 description
3d2ab385 169 "Nexthop's MPLS label stack.";
fdd5c6e8
MS
170 }
171
172 leaf mtu {
173 type uint32;
174 description
3d2ab385 175 "The nexthop's specific MTU.";
fdd5c6e8 176 }
3d2ab385 177 }
fdd5c6e8 178
3d2ab385 179 // End of nexthop
fdd5c6e8
MS
180 /*
181 * Nexthop-group container
182 */
3d2ab385 183
fdd5c6e8
MS
184 grouping frr-nexthop-group {
185 description
186 "A nexthop-group, represented as a list of nexthop objects.";
fdd5c6e8
MS
187 leaf name {
188 type string;
189 description
190 "The nexthop-group name.";
191 }
192
193 list entry {
194 key "id";
195 description
196 "A list of nexthop objects.";
197 leaf id {
198 type uint32;
199 description
200 "Identifies a nexthop within a nexthop group; the entries
201 are ordered by id value, and the value has no other meaning.";
202 }
203
204 uses frr-nexthop;
fdd5c6e8 205 }
3d2ab385 206 }
fdd5c6e8 207
3d2ab385 208 // End of frr-nexthop-group
fdd5c6e8 209}