8fe07acccf28a347c063af72a690386c10e18e57
[packages.git] / net / quagga / patches-old / 002-quagga_manet.patch
1 --- a/bgpd/bgp_vty.c
2 +++ b/bgpd/bgp_vty.c
3 @@ -3,6 +3,9 @@
4  
5  This file is part of GNU Zebra.
6  
7 +This file was modified from the original on 30/12/2007
8 +by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
9 +
10  GNU Zebra is free software; you can redistribute it and/or modify it
11  under the terms of the GNU General Public License as published by the
12  Free Software Foundation; either version 2, or (at your option) any
13 @@ -7793,8 +7796,12 @@ bgp_str2route_type (int afi, const char 
14         return ZEBRA_ROUTE_STATIC;
15        else if (strncmp (str, "r", 1) == 0)
16         return ZEBRA_ROUTE_RIP;
17 -      else if (strncmp (str, "o", 1) == 0)
18 +      else if (strncmp (str, "ol", 2) == 0)
19 +       return ZEBRA_ROUTE_OLSR;
20 +      else if (strncmp (str, "os", 2) == 0)
21         return ZEBRA_ROUTE_OSPF;
22 +      else if (strncmp (str, "ba", 2) == 0)
23 +       return ZEBRA_ROUTE_BATMAN;
24      }
25    if (afi == AFI_IP6)
26      {
27 @@ -7806,21 +7813,28 @@ bgp_str2route_type (int afi, const char 
28         return ZEBRA_ROUTE_STATIC;
29        else if (strncmp (str, "r", 1) == 0)
30         return ZEBRA_ROUTE_RIPNG;
31 -      else if (strncmp (str, "o", 1) == 0)
32 +      else if (strncmp (str, "os", 2) == 0)
33         return ZEBRA_ROUTE_OSPF6;
34 +      else if (strncmp (str, "ol", 2) == 0)
35 +       return ZEBRA_ROUTE_OLSR;
36 +      else if (strncmp (str, "ba", 2) == 0)
37 +       return ZEBRA_ROUTE_BATMAN;
38      }
39    return 0;
40  }
41  
42  DEFUN (bgp_redistribute_ipv4,
43         bgp_redistribute_ipv4_cmd,
44 -       "redistribute (connected|kernel|ospf|rip|static)",
45 +       "redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
46         "Redistribute information from another routing protocol\n"
47         "Connected\n"
48         "Kernel routes\n"
49         "Open Shurtest Path First (OSPF)\n"
50         "Routing Information Protocol (RIP)\n"
51 -       "Static routes\n")
52 +       "Static routes\n"
53 +       "Optimized Link State Routing (OLSR)\n"
54 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
55 +       )
56  {
57    int type;
58  
59 @@ -7835,13 +7849,15 @@ DEFUN (bgp_redistribute_ipv4,
60  
61  DEFUN (bgp_redistribute_ipv4_rmap,
62         bgp_redistribute_ipv4_rmap_cmd,
63 -       "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
64 +       "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
65         "Redistribute information from another routing protocol\n"
66         "Connected\n"
67         "Kernel routes\n"
68         "Open Shurtest Path First (OSPF)\n"
69         "Routing Information Protocol (RIP)\n"
70         "Static routes\n"
71 +       "Optimized Link State Routing (OLSR)\n"
72 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
73         "Route map reference\n"
74         "Pointer to route-map entries\n")
75  {
76 @@ -7860,13 +7876,15 @@ DEFUN (bgp_redistribute_ipv4_rmap,
77  
78  DEFUN (bgp_redistribute_ipv4_metric,
79         bgp_redistribute_ipv4_metric_cmd,
80 -       "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
81 +       "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
82         "Redistribute information from another routing protocol\n"
83         "Connected\n"
84         "Kernel routes\n"
85         "Open Shurtest Path First (OSPF)\n"
86         "Routing Information Protocol (RIP)\n"
87         "Static routes\n"
88 +       "Optimized Link State Routing (OLSR)\n"
89 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
90         "Metric for redistributed routes\n"
91         "Default metric\n")
92  {
93 @@ -7887,13 +7905,15 @@ DEFUN (bgp_redistribute_ipv4_metric,
94  
95  DEFUN (bgp_redistribute_ipv4_rmap_metric,
96         bgp_redistribute_ipv4_rmap_metric_cmd,
97 -       "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
98 +       "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD metric <0-4294967295>",
99         "Redistribute information from another routing protocol\n"
100         "Connected\n"
101         "Kernel routes\n"
102         "Open Shurtest Path First (OSPF)\n"
103         "Routing Information Protocol (RIP)\n"
104         "Static routes\n"
105 +       "Optimized Link State Routing (OLSR)\n"
106 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
107         "Route map reference\n"
108         "Pointer to route-map entries\n"
109         "Metric for redistributed routes\n"
110 @@ -7917,13 +7937,15 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
111  
112  DEFUN (bgp_redistribute_ipv4_metric_rmap,
113         bgp_redistribute_ipv4_metric_rmap_cmd,
114 -       "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
115 +       "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
116         "Redistribute information from another routing protocol\n"
117         "Connected\n"
118         "Kernel routes\n"
119         "Open Shurtest Path First (OSPF)\n"
120         "Routing Information Protocol (RIP)\n"
121         "Static routes\n"
122 +       "Optimized Link State Routing (OLSR)\n"
123 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
124         "Metric for redistributed routes\n"
125         "Default metric\n"
126         "Route map reference\n"
127 @@ -7947,14 +7969,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
128  
129  DEFUN (no_bgp_redistribute_ipv4,
130         no_bgp_redistribute_ipv4_cmd,
131 -       "no redistribute (connected|kernel|ospf|rip|static)",
132 +       "no redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
133         NO_STR
134         "Redistribute information from another routing protocol\n"
135         "Connected\n"
136         "Kernel routes\n"
137         "Open Shurtest Path First (OSPF)\n"
138         "Routing Information Protocol (RIP)\n"
139 -       "Static routes\n")
140 +       "Static routes\n"
141 +       "Optimized Link State Routing (OLSR)\n"
142 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
143 +       )
144  {
145    int type;
146  
147 @@ -7970,7 +7995,7 @@ DEFUN (no_bgp_redistribute_ipv4,
148  
149  DEFUN (no_bgp_redistribute_ipv4_rmap,
150         no_bgp_redistribute_ipv4_rmap_cmd,
151 -       "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
152 +       "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
153         NO_STR
154         "Redistribute information from another routing protocol\n"
155         "Connected\n"
156 @@ -7978,6 +8003,8 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
157         "Open Shurtest Path First (OSPF)\n"
158         "Routing Information Protocol (RIP)\n"
159         "Static routes\n"
160 +       "Optimized Link State Routing (OLSR)\n"
161 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
162         "Route map reference\n"
163         "Pointer to route-map entries\n")
164  {
165 @@ -7996,7 +8023,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
166  
167  DEFUN (no_bgp_redistribute_ipv4_metric,
168         no_bgp_redistribute_ipv4_metric_cmd,
169 -       "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
170 +       "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
171         NO_STR
172         "Redistribute information from another routing protocol\n"
173         "Connected\n"
174 @@ -8004,6 +8031,8 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
175         "Open Shurtest Path First (OSPF)\n"
176         "Routing Information Protocol (RIP)\n"
177         "Static routes\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 @@ -8022,7 +8051,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|olsr|batman) route-map WORD metric <0-4294967295>",
189         NO_STR
190         "Redistribute information from another routing protocol\n"
191         "Connected\n"
192 @@ -8030,6 +8059,8 @@ 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 +       "Optimized Link State Routing (OLSR)\n"
197 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
198         "Route map reference\n"
199         "Pointer to route-map entries\n"
200         "Metric for redistributed routes\n"
201 @@ -8051,7 +8082,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
202  
203  ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
204         no_bgp_redistribute_ipv4_metric_rmap_cmd,
205 -       "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
206 +       "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
207         NO_STR
208         "Redistribute information from another routing protocol\n"
209         "Connected\n"
210 @@ -8059,6 +8090,8 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
211         "Open Shurtest Path First (OSPF)\n"
212         "Routing Information Protocol (RIP)\n"
213         "Static routes\n"
214 +       "Optimized Link State Routing (OLSR)\n"
215 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
216         "Metric for redistributed routes\n"
217         "Default metric\n"
218         "Route map reference\n"
219 @@ -8067,13 +8100,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
220  #ifdef HAVE_IPV6
221  DEFUN (bgp_redistribute_ipv6,
222         bgp_redistribute_ipv6_cmd,
223 -       "redistribute (connected|kernel|ospf6|ripng|static)",
224 +       "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
225         "Redistribute information from another routing protocol\n"
226         "Connected\n"
227         "Kernel routes\n"
228         "Open Shurtest Path First (OSPFv3)\n"
229         "Routing Information Protocol (RIPng)\n"
230 -       "Static routes\n")
231 +       "Static routes\n"
232 +       "Optimized Link State Routing (OLSR)\n"
233 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
234 +       )
235  {
236    int type;
237  
238 @@ -8089,13 +8125,15 @@ DEFUN (bgp_redistribute_ipv6,
239  
240  DEFUN (bgp_redistribute_ipv6_rmap,
241         bgp_redistribute_ipv6_rmap_cmd,
242 -       "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
243 +       "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
244         "Redistribute information from another routing protocol\n"
245         "Connected\n"
246         "Kernel routes\n"
247         "Open Shurtest Path First (OSPFv3)\n"
248         "Routing Information Protocol (RIPng)\n"
249         "Static routes\n"
250 +       "Optimized Link State Routing (OLSR)\n"
251 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
252         "Route map reference\n"
253         "Pointer to route-map entries\n")
254  {
255 @@ -8114,13 +8152,15 @@ DEFUN (bgp_redistribute_ipv6_rmap,
256  
257  DEFUN (bgp_redistribute_ipv6_metric,
258         bgp_redistribute_ipv6_metric_cmd,
259 -       "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
260 +       "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
261         "Redistribute information from another routing protocol\n"
262         "Connected\n"
263         "Kernel routes\n"
264         "Open Shurtest Path First (OSPFv3)\n"
265         "Routing Information Protocol (RIPng)\n"
266         "Static routes\n"
267 +       "Optimized Link State Routing (OLSR)\n"
268 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
269         "Metric for redistributed routes\n"
270         "Default metric\n")
271  {
272 @@ -8141,13 +8181,15 @@ DEFUN (bgp_redistribute_ipv6_metric,
273  
274  DEFUN (bgp_redistribute_ipv6_rmap_metric,
275         bgp_redistribute_ipv6_rmap_metric_cmd,
276 -       "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
277 +       "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
278         "Redistribute information from another routing protocol\n"
279         "Connected\n"
280         "Kernel routes\n"
281         "Open Shurtest Path First (OSPFv3)\n"
282         "Routing Information Protocol (RIPng)\n"
283         "Static routes\n"
284 +       "Optimized Link State Routing (OLSR)\n"
285 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
286         "Route map reference\n"
287         "Pointer to route-map entries\n"
288         "Metric for redistributed routes\n"
289 @@ -8171,13 +8213,15 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
290  
291  DEFUN (bgp_redistribute_ipv6_metric_rmap,
292         bgp_redistribute_ipv6_metric_rmap_cmd,
293 -       "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
294 +       "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
295         "Redistribute information from another routing protocol\n"
296         "Connected\n"
297         "Kernel routes\n"
298         "Open Shurtest Path First (OSPFv3)\n"
299         "Routing Information Protocol (RIPng)\n"
300         "Static routes\n"
301 +       "Optimized Link State Routing (OLSR)\n"
302 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
303         "Metric for redistributed routes\n"
304         "Default metric\n"
305         "Route map reference\n"
306 @@ -8201,14 +8245,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
307  
308  DEFUN (no_bgp_redistribute_ipv6,
309         no_bgp_redistribute_ipv6_cmd,
310 -       "no redistribute (connected|kernel|ospf6|ripng|static)",
311 +       "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
312         NO_STR
313         "Redistribute information from another routing protocol\n"
314         "Connected\n"
315         "Kernel routes\n"
316         "Open Shurtest Path First (OSPFv3)\n"
317         "Routing Information Protocol (RIPng)\n"
318 -       "Static routes\n")
319 +       "Static routes\n"
320 +       "Optimized Link State Routing (OLSR)\n"
321 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
322 +      )
323  {
324    int type;
325  
326 @@ -8224,7 +8271,7 @@ DEFUN (no_bgp_redistribute_ipv6,
327  
328  DEFUN (no_bgp_redistribute_ipv6_rmap,
329         no_bgp_redistribute_ipv6_rmap_cmd,
330 -       "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
331 +       "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
332         NO_STR
333         "Redistribute information from another routing protocol\n"
334         "Connected\n"
335 @@ -8232,6 +8279,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
336         "Open Shurtest Path First (OSPFv3)\n"
337         "Routing Information Protocol (RIPng)\n"
338         "Static routes\n"
339 +       "Optimized Link State Routing (OLSR)\n"
340 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
341         "Route map reference\n"
342         "Pointer to route-map entries\n")
343  {
344 @@ -8250,7 +8299,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
345  
346  DEFUN (no_bgp_redistribute_ipv6_metric,
347         no_bgp_redistribute_ipv6_metric_cmd,
348 -       "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
349 +       "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
350         NO_STR
351         "Redistribute information from another routing protocol\n"
352         "Connected\n"
353 @@ -8258,6 +8307,8 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
354         "Open Shurtest Path First (OSPFv3)\n"
355         "Routing Information Protocol (RIPng)\n"
356         "Static routes\n"
357 +       "Optimized Link State Routing (OLSR)\n"
358 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
359         "Metric for redistributed routes\n"
360         "Default metric\n")
361  {
362 @@ -8276,7 +8327,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
363  
364  DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
365         no_bgp_redistribute_ipv6_rmap_metric_cmd,
366 -       "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
367 +       "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
368         NO_STR
369         "Redistribute information from another routing protocol\n"
370         "Connected\n"
371 @@ -8284,6 +8335,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
372         "Open Shurtest Path First (OSPFv3)\n"
373         "Routing Information Protocol (RIPng)\n"
374         "Static routes\n"
375 +       "Optimized Link State Routing (OLSR)\n"
376 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
377         "Route map reference\n"
378         "Pointer to route-map entries\n"
379         "Metric for redistributed routes\n"
380 @@ -8305,7 +8358,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
381  
382  ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
383         no_bgp_redistribute_ipv6_metric_rmap_cmd,
384 -       "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
385 +       "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
386         NO_STR
387         "Redistribute information from another routing protocol\n"
388         "Connected\n"
389 @@ -8313,6 +8366,8 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
390         "Open Shurtest Path First (OSPFv3)\n"
391         "Routing Information Protocol (RIPng)\n"
392         "Static routes\n"
393 +       "Optimized Link State Routing (OLSR)\n"
394 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
395         "Metric for redistributed routes\n"
396         "Default metric\n"
397         "Route map reference\n"
398 @@ -8325,7 +8380,7 @@ bgp_config_write_redistribute (struct vt
399  {
400    int i;
401    const char *str[] = { "system", "kernel", "connected", "static", "rip",
402 -                 "ripng", "ospf", "ospf6", "isis", "bgp"};
403 +                 "ripng", "ospf", "ospf6", "isis", "bgp", "hsls", "olsr", "batman"};
404  
405    /* Unicast redistribution only.  */
406    if (safi != SAFI_UNICAST)
407 --- a/lib/zebra.h
408 +++ b/lib/zebra.h
409 @@ -3,6 +3,9 @@
410  
411  This file is part of GNU Zebra.
412  
413 +This file was modified from the original on 30/12/2007
414 +by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
415 +
416  GNU Zebra is free software; you can redistribute it and/or modify it
417  under the terms of the GNU General Public License as published by the
418  Free Software Foundation; either version 2, or (at your option) any
419 @@ -378,7 +381,9 @@ struct in_pktinfo
420  #define ZEBRA_ROUTE_ISIS                 8
421  #define ZEBRA_ROUTE_BGP                  9
422  #define ZEBRA_ROUTE_HSLS                10
423 -#define ZEBRA_ROUTE_MAX                  11
424 +#define ZEBRA_ROUTE_OLSR                11
425 +#define ZEBRA_ROUTE_BATMAN              12
426 +#define ZEBRA_ROUTE_MAX                  13
427  
428  /* Zebra's family types. */
429  #define ZEBRA_FAMILY_IPV4                1
430 --- a/ospfd/ospf_vty.c
431 +++ b/ospfd/ospf_vty.c
432 @@ -3,6 +3,9 @@
433   *
434   * This file is part of GNU Zebra.
435   *
436 + * This file was modified from the original on 30/12/2007
437 + * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
438 + *
439   * GNU Zebra is free software; you can redistribute it and/or modify it
440   * under the terms of the GNU General Public License as published by the
441   * Free Software Foundation; either version 2, or (at your option) any
442 @@ -106,11 +109,15 @@ str2distribute_source (const char *str, 
443      *source = ZEBRA_ROUTE_STATIC;
444    else if (strncmp (str, "r", 1) == 0)
445      *source = ZEBRA_ROUTE_RIP;
446 -  else if (strncmp (str, "b", 1) == 0)
447 +  else if (strncmp (str, "bg", 2) == 0)
448      *source = ZEBRA_ROUTE_BGP;
449 +  else if (strncmp (str, "ol", 2) == 0)
450 +    *source = ZEBRA_ROUTE_OLSR;
451 +  else if (strncmp (str, "ba", 2) == 0)
452 +    *source = ZEBRA_ROUTE_BATMAN;
453    else
454      return 0;
455 -
456 +  
457    return 1;
458  }
459  
460 @@ -5302,13 +5309,15 @@ ALIAS (no_ip_ospf_transmit_delay,
461  \f
462  DEFUN (ospf_redistribute_source_metric_type,
463         ospf_redistribute_source_metric_type_routemap_cmd,
464 -       "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2) route-map WORD",
465 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2) route-map WORD",
466         "Redistribute information from another routing protocol\n"
467         "Kernel routes\n"
468         "Connected\n"
469         "Static routes\n"
470         "Routing Information Protocol (RIP)\n"
471         "Border Gateway Protocol (BGP)\n"
472 +       "Optimized Link State Routing (OLSR)\n"
473 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
474         "Metric for redistributed routes\n"
475         "OSPF default metric\n"
476         "OSPF exterior metric type for redistributed routes\n"
477 @@ -5346,13 +5355,15 @@ DEFUN (ospf_redistribute_source_metric_t
478  
479  ALIAS (ospf_redistribute_source_metric_type,
480         ospf_redistribute_source_metric_type_cmd,
481 -       "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2)",
482 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2)",
483         "Redistribute information from another routing protocol\n"
484         "Kernel routes\n"
485         "Connected\n"
486         "Static routes\n"
487         "Routing Information Protocol (RIP)\n"
488         "Border Gateway Protocol (BGP)\n"
489 +       "Optimized Link State Routing (OLSR)\n"
490 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
491         "Metric for redistributed routes\n"
492         "OSPF default metric\n"
493         "OSPF exterior metric type for redistributed routes\n"
494 @@ -5361,25 +5372,29 @@ ALIAS (ospf_redistribute_source_metric_t
495  
496  ALIAS (ospf_redistribute_source_metric_type,
497         ospf_redistribute_source_metric_cmd,
498 -       "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>",
499 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214>",
500         "Redistribute information from another routing protocol\n"
501         "Kernel routes\n"
502         "Connected\n"
503         "Static routes\n"
504         "Routing Information Protocol (RIP)\n"
505         "Border Gateway Protocol (BGP)\n"
506 +       "Optimized Link State Routing (OLSR)\n"
507 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
508         "Metric for redistributed routes\n"
509         "OSPF default metric\n")
510  
511  DEFUN (ospf_redistribute_source_type_metric,
512         ospf_redistribute_source_type_metric_routemap_cmd,
513 -       "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map WORD",
514 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214> route-map WORD",
515         "Redistribute information from another routing protocol\n"
516         "Kernel routes\n"
517         "Connected\n"
518         "Static routes\n"
519         "Routing Information Protocol (RIP)\n"
520         "Border Gateway Protocol (BGP)\n"
521 +       "Optimized Link State Routing (OLSR)\n"
522 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
523         "OSPF exterior metric type for redistributed routes\n"
524         "Set OSPF External Type 1 metrics\n"
525         "Set OSPF External Type 2 metrics\n"
526 @@ -5417,13 +5432,15 @@ DEFUN (ospf_redistribute_source_type_met
527  
528  ALIAS (ospf_redistribute_source_type_metric,
529         ospf_redistribute_source_type_metric_cmd,
530 -       "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>",
531 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214>",
532         "Redistribute information from another routing protocol\n"
533         "Kernel routes\n"
534         "Connected\n"
535         "Static routes\n"
536         "Routing Information Protocol (RIP)\n"
537         "Border Gateway Protocol (BGP)\n"
538 +       "Optimized Link State Routing (OLSR)\n"
539 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
540         "OSPF exterior metric type for redistributed routes\n"
541         "Set OSPF External Type 1 metrics\n"
542         "Set OSPF External Type 2 metrics\n"
543 @@ -5432,7 +5449,7 @@ ALIAS (ospf_redistribute_source_type_met
544  
545  ALIAS (ospf_redistribute_source_type_metric,
546         ospf_redistribute_source_type_cmd,
547 -       "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)",
548 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2)",
549         "Redistribute information from another routing protocol\n"
550         "Kernel routes\n"
551         "Connected\n"
552 @@ -5440,28 +5457,35 @@ ALIAS (ospf_redistribute_source_type_met
553         "Routing Information Protocol (RIP)\n"
554         "Border Gateway Protocol (BGP)\n"
555         "OSPF exterior metric type for redistributed routes\n"
556 +       "Optimized Link State Routing (OLSR)\n"
557 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
558         "Set OSPF External Type 1 metrics\n"
559         "Set OSPF External Type 2 metrics\n")
560  
561  ALIAS (ospf_redistribute_source_type_metric,
562         ospf_redistribute_source_cmd,
563 -       "redistribute (kernel|connected|static|rip|bgp)",
564 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
565         "Redistribute information from another routing protocol\n"
566         "Kernel routes\n"
567         "Connected\n"
568         "Static routes\n"
569         "Routing Information Protocol (RIP)\n"
570 -       "Border Gateway Protocol (BGP)\n")
571 +       "Border Gateway Protocol (BGP)\n"
572 +       "Optimized Link State Routing (OLSR)\n"
573 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
574 +       )
575  
576  DEFUN (ospf_redistribute_source_metric_routemap,
577         ospf_redistribute_source_metric_routemap_cmd,
578 -       "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map WORD",
579 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> route-map WORD",
580         "Redistribute information from another routing protocol\n"
581         "Kernel routes\n"
582         "Connected\n"
583         "Static routes\n"
584         "Routing Information Protocol (RIP)\n"
585         "Border Gateway Protocol (BGP)\n"
586 +       "Optimized Link State Routing (OLSR)\n"
587 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
588         "Metric for redistributed routes\n"
589         "OSPF default metric\n"
590         "Route map reference\n"
591 @@ -5490,13 +5514,15 @@ DEFUN (ospf_redistribute_source_metric_r
592  
593  DEFUN (ospf_redistribute_source_type_routemap,
594         ospf_redistribute_source_type_routemap_cmd,
595 -       "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD",
596 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) route-map WORD",
597         "Redistribute information from another routing protocol\n"
598         "Kernel routes\n"
599         "Connected\n"
600         "Static routes\n"
601         "Routing Information Protocol (RIP)\n"
602         "Border Gateway Protocol (BGP)\n"
603 +       "Optimized Link State Routing (OLSR)\n"
604 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
605         "OSPF exterior metric type for redistributed routes\n"
606         "Set OSPF External Type 1 metrics\n"
607         "Set OSPF External Type 2 metrics\n"
608 @@ -5526,13 +5552,15 @@ DEFUN (ospf_redistribute_source_type_rou
609  
610  DEFUN (ospf_redistribute_source_routemap,
611         ospf_redistribute_source_routemap_cmd,
612 -       "redistribute (kernel|connected|static|rip|bgp) route-map WORD",
613 +       "redistribute (kernel|connected|static|rip|bgp|olsr|batman) route-map WORD",
614         "Redistribute information from another routing protocol\n"
615         "Kernel routes\n"
616         "Connected\n"
617         "Static routes\n"
618         "Routing Information Protocol (RIP)\n"
619         "Border Gateway Protocol (BGP)\n"
620 +       "Optimized Link State Routing (OLSR)\n"
621 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
622         "Route map reference\n"
623         "Pointer to route-map entries\n")
624  {
625 @@ -5553,14 +5581,17 @@ DEFUN (ospf_redistribute_source_routemap
626  
627  DEFUN (no_ospf_redistribute_source,
628         no_ospf_redistribute_source_cmd,
629 -       "no redistribute (kernel|connected|static|rip|bgp)",
630 +       "no redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
631         NO_STR
632         "Redistribute information from another routing protocol\n"
633         "Kernel routes\n"
634         "Connected\n"
635         "Static routes\n"
636         "Routing Information Protocol (RIP)\n"
637 -       "Border Gateway Protocol (BGP)\n")
638 +       "Border Gateway Protocol (BGP)\n"
639 +       "Optimized Link State Routing (OLSR)\n"
640 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
641 +       )
642  {
643    struct ospf *ospf = vty->index;
644    int source;
645 @@ -5574,7 +5605,7 @@ DEFUN (no_ospf_redistribute_source,
646  
647  DEFUN (ospf_distribute_list_out,
648         ospf_distribute_list_out_cmd,
649 -       "distribute-list WORD out (kernel|connected|static|rip|bgp)",
650 +       "distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
651         "Filter networks in routing updates\n"
652         "Access-list name\n"
653         OUT_STR
654 @@ -5582,7 +5613,10 @@ DEFUN (ospf_distribute_list_out,
655         "Connected\n"
656         "Static routes\n"
657         "Routing Information Protocol (RIP)\n"
658 -       "Border Gateway Protocol (BGP)\n")
659 +       "Border Gateway Protocol (BGP)\n"
660 +       "Optimized Link State Routing (OLSR)\n"
661 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
662 +)
663  {
664    struct ospf *ospf = vty->index;
665    int source;
666 @@ -5596,7 +5630,7 @@ DEFUN (ospf_distribute_list_out,
667  
668  DEFUN (no_ospf_distribute_list_out,
669         no_ospf_distribute_list_out_cmd,
670 -       "no distribute-list WORD out (kernel|connected|static|rip|bgp)",
671 +       "no distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
672         NO_STR
673         "Filter networks in routing updates\n"
674         "Access-list name\n"
675 @@ -5605,7 +5639,10 @@ DEFUN (no_ospf_distribute_list_out,
676         "Connected\n"
677         "Static routes\n"
678         "Routing Information Protocol (RIP)\n"
679 -       "Border Gateway Protocol (BGP)\n")
680 +       "Border Gateway Protocol (BGP)\n"
681 +       "Optimized Link State Routing (OLSR)\n"
682 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
683 +)
684  {
685    struct ospf *ospf = vty->index;
686    int source;
687 @@ -7121,7 +7158,8 @@ config_write_virtual_link (struct vty *v
688  
689  \f
690  const char *distribute_str[] = { "system", "kernel", "connected", "static",
691 -                               "rip", "ripng", "ospf", "ospf6", "isis", "bgp"};
692 +                               "rip", "ripng", "ospf", "ospf6", "isis", "bgp",
693 +                               "hsls","olsr","batman"};
694  int
695  config_write_ospf_redistribute (struct vty *vty, struct ospf *ospf)
696  {
697 --- a/zebra/redistribute.c
698 +++ b/zebra/redistribute.c
699 @@ -3,6 +3,9 @@
700   *
701   * This file is part of GNU Zebra.
702   *
703 + * This file was modified from the original on 30/12/2007
704 + * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
705 + *
706   * GNU Zebra is free software; you can redistribute it and/or modify it
707   * under the terms of the GNU General Public License as published by the
708   * Free Software Foundation; either version 2, or (at your option) any
709 @@ -253,6 +256,8 @@ zebra_redistribute_add (int command, str
710      case ZEBRA_ROUTE_OSPF:
711      case ZEBRA_ROUTE_OSPF6:
712      case ZEBRA_ROUTE_BGP:
713 +    case ZEBRA_ROUTE_OLSR:
714 +    case ZEBRA_ROUTE_BATMAN:
715        if (! client->redist[type])
716         {
717           client->redist[type] = 1;
718 @@ -281,6 +286,8 @@ zebra_redistribute_delete (int command, 
719      case ZEBRA_ROUTE_OSPF:
720      case ZEBRA_ROUTE_OSPF6:
721      case ZEBRA_ROUTE_BGP:
722 +    case ZEBRA_ROUTE_OLSR:
723 +    case ZEBRA_ROUTE_BATMAN:
724        client->redist[type] = 0;
725        break;
726      default:
727 --- a/zebra/zebra_vty.c
728 +++ b/zebra/zebra_vty.c
729 @@ -53,6 +53,10 @@ route_type_str (u_char type)
730        return "isis";
731      case ZEBRA_ROUTE_BGP:
732        return "bgp";
733 +    case ZEBRA_ROUTE_OLSR:
734 +      return "olsr";
735 +    case ZEBRA_ROUTE_BATMAN:
736 +      return "batman";
737      default:
738        return "unknown";
739      }
740 @@ -84,6 +88,12 @@ route_type_char (u_char type)
741        return 'I';
742      case ZEBRA_ROUTE_BGP:
743        return 'B';
744 +    case ZEBRA_ROUTE_HSLS:
745 +      return 'H';
746 +    case ZEBRA_ROUTE_OLSR:
747 +      return 'L';
748 +    case ZEBRA_ROUTE_BATMAN:
749 +      return 'M';
750      default:
751        return '?';
752      }
753 @@ -755,8 +765,8 @@ vty_show_ip_route (struct vty *vty, stru
754  }
755  
756  #define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
757 -  "S - static, R - RIP, O - OSPF,%s       I - ISIS, B - BGP, " \
758 -  "> - selected route, * - FIB route%s%s"
759 +  "S - static, R - RIP, O - OSPF,%s       I - ISIS, B - BGP, H - HSLS, " \
760 +  "L - OLSR, M - BATMAN, > - selected route, * - FIB route%s%s"
761  
762  DEFUN (show_ip_route,
763         show_ip_route_cmd,
764 @@ -874,7 +884,7 @@ DEFUN (show_ip_route_supernets,
765  
766  DEFUN (show_ip_route_protocol,
767         show_ip_route_protocol_cmd,
768 -       "show ip route (bgp|connected|isis|kernel|ospf|rip|static)",
769 +       "show ip route (bgp|connected|isis|kernel|ospf|rip|olsr|batman|static)",
770         SHOW_STR
771         IP_STR
772         "IP routing table\n"
773 @@ -884,6 +894,8 @@ DEFUN (show_ip_route_protocol,
774         "Kernel\n"
775         "Open Shortest Path First (OSPF)\n"
776         "Routing Information Protocol (RIP)\n"
777 +       "Optimized Link State Routing (OLSR)\n"
778 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
779         "Static routes\n")
780  {
781    int type;
782 @@ -892,13 +904,13 @@ DEFUN (show_ip_route_protocol,
783    struct rib *rib;
784    int first = 1;
785  
786 -  if (strncmp (argv[0], "b", 1) == 0)
787 +  if (strncmp (argv[0], "bg", 2) == 0)
788      type = ZEBRA_ROUTE_BGP;
789    else if (strncmp (argv[0], "c", 1) == 0)
790      type = ZEBRA_ROUTE_CONNECT;
791    else if (strncmp (argv[0], "k", 1) ==0)
792      type = ZEBRA_ROUTE_KERNEL;
793 -  else if (strncmp (argv[0], "o", 1) == 0)
794 +  else if (strncmp (argv[0], "os", 2) == 0)
795      type = ZEBRA_ROUTE_OSPF;
796    else if (strncmp (argv[0], "i", 1) == 0)
797      type = ZEBRA_ROUTE_ISIS;
798 @@ -906,6 +918,10 @@ DEFUN (show_ip_route_protocol,
799      type = ZEBRA_ROUTE_RIP;
800    else if (strncmp (argv[0], "s", 1) == 0)
801      type = ZEBRA_ROUTE_STATIC;
802 +  else if (strncmp (argv[0], "ol", 2) == 0)
803 +    type = ZEBRA_ROUTE_OLSR;
804 +  else if (strncmp (argv[0], "ba", 2) == 0)
805 +    type = ZEBRA_ROUTE_BATMAN;
806    else 
807      {
808        vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
809 @@ -1732,7 +1748,7 @@ DEFUN (show_ipv6_route_prefix_longer,
810  
811  DEFUN (show_ipv6_route_protocol,
812         show_ipv6_route_protocol_cmd,
813 -       "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static)",
814 +       "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|olsr|batman|static)",
815         SHOW_STR
816         IP_STR
817         "IP routing table\n"
818 @@ -1742,6 +1758,8 @@ DEFUN (show_ipv6_route_protocol,
819         "Kernel\n"
820         "Open Shortest Path First (OSPFv3)\n"
821         "Routing Information Protocol (RIPng)\n"
822 +       "Optimized Link State Routing (OLSR)\n"
823 +       "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
824         "Static routes\n")
825  {
826    int type;
827 @@ -1750,13 +1768,13 @@ DEFUN (show_ipv6_route_protocol,
828    struct rib *rib;
829    int first = 1;
830  
831 -  if (strncmp (argv[0], "b", 1) == 0)
832 +  if (strncmp (argv[0], "bg", 2) == 0)
833      type = ZEBRA_ROUTE_BGP;
834    else if (strncmp (argv[0], "c", 1) == 0)
835      type = ZEBRA_ROUTE_CONNECT;
836    else if (strncmp (argv[0], "k", 1) ==0)
837      type = ZEBRA_ROUTE_KERNEL;
838 -  else if (strncmp (argv[0], "o", 1) == 0)
839 +  else if (strncmp (argv[0], "os", 2) == 0)
840      type = ZEBRA_ROUTE_OSPF6;
841    else if (strncmp (argv[0], "i", 1) == 0)
842      type = ZEBRA_ROUTE_ISIS;
843 @@ -1764,7 +1782,11 @@ DEFUN (show_ipv6_route_protocol,
844      type = ZEBRA_ROUTE_RIPNG;
845    else if (strncmp (argv[0], "s", 1) == 0)
846      type = ZEBRA_ROUTE_STATIC;
847 -  else 
848 +  else if (strncmp (argv[0], "ol", 2) == 0)
849 +     type = ZEBRA_ROUTE_OLSR;
850 +  else if (strncmp (argv[0], "ba", 2) == 0)
851 +     type = ZEBRA_ROUTE_BATMAN;
852 +  else
853      {
854        vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
855        return CMD_WARNING;