abbcd489fe0c8c4b9b9854fb06a607e85cb32ffb
[openwrt/svn-archive/archive.git] / net / quagga-unstable / patches / 002-quagga_manet.patch
1 --- a/bgpd/bgp_vty.c
2 +++ b/bgpd/bgp_vty.c
3 @@ -8228,8 +8228,14 @@ bgp_str2route_type (int afi, const char
4 return ZEBRA_ROUTE_STATIC;
5 else if (strncmp (str, "r", 1) == 0)
6 return ZEBRA_ROUTE_RIP;
7 - else if (strncmp (str, "o", 1) == 0)
8 + else if (strncmp (str, "os", 2) == 0)
9 return ZEBRA_ROUTE_OSPF;
10 + else if (strncmp (str, "h", 1) == 0)
11 + return ZEBRA_ROUTE_HSLS;
12 + else if (strncmp (str, "ol", 2) == 0)
13 + return ZEBRA_ROUTE_OLSR;
14 + else if (strncmp (str, "b", 1) == 0)
15 + return ZEBRA_ROUTE_BATMAN;
16 }
17 if (afi == AFI_IP6)
18 {
19 @@ -8241,21 +8247,30 @@ bgp_str2route_type (int afi, const char
20 return ZEBRA_ROUTE_STATIC;
21 else if (strncmp (str, "r", 1) == 0)
22 return ZEBRA_ROUTE_RIPNG;
23 - else if (strncmp (str, "o", 1) == 0)
24 + else if (strncmp (str, "os", 2) == 0)
25 return ZEBRA_ROUTE_OSPF6;
26 + else if (strncmp (str, "h", 1) == 0)
27 + return ZEBRA_ROUTE_HSLS;
28 + else if (strncmp (str, "ol", 2) == 0)
29 + return ZEBRA_ROUTE_OLSR;
30 + else if (strncmp (str, "b", 1) == 0)
31 + return ZEBRA_ROUTE_BATMAN;
32 }
33 return 0;
34 }
35
36 DEFUN (bgp_redistribute_ipv4,
37 bgp_redistribute_ipv4_cmd,
38 - "redistribute (connected|kernel|ospf|rip|static)",
39 + "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman)",
40 "Redistribute information from another routing protocol\n"
41 "Connected\n"
42 "Kernel routes\n"
43 "Open Shurtest Path First (OSPF)\n"
44 "Routing Information Protocol (RIP)\n"
45 - "Static routes\n")
46 + "Static routes\n"
47 + "Hazy-Sighted Link State Protocol (HSLS)\n"
48 + "Optimized Link State Routing (OLSR)\n"
49 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
50 {
51 int type;
52
53 @@ -8270,13 +8285,16 @@ DEFUN (bgp_redistribute_ipv4,
54
55 DEFUN (bgp_redistribute_ipv4_rmap,
56 bgp_redistribute_ipv4_rmap_cmd,
57 - "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
58 + "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD",
59 "Redistribute information from another routing protocol\n"
60 "Connected\n"
61 "Kernel routes\n"
62 "Open Shurtest Path First (OSPF)\n"
63 "Routing Information Protocol (RIP)\n"
64 "Static routes\n"
65 + "Hazy-Sighted Link State Protocol (HSLS)\n"
66 + "Optimized Link State Routing (OLSR)\n"
67 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
68 "Route map reference\n"
69 "Pointer to route-map entries\n")
70 {
71 @@ -8295,13 +8313,16 @@ DEFUN (bgp_redistribute_ipv4_rmap,
72
73 DEFUN (bgp_redistribute_ipv4_metric,
74 bgp_redistribute_ipv4_metric_cmd,
75 - "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
76 + "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295>",
77 "Redistribute information from another routing protocol\n"
78 "Connected\n"
79 "Kernel routes\n"
80 "Open Shurtest Path First (OSPF)\n"
81 "Routing Information Protocol (RIP)\n"
82 "Static routes\n"
83 + "Hazy-Sighted Link State Protocol (HSLS)\n"
84 + "Optimized Link State Routing (OLSR)\n"
85 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
86 "Metric for redistributed routes\n"
87 "Default metric\n")
88 {
89 @@ -8322,13 +8343,16 @@ DEFUN (bgp_redistribute_ipv4_metric,
90
91 DEFUN (bgp_redistribute_ipv4_rmap_metric,
92 bgp_redistribute_ipv4_rmap_metric_cmd,
93 - "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
94 + "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
95 "Redistribute information from another routing protocol\n"
96 "Connected\n"
97 "Kernel routes\n"
98 "Open Shurtest Path First (OSPF)\n"
99 "Routing Information Protocol (RIP)\n"
100 "Static routes\n"
101 + "Hazy-Sighted Link State Protocol (HSLS)\n"
102 + "Optimized Link State Routing (OLSR)\n"
103 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
104 "Route map reference\n"
105 "Pointer to route-map entries\n"
106 "Metric for redistributed routes\n"
107 @@ -8352,13 +8376,16 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
108
109 DEFUN (bgp_redistribute_ipv4_metric_rmap,
110 bgp_redistribute_ipv4_metric_rmap_cmd,
111 - "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
112 + "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
113 "Redistribute information from another routing protocol\n"
114 "Connected\n"
115 "Kernel routes\n"
116 "Open Shurtest Path First (OSPF)\n"
117 "Routing Information Protocol (RIP)\n"
118 "Static routes\n"
119 + "Hazy-Sighted Link State Protocol (HSLS)\n"
120 + "Optimized Link State Routing (OLSR)\n"
121 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
122 "Metric for redistributed routes\n"
123 "Default metric\n"
124 "Route map reference\n"
125 @@ -8382,14 +8409,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
126
127 DEFUN (no_bgp_redistribute_ipv4,
128 no_bgp_redistribute_ipv4_cmd,
129 - "no redistribute (connected|kernel|ospf|rip|static)",
130 + "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman)",
131 NO_STR
132 "Redistribute information from another routing protocol\n"
133 "Connected\n"
134 "Kernel routes\n"
135 "Open Shurtest Path First (OSPF)\n"
136 "Routing Information Protocol (RIP)\n"
137 - "Static routes\n")
138 + "Static routes\n"
139 + "Hazy-Sighted Link State Protocol (HSLS)\n"
140 + "Optimized Link State Routing (OLSR)\n"
141 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
142 {
143 int type;
144
145 @@ -8405,7 +8435,7 @@ DEFUN (no_bgp_redistribute_ipv4,
146
147 DEFUN (no_bgp_redistribute_ipv4_rmap,
148 no_bgp_redistribute_ipv4_rmap_cmd,
149 - "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
150 + "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD",
151 NO_STR
152 "Redistribute information from another routing protocol\n"
153 "Connected\n"
154 @@ -8413,6 +8443,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
155 "Open Shurtest Path First (OSPF)\n"
156 "Routing Information Protocol (RIP)\n"
157 "Static routes\n"
158 + "Hazy-Sighted Link State Protocol (HSLS)\n"
159 + "Optimized Link State Routing (OLSR)\n"
160 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
161 "Route map reference\n"
162 "Pointer to route-map entries\n")
163 {
164 @@ -8431,7 +8464,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
165
166 DEFUN (no_bgp_redistribute_ipv4_metric,
167 no_bgp_redistribute_ipv4_metric_cmd,
168 - "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
169 + "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295>",
170 NO_STR
171 "Redistribute information from another routing protocol\n"
172 "Connected\n"
173 @@ -8439,6 +8472,9 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
174 "Open Shurtest Path First (OSPF)\n"
175 "Routing Information Protocol (RIP)\n"
176 "Static routes\n"
177 + "Hazy-Sighted Link State Protocol (HSLS)\n"
178 + "Optimized Link State Routing (OLSR)\n"
179 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
180 "Metric for redistributed routes\n"
181 "Default metric\n")
182 {
183 @@ -8457,7 +8493,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
184
185 DEFUN (no_bgp_redistribute_ipv4_rmap_metric,
186 no_bgp_redistribute_ipv4_rmap_metric_cmd,
187 - "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
188 + "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
189 NO_STR
190 "Redistribute information from another routing protocol\n"
191 "Connected\n"
192 @@ -8465,6 +8501,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
193 "Open Shurtest Path First (OSPF)\n"
194 "Routing Information Protocol (RIP)\n"
195 "Static routes\n"
196 + "Hazy-Sighted Link State Protocol (HSLS)\n"
197 + "Optimized Link State Routing (OLSR)\n"
198 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
199 "Route map reference\n"
200 "Pointer to route-map entries\n"
201 "Metric for redistributed routes\n"
202 @@ -8486,7 +8525,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
203
204 ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
205 no_bgp_redistribute_ipv4_metric_rmap_cmd,
206 - "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
207 + "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
208 NO_STR
209 "Redistribute information from another routing protocol\n"
210 "Connected\n"
211 @@ -8494,6 +8533,9 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
212 "Open Shurtest Path First (OSPF)\n"
213 "Routing Information Protocol (RIP)\n"
214 "Static routes\n"
215 + "Hazy-Sighted Link State Protocol (HSLS)\n"
216 + "Optimized Link State Routing (OLSR)\n"
217 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
218 "Metric for redistributed routes\n"
219 "Default metric\n"
220 "Route map reference\n"
221 @@ -8502,13 +8544,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
222 #ifdef HAVE_IPV6
223 DEFUN (bgp_redistribute_ipv6,
224 bgp_redistribute_ipv6_cmd,
225 - "redistribute (connected|kernel|ospf6|ripng|static)",
226 + "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman)",
227 "Redistribute information from another routing protocol\n"
228 "Connected\n"
229 "Kernel routes\n"
230 "Open Shurtest Path First (OSPFv3)\n"
231 "Routing Information Protocol (RIPng)\n"
232 - "Static routes\n")
233 + "Static routes\n"
234 + "Hazy-Sighted Link State Protocol (HSLS)\n"
235 + "Optimized Link State Routing (OLSR)\n"
236 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
237 {
238 int type;
239
240 @@ -8524,13 +8569,16 @@ DEFUN (bgp_redistribute_ipv6,
241
242 DEFUN (bgp_redistribute_ipv6_rmap,
243 bgp_redistribute_ipv6_rmap_cmd,
244 - "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
245 + "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD",
246 "Redistribute information from another routing protocol\n"
247 "Connected\n"
248 "Kernel routes\n"
249 "Open Shurtest Path First (OSPFv3)\n"
250 "Routing Information Protocol (RIPng)\n"
251 "Static routes\n"
252 + "Hazy-Sighted Link State Protocol (HSLS)\n"
253 + "Optimized Link State Routing (OLSR)\n"
254 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
255 "Route map reference\n"
256 "Pointer to route-map entries\n")
257 {
258 @@ -8549,13 +8597,16 @@ DEFUN (bgp_redistribute_ipv6_rmap,
259
260 DEFUN (bgp_redistribute_ipv6_metric,
261 bgp_redistribute_ipv6_metric_cmd,
262 - "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
263 + "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295>",
264 "Redistribute information from another routing protocol\n"
265 "Connected\n"
266 "Kernel routes\n"
267 "Open Shurtest Path First (OSPFv3)\n"
268 "Routing Information Protocol (RIPng)\n"
269 "Static routes\n"
270 + "Hazy-Sighted Link State Protocol (HSLS)\n"
271 + "Optimized Link State Routing (OLSR)\n"
272 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
273 "Metric for redistributed routes\n"
274 "Default metric\n")
275 {
276 @@ -8576,13 +8627,16 @@ DEFUN (bgp_redistribute_ipv6_metric,
277
278 DEFUN (bgp_redistribute_ipv6_rmap_metric,
279 bgp_redistribute_ipv6_rmap_metric_cmd,
280 - "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
281 + "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
282 "Redistribute information from another routing protocol\n"
283 "Connected\n"
284 "Kernel routes\n"
285 "Open Shurtest Path First (OSPFv3)\n"
286 "Routing Information Protocol (RIPng)\n"
287 "Static routes\n"
288 + "Hazy-Sighted Link State Protocol (HSLS)\n"
289 + "Optimized Link State Routing (OLSR)\n"
290 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
291 "Route map reference\n"
292 "Pointer to route-map entries\n"
293 "Metric for redistributed routes\n"
294 @@ -8606,13 +8660,16 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
295
296 DEFUN (bgp_redistribute_ipv6_metric_rmap,
297 bgp_redistribute_ipv6_metric_rmap_cmd,
298 - "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
299 + "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
300 "Redistribute information from another routing protocol\n"
301 "Connected\n"
302 "Kernel routes\n"
303 "Open Shurtest Path First (OSPFv3)\n"
304 "Routing Information Protocol (RIPng)\n"
305 "Static routes\n"
306 + "Hazy-Sighted Link State Protocol (HSLS)\n"
307 + "Optimized Link State Routing (OLSR)\n"
308 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
309 "Metric for redistributed routes\n"
310 "Default metric\n"
311 "Route map reference\n"
312 @@ -8636,14 +8693,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
313
314 DEFUN (no_bgp_redistribute_ipv6,
315 no_bgp_redistribute_ipv6_cmd,
316 - "no redistribute (connected|kernel|ospf6|ripng|static)",
317 + "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman)",
318 NO_STR
319 "Redistribute information from another routing protocol\n"
320 "Connected\n"
321 "Kernel routes\n"
322 "Open Shurtest Path First (OSPFv3)\n"
323 "Routing Information Protocol (RIPng)\n"
324 - "Static routes\n")
325 + "Static routes\n"
326 + "Hazy-Sighted Link State Protocol (HSLS)\n"
327 + "Optimized Link State Routing (OLSR)\n"
328 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
329 {
330 int type;
331
332 @@ -8659,7 +8719,7 @@ DEFUN (no_bgp_redistribute_ipv6,
333
334 DEFUN (no_bgp_redistribute_ipv6_rmap,
335 no_bgp_redistribute_ipv6_rmap_cmd,
336 - "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
337 + "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD",
338 NO_STR
339 "Redistribute information from another routing protocol\n"
340 "Connected\n"
341 @@ -8667,6 +8727,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
342 "Open Shurtest Path First (OSPFv3)\n"
343 "Routing Information Protocol (RIPng)\n"
344 "Static routes\n"
345 + "Hazy-Sighted Link State Protocol (HSLS)\n"
346 + "Optimized Link State Routing (OLSR)\n"
347 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
348 "Route map reference\n"
349 "Pointer to route-map entries\n")
350 {
351 @@ -8685,7 +8748,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
352
353 DEFUN (no_bgp_redistribute_ipv6_metric,
354 no_bgp_redistribute_ipv6_metric_cmd,
355 - "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
356 + "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295>",
357 NO_STR
358 "Redistribute information from another routing protocol\n"
359 "Connected\n"
360 @@ -8693,6 +8756,9 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
361 "Open Shurtest Path First (OSPFv3)\n"
362 "Routing Information Protocol (RIPng)\n"
363 "Static routes\n"
364 + "Hazy-Sighted Link State Protocol (HSLS)\n"
365 + "Optimized Link State Routing (OLSR)\n"
366 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
367 "Metric for redistributed routes\n"
368 "Default metric\n")
369 {
370 @@ -8711,7 +8777,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
371
372 DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
373 no_bgp_redistribute_ipv6_rmap_metric_cmd,
374 - "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
375 + "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
376 NO_STR
377 "Redistribute information from another routing protocol\n"
378 "Connected\n"
379 @@ -8719,6 +8785,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
380 "Open Shurtest Path First (OSPFv3)\n"
381 "Routing Information Protocol (RIPng)\n"
382 "Static routes\n"
383 + "Hazy-Sighted Link State Protocol (HSLS)\n"
384 + "Optimized Link State Routing (OLSR)\n"
385 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
386 "Route map reference\n"
387 "Pointer to route-map entries\n"
388 "Metric for redistributed routes\n"
389 @@ -8740,7 +8809,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
390
391 ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
392 no_bgp_redistribute_ipv6_metric_rmap_cmd,
393 - "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
394 + "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
395 NO_STR
396 "Redistribute information from another routing protocol\n"
397 "Connected\n"
398 @@ -8748,6 +8817,9 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
399 "Open Shurtest Path First (OSPFv3)\n"
400 "Routing Information Protocol (RIPng)\n"
401 "Static routes\n"
402 + "Hazy-Sighted Link State Protocol (HSLS)\n"
403 + "Optimized Link State Routing (OLSR)\n"
404 + "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
405 "Metric for redistributed routes\n"
406 "Default metric\n"
407 "Route map reference\n"
408 --- a/lib/log.c
409 +++ b/lib/log.c
410 @@ -835,6 +835,8 @@ static const struct zebra_desc_table rou
411 DESC_ENTRY (ZEBRA_ROUTE_ISIS, "isis", 'I' ),
412 DESC_ENTRY (ZEBRA_ROUTE_BGP, "bgp", 'B' ),
413 DESC_ENTRY (ZEBRA_ROUTE_HSLS, "hsls", 'H' ),
414 + DESC_ENTRY (ZEBRA_ROUTE_OLSR, "olsr", 'o' ),
415 + DESC_ENTRY (ZEBRA_ROUTE_BATMAN, "batman", 'b' ),
416 };
417 #undef DESC_ENTRY
418
419 --- a/lib/route_types.txt
420 +++ b/lib/route_types.txt
421 @@ -51,13 +51,9 @@ ZEBRA_ROUTE_OSPF, ospf, ospfd
422 ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'O', 0, 1, "OSPF"
423 ZEBRA_ROUTE_ISIS, isis, isisd, 'I', 1, 1, "IS-IS"
424 ZEBRA_ROUTE_BGP, bgp, bgpd, 'B', 1, 1, "BGP"
425 -# HSLS and OLSR both are AFI independent (so: 1, 1), however
426 -# we want to disable for them for general Quagga distribution.
427 -# This at least makes it trivial for users of these protocols
428 -# to 'switch on' redist support (direct numeric entry remaining
429 -# possible).
430 -ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 0, 0, "HSLS"
431 -ZEBRA_ROUTE_OLSR, olsr, oslrd, 'o', 0, 0, "OLSR"
432 +ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 1, 1, "HSLS"
433 +ZEBRA_ROUTE_OLSR, olsr, olsrd, 'o', 1, 1, "OLSR"
434 +ZEBRA_ROUTE_BATMAN, batman, batmand,'b', 1, 1, "BATMAN"
435
436 ## help strings
437 ZEBRA_ROUTE_SYSTEM, "Reserved route type, for internal use only"
438 @@ -71,4 +67,5 @@ ZEBRA_ROUTE_OSPF6, "Open Shortest Path
439 ZEBRA_ROUTE_ISIS, "Intermediate System to Intermediate System (IS-IS)"
440 ZEBRA_ROUTE_BGP, "Border Gateway Protocol (BGP)"
441 ZEBRA_ROUTE_HSLS, "Hazy-Sighted Link State Protocol (HSLS)"
442 -ZEBRA_ROUTE_OLSR, "Optimised Link State Routing (OLSR)"
443 +ZEBRA_ROUTE_OLSR, "Optimized Link State Routing (OLSR)"
444 +ZEBRA_ROUTE_BATMAN, "Better Approach to Mobile Ad-Hoc Networking (BATMAN)"
445 --- a/lib/zebra.h
446 +++ b/lib/zebra.h
447 @@ -441,7 +441,9 @@ struct in_pktinfo
448 #define ZEBRA_ROUTE_ISIS 8
449 #define ZEBRA_ROUTE_BGP 9
450 #define ZEBRA_ROUTE_HSLS 10
451 -#define ZEBRA_ROUTE_MAX 11
452 +#define ZEBRA_ROUTE_OLSR 11
453 +#define ZEBRA_ROUTE_BATMAN 12
454 +#define ZEBRA_ROUTE_MAX 13
455
456 /* Note: whenever a new route-type or zserv-command is added the
457 * corresponding {command,route}_types[] table in lib/log.c MUST be
458 --- a/ospf6d/ospf6_asbr.c
459 +++ b/ospf6d/ospf6_asbr.c
460 @@ -616,13 +616,16 @@ ospf6_asbr_redistribute_remove (int type
461
462 DEFUN (ospf6_redistribute,
463 ospf6_redistribute_cmd,
464 - "redistribute (static|kernel|connected|ripng|bgp)",
465 + "redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman)",
466 "Redistribute\n"
467 "Static route\n"
468 "Kernel route\n"
469 "Connected route\n"
470 "RIPng route\n"
471 "BGP route\n"
472 + "HSLS route\n"
473 + "OLSR route\n"
474 + "BATMAN route\n"
475 )
476 {
477 int type = 0;
478 @@ -637,6 +640,12 @@ DEFUN (ospf6_redistribute,
479 type = ZEBRA_ROUTE_RIPNG;
480 else if (strncmp (argv[0], "bgp", 3) == 0)
481 type = ZEBRA_ROUTE_BGP;
482 + else if (strncmp (argv[0], "h", 1) == 0)
483 + type = ZEBRA_ROUTE_HSLS;
484 + else if (strncmp (argv[0], "o", 1) == 0)
485 + type = ZEBRA_ROUTE_OLSR;
486 + else if (strncmp (argv[0], "ba", 2) == 0)
487 + type = ZEBRA_ROUTE_BATMAN;
488
489 ospf6_asbr_redistribute_unset (type);
490 ospf6_asbr_routemap_unset (type);
491 @@ -646,13 +655,16 @@ DEFUN (ospf6_redistribute,
492
493 DEFUN (ospf6_redistribute_routemap,
494 ospf6_redistribute_routemap_cmd,
495 - "redistribute (static|kernel|connected|ripng|bgp) route-map WORD",
496 + "redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman) route-map WORD",
497 "Redistribute\n"
498 "Static routes\n"
499 "Kernel route\n"
500 "Connected route\n"
501 "RIPng route\n"
502 "BGP route\n"
503 + "HSLS route\n"
504 + "OLSR route\n"
505 + "BATMAN route\n"
506 "Route map reference\n"
507 "Route map name\n"
508 )
509 @@ -669,6 +681,12 @@ DEFUN (ospf6_redistribute_routemap,
510 type = ZEBRA_ROUTE_RIPNG;
511 else if (strncmp (argv[0], "bgp", 3) == 0)
512 type = ZEBRA_ROUTE_BGP;
513 + else if (strncmp (argv[0], "h", 1) == 0)
514 + type = ZEBRA_ROUTE_HSLS;
515 + else if (strncmp (argv[0], "o", 1) == 0)
516 + type = ZEBRA_ROUTE_OLSR;
517 + else if (strncmp (argv[0], "ba", 2) == 0)
518 + type = ZEBRA_ROUTE_BATMAN;
519
520 ospf6_asbr_redistribute_unset (type);
521 ospf6_asbr_routemap_set (type, argv[1]);
522 @@ -678,7 +696,7 @@ DEFUN (ospf6_redistribute_routemap,
523
524 DEFUN (no_ospf6_redistribute,
525 no_ospf6_redistribute_cmd,
526 - "no redistribute (static|kernel|connected|ripng|bgp)",
527 + "no redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman)",
528 NO_STR
529 "Redistribute\n"
530 "Static route\n"
531 @@ -686,6 +704,9 @@ DEFUN (no_ospf6_redistribute,
532 "Connected route\n"
533 "RIPng route\n"
534 "BGP route\n"
535 + "HSLS route\n"
536 + "OLSR route\n"
537 + "BATMAN route\n"
538 )
539 {
540 int type = 0;
541 @@ -700,6 +721,12 @@ DEFUN (no_ospf6_redistribute,
542 type = ZEBRA_ROUTE_RIPNG;
543 else if (strncmp (argv[0], "bgp", 3) == 0)
544 type = ZEBRA_ROUTE_BGP;
545 + else if (strncmp (argv[0], "h", 1) == 0)
546 + type = ZEBRA_ROUTE_HSLS;
547 + else if (strncmp (argv[0], "o", 1) == 0)
548 + type = ZEBRA_ROUTE_OLSR;
549 + else if (strncmp (argv[0], "ba", 2) == 0)
550 + type = ZEBRA_ROUTE_BATMAN;
551
552 ospf6_asbr_redistribute_unset (type);
553 ospf6_asbr_routemap_unset (type);
554 --- a/ospfd/ospf_vty.c
555 +++ b/ospfd/ospf_vty.c
556 @@ -107,8 +107,14 @@ str2distribute_source (const char *str,
557 *source = ZEBRA_ROUTE_STATIC;
558 else if (strncmp (str, "r", 1) == 0)
559 *source = ZEBRA_ROUTE_RIP;
560 - else if (strncmp (str, "b", 1) == 0)
561 + else if (strncmp (str, "bg", 2) == 0)
562 *source = ZEBRA_ROUTE_BGP;
563 + else if (strncmp (str, "h", 1) == 0)
564 + *source = ZEBRA_ROUTE_HSLS;
565 + else if (strncmp (str, "o", 1) == 0)
566 + *source = ZEBRA_ROUTE_OLSR;
567 + else if (strncmp (str, "ba", 2) == 0)
568 + *source = ZEBRA_ROUTE_BATMAN;
569 else
570 return 0;
571
572 --- a/ripd/rip_zebra.c
573 +++ b/ripd/rip_zebra.c
574 @@ -204,8 +204,11 @@ static struct {
575 {ZEBRA_ROUTE_KERNEL, 1, "kernel"},
576 {ZEBRA_ROUTE_CONNECT, 1, "connected"},
577 {ZEBRA_ROUTE_STATIC, 1, "static"},
578 - {ZEBRA_ROUTE_OSPF, 1, "ospf"},
579 - {ZEBRA_ROUTE_BGP, 1, "bgp"},
580 + {ZEBRA_ROUTE_OSPF, 2, "ospf"},
581 + {ZEBRA_ROUTE_BGP, 2, "bgp"},
582 + {ZEBRA_ROUTE_HSLS, 1, "hsls"},
583 + {ZEBRA_ROUTE_OLSR, 2, "olsr"},
584 + {ZEBRA_ROUTE_BATMAN, 2, "batman"},
585 {0, 0, NULL}
586 };
587
588 --- a/ripngd/ripng_zebra.c
589 +++ b/ripngd/ripng_zebra.c
590 @@ -214,8 +214,11 @@ static struct {
591 {ZEBRA_ROUTE_KERNEL, 1, "kernel"},
592 {ZEBRA_ROUTE_CONNECT, 1, "connected"},
593 {ZEBRA_ROUTE_STATIC, 1, "static"},
594 - {ZEBRA_ROUTE_OSPF6, 1, "ospf6"},
595 - {ZEBRA_ROUTE_BGP, 1, "bgp"},
596 + {ZEBRA_ROUTE_OSPF6, 2, "ospf6"},
597 + {ZEBRA_ROUTE_BGP, 2, "bgp"},
598 + {ZEBRA_ROUTE_HSLS, 1, "hsls"},
599 + {ZEBRA_ROUTE_OLSR, 2, "olsr"},
600 + {ZEBRA_ROUTE_BATMAN, 2, "batman"},
601 {0, 0, NULL}
602 };
603
604 --- a/zebra/redistribute.c
605 +++ b/zebra/redistribute.c
606 @@ -255,6 +255,9 @@ zebra_redistribute_add (int command, str
607 case ZEBRA_ROUTE_OSPF:
608 case ZEBRA_ROUTE_OSPF6:
609 case ZEBRA_ROUTE_BGP:
610 + case ZEBRA_ROUTE_HSLS:
611 + case ZEBRA_ROUTE_OLSR:
612 + case ZEBRA_ROUTE_BATMAN:
613 if (! client->redist[type])
614 {
615 client->redist[type] = 1;
616 @@ -283,6 +286,9 @@ zebra_redistribute_delete (int command,
617 case ZEBRA_ROUTE_OSPF:
618 case ZEBRA_ROUTE_OSPF6:
619 case ZEBRA_ROUTE_BGP:
620 + case ZEBRA_ROUTE_HSLS:
621 + case ZEBRA_ROUTE_OLSR:
622 + case ZEBRA_ROUTE_BATMAN:
623 client->redist[type] = 0;
624 break;
625 default:
626 --- a/zebra/zebra_rib.c
627 +++ b/zebra/zebra_rib.c
628 @@ -66,7 +66,10 @@ static const struct
629 {ZEBRA_ROUTE_OSPF, 110},
630 {ZEBRA_ROUTE_OSPF6, 110},
631 {ZEBRA_ROUTE_ISIS, 115},
632 - {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */}
633 + {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */},
634 + {ZEBRA_ROUTE_HSLS, 0},
635 + {ZEBRA_ROUTE_OLSR, 0},
636 + {ZEBRA_ROUTE_BATMAN, 0}
637 };
638 \f
639 /* Vector for routing table. */
640 @@ -1229,6 +1232,8 @@ static const u_char meta_queue_map[ZEBRA
641 [ZEBRA_ROUTE_ISIS] = 2,
642 [ZEBRA_ROUTE_BGP] = 3,
643 [ZEBRA_ROUTE_HSLS] = 4,
644 + [ZEBRA_ROUTE_OLSR] = 4,
645 + [ZEBRA_ROUTE_BATMAN] = 4,
646 };
647
648 /* Look into the RN and queue it into one or more priority queues,
649 --- a/zebra/zebra_snmp.c
650 +++ b/zebra/zebra_snmp.c
651 @@ -251,6 +251,12 @@ proto_trans(int type)
652 return 1; /* shouldn't happen */
653 case ZEBRA_ROUTE_BGP:
654 return 14; /* bgp */
655 + case ZEBRA_ROUTE_HSLS:
656 + return 1; /* other */
657 + case ZEBRA_ROUTE_OLSR:
658 + return 1; /* other */
659 + case ZEBRA_ROUTE_BATMAN:
660 + return 1; /* other */
661 default:
662 return 1; /* other */
663 }
664 --- a/zebra/zebra_vty.c
665 +++ b/zebra/zebra_vty.c
666 @@ -557,7 +557,10 @@ vty_show_ip_route_detail (struct vty *vt
667 if (rib->type == ZEBRA_ROUTE_RIP
668 || rib->type == ZEBRA_ROUTE_OSPF
669 || rib->type == ZEBRA_ROUTE_ISIS
670 - || rib->type == ZEBRA_ROUTE_BGP)
671 + || rib->type == ZEBRA_ROUTE_BGP
672 + || rib->type == ZEBRA_ROUTE_HSLS
673 + || rib->type == ZEBRA_ROUTE_OLSR
674 + || rib->type == ZEBRA_ROUTE_BATMAN)
675 {
676 time_t uptime;
677 struct tm *tm;
678 @@ -775,7 +778,10 @@ vty_show_ip_route (struct vty *vty, stru
679 if (rib->type == ZEBRA_ROUTE_RIP
680 || rib->type == ZEBRA_ROUTE_OSPF
681 || rib->type == ZEBRA_ROUTE_ISIS
682 - || rib->type == ZEBRA_ROUTE_BGP)
683 + || rib->type == ZEBRA_ROUTE_BGP
684 + || rib->type == ZEBRA_ROUTE_HSLS
685 + || rib->type == ZEBRA_ROUTE_OLSR
686 + || rib->type == ZEBRA_ROUTE_BATMAN)
687 {
688 time_t uptime;
689 struct tm *tm;
690 @@ -803,8 +809,8 @@ vty_show_ip_route (struct vty *vty, stru
691 }
692
693 #define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
694 - "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, " \
695 - "> - selected route, * - FIB route%s%s"
696 + "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, H - HSLS, " \
697 + "o - OLSR, b - BATMAN,%s > - selected route, * - FIB route%s%s"
698
699 DEFUN (show_ip_route,
700 show_ip_route_cmd,
701 @@ -829,7 +835,7 @@ DEFUN (show_ip_route,
702 if (first)
703 {
704 vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE, VTY_NEWLINE,
705 - VTY_NEWLINE);
706 + VTY_NEWLINE, VTY_NEWLINE);
707 first = 0;
708 }
709 vty_show_ip_route (vty, rn, rib);
710 @@ -872,7 +878,7 @@ DEFUN (show_ip_route_prefix_longer,
711 if (first)
712 {
713 vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
714 - VTY_NEWLINE, VTY_NEWLINE);
715 + VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
716 first = 0;
717 }
718 vty_show_ip_route (vty, rn, rib);
719 @@ -911,7 +917,7 @@ DEFUN (show_ip_route_supernets,
720 if (first)
721 {
722 vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
723 - VTY_NEWLINE, VTY_NEWLINE);
724 + VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
725 first = 0;
726 }
727 vty_show_ip_route (vty, rn, rib);
728 @@ -922,7 +928,7 @@ DEFUN (show_ip_route_supernets,
729
730 DEFUN (show_ip_route_protocol,
731 show_ip_route_protocol_cmd,
732 - "show ip route (bgp|connected|isis|kernel|ospf|rip|static)",
733 + "show ip route (bgp|connected|isis|kernel|ospf|rip|static|hsls|olsr|batman)",
734 SHOW_STR
735 IP_STR
736 "IP routing table\n"
737 @@ -940,13 +946,13 @@ DEFUN (show_ip_route_protocol,
738 struct rib *rib;
739 int first = 1;
740
741 - if (strncmp (argv[0], "b", 1) == 0)
742 + if (strncmp (argv[0], "bg", 2) == 0)
743 type = ZEBRA_ROUTE_BGP;
744 else if (strncmp (argv[0], "c", 1) == 0)
745 type = ZEBRA_ROUTE_CONNECT;
746 else if (strncmp (argv[0], "k", 1) ==0)
747 type = ZEBRA_ROUTE_KERNEL;
748 - else if (strncmp (argv[0], "o", 1) == 0)
749 + else if (strncmp (argv[0], "os", 2) == 0)
750 type = ZEBRA_ROUTE_OSPF;
751 else if (strncmp (argv[0], "i", 1) == 0)
752 type = ZEBRA_ROUTE_ISIS;
753 @@ -954,6 +960,12 @@ DEFUN (show_ip_route_protocol,
754 type = ZEBRA_ROUTE_RIP;
755 else if (strncmp (argv[0], "s", 1) == 0)
756 type = ZEBRA_ROUTE_STATIC;
757 + else if (strncmp (argv[0], "h", 1) == 0)
758 + type = ZEBRA_ROUTE_HSLS;
759 + else if (strncmp (argv[0], "ol", 2) == 0)
760 + type = ZEBRA_ROUTE_OLSR;
761 + else if (strncmp (argv[0], "ba", 2) == 0)
762 + type = ZEBRA_ROUTE_BATMAN;
763 else
764 {
765 vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
766 @@ -971,7 +983,7 @@ DEFUN (show_ip_route_protocol,
767 {
768 if (first)
769 {
770 - vty_out (vty, SHOW_ROUTE_V4_HEADER,
771 + vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
772 VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
773 first = 0;
774 }
775 @@ -1560,7 +1572,10 @@ vty_show_ipv6_route_detail (struct vty *
776 if (rib->type == ZEBRA_ROUTE_RIPNG
777 || rib->type == ZEBRA_ROUTE_OSPF6
778 || rib->type == ZEBRA_ROUTE_ISIS
779 - || rib->type == ZEBRA_ROUTE_BGP)
780 + || rib->type == ZEBRA_ROUTE_BGP
781 + || rib->type == ZEBRA_ROUTE_HSLS
782 + || rib->type == ZEBRA_ROUTE_OLSR
783 + || rib->type == ZEBRA_ROUTE_BATMAN)
784 {
785 time_t uptime;
786 struct tm *tm;
787 @@ -1739,7 +1754,10 @@ vty_show_ipv6_route (struct vty *vty, st
788 if (rib->type == ZEBRA_ROUTE_RIPNG
789 || rib->type == ZEBRA_ROUTE_OSPF6
790 || rib->type == ZEBRA_ROUTE_ISIS
791 - || rib->type == ZEBRA_ROUTE_BGP)
792 + || rib->type == ZEBRA_ROUTE_BGP
793 + || rib->type == ZEBRA_ROUTE_HSLS
794 + || rib->type == ZEBRA_ROUTE_OLSR
795 + || rib->type == ZEBRA_ROUTE_BATMAN)
796 {
797 time_t uptime;
798 struct tm *tm;
799 @@ -1766,7 +1784,7 @@ vty_show_ipv6_route (struct vty *vty, st
800 }
801 }
802
803 -#define SHOW_ROUTE_V6_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,%s I - ISIS, B - BGP, * - FIB route.%s%s"
804 +#define SHOW_ROUTE_V6_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,%s I - ISIS, B - BGP, H - HSLS, o - OLSR, b - BATMAN, * - FIB route.%s%s"
805
806 DEFUN (show_ipv6_route,
807 show_ipv6_route_cmd,
808 @@ -1842,7 +1860,7 @@ DEFUN (show_ipv6_route_prefix_longer,
809
810 DEFUN (show_ipv6_route_protocol,
811 show_ipv6_route_protocol_cmd,
812 - "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static)",
813 + "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static|hsls|olsr|batman)",
814 SHOW_STR
815 IP_STR
816 "IP routing table\n"
817 @@ -1860,13 +1878,13 @@ DEFUN (show_ipv6_route_protocol,
818 struct rib *rib;
819 int first = 1;
820
821 - if (strncmp (argv[0], "b", 1) == 0)
822 + if (strncmp (argv[0], "bg", 2) == 0)
823 type = ZEBRA_ROUTE_BGP;
824 else if (strncmp (argv[0], "c", 1) == 0)
825 type = ZEBRA_ROUTE_CONNECT;
826 else if (strncmp (argv[0], "k", 1) ==0)
827 type = ZEBRA_ROUTE_KERNEL;
828 - else if (strncmp (argv[0], "o", 1) == 0)
829 + else if (strncmp (argv[0], "os", 2) == 0)
830 type = ZEBRA_ROUTE_OSPF6;
831 else if (strncmp (argv[0], "i", 1) == 0)
832 type = ZEBRA_ROUTE_ISIS;
833 @@ -1874,6 +1892,12 @@ DEFUN (show_ipv6_route_protocol,
834 type = ZEBRA_ROUTE_RIPNG;
835 else if (strncmp (argv[0], "s", 1) == 0)
836 type = ZEBRA_ROUTE_STATIC;
837 + else if (strncmp (argv[0], "h", 1) == 0)
838 + type = ZEBRA_ROUTE_HSLS;
839 + else if (strncmp (argv[0], "ol", 2) == 0)
840 + type = ZEBRA_ROUTE_OLSR;
841 + else if (strncmp (argv[0], "ba", 2) == 0)
842 + type = ZEBRA_ROUTE_BATMAN;
843 else
844 {
845 vty_out (vty, "Unknown route type%s", VTY_NEWLINE);