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