contrib/package/olsrd-luci: bump to hg rev 1785
[project/luci.git] / contrib / package / olsrd-luci / patches / 140-olsrd-optimize-size.patch
1 diff -ur olsrd-0-5-6-54e88033741d.orig/Makefile.inc olsrd-0-5-6-54e88033741d/Makefile.inc
2 --- olsrd-0-5-6-54e88033741d.orig/Makefile.inc  2009-03-25 21:44:43.000000000 +0000
3 +++ olsrd-0-5-6-54e88033741d/Makefile.inc       2009-03-25 21:45:02.000000000 +0000
4 @@ -204,6 +204,10 @@
5  $(warning Use CPPFLAGS instead of DEFINES for -D)
6  endif
7  
8 +ifeq ($(SVEN_OLA_UNBLOAT),1)
9 +CPPFLAGS += -DSVEN_OLA_UNBLOAT -DNODEBUG
10 +endif
11 +
12  TAGFILE ?=     src/TAGS
13  
14  help:
15 diff -ur olsrd-0-5-6-54e88033741d.orig/lib/bmf/src/NetworkInterfaces.c olsrd-0-5-6-54e88033741d/lib/bmf/src/NetworkInterfaces.c
16 --- olsrd-0-5-6-54e88033741d.orig/lib/bmf/src/NetworkInterfaces.c       2009-03-25 21:44:43.000000000 +0000
17 +++ olsrd-0-5-6-54e88033741d/lib/bmf/src/NetworkInterfaces.c    2009-03-25 21:45:02.000000000 +0000
18 @@ -544,7 +544,9 @@
19            OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: no link found\n", PLUGIN_NAME_SHORT,
20                        olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
21          } else {
22 +#ifndef DEBUG
23            struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr);
24 +#endif
25  
26            OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %5.2f\n",
27                        PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), bestIntf->int_name,
28 diff -ur olsrd-0-5-6-54e88033741d.orig/lib/httpinfo/Makefile olsrd-0-5-6-54e88033741d/lib/httpinfo/Makefile
29 --- olsrd-0-5-6-54e88033741d.orig/lib/httpinfo/Makefile 2009-03-25 21:44:43.000000000 +0000
30 +++ olsrd-0-5-6-54e88033741d/lib/httpinfo/Makefile      2009-03-25 21:45:02.000000000 +0000
31 @@ -47,7 +47,11 @@
32  CPPFLAGS +=    -DADMIN_INTERFACE
33  endif
34  
35 +ifdef SVEN_OLA_UNBLOAT
36 +       CFLAGS += -DSVEN_OLA
37 +else
38  OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o
39 +endif
40  
41  default_target: $(PLUGIN_FULLNAME)
42  ifdef ADMIN_INTERFACE
43 diff -ur olsrd-0-5-6-54e88033741d.orig/lib/httpinfo/src/olsrd_httpinfo.c olsrd-0-5-6-54e88033741d/lib/httpinfo/src/olsrd_httpinfo.c
44 --- olsrd-0-5-6-54e88033741d.orig/lib/httpinfo/src/olsrd_httpinfo.c     2009-03-25 21:44:43.000000000 +0000
45 +++ olsrd-0-5-6-54e88033741d/lib/httpinfo/src/olsrd_httpinfo.c  2009-03-25 21:45:02.000000000 +0000
46 @@ -67,7 +67,9 @@
47  
48  #include "olsrd_httpinfo.h"
49  #include "admin_interface.h"
50 +#ifndef SVEN_OLA_UNBLOAT
51  #include "gfx.h"
52 +#endif /* SVEN_OLA_UNBLOAT */
53  
54  #ifdef OS
55  #undef OS
56 @@ -181,7 +183,9 @@
57  
58  static int build_about_body(char *, uint32_t);
59  
60 +#ifndef SVEN_OLA_UNBLOAT
61  static int build_cfgfile_body(char *, uint32_t);
62 +#endif /* SVEN_OLA_UNBLOAT */
63  
64  static int check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr);
65  
66 @@ -216,10 +220,13 @@
67    {"Admin", "admin", build_admin_body, true},
68  #endif
69    {"About", "about", build_about_body, true},
70 +#ifndef SVEN_OLA_UNBLOAT
71    {"FOO", "cfgfile", build_cfgfile_body, false},
72 +#endif /* SVEN_OLA_UNBLOAT */
73    {NULL, NULL, NULL, false}
74  };
75  
76 +#ifndef SVEN_OLA_UNBLOAT
77  static const struct static_bin_file_entry static_bin_files[] = {
78    {"favicon.ico", favicon_ico, sizeof(favicon_ico)}
79    ,
80 @@ -229,6 +236,7 @@
81    ,
82    {NULL, NULL, 0}
83  };
84 +#endif /* SVEN_OLA_UNBLOAT */
85  
86  static const struct static_txt_file_entry static_txt_files[] = {
87    {"httpinfo.css", httpinfo_css},
88 @@ -407,6 +415,7 @@
89    } else if (!strcmp(req_type, "GET")) {
90      int i = 0;
91  
92 +#ifndef SVEN_OLA_UNBLOAT
93      for (i = 0; static_bin_files[i].filename; i++) {
94        if (FILENREQ_MATCH(filename, static_bin_files[i].filename)) {
95          break;
96 @@ -422,6 +431,7 @@
97      }
98  
99      i = 0;
100 +#endif /* SVEN_OLA_UNBLOAT */
101      while (static_txt_files[i].filename) {
102        if (FILENREQ_MATCH(filename, static_txt_files[i].filename)) {
103          break;
104 @@ -461,16 +471,22 @@
105          snprintf(&body[size], sizeof(body) - size,
106                   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<head>\n"
107                   "<meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n"
108 -                 "<title>olsr.org httpinfo plugin</title>\n" "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
109 +                 "<title>olsr.org httpinfo plugin</title>\n"
110 +#ifndef SVEN_OLA_UNBLOAT
111 +                 "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
112                   "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
113 +#endif /* SVEN_OLA_UNBLOAT */
114                   "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n" "</head>\n"
115                   "<body bgcolor=\"#ffffff\" text=\"#000000\">\n"
116 +#ifndef SVEN_OLA_UNBLOAT
117                   "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%d\">\n"
118                   "<tbody><tr bgcolor=\"#ffffff\">\n" "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n"
119                   "<font color=\"black\" face=\"timesroman\" size=\"6\">&nbsp;&nbsp;&nbsp;<a href=\"http://www.olsr.org/\">olsr.org OLSR daemon</a></font></td>\n"
120                   "<td height=\"69\" valign=\"middle\" width=\"20%%\">\n"
121                   "<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n" "</tr>\n"
122 -                 "</tbody>\n" "</table>\n", FRAMEWIDTH);
123 +                 "</tbody>\n" "</table>\n", FRAMEWIDTH
124 +#endif /* SVEN_OLA_UNBLOAT */
125 +        );
126  
127        size += build_tabs(&body[size], sizeof(body) - size, i);
128        size += build_frame(&body[size], sizeof(body) - size, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb);
129 @@ -854,7 +870,7 @@
130        size += snprintf(&buf[size], bufsize - size, "<tr><td colspan=\"3\">Status: DOWN</td></tr>\n");
131        continue;
132      }
133 -
134 +#ifndef SVEN_OLA_UNBLOAT
135      if (olsr_cnf->ip_version == AF_INET) {
136        struct ipaddr_str addrbuf, maskbuf, bcastbuf;
137        size +=
138 @@ -867,6 +883,7 @@
139          snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n" "<td></td>\n" "</tr>\n",
140                   ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
141      }
142 +#endif /* SVEN_OLA_UNBLOAT */
143      size +=
144        snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n" "<td>STATUS: UP</td>\n" "</tr>\n",
145                 rifs->int_mtu, rifs->is_wireless ? "Yes" : "No");
146 @@ -1115,6 +1132,7 @@
147                    build_host);
148  }
149  
150 +#ifndef SVEN_OLA_UNBLOAT
151  static int
152  build_cfgfile_body(char *buf, uint32_t bufsize)
153  {
154 @@ -1149,6 +1167,7 @@
155  #endif
156    return size;
157  }
158 +#endif /* SVEN_OLA_UNBLOAT */
159  
160  static int
161  check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr)
162 diff -ur olsrd-0-5-6-54e88033741d.orig/lib/nameservice/src/nameservice.c olsrd-0-5-6-54e88033741d/lib/nameservice/src/nameservice.c
163 --- olsrd-0-5-6-54e88033741d.orig/lib/nameservice/src/nameservice.c     2009-03-25 21:44:43.000000000 +0000
164 +++ olsrd-0-5-6-54e88033741d/lib/nameservice/src/nameservice.c  2009-03-25 21:45:02.000000000 +0000
165 @@ -65,6 +65,11 @@
166  #include "mapwrite.h"
167  #include "compat.h"
168  
169 +#ifdef SVEN_OLA_UNBLOAT
170 +#undef OLSR_PRINTF
171 +#define OLSR_PRINTF(...)
172 +#endif /* SVEN_OLA_UNBLOAT */
173 +
174  /* config parameters */
175  static char my_hosts_file[MAX_FILE + 1];
176  static char my_sighup_pid_file[MAX_FILE + 1];
177 @@ -73,12 +78,16 @@
178  static char my_suffix[MAX_SUFFIX];
179  static int my_interval = EMISSION_INTERVAL;
180  static double my_timeout = NAME_VALID_TIME;
181 +#ifndef SVEN_OLA_UNBLOAT
182  static char my_resolv_file[MAX_FILE + 1];
183 +#endif /* SVEN_OLA_UNBLOAT */
184  static char my_services_file[MAX_FILE + 1];
185  static char my_macs_file[MAX_FILE + 1];
186 +#ifndef SVEN_OLA_UNBLOAT
187  static char my_name_change_script[MAX_FILE + 1];
188  static char my_services_change_script[MAX_FILE + 1];
189  static char my_macs_change_script[MAX_FILE + 1];
190 +#endif
191  static char latlon_in_file[MAX_FILE + 1];
192  static char my_latlon_file[MAX_FILE + 1];
193  float my_lat = 0.0, my_lon = 0.0;
194 @@ -102,9 +111,11 @@
195  static struct name_entry *my_macs = NULL;
196  static bool mac_table_changed = true;
197  
198 +#ifndef SVEN_OLA_UNBLOAT
199  static struct list_node forwarder_list[HASHSIZE];
200  static struct name_entry *my_forwarders = NULL;
201  static bool forwarder_table_changed = true;
202 +#endif /* SVEN_OLA_UNBLOAT */
203  
204  struct list_node latlon_list[HASHSIZE];
205  static bool latlon_table_changed = true;
206 @@ -138,7 +149,9 @@
207    GetWindowsDirectory(my_hosts_file, MAX_FILE - 12);
208    GetWindowsDirectory(my_services_file, MAX_FILE - 12);
209    GetWindowsDirectory(my_macs_file, MAX_FILE - 12);
210 +#ifndef SVEN_OLA_UNBLOAT
211    GetWindowsDirectory(my_resolv_file, MAX_FILE - 12);
212 +#endif /* SVEN_OLA_UNBLOAT */
213  
214    len = strlen(my_hosts_file);
215    if (my_hosts_file[len - 1] != '\\')
216 @@ -155,15 +168,19 @@
217      strscat(my_macs_file, "\\", sizeof(my_macs_file));
218    strscat(my_macs_file, "macs_olsr", sizeof(my_macs_file));
219  
220 +#ifndef SVEN_OLA_UNBLOAT
221    len = strlen(my_resolv_file);
222    if (my_resolv_file[len - 1] != '\\')
223      strscat(my_resolv_file, "\\", sizeof(my_resolv_file));
224    strscat(my_resolv_file, "resolvconf_olsr", sizeof(my_resolv_file));
225 +#endif /* SVEN_OLA_UNBLOAT */
226  #else
227    strscpy(my_hosts_file, "/var/run/hosts_olsr", sizeof(my_hosts_file));
228    strscpy(my_services_file, "/var/run/services_olsr", sizeof(my_services_file));
229    strscpy(my_macs_file, "/var/run/macs_olsr", sizeof(my_macs_file));
230 +#ifndef SVEN_OLA_UNBLOAT
231    strscpy(my_resolv_file, "/var/run/resolvconf_olsr", sizeof(my_resolv_file));
232 +#endif /* SVEN_OLA_UNBLOAT */
233    *my_sighup_pid_file = 0;
234  #endif
235  
236 @@ -171,14 +188,18 @@
237    my_add_hosts[0] = '\0';
238    my_latlon_file[0] = '\0';
239    latlon_in_file[0] = '\0';
240 +#ifndef SVEN_OLA_UNBLOAT
241    my_name_change_script[0] = '\0';
242    my_services_change_script[0] = '\0';
243    my_macs_change_script[0] = '\0';
244 +#endif /* SVEN_OLA_UNBLOAT */
245  
246    /* init the lists heads */
247    for (i = 0; i < HASHSIZE; i++) {
248      list_head_init(&name_list[i]);
249 +#ifndef SVEN_OLA_UNBLOAT
250      list_head_init(&forwarder_list[i]);
251 +#endif /* SVEN_OLA_UNBLOAT */
252      list_head_init(&service_list[i]);
253      list_head_init(&mac_list[i]);
254      list_head_init(&latlon_list[i]);
255 @@ -186,6 +207,7 @@
256  
257  }
258  
259 +#ifndef SVEN_OLA_UNBLOAT
260  static int
261  set_nameservice_server(const char *value, void *data, set_plugin_parameter_addon addon)
262  {
263 @@ -204,6 +226,7 @@
264    }
265    return 1;
266  }
267 +#endif /* SVEN_OLA_UNBLOAT */
268  
269  static int
270  set_nameservice_name(const char *value, void *data, set_plugin_parameter_addon addon)
271 @@ -253,10 +276,12 @@
272    { .name = "timeout",                .set_plugin_parameter = &set_nameservice_float,  .data = &my_timeout },
273    { .name = "sighup-pid-file",        .set_plugin_parameter = &set_plugin_string,      .data = &my_sighup_pid_file,        .addon = {sizeof(my_sighup_pid_file)} },
274    { .name = "hosts-file",             .set_plugin_parameter = &set_plugin_string,      .data = &my_hosts_file,             .addon = {sizeof(my_hosts_file)} },
275 +#ifndef SVEN_OLA_UNBLOAT
276    { .name = "name-change-script",     .set_plugin_parameter = &set_plugin_string,      .data = &my_name_change_script,     .addon = {sizeof(my_name_change_script)} },
277    { .name = "services-change-script", .set_plugin_parameter = &set_plugin_string,      .data = &my_services_change_script, .addon = {sizeof(my_services_change_script)} },
278    { .name = "macs-change-script",     .set_plugin_parameter = &set_plugin_string,      .data = &my_macs_change_script,     .addon = {sizeof(my_macs_change_script)} },
279    { .name = "resolv-file",            .set_plugin_parameter = &set_plugin_string,      .data = &my_resolv_file,            .addon = {sizeof(my_resolv_file)} },
280 +#endif /* SVEN_OLA_UNBLOAT */
281    { .name = "suffix",                 .set_plugin_parameter = &set_plugin_string,      .data = &my_suffix,                 .addon = {sizeof(my_suffix)} },
282    { .name = "add-hosts",              .set_plugin_parameter = &set_plugin_string,      .data = &my_add_hosts,              .addon = {sizeof(my_add_hosts)} },
283    { .name = "services-file",          .set_plugin_parameter = &set_plugin_string,      .data = &my_services_file,          .addon = {sizeof(my_services_file)} },
284 @@ -265,7 +290,9 @@
285    { .name = "lon",                    .set_plugin_parameter = &set_nameservice_float,  .data = &my_lon },
286    { .name = "latlon-file",            .set_plugin_parameter = &set_plugin_string,      .data = &my_latlon_file,            .addon = {sizeof(my_latlon_file)} },
287    { .name = "latlon-infile",          .set_plugin_parameter = &set_plugin_string,      .data = &latlon_in_file,            .addon = {sizeof(latlon_in_file)} },
288 +#ifndef SVEN_OLA_UNBLOAT
289    { .name = "dns-server",             .set_plugin_parameter = &set_nameservice_server, .data = &my_forwarders,             .addon = {NAME_FORWARDER} },
290 +#endif /* SVEN_OLA_UNBLOAT */
291    { .name = "name",                   .set_plugin_parameter = &set_nameservice_name,   .data = &my_names,                  .addon = {NAME_HOST} },
292    { .name = "service",                .set_plugin_parameter = &set_nameservice_name,   .data = &my_services,               .addon = {NAME_SERVICE} },
293    { .name = "mac",                    .set_plugin_parameter = &set_nameservice_name,   .data = &my_macs,                   .addon = {NAME_MACADDR} },
294 @@ -381,16 +408,20 @@
295        name->ip = olsr_cnf->main_addr;
296      }
297    }
298 +#ifndef SVEN_OLA_UNBLOAT
299    for (name = my_forwarders; name != NULL; name = name->next) {
300      if (name->ip.v4.s_addr == 0) {
301        OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name);
302        name->ip = olsr_cnf->main_addr;
303      }
304    }
305 +#endif /* SVEN_OLA_UNBLOAT */
306  
307    //check if entries I want to announce myself are valid and allowed
308    my_names = remove_nonvalid_names_from_list(my_names, NAME_HOST);
309 +#ifndef SVEN_OLA_UNBLOAT
310    my_forwarders = remove_nonvalid_names_from_list(my_forwarders, NAME_FORWARDER);
311 +#endif /* SVEN_OLA_UNBLOAT */
312    my_services = remove_nonvalid_names_from_list(my_services, NAME_SERVICE);
313    my_macs = remove_nonvalid_names_from_list(my_macs, NAME_MACADDR);
314  
315 @@ -463,12 +494,16 @@
316    free_name_entry_list(&my_names);
317    free_name_entry_list(&my_services);
318    free_name_entry_list(&my_macs);
319 +#ifndef SVEN_OLA_UNBLOAT
320    free_name_entry_list(&my_forwarders);
321 +#endif /* SVEN_OLA_UNBLOAT */
322  
323    free_all_list_entries(name_list);
324    free_all_list_entries(service_list);
325    free_all_list_entries(mac_list);
326 +#ifndef SVEN_OLA_UNBLOAT
327    free_all_list_entries(forwarder_list);
328 +#endif /* SVEN_OLA_UNBLOAT */
329    free_all_list_entries(latlon_list);
330  
331    olsr_stop_timer(write_file_timer);
332 @@ -511,7 +546,9 @@
333  {
334    write_file_timer = NULL;
335  
336 +#ifndef SVEN_OLA_UNBLOAT
337    write_resolv_file();             /* if forwarder_table_changed */
338 +#endif /* SVEN_OLA_UNBLOAT */
339    write_hosts_file();              /* if name_table_changed */
340    write_services_file(false); /* if service_table_changed */
341    write_services_file(true);  /* if mac_table_changed */
342 @@ -693,11 +730,13 @@
343      pos = create_packet((struct name *)pos, my_name);
344      i++;
345    }
346 +#ifndef SVEN_OLA_UNBLOAT
347    // forwarders
348    for (my_name = my_forwarders; my_name != NULL; my_name = my_name->next) {
349      pos = create_packet((struct name *)pos, my_name);
350      i++;
351    }
352 +#endif /* SVEN_OLA_UNBLOAT */
353    // services
354    for (my_name = my_services; my_name != NULL; my_name = my_name->next) {
355      pos = create_packet((struct name *)pos, my_name);
356 @@ -880,9 +919,11 @@
357      case NAME_HOST:
358        insert_new_name_in_list(originator, name_list, from_packet, &name_table_changed, vtime);
359        break;
360 +#ifndef SVEN_OLA_UNBLOAT
361      case NAME_FORWARDER:
362        insert_new_name_in_list(originator, forwarder_list, from_packet, &forwarder_table_changed, vtime);
363        break;
364 +#endif /* SVEN_OLA_UNBLOAT */
365      case NAME_SERVICE:
366        insert_new_name_in_list(originator, service_list, from_packet, &service_table_changed, vtime);
367        break;
368 @@ -901,9 +942,11 @@
369      pos += sizeof(struct name);
370      pos += 1 + ((ntohs(from_packet->len) - 1) | 3);
371    }
372 +#ifdef DEBUG
373    if (i != 0)
374      OLSR_PRINTF(4, "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n", i,
375                  olsr_ip_to_string(&strbuf, originator));
376 +#endif
377  }
378  
379  /**
380 @@ -1120,6 +1163,7 @@
381  #endif
382    name_table_changed = false;
383  
384 +#ifndef SVEN_OLA_UNBLOAT
385    // Executes my_name_change_script after writing the hosts file
386    if (my_name_change_script[0] != '\0') {
387      if (system(my_name_change_script) != -1) {
388 @@ -1128,6 +1172,7 @@
389        OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on hosts change\n", my_name_change_script);
390      }
391    }
392 +#endif /* SVEN_OLA_UNBLOAT */
393  }
394  
395  /**
396 @@ -1193,6 +1238,7 @@
397  
398    fclose(file);
399    if (writemacs) {
400 +#ifndef SVEN_OLA_UNBLOAT
401      // Executes my_macs_change_script after writing the macs file
402      if (my_macs_change_script[0] != '\0') {
403        if (system(my_macs_change_script) != -1) {
404 @@ -1201,9 +1247,11 @@
405          OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on mac change\n", my_macs_change_script);
406        }
407      }
408 +#endif /* SVEN_OLA_UNBLOAT */
409      mac_table_changed = false;
410    }
411    else {
412 +#ifndef SVEN_OLA_UNBLOAT
413      // Executes my_services_change_script after writing the services file
414      if (my_services_change_script[0] != '\0') {
415        if (system(my_services_change_script) != -1) {
416 @@ -1212,6 +1260,7 @@
417          OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on service change\n", my_services_change_script);
418        }
419      }
420 +#endif /* SVEN_OLA_UNBLOAT */
421      service_table_changed = false;
422    }
423  }
424 @@ -1222,6 +1271,7 @@
425   * fresh entries are at the beginning of the array and
426   * the best entry is at the end of the array.
427   */
428 +#ifndef SVEN_OLA_UNBLOAT
429  static void
430  select_best_nameserver(struct rt_entry **rt)
431  {
432 @@ -1253,11 +1303,13 @@
433      }
434    }
435  }
436 +#endif /* SVEN_OLA_UNBLOAT */
437  
438  /**
439   * write the 3 best upstream DNS servers to resolv.conf file
440   * best means the 3 with the best etx value in routing table
441   */
442 +#ifndef SVEN_OLA_UNBLOAT
443  void
444  write_resolv_file(void)
445  {
446 @@ -1341,6 +1393,7 @@
447    fclose(resolv);
448    forwarder_table_changed = false;
449  }
450 +#endif /* SVEN_OLA_UNBLOAT */
451  
452  /**
453   * completely free a list of name_entries
454 @@ -1359,9 +1412,11 @@
455      case NAME_HOST:
456        name_table_changed = true;
457        break;
458 +#ifndef SVEN_OLA_UNBLOAT
459      case NAME_FORWARDER:
460        forwarder_table_changed = true;
461        break;
462 +#endif /* SVEN_OLA_UNBLOAT */
463      case NAME_SERVICE:
464        service_table_changed = true;
465        break;
466 diff -ur olsrd-0-5-6-54e88033741d.orig/src/apm.h olsrd-0-5-6-54e88033741d/src/apm.h
467 --- olsrd-0-5-6-54e88033741d.orig/src/apm.h     2009-03-25 21:44:43.000000000 +0000
468 +++ olsrd-0-5-6-54e88033741d/src/apm.h  2009-03-25 21:45:02.000000000 +0000
469 @@ -41,6 +41,7 @@
470  
471  #ifndef _OLSR_APM
472  #define _OLSR_APM
473 +#ifndef SVEN_OLA_UNBLOAT
474  
475  /*
476   * Interface to OS dependent power management information
477 @@ -69,6 +70,7 @@
478  int apm_read(struct olsr_apm_info *);
479  
480  #endif
481 +#endif /* SVEN_OLA_UNBLOAT */
482  
483  /*
484   * Local Variables:
485 diff -ur olsrd-0-5-6-54e88033741d.orig/src/cfgparser/cfgfile_gen.c olsrd-0-5-6-54e88033741d/src/cfgparser/cfgfile_gen.c
486 --- olsrd-0-5-6-54e88033741d.orig/src/cfgparser/cfgfile_gen.c   2009-03-25 21:44:43.000000000 +0000
487 +++ olsrd-0-5-6-54e88033741d/src/cfgparser/cfgfile_gen.c        2009-03-25 21:45:02.000000000 +0000
488 @@ -57,7 +57,9 @@
489    struct olsr_if *in = cnf->interfaces;
490    struct plugin_entry *pe = cnf->plugins;
491    struct plugin_param *pp;
492 +#ifndef SVEN_OLA_UNBLOAT
493    struct ip_prefix_list *ie = cnf->ipc_nets;
494 +#endif /* SVEN_OLA_UNBLOAT */
495    struct olsr_lq_mult *mult;
496  
497    char ipv6_buf[100];                  /* buffer for IPv6 inet_htop */
498 @@ -133,6 +135,7 @@
499    else
500      fprintf(fd, "Willingness\t%d\n\n", cnf->willingness);
501  
502 +#ifndef SVEN_OLA_UNBLOAT
503    /* IPC */
504    fprintf(fd, "# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
505    fprintf(fd, "IpcConnect {\n");
506 @@ -149,6 +152,7 @@
507    }
508  
509    fprintf(fd, "}\n\n");
510 +#endif /* SVEN_OLA_UNBLOAT */
511  
512    /* Hysteresis */
513    fprintf(fd, "# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
514 @@ -367,7 +371,9 @@
515    struct olsr_if *in = cnf->interfaces;
516    struct plugin_entry *pe = cnf->plugins;
517    struct plugin_param *pp;
518 +#ifndef SVEN_OLA_UNBLOAT
519    struct ip_prefix_list *ie = cnf->ipc_nets;
520 +#endif /* SVEN_OLA_UNBLOAT */
521    struct olsr_lq_mult *mult;
522  
523    int size = 0;
524 @@ -434,6 +440,7 @@
525    else
526      WRITE_TO_BUF("Willingness\t%d\n\n", cnf->willingness);
527  
528 +#ifndef SVEN_OLA_UNBLOAT
529    /* IPC */
530    WRITE_TO_BUF("# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
531    WRITE_TO_BUF("IpcConnect {\n");
532 @@ -449,6 +456,7 @@
533    }
534  
535    WRITE_TO_BUF("}\n\n");
536 +#endif /* SVEN_OLA_UNBLOAT */
537  
538    /* Hysteresis */
539    WRITE_TO_BUF("# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
540 diff -ur olsrd-0-5-6-54e88033741d.orig/src/cfgparser/local.mk olsrd-0-5-6-54e88033741d/src/cfgparser/local.mk
541 --- olsrd-0-5-6-54e88033741d.orig/src/cfgparser/local.mk        2009-03-25 21:44:43.000000000 +0000
542 +++ olsrd-0-5-6-54e88033741d/src/cfgparser/local.mk     2009-03-25 21:45:02.000000000 +0000
543 @@ -41,8 +41,13 @@
544  C=$(if $(CFGDIR),$(CFGDIR)/)
545  
546  # add the variables as we may have others already there
547 +ifeq ($(SVEN_OLA_UNBLOAT),1)
548 +SRCS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).c)
549 +OBJS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).o)
550 +else
551  SRCS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).c)
552  OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o)
553 +endif
554  HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
555  
556  $(C)oscan.c: $(C)oscan.lex $(C)Makefile
557 diff -ur olsrd-0-5-6-54e88033741d.orig/src/cfgparser/olsrd_conf.c olsrd-0-5-6-54e88033741d/src/cfgparser/olsrd_conf.c
558 --- olsrd-0-5-6-54e88033741d.orig/src/cfgparser/olsrd_conf.c    2009-03-25 21:44:43.000000000 +0000
559 +++ olsrd-0-5-6-54e88033741d/src/cfgparser/olsrd_conf.c 2009-03-25 21:45:02.000000000 +0000
560 @@ -81,11 +81,13 @@
561    }
562  
563    if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) {
564 +#ifndef SVEN_OLA_UNBLOAT
565      if ((argc > 2) && (!strcmp(argv[2], "-print"))) {
566        olsrd_print_cnf(cnf);
567        olsrd_write_cnf(cnf, "./out.conf");
568      } else
569        printf("Use -print to view parsed values\n");
570 +#endif /* SVEN_OLA_UNBLOAT */
571      printf("Configfile parsed OK\n");
572    } else {
573      printf("Failed parsing \"%s\"\n", argv[1]);
574 @@ -152,7 +154,9 @@
575      /* set various stuff */
576      in->configured = false;
577      in->interf = NULL;
578 +#ifndef SVEN_OLA_UNBLOAT
579      in->host_emul = false;
580 +#endif /* SVEN_OLA_UNBLOAT */
581    }
582    return olsr_cnf;
583  }
584 @@ -389,7 +393,9 @@
585  
586    cnf->debug_level = DEF_DEBUGLVL;
587    cnf->no_fork = false;
588 +#ifndef SVEN_OLA_UNBLOAT
589    cnf->host_emul = false;
590 +#endif /* SVEN_OLA_UNBLOAT */
591    cnf->ip_version = AF_INET;
592    cnf->ipsize = sizeof(struct in_addr);
593    cnf->maxplen = 32;
594 @@ -400,7 +406,9 @@
595    cnf->rtproto = 3;
596    cnf->rttable_default = 0;
597    cnf->willingness_auto = DEF_WILL_AUTO;
598 +#ifndef SVEN_OLA_UNBLOAT
599    cnf->ipc_connections = DEF_IPC_CONNECTIONS;
600 +#endif /* SVEN_OLA_UNBLOAT */
601    cnf->fib_metric = DEF_FIB_METRIC;
602  
603    cnf->use_hysteresis = DEF_USE_HYST;
604 @@ -479,6 +487,7 @@
605  
606  }
607  
608 +#ifndef SVEN_OLA_UNBLOAT
609  void
610  olsrd_print_cnf(struct olsrd_config *cnf)
611  {
612 @@ -622,6 +631,7 @@
613      }
614    }
615  }
616 +#endif /* SVEN_OLA_UNBLOAT */
617  
618  #if defined WIN32
619  struct ioinfo {
620 diff -ur olsrd-0-5-6-54e88033741d.orig/src/cfgparser/oparse.y olsrd-0-5-6-54e88033741d/src/cfgparser/oparse.y
621 --- olsrd-0-5-6-54e88033741d.orig/src/cfgparser/oparse.y        2009-03-25 21:44:43.000000000 +0000
622 +++ olsrd-0-5-6-54e88033741d/src/cfgparser/oparse.y     2009-03-25 21:45:02.000000000 +0000
623 @@ -178,7 +178,6 @@
624  %token TOK_RTPROTO
625  %token TOK_RTTABLE_DEFAULT
626  %token TOK_WILLINGNESS
627 -%token TOK_IPCCON
628  %token TOK_FIBMETRIC
629  %token TOK_USEHYST
630  %token TOK_HYSTSCALE
631 @@ -201,7 +200,6 @@
632  
633  %token TOK_HOSTLABEL
634  %token TOK_NETLABEL
635 -%token TOK_MAXIPC
636  
637  %token TOK_IP4BROADCAST
638  %token TOK_IFMODE
639 @@ -263,7 +261,6 @@
640  
641  block:      TOK_HNA4 hna4body
642            | TOK_HNA6 hna6body
643 -          | TOK_IPCCON ipcbody
644            | ifblock ifbody
645            | plblock plbody
646  ;
647 @@ -288,18 +285,6 @@
648           | ihna6entry
649  ;
650  
651 -ipcbody:    TOK_OPEN ipcstmts TOK_CLOSE
652 -;
653 -
654 -ipcstmts: | ipcstmts ipcstmt
655 -;
656 -
657 -ipcstmt:  vcomment
658 -          | imaxipc
659 -          | ipchost
660 -          | ipcnet
661 -;
662 -
663  ifblock:   ifstart ifnicks
664  ;
665  
666 @@ -341,77 +326,6 @@
667            | vcomment
668  ;
669  
670 -imaxipc: TOK_MAXIPC TOK_INTEGER
671 -{
672 -  olsr_cnf->ipc_connections = $2->integer;
673 -  free($2);
674 -}
675 -;
676 -
677 -ipchost: TOK_HOSTLABEL TOK_IP4_ADDR
678 -{
679 -  union olsr_ip_addr ipaddr;
680 -  PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string);
681 -  
682 -  if (inet_aton($2->string, &ipaddr.v4) == 0) {
683 -    fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string);
684 -    YYABORT;
685 -  }
686 -
687 -  ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen);
688 -
689 -  free($2->string);
690 -  free($2);
691 -}
692 -;
693 -
694 -ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR
695 -{
696 -  union olsr_ip_addr ipaddr, netmask;
697 -
698 -  PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
699 -  
700 -  if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
701 -    fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
702 -    YYABORT;
703 -  }
704 -
705 -  if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) {
706 -    fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string);
707 -    YYABORT;
708 -  }
709 -
710 -  ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask));
711 -
712 -  free($2->string);
713 -  free($2);
714 -  free($3->string);
715 -  free($3);
716 -}
717 -        |       TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER
718 -{
719 -  union olsr_ip_addr ipaddr;
720 -
721 -  PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
722 -  
723 -  if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
724 -    fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
725 -    YYABORT;
726 -  }
727 -
728 -  if ($4->integer > olsr_cnf->maxplen) {
729 -    fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen);
730 -    YYABORT;
731 -  }
732 -
733 -  ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer);
734 -
735 -  free($2->string);
736 -  free($2);
737 -  free($4);
738 -}
739 -;
740 -
741  iifweight:       TOK_IFWEIGHT TOK_INTEGER
742  {
743    int ifcnt = ifs_in_curr_cfg;
744 diff -ur olsrd-0-5-6-54e88033741d.orig/src/cfgparser/oscan.lex olsrd-0-5-6-54e88033741d/src/cfgparser/oscan.lex
745 --- olsrd-0-5-6-54e88033741d.orig/src/cfgparser/oscan.lex       2009-03-25 21:44:43.000000000 +0000
746 +++ olsrd-0-5-6-54e88033741d/src/cfgparser/oscan.lex    2009-03-25 21:45:02.000000000 +0000
747 @@ -253,11 +253,6 @@
748      return TOK_NETLABEL;
749  }
750  
751 -"MaxConnections" {
752 -    yylval = NULL;
753 -    return TOK_MAXIPC;
754 -}
755 -
756  "DebugLevel" {
757      yylval = NULL;
758      return TOK_DEBUGLEVEL;
759 @@ -334,11 +329,6 @@
760      return TOK_WILLINGNESS;
761  }
762  
763 -"IpcConnect" {
764 -    yylval = NULL;
765 -    return TOK_IPCCON;
766 -}
767 -
768  "FIBMetric" {
769      yylval = NULL;
770      return TOK_FIBMETRIC;
771 diff -ur olsrd-0-5-6-54e88033741d.orig/src/defs.h olsrd-0-5-6-54e88033741d/src/defs.h
772 --- olsrd-0-5-6-54e88033741d.orig/src/defs.h    2009-03-25 21:44:43.000000000 +0000
773 +++ olsrd-0-5-6-54e88033741d/src/defs.h 2009-03-25 21:45:02.000000000 +0000
774 @@ -190,6 +190,8 @@
775   */
776  clock_t olsr_times(void);
777  
778 +#ifndef SVEN_OLA_UNBLOAT
779 +
780  /*
781   *IPC functions
782   *These are moved to a plugin soon
783 @@ -207,6 +209,7 @@
784  int ipc_output(struct olsr *);
785  
786  #endif
787 +#endif /* SVEN_OLA_UNBLOAT */
788  
789  /*
790   * Local Variables:
791 diff -ur olsrd-0-5-6-54e88033741d.orig/src/duplicate_set.c olsrd-0-5-6-54e88033741d/src/duplicate_set.c
792 --- olsrd-0-5-6-54e88033741d.orig/src/duplicate_set.c   2009-03-25 21:44:43.000000000 +0000
793 +++ olsrd-0-5-6-54e88033741d/src/duplicate_set.c        2009-03-25 21:45:02.000000000 +0000
794 @@ -174,6 +174,7 @@
795    return false;                 /* no duplicate */
796  }
797  
798 +#ifndef SVEN_OLA_UNBLOAT
799  void
800  olsr_print_duplicate_table(void)
801  {
802 @@ -192,6 +193,7 @@
803    } OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
804  #endif
805  }
806 +#endif /* SVEN_OLA_UNBLOAT */
807  
808  /*
809   * Local Variables:
810 diff -ur olsrd-0-5-6-54e88033741d.orig/src/hna_set.c olsrd-0-5-6-54e88033741d/src/hna_set.c
811 --- olsrd-0-5-6-54e88033741d.orig/src/hna_set.c 2009-03-25 21:44:43.000000000 +0000
812 +++ olsrd-0-5-6-54e88033741d/src/hna_set.c      2009-03-25 21:45:02.000000000 +0000
813 @@ -279,6 +279,7 @@
814   *
815   *@return nada
816   */
817 +#ifndef SVEN_OLA_UNBLOAT
818  void
819  olsr_print_hna_set(void)
820  {
821 @@ -320,6 +321,7 @@
822    }
823  #endif
824  }
825 +#endif /* SVEN_OLA_UNBLOAT */
826  
827  /**
828   *Process incoming HNA message.
829 diff -ur olsrd-0-5-6-54e88033741d.orig/src/interfaces.c olsrd-0-5-6-54e88033741d/src/interfaces.c
830 --- olsrd-0-5-6-54e88033741d.orig/src/interfaces.c      2009-03-25 21:44:43.000000000 +0000
831 +++ olsrd-0-5-6-54e88033741d/src/interfaces.c   2009-03-25 21:45:02.000000000 +0000
832 @@ -93,12 +93,16 @@
833    OLSR_PRINTF(1, "\n ---- Interface configuration ---- \n\n");
834    /* Run trough all interfaces immedeatly */
835    for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
836 +#ifndef SVEN_OLA_UNBLOAT
837      if (!tmp_if->host_emul) {
838        if (!olsr_cnf->host_emul) /* XXX: TEMPORARY! */
839 +#endif /* SVEN_OLA_UNBLOAT */
840          chk_if_up(tmp_if, 1);
841 +#ifndef SVEN_OLA_UNBLOAT
842      } else {
843        add_hemu_if(tmp_if);
844      }
845 +#endif /* SVEN_OLA_UNBLOAT */
846    }
847  
848    /* Kick a periodic timer for the network interface update function */
849 @@ -244,7 +248,11 @@
850   *@return nada
851   */
852  struct olsr_if *
853 +#ifdef SVEN_OLA_UNBLOAT
854 +queue_if(const char *name)
855 +#else                                  /* SVEN_OLA_UNBLOAT */
856  queue_if(const char *name, int hemu)
857 +#endif                                 /* SVEN_OLA_UNBLOAT */
858  {
859    struct olsr_if *interf_n = olsr_cnf->interfaces;
860    size_t name_size;
861 @@ -268,7 +276,9 @@
862    interf_n->interf = NULL;
863    interf_n->configured = 0;
864  
865 +#ifndef SVEN_OLA_UNBLOAT
866    interf_n->host_emul = hemu ? true : false;
867 +#endif /* SVEN_OLA_UNBLOAT */
868  
869    strscpy(interf_n->name, name, name_size);
870    interf_n->next = olsr_cnf->interfaces;
871 diff -ur olsrd-0-5-6-54e88033741d.orig/src/interfaces.h olsrd-0-5-6-54e88033741d/src/interfaces.h
872 --- olsrd-0-5-6-54e88033741d.orig/src/interfaces.h      2009-03-25 21:44:43.000000000 +0000
873 +++ olsrd-0-5-6-54e88033741d/src/interfaces.h   2009-03-25 21:45:02.000000000 +0000
874 @@ -200,7 +200,12 @@
875  
876  struct interface *if_ifwithindex(const int if_index);
877  
878 -struct olsr_if *queue_if(const char *, int);
879 +struct olsr_if *
880 +#ifdef SVEN_OLA_UNBLOAT
881 +  queue_if(const char *);
882 +#else                                  /* SVEN_OLA_UNBLOAT */
883 +  queue_if(const char *, int);
884 +#endif /* SVEN_OLA_UNBLOAT */
885  
886  int add_ifchgf(int (*f) (struct interface *, int));
887  
888 diff -ur olsrd-0-5-6-54e88033741d.orig/src/ipc_frontend.c olsrd-0-5-6-54e88033741d/src/ipc_frontend.c
889 --- olsrd-0-5-6-54e88033741d.orig/src/ipc_frontend.c    2009-03-25 21:44:43.000000000 +0000
890 +++ olsrd-0-5-6-54e88033741d/src/ipc_frontend.c 2009-03-25 21:45:02.000000000 +0000
891 @@ -46,6 +46,7 @@
892   *
893   */
894  
895 +#ifndef SVEN_OLA_UNBLOAT
896  #include "ipc_frontend.h"
897  #include "link_set.h"
898  #include "olsr.h"
899 @@ -423,6 +424,7 @@
900  
901    return 1;
902  }
903 +#endif /* SVEN_OLA_UNBLOAT */
904  
905  /*
906   * Local Variables:
907 diff -ur olsrd-0-5-6-54e88033741d.orig/src/ipc_frontend.h olsrd-0-5-6-54e88033741d/src/ipc_frontend.h
908 --- olsrd-0-5-6-54e88033741d.orig/src/ipc_frontend.h    2009-03-25 21:44:43.000000000 +0000
909 +++ olsrd-0-5-6-54e88033741d/src/ipc_frontend.h 2009-03-25 21:45:02.000000000 +0000
910 @@ -48,6 +48,7 @@
911  
912  #ifndef _OLSR_IPC
913  #define _OLSR_IPC
914 +#ifndef SVEN_OLA_UNBLOAT
915  
916  #include <sys/types.h>
917  #include <netinet/in.h>
918 @@ -103,6 +104,7 @@
919  int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *);
920  
921  #endif
922 +#endif /* SVEN_OLA_UNBLOAT */
923  
924  /*
925   * Local Variables:
926 diff -ur olsrd-0-5-6-54e88033741d.orig/src/ipcalc.c olsrd-0-5-6-54e88033741d/src/ipcalc.c
927 --- olsrd-0-5-6-54e88033741d.orig/src/ipcalc.c  2009-03-25 21:44:43.000000000 +0000
928 +++ olsrd-0-5-6-54e88033741d/src/ipcalc.c       2009-03-25 21:45:02.000000000 +0000
929 @@ -121,6 +121,7 @@
930    return prefix;
931  }
932  
933 +#ifndef SVEN_OLA_UNBLOAT
934  const char *
935  olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
936  {
937 @@ -147,6 +148,7 @@
938    }
939    return rv;
940  }
941 +#endif /* SVEN_OLA_UNBLOAT */
942  
943  /* see if the ipaddr is in the net. That is equivalent to the fact that the net part
944   * of both are equal. So we must compare the first <prefixlen> bits.
945 diff -ur olsrd-0-5-6-54e88033741d.orig/src/ipcalc.h olsrd-0-5-6-54e88033741d/src/ipcalc.h
946 --- olsrd-0-5-6-54e88033741d.orig/src/ipcalc.h  2009-03-25 21:44:43.000000000 +0000
947 +++ olsrd-0-5-6-54e88033741d/src/ipcalc.h       2009-03-25 21:45:02.000000000 +0000
948 @@ -146,7 +146,9 @@
949    return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
950  }
951  
952 +#ifndef SVEN_OLA_UNBLOAT
953  const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
954 +#endif /* SVEN_OLA_UNBLOAT */
955  
956  static INLINE const char *
957  sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr)
958 diff -ur olsrd-0-5-6-54e88033741d.orig/src/link_set.c olsrd-0-5-6-54e88033741d/src/link_set.c
959 --- olsrd-0-5-6-54e88033741d.orig/src/link_set.c        2009-03-25 21:44:43.000000000 +0000
960 +++ olsrd-0-5-6-54e88033741d/src/link_set.c     2009-03-25 21:45:02.000000000 +0000
961 @@ -761,6 +761,7 @@
962    return ret;
963  }
964  
965 +#ifndef SVEN_OLA_UNBLOAT
966  void
967  olsr_print_link_set(void)
968  {
969 @@ -782,6 +783,7 @@
970    } OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
971  #endif
972  }
973 +#endif /* SVEN_OLA_UNBLOAT */
974  
975  /*
976   * called for every LQ HELLO message.
977 diff -ur olsrd-0-5-6-54e88033741d.orig/src/linux/apm.c olsrd-0-5-6-54e88033741d/src/linux/apm.c
978 --- olsrd-0-5-6-54e88033741d.orig/src/linux/apm.c       2009-03-25 21:44:43.000000000 +0000
979 +++ olsrd-0-5-6-54e88033741d/src/linux/apm.c    2009-03-25 21:45:02.000000000 +0000
980 @@ -44,6 +44,7 @@
981   * Acpi-Power Enlightenment epplet
982   */
983  
984 +#ifndef SVEN_OLA_UNBLOAT
985  #include "apm.h"
986  #include "defs.h"
987  #include <stdio.h>
988 @@ -348,6 +349,7 @@
989    /* No battery found */
990    return -1;
991  }
992 +#endif /* SVEN_OLA_UNBLOAT */
993  
994  /*
995   * Local Variables:
996 diff -ur olsrd-0-5-6-54e88033741d.orig/src/linux/kernel_routes.c olsrd-0-5-6-54e88033741d/src/linux/kernel_routes.c
997 --- olsrd-0-5-6-54e88033741d.orig/src/linux/kernel_routes.c     2009-03-25 21:44:43.000000000 +0000
998 +++ olsrd-0-5-6-54e88033741d/src/linux/kernel_routes.c  2009-03-25 21:45:02.000000000 +0000
999 @@ -297,11 +297,13 @@
1000      if (rt_ret > 0) rt_ret = 0; /* successful recovery */
1001      else rt_ret = -1; /* unrecoverable error */
1002    }
1003 +#ifndef SVEN_OLA_UNBLOAT
1004    //send ipc update on success
1005    if ( ( cmd != RTM_NEWRULE ) & ( cmd != RTM_DELRULE ) & (flag = RT_ORIG_REQUEST) & (0 <= rt_ret && olsr_cnf->ipc_connections > 0)) {
1006      ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd,
1007                               if_ifwithindex_name(nexthop->iif_index));
1008    }
1009 +#endif /* SVEN_OLA_UNBLOAT */
1010    if (rt_ret == -2) olsr_syslog(OLSR_LOG_ERR,"no rtnetlink response! (no system ressources left?, everything may happen now ...)");
1011    return rt_ret;
1012  }
1013 @@ -339,7 +341,9 @@
1014    int rslt;
1015  #endif /* LINUX_POLICY_ROUTING */
1016  
1017 +#ifndef SVEN_OLA_UNBLOAT
1018    OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
1019 +#endif /* SVEN_OLA_UNBLOAT */
1020  
1021  #if !LINUX_POLICY_ROUTING
1022    memset(&kernel_route, 0, sizeof(struct rtentry));
1023 @@ -413,7 +417,9 @@
1024    struct in6_rtmsg kernel_route;
1025    int rslt;
1026  
1027 +#ifndef SVEN_OLA_UNBLOAT
1028    OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
1029 +#endif /* SVEN_OLA_UNBLOAT */
1030  
1031    memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
1032  
1033 @@ -466,7 +472,9 @@
1034    int rslt;
1035  #endif /* LINUX_POLICY_ROUTING */
1036  
1037 +#ifndef SVEN_OLA_UNBLOAT
1038    OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
1039 +#endif /* SVEN_OLA_UNBLOAT */
1040  
1041  #if !LINUX_POLICY_ROUTING
1042    memset(&kernel_route, 0, sizeof(struct rtentry));
1043 @@ -533,7 +541,9 @@
1044    int rslt;
1045  #endif /* LINUX_POLICY_ROUTING */
1046  
1047 +#ifndef SVEN_OLA_UNBLOAT
1048    OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
1049 +#endif /* SVEN_OLA_UNBLOAT */
1050  
1051  #if !LINUX_POLICY_ROUTING
1052    memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
1053 diff -ur olsrd-0-5-6-54e88033741d.orig/src/linux/net.c olsrd-0-5-6-54e88033741d/src/linux/net.c
1054 --- olsrd-0-5-6-54e88033741d.orig/src/linux/net.c       2009-03-25 21:44:43.000000000 +0000
1055 +++ olsrd-0-5-6-54e88033741d/src/linux/net.c    2009-03-25 21:45:02.000000000 +0000
1056 @@ -69,8 +69,10 @@
1057  #define SIOCGIWRATE    0x8B21  /* get default bit rate (bps) */
1058  
1059  /* The original state of the IP forwarding proc entry */
1060 +#ifndef SVEN_OLA_UNBLOAT
1061  static char orig_fwd_state;
1062  static char orig_global_redirect_state;
1063 +#endif /* SVEN_OLA_UNBLOAT */
1064  
1065  /**
1066   *Bind a socket to a device
1067 @@ -91,6 +93,8 @@
1068    return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1);
1069  }
1070  
1071 +#ifndef SVEN_OLA_UNBLOAT
1072 +
1073  /**
1074   *Enable IP forwarding.
1075   *Just writing "1" to the /proc/sys/net/ipv4/ip_forward
1076 @@ -110,6 +114,9 @@
1077    const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
1078  
1079    if ((proc_fwd = fopen(procfile, "r")) == NULL) {
1080 +#ifdef SVEN_OLA_UNBLOAT_OLD
1081 +    perror(procfile);
1082 +#else
1083      /* IPv4 */
1084      if (version == AF_INET)
1085        fprintf(stderr,
1086 @@ -122,6 +129,7 @@
1087                procfile);
1088  
1089      sleep(3);
1090 +#endif
1091      return 0;
1092    }
1093  
1094 @@ -131,9 +139,13 @@
1095      OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
1096    } else {
1097      if ((proc_fwd = fopen(procfile, "w")) == NULL) {
1098 +#ifdef SVEN_OLA_UNBLOAT_OLD
1099 +      perror(procfile);
1100 +#else
1101        fprintf(stderr, "Could not open %s for writing!\n", procfile);
1102        fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP forwarding is enabeled!\n\n");
1103        sleep(3);
1104 +#endif
1105        return 0;
1106      } else {
1107        syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile);
1108 @@ -154,11 +166,15 @@
1109      return -1;
1110  
1111    if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1112 +#ifdef SVEN_OLA_UNBLOAT_OLD
1113 +    perror(procfile);
1114 +#else
1115      fprintf(stderr,
1116              "WARNING! Could not open the %s file to check/disable ICMP redirects!\nAre you using the procfile filesystem?\nDoes your system support IPv4?\nI will continue(in 3 sec) - but you should mannually ensure that ICMP redirects are disabled!\n\n",
1117              procfile);
1118  
1119      sleep(3);
1120 +#endif
1121      return -1;
1122    }
1123    orig_global_redirect_state = fgetc(proc_redirect);
1124 @@ -168,9 +184,13 @@
1125      return 0;
1126  
1127    if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1128 +#ifdef SVEN_OLA_UNBLOAT_OLD
1129 +    perror(procfile);
1130 +#else
1131      fprintf(stderr, "Could not open %s for writing!\n", procfile);
1132      fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1133      sleep(3);
1134 +#endif
1135      return 0;
1136    }
1137    syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1138 @@ -196,19 +216,27 @@
1139    snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name);
1140  
1141    if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1142 +#ifdef SVEN_OLA_UNBLOAT_OLD
1143 +    perror(procfile);
1144 +#else
1145      fprintf(stderr,
1146              "WARNING! Could not open the %s file to check/disable ICMP redirects!\nAre you using the procfile filesystem?\nDoes your system support IPv4?\nI will continue(in 3 sec) - but you should mannually ensure that ICMP redirects are disabled!\n\n",
1147              procfile);
1148      sleep(3);
1149 +#endif
1150      return 0;
1151    }
1152    iface->nic_state.redirect = fgetc(proc_redirect);
1153    fclose(proc_redirect);
1154  
1155    if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1156 +#ifdef SVEN_OLA_UNBLOAT_OLD
1157 +    perror(procfile);
1158 +#else
1159      fprintf(stderr, "Could not open %s for writing!\n", procfile);
1160      fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1161      sleep(3);
1162 +#endif
1163      return 0;
1164    }
1165    syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1166 @@ -234,20 +262,28 @@
1167    sprintf(procfile, SPOOF_PROC, if_name);
1168  
1169    if ((proc_spoof = fopen(procfile, "r")) == NULL) {
1170 +#ifdef SVEN_OLA_UNBLOAT_OLD
1171 +    perror(procfile);
1172 +#else
1173      fprintf(stderr,
1174              "WARNING! Could not open the %s file to check/disable the IP spoof filter!\nAre you using the procfile filesystem?\nDoes your system support IPv4?\nI will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabled!\n\n",
1175              procfile);
1176  
1177      sleep(3);
1178 +#endif
1179      return 0;
1180    }
1181    iface->nic_state.spoof = fgetc(proc_spoof);
1182    fclose(proc_spoof);
1183  
1184    if ((proc_spoof = fopen(procfile, "w")) == NULL) {
1185 +#ifdef SVEN_OLA_UNBLOAT_OLD
1186 +    perror(procfile);
1187 +#else
1188      fprintf(stderr, "Could not open %s for writing!\n", procfile);
1189      fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabeled!\n\n");
1190      sleep(3);
1191 +#endif
1192      return 0;
1193    }
1194    syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1195 @@ -272,7 +308,11 @@
1196      FILE *proc_fd;
1197  
1198      if ((proc_fd = fopen(procfile, "w")) == NULL) {
1199 +#ifdef SVEN_OLA_UNBLOAT_OLD
1200 +      perror(procfile);
1201 +#else
1202        fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1203 +#endif
1204      } else {
1205        syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state);
1206        fputc(orig_fwd_state, proc_fd);
1207 @@ -287,7 +327,11 @@
1208        FILE *proc_fd;
1209  
1210        if ((proc_fd = fopen(procfile, "w")) == NULL) {
1211 +#ifdef SVEN_OLA_UNBLOAT_OLD
1212 +        perror(procfile);
1213 +#else
1214          fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1215 +#endif
1216        } else {
1217          syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state);
1218          fputc(orig_global_redirect_state, proc_fd);
1219 @@ -311,7 +355,11 @@
1220      snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name);
1221  
1222      if ((proc_fd = fopen(procfile, "w")) == NULL)
1223 +#ifdef SVEN_OLA_UNBLOAT_OLD
1224 +      perror(procfile);
1225 +#else
1226        fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1227 +#endif
1228      else {
1229        syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect);
1230  
1231 @@ -324,7 +372,11 @@
1232      /* Generate the procfile name */
1233      sprintf(procfile, SPOOF_PROC, ifs->int_name);
1234      if ((proc_fd = fopen(procfile, "w")) == NULL)
1235 +#ifdef SVEN_OLA_UNBLOAT_OLD
1236 +      perror(procfile);
1237 +#else
1238        fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1239 +#endif
1240      else {
1241        syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof);
1242  
1243 @@ -372,6 +424,8 @@
1244    return sock;
1245  }
1246  
1247 +#endif /* SVEN_OLA_UNBLOAT */
1248 +
1249  /**
1250   *Creates a nonblocking broadcast socket.
1251   *@param sa sockaddr struct. Used for bind(2).
1252 diff -ur olsrd-0-5-6-54e88033741d.orig/src/lq_plugin.c olsrd-0-5-6-54e88033741d/src/lq_plugin.c
1253 --- olsrd-0-5-6-54e88033741d.orig/src/lq_plugin.c       2009-03-25 21:44:43.000000000 +0000
1254 +++ olsrd-0-5-6-54e88033741d/src/lq_plugin.c    2009-03-25 21:45:02.000000000 +0000
1255 @@ -67,12 +67,18 @@
1256  init_lq_handler_tree(void)
1257  {
1258    avl_init(&lq_handler_tree, &avl_strcasecmp);
1259 +#ifndef SVEN_OLA_UNBLOAT
1260    register_lq_handler(&lq_etx_float_handler, LQ_ALGORITHM_ETX_FLOAT_NAME);
1261    register_lq_handler(&lq_etx_fpm_handler, LQ_ALGORITHM_ETX_FPM_NAME);
1262 +#endif /* SVEN_OLA_UNBLOAT */
1263    register_lq_handler(&lq_etx_ff_handler, LQ_ALGORITHM_ETX_FF_NAME);
1264 +#ifndef SVEN_OLA_UNBLOAT
1265    if (activate_lq_handler(olsr_cnf->lq_algorithm)) {
1266      activate_lq_handler(LQ_ALGORITHM_ETX_FPM_NAME);
1267    }
1268 +#else /* SVEN_OLA_UNBLOAT */
1269 +  activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME);
1270 +#endif /* SVEN_OLA_UNBLOAT */
1271  }
1272  
1273  /*
1274 @@ -417,7 +423,11 @@
1275   * @return pointer to hello_neighbor
1276   */
1277  struct hello_neighbor *
1278 +#ifndef SVEN_OLA_UNBLOAT
1279  olsr_malloc_hello_neighbor(const char *id)
1280 +#else                                  /* SVEN_OLA_UNBLOAT */
1281 +olsr_malloc_hello_neighbor(const char *id __attribute__ ((unused)))
1282 +#endif /* SVEN_OLA_UNBLOAT */
1283  {
1284    struct hello_neighbor *h;
1285  
1286 @@ -439,7 +449,11 @@
1287   * @return pointer to tc_mpr_addr
1288   */
1289  struct tc_mpr_addr *
1290 +#ifndef SVEN_OLA_UNBLOAT
1291  olsr_malloc_tc_mpr_addr(const char *id)
1292 +#else                                  /* SVEN_OLA_UNBLOAT */
1293 +olsr_malloc_tc_mpr_addr(const char *id __attribute__ ((unused)))
1294 +#endif /* SVEN_OLA_UNBLOAT */
1295  {
1296    struct tc_mpr_addr *t;
1297  
1298 @@ -461,7 +475,11 @@
1299   * @return pointer to lq_hello_neighbor
1300   */
1301  struct lq_hello_neighbor *
1302 +#ifndef SVEN_OLA_UNBLOAT
1303  olsr_malloc_lq_hello_neighbor(const char *id)
1304 +#else                                  /* SVEN_OLA_UNBLOAT */
1305 +olsr_malloc_lq_hello_neighbor(const char *id __attribute__ ((unused)))
1306 +#endif /* SVEN_OLA_UNBLOAT */
1307  {
1308    struct lq_hello_neighbor *h;
1309  
1310 @@ -483,7 +501,11 @@
1311   * @return pointer to link_entry
1312   */
1313  struct link_entry *
1314 +#ifndef SVEN_OLA_UNBLOAT
1315  olsr_malloc_link_entry(const char *id)
1316 +#else                                  /* SVEN_OLA_UNBLOAT */
1317 +olsr_malloc_link_entry(const char *id __attribute__ ((unused)))
1318 +#endif /* SVEN_OLA_UNBLOAT */
1319  {
1320    struct link_entry *h;
1321  
1322 diff -ur olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_float.c olsrd-0-5-6-54e88033741d/src/lq_plugin_default_float.c
1323 --- olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_float.c 2009-03-25 21:44:43.000000000 +0000
1324 +++ olsrd-0-5-6-54e88033741d/src/lq_plugin_default_float.c      2009-03-25 21:45:02.000000000 +0000
1325 @@ -39,6 +39,7 @@
1326   *
1327   */
1328  
1329 +#ifndef SVEN_OLA_UNBLOAT
1330  #include "tc_set.h"
1331  #include "link_set.h"
1332  #include "olsr_spf.h"
1333 @@ -223,6 +224,7 @@
1334  
1335    return buffer->buf;
1336  }
1337 +#endif /* SVEN_OLA_UNBLOAT */
1338  
1339  /*
1340   * Local Variables:
1341 diff -ur olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_float.h olsrd-0-5-6-54e88033741d/src/lq_plugin_default_float.h
1342 --- olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_float.h 2009-03-25 21:44:43.000000000 +0000
1343 +++ olsrd-0-5-6-54e88033741d/src/lq_plugin_default_float.h      2009-03-25 21:45:02.000000000 +0000
1344 @@ -39,6 +39,7 @@
1345   *
1346   */
1347  
1348 +#ifndef SVEN_OLA_UNBLOAT
1349  #ifndef LQ_PLUGIN_DEFAULT_H_
1350  #define LQ_PLUGIN_DEFAULT_H_
1351  
1352 @@ -77,6 +78,7 @@
1353  extern struct lq_handler lq_etx_float_handler;
1354  
1355  #endif /*LQ_PLUGIN_DEFAULT_H_ */
1356 +#endif /* SVEN_OLA_UNBLOAT */
1357  
1358  /*
1359   * Local Variables:
1360 diff -ur olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_fpm.c olsrd-0-5-6-54e88033741d/src/lq_plugin_default_fpm.c
1361 --- olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_fpm.c   2009-03-25 21:44:43.000000000 +0000
1362 +++ olsrd-0-5-6-54e88033741d/src/lq_plugin_default_fpm.c        2009-03-25 21:45:02.000000000 +0000
1363 @@ -39,6 +39,7 @@
1364   *
1365   */
1366  
1367 +#ifndef SVEN_OLA_UNBLOAT
1368  #include "tc_set.h"
1369  #include "link_set.h"
1370  #include "lq_plugin.h"
1371 @@ -235,6 +236,7 @@
1372    snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER);
1373    return buffer->buf;
1374  }
1375 +#endif /* SVEN_OLA_UNBLOAT */
1376  
1377  /*
1378   * Local Variables:
1379 diff -ur olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_fpm.h olsrd-0-5-6-54e88033741d/src/lq_plugin_default_fpm.h
1380 --- olsrd-0-5-6-54e88033741d.orig/src/lq_plugin_default_fpm.h   2009-03-25 21:44:43.000000000 +0000
1381 +++ olsrd-0-5-6-54e88033741d/src/lq_plugin_default_fpm.h        2009-03-25 21:45:02.000000000 +0000
1382 @@ -39,6 +39,7 @@
1383   *
1384   */
1385  
1386 +#ifndef SVEN_OLA_UNBLOAT
1387  #ifndef LQ_ETX_FPM_
1388  #define LQ_ETX_FPM_
1389  
1390 @@ -83,6 +84,7 @@
1391  extern struct lq_handler lq_etx_fpm_handler;
1392  
1393  #endif /*LQ_ETX_FPM_ */
1394 +#endif /* SVEN_OLA_UNBLOAT */
1395  
1396  /*
1397   * Local Variables:
1398 diff -ur olsrd-0-5-6-54e88033741d.orig/src/main.c olsrd-0-5-6-54e88033741d/src/main.c
1399 --- olsrd-0-5-6-54e88033741d.orig/src/main.c    2009-03-25 21:44:43.000000000 +0000
1400 +++ olsrd-0-5-6-54e88033741d/src/main.c 2009-03-25 21:45:02.000000000 +0000
1401 @@ -256,13 +256,17 @@
1402    /*
1403     * Print configuration
1404     */
1405 +#ifndef SVEN_OLA_UNBLOAT
1406    if (olsr_cnf->debug_level > 1) {
1407      olsrd_print_cnf(olsr_cnf);
1408    }
1409 +#endif /* SVEN_OLA_UNBLOAT */
1410  #ifndef WIN32
1411 +#ifndef SVEN_OLA_UNBLOAT
1412    /* Disable redirects globally */
1413    disable_redirects_global(olsr_cnf->ip_version);
1414  #endif
1415 +#endif /* SVEN_OLA_UNBLOAT */
1416  
1417    /*
1418     * socket for ioctl calls
1419 @@ -298,7 +302,9 @@
1420    /*
1421     *enable ip forwarding on host
1422     */
1423 +#ifndef SVEN_OLA_UNBLOAT
1424    enable_ip_forwarding(olsr_cnf->ip_version);
1425 +#endif /* SVEN_OLA_UNBLOAT */
1426  
1427    /* Initialize parser */
1428    olsr_init_parser();
1429 @@ -316,6 +322,7 @@
1430     *Set up willingness/APM
1431     */
1432    if (olsr_cnf->willingness_auto) {
1433 +#ifndef SVEN_OLA_UNBLOAT
1434      if (apm_init() < 0) {
1435        OLSR_PRINTF(1, "Could not read APM info - setting default willingness(%d)\n", WILL_DEFAULT);
1436  
1437 @@ -324,10 +331,13 @@
1438        olsr_cnf->willingness_auto = 0;
1439        olsr_cnf->willingness = WILL_DEFAULT;
1440      } else {
1441 +#endif /* SVEN_OLA_UNBLOAT */
1442        olsr_cnf->willingness = olsr_calculate_willingness();
1443  
1444        OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int);
1445 +#ifndef SVEN_OLA_UNBLOAT
1446      }
1447 +#endif /* SVEN_OLA_UNBLOAT */
1448    }
1449  
1450    /* Initialize net */
1451 @@ -362,9 +372,11 @@
1452  
1453    /* Initialize the IPC socket */
1454  
1455 +#ifndef SVEN_OLA_UNBLOAT
1456    if (olsr_cnf->ipc_connections > 0) {
1457      ipc_init();
1458    }
1459 +#endif /* SVEN_OLA_UNBLOAT */
1460    /* Initialisation of different tables to be used. */
1461    olsr_init_tables();
1462  
1463 @@ -487,9 +499,11 @@
1464    OLSR_PRINTF(1, "Closing sockets...\n");
1465  
1466    /* front-end IPC socket */
1467 +#ifndef SVEN_OLA_UNBLOAT
1468    if (olsr_cnf->ipc_connections > 0) {
1469      shutdown_ipc();
1470    }
1471 +#endif /* SVEN_OLA_UNBLOAT */
1472  
1473    /* OLSR sockets */
1474    for (ifn = ifnet; ifn; ifn = ifn->int_next)
1475 @@ -499,7 +513,9 @@
1476    olsr_close_plugins();
1477  
1478    /* Reset network settings */
1479 +#ifndef SVEN_OLA_UNBLOAT
1480    restore_settings(olsr_cnf->ip_version);
1481 +#endif /* SVEN_OLA_UNBLOAT */
1482  
1483    /* ioctl socket */
1484    close(olsr_cnf->ioctl_s);
1485 @@ -540,7 +556,11 @@
1486            "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n"
1487            "  [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n"
1488            "  [-lql <LQ level>] [-lqw <LQ winsize>] [-lqnt <nat threshold>]\n"
1489 +#ifdef SVEN_OLA_UNBLOAT
1490 +          "  [-bcast <broadcastaddr>] [-delgw] (Note: no -ipc,-dispin,-dispout)\n"
1491 +#else /* SVEN_OLA_UNBLOAT */
1492            "  [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n"
1493 +#endif /* SVEN_OLA_UNBLOAT */
1494            "  [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n"
1495            "  [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n"
1496            "  [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n" "  [-lql <LQ level>] [-lqa <LQ aging factor>]\n");
1497 @@ -704,12 +724,20 @@
1498          olsr_exit(__func__, EXIT_FAILURE);
1499        }
1500        printf("Queuing if %s\n", *argv);
1501 +#ifdef SVEN_OLA_UNBLOAT
1502 +      queue_if(*argv);
1503 +#else /* SVEN_OLA_UNBLOAT */
1504        queue_if(*argv, false);
1505 +#endif /* SVEN_OLA_UNBLOAT */
1506  
1507        while ((argc - 1) && (argv[1][0] != '-')) {
1508          NEXT_ARG;
1509          printf("Queuing if %s\n", *argv);
1510 +#ifdef SVEN_OLA_UNBLOAT
1511 +        queue_if(*argv);
1512 +#else /* SVEN_OLA_UNBLOAT */
1513          queue_if(*argv, false);
1514 +#endif /* SVEN_OLA_UNBLOAT */
1515        }
1516  
1517        continue;
1518 @@ -771,7 +799,7 @@
1519        sscanf(*argv, "%f", &cnf->pollrate);
1520        continue;
1521      }
1522 -
1523 +#ifndef SVEN_OLA_UNBLOAT
1524      /*
1525       * Should we display the contents of packages beeing sent?
1526       */
1527 @@ -795,6 +823,7 @@
1528        cnf->ipc_connections = 1;
1529        continue;
1530      }
1531 +#endif /* SVEN_OLA_UNBLOAT */
1532  
1533      /*
1534       * IPv6 multicast addr
1535 @@ -812,7 +841,7 @@
1536  
1537        continue;
1538      }
1539 -
1540 +#ifndef SVEN_OLA_UNBLOAT
1541      /*
1542       * Host emulation
1543       */
1544 @@ -840,6 +869,7 @@
1545  
1546        continue;
1547      }
1548 +#endif /* SVEN_OLA_UNBLOAT */
1549  
1550      /*
1551       * Delete possible default GWs
1552 diff -ur olsrd-0-5-6-54e88033741d.orig/src/neighbor_table.c olsrd-0-5-6-54e88033741d/src/neighbor_table.c
1553 --- olsrd-0-5-6-54e88033741d.orig/src/neighbor_table.c  2009-03-25 21:44:43.000000000 +0000
1554 +++ olsrd-0-5-6-54e88033741d/src/neighbor_table.c       2009-03-25 21:45:02.000000000 +0000
1555 @@ -362,6 +362,7 @@
1556   *
1557   *@return nada
1558   */
1559 +#ifndef SVEN_OLA_UNBLOAT
1560  void
1561  olsr_print_neighbor_table(void)
1562  {
1563 @@ -391,6 +392,7 @@
1564    }
1565  #endif
1566  }
1567 +#endif /* SVEN_OLA_UNBLOAT */
1568  
1569  /*
1570   * Local Variables:
1571 diff -ur olsrd-0-5-6-54e88033741d.orig/src/net_olsr.c olsrd-0-5-6-54e88033741d/src/net_olsr.c
1572 --- olsrd-0-5-6-54e88033741d.orig/src/net_olsr.c        2009-03-25 21:44:43.000000000 +0000
1573 +++ olsrd-0-5-6-54e88033741d/src/net_olsr.c     2009-03-25 21:45:02.000000000 +0000
1574 @@ -44,7 +44,9 @@
1575  #include "log.h"
1576  #include "olsr.h"
1577  #include "net_os.h"
1578 +#ifndef SVEN_OLA_UNBLOAT
1579  #include "print_packet.h"
1580 +#endif /* SVEN_OLA_UNBLOAT */
1581  #include "link_set.h"
1582  #include "lq_packet.h"
1583  
1584 @@ -385,8 +387,10 @@
1585     *if the -dispout option was given
1586     *we print the content of the packets
1587     */
1588 +#ifndef SVEN_OLA_UNBLOAT
1589    if (disp_pack_out)
1590      print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr);
1591 +#endif /* SVEN_OLA_UNBLOAT */
1592  
1593    if (olsr_cnf->ip_version == AF_INET) {
1594      /* IP version 4 */
1595 @@ -400,12 +404,16 @@
1596      /* IP version 6 */
1597      if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
1598          < 0) {
1599 +#ifndef SVEN_OLA_UNBLOAT
1600        struct ipaddr_str buf;
1601 +#endif /* SVEN_OLA_UNBLOAT */
1602        perror("sendto(v6)");
1603        olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
1604 +#ifndef SVEN_OLA_UNBLOAT
1605        fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index);
1606        fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6));
1607        fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending);
1608 +#endif /* SVEN_OLA_UNBLOAT */
1609        retval = -1;
1610      }
1611    }
1612 diff -ur olsrd-0-5-6-54e88033741d.orig/src/olsr.c olsrd-0-5-6-54e88033741d/src/olsr.c
1613 --- olsrd-0-5-6-54e88033741d.orig/src/olsr.c    2009-03-25 21:44:43.000000000 +0000
1614 +++ olsrd-0-5-6-54e88033741d/src/olsr.c 2009-03-25 21:45:02.000000000 +0000
1615 @@ -149,7 +149,9 @@
1616      return;
1617  
1618    if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) {
1619 +#ifndef SVEN_OLA_UNBLOAT
1620      clear_console();
1621 +#endif /* SVEN_OLA_UNBLOAT */
1622      printf("       *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host);
1623    }
1624  
1625 @@ -165,7 +167,7 @@
1626    if (changes_neighborhood || changes_topology || changes_hna) {
1627      olsr_calculate_routing_table();
1628    }
1629 -
1630 +#ifndef SVEN_OLA_UNBLOAT
1631    if (olsr_cnf->debug_level > 0) {
1632      if (olsr_cnf->debug_level > 2) {
1633        olsr_print_mid_set();
1634 @@ -184,6 +186,7 @@
1635      olsr_print_tc_table();
1636  #endif
1637    }
1638 +#endif /* SVEN_OLA_UNBLOAT */
1639  
1640    for (tmp_pc_list = pcf_list; tmp_pc_list != NULL; tmp_pc_list = tmp_pc_list->next) {
1641      tmp_pc_list->function(changes_neighborhood, changes_topology, changes_hna);
1642 @@ -420,12 +423,15 @@
1643  uint8_t
1644  olsr_calculate_willingness(void)
1645  {
1646 +#ifndef SVEN_OLA_UNBLOAT
1647    struct olsr_apm_info ainfo;
1648 +#endif /* SVEN_OLA_UNBLOAT */
1649  
1650    /* If fixed willingness */
1651    if (!olsr_cnf->willingness_auto)
1652      return olsr_cnf->willingness;
1653  
1654 +#ifndef SVEN_OLA_UNBLOAT
1655    if (apm_read(&ainfo) < 1)
1656      return WILL_DEFAULT;
1657  
1658 @@ -442,8 +448,12 @@
1659     * 26% > juice will: 1
1660     */
1661    return (ainfo.battery_percentage / 26);
1662 +#else /* SVEN_OLA_UNBLOAT */
1663 +  return WILL_DEFAULT;
1664 +#endif /* SVEN_OLA_UNBLOAT */
1665  }
1666  
1667 +#ifndef SVEN_OLA_UNBLOAT
1668  const char *
1669  olsr_msgtype_to_string(uint8_t msgtype)
1670  {
1671 @@ -513,6 +523,7 @@
1672    snprintf(type, sizeof(type), "UNKNOWN(%d)", status);
1673    return type;
1674  }
1675 +#endif /* SVEN_OLA_UNBLOAT */
1676  
1677  /**
1678   *Termination function to be called whenever a error occures
1679 @@ -541,6 +552,7 @@
1680   *
1681   * @return a void pointer to the memory allocated
1682   */
1683 +#ifndef SVEN_OLA_UNBLOAT
1684  void *
1685  olsr_malloc(size_t size, const char *id)
1686  {
1687 @@ -565,6 +577,7 @@
1688  
1689    return ptr;
1690  }
1691 +#endif /* SVEN_OLA_UNBLOAT */
1692  
1693  /**
1694   *Wrapper for printf that prints to a specific
1695 diff -ur olsrd-0-5-6-54e88033741d.orig/src/olsr.h olsrd-0-5-6-54e88033741d/src/olsr.h
1696 --- olsrd-0-5-6-54e88033741d.orig/src/olsr.h    2009-03-25 21:44:43.000000000 +0000
1697 +++ olsrd-0-5-6-54e88033741d/src/olsr.h 2009-03-25 21:45:02.000000000 +0000
1698 @@ -72,15 +72,21 @@
1699  
1700  uint8_t olsr_calculate_willingness(void);
1701  
1702 +#ifndef SVEN_OLA_UNBLOAT
1703  const char *olsr_msgtype_to_string(uint8_t);
1704  
1705  const char *olsr_link_to_string(uint8_t);
1706  
1707  const char *olsr_status_to_string(uint8_t);
1708 +#endif /* SVEN_OLA_UNBLOAT */
1709  
1710  void olsr_exit(const char *, int);
1711  
1712 +#ifdef SVEN_OLA_UNBLOAT
1713 +#define olsr_malloc(size, msg) calloc(1, size)
1714 +#else /* SVEN_OLA_UNBLOAT */
1715  void *olsr_malloc(size_t, const char *);
1716 +#endif /* SVEN_OLA_UNBLOAT */
1717  
1718  int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
1719  
1720 diff -ur olsrd-0-5-6-54e88033741d.orig/src/olsr_cfg.h olsrd-0-5-6-54e88033741d/src/olsr_cfg.h
1721 --- olsrd-0-5-6-54e88033741d.orig/src/olsr_cfg.h        2009-03-25 21:44:43.000000000 +0000
1722 +++ olsrd-0-5-6-54e88033741d/src/olsr_cfg.h     2009-03-25 21:45:02.000000000 +0000
1723 @@ -146,8 +146,10 @@
1724    char *name;
1725    char *config;
1726    bool configured;
1727 +#ifndef SVEN_OLA_UNBLOAT
1728    bool host_emul;
1729    union olsr_ip_addr hemu_ip;
1730 +#endif /* SVEN_OLA_UNBLOAT */
1731    struct interface *interf;
1732    struct if_config_options *cnf;
1733    struct olsr_if *next;
1734 @@ -190,7 +192,9 @@
1735    uint16_t olsrport;
1736    int debug_level;
1737    bool no_fork;
1738 +#ifndef SVEN_OLA_UNBLOAT
1739    bool host_emul;
1740 +#endif /* SVEN_OLA_UNBLOAT */
1741    int ip_version;
1742    bool allow_no_interfaces;
1743    uint16_t tos;
1744 @@ -199,13 +203,17 @@
1745    uint8_t rttable_default;
1746    uint8_t willingness;
1747    bool willingness_auto;
1748 +#ifndef SVEN_OLA_UNBLOAT
1749    int ipc_connections;
1750 +#endif /* SVEN_OLA_UNBLOAT */
1751    bool use_hysteresis;
1752    olsr_fib_metric_options fib_metric;
1753    struct hyst_param hysteresis_param;
1754    struct plugin_entry *plugins;
1755    struct ip_prefix_list *hna_entries;
1756 +#ifndef SVEN_OLA_UNBLOAT
1757    struct ip_prefix_list *ipc_nets;
1758 +#endif /* SVEN_OLA_UNBLOAT */
1759    struct olsr_if *interfaces;
1760    float pollrate;
1761    float nic_chgs_pollrate;
1762 @@ -265,7 +273,9 @@
1763  
1764    void olsrd_free_cnf(struct olsrd_config *);
1765  
1766 +#ifndef SVEN_OLA_UNBLOAT
1767    void olsrd_print_cnf(struct olsrd_config *);
1768 +#endif                                 /* SVEN_OLA_UNBLOAT */
1769  
1770    int olsrd_write_cnf(struct olsrd_config *, const char *);
1771  
1772 diff -ur olsrd-0-5-6-54e88033741d.orig/src/parser.c olsrd-0-5-6-54e88033741d/src/parser.c
1773 --- olsrd-0-5-6-54e88033741d.orig/src/parser.c  2009-03-25 21:44:43.000000000 +0000
1774 +++ olsrd-0-5-6-54e88033741d/src/parser.c       2009-03-25 21:45:02.000000000 +0000
1775 @@ -51,7 +51,9 @@
1776  #include "rebuild_packet.h"
1777  #include "net_os.h"
1778  #include "log.h"
1779 +#ifndef SVEN_OLA_UNBLOAT
1780  #include "print_packet.h"
1781 +#endif /* SVEN_OLA_UNBLOAT */
1782  #include "net_olsr.h"
1783  
1784  #ifdef WIN32
1785 @@ -281,8 +283,10 @@
1786    //printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr));
1787  
1788    /* Display packet */
1789 +#ifndef SVEN_OLA_UNBLOAT
1790    if (disp_pack_in)
1791      print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr);
1792 +#endif /* SVEN_OLA_UNBLOAT */
1793  
1794    if (olsr_cnf->ip_version == AF_INET)
1795      msgsize = ntohs(m->v4.olsr_msgsize);
1796 Only in olsrd-0-5-6-54e88033741d/src: parser.c.orig
1797 diff -ur olsrd-0-5-6-54e88033741d.orig/src/print_packet.c olsrd-0-5-6-54e88033741d/src/print_packet.c
1798 --- olsrd-0-5-6-54e88033741d.orig/src/print_packet.c    2009-03-25 21:44:43.000000000 +0000
1799 +++ olsrd-0-5-6-54e88033741d/src/print_packet.c 2009-03-25 21:45:02.000000000 +0000
1800 @@ -39,6 +39,7 @@
1801   *
1802   */
1803  
1804 +#ifndef SVEN_OLA_UNBLOAT
1805  #include "print_packet.h"
1806  #include "ipcalc.h"
1807  #include "mantissa.h"
1808 @@ -339,6 +340,7 @@
1809      remsize -= olsr_cnf->ipsize;
1810    }
1811  }
1812 +#endif /* SVEN_OLA_UNBLOAT */
1813  
1814  /*
1815   * Local Variables:
1816 diff -ur olsrd-0-5-6-54e88033741d.orig/src/process_routes.c olsrd-0-5-6-54e88033741d/src/process_routes.c
1817 --- olsrd-0-5-6-54e88033741d.orig/src/process_routes.c  2009-03-25 21:44:43.000000000 +0000
1818 +++ olsrd-0-5-6-54e88033741d/src/process_routes.c       2009-03-25 21:45:02.000000000 +0000
1819 @@ -159,6 +159,7 @@
1820  static void
1821  olsr_delete_kernel_route(struct rt_entry *rt)
1822  {
1823 +#ifndef SVEN_OLA_UNBLOAT
1824    if (!olsr_cnf->host_emul) {
1825      int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1826  
1827 @@ -170,6 +171,12 @@
1828        olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
1829      }
1830    }
1831 +#else /* SVEN_OLA_UNBLOAT */
1832 +  int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1833 +  if (0 > error) {
1834 +    olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno));
1835 +  }
1836 +#endif /* SVEN_OLA_UNBLOAT */
1837  }
1838  
1839  /**
1840 @@ -181,6 +188,7 @@
1841  olsr_add_kernel_route(struct rt_entry *rt)
1842  {
1843  
1844 +#ifndef SVEN_OLA_UNBLOAT
1845    if (!olsr_cnf->host_emul) {
1846      int16_t error = (olsr_cnf->ip_version == AF_INET) ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1847  
1848 @@ -199,6 +207,14 @@
1849        rt->rt_metric = rt->rt_best->rtp_metric;
1850      }
1851    }
1852 +#else /* SVEN_OLA_UNBLOAT */
1853 +  int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1854 +  if (0 > error) {
1855 +    olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno));
1856 +  } else {
1857 +    rt->rt_nexthop = rt->rt_best->rtp_nexthop;
1858 +  }
1859 +#endif /* SVEN_OLA_UNBLOAT */
1860  }
1861  
1862  /**
1863 @@ -385,7 +401,7 @@
1864    /* route additions */
1865    olsr_add_kernel_routes(&add_kernel_list);
1866  
1867 -#if DEBUG
1868 +#ifdef DEBUG
1869    olsr_print_routing_table(&routingtree);
1870  #endif
1871  }
1872 diff -ur olsrd-0-5-6-54e88033741d.orig/src/rebuild_packet.c olsrd-0-5-6-54e88033741d/src/rebuild_packet.c
1873 --- olsrd-0-5-6-54e88033741d.orig/src/rebuild_packet.c  2009-03-25 21:44:43.000000000 +0000
1874 +++ olsrd-0-5-6-54e88033741d/src/rebuild_packet.c       2009-03-25 21:45:02.000000000 +0000
1875 @@ -60,7 +60,11 @@
1876  mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m)
1877  {
1878    int i;
1879 +#ifndef SVEN_OLA_UNBLOAT
1880    struct mid_alias *alias, *alias_tmp;
1881 +#else /* SVEN_OLA_UNBLOAT */
1882 +  struct mid_alias *alias;
1883 +#endif /* SVEN_OLA_UNBLOAT */
1884    int no_aliases;
1885  
1886    /* Checking if everything is ok */
1887 @@ -100,6 +104,7 @@
1888        maddr++;
1889      }
1890  
1891 +#ifndef SVEN_OLA_UNBLOAT
1892      if (olsr_cnf->debug_level > 1) {
1893        struct ipaddr_str buf;
1894        OLSR_PRINTF(3, "Alias list for %s: ", olsr_ip_to_string(&buf, &mmsg->mid_origaddr));
1895 @@ -111,6 +116,7 @@
1896        }
1897        OLSR_PRINTF(3, "\n");
1898      }
1899 +#endif /* SVEN_OLA_UNBLOAT */
1900    } else {
1901      /* IPv6 */
1902      const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr;
1903 @@ -144,6 +150,7 @@
1904        maddr6++;
1905      }
1906  
1907 +#ifndef SVEN_OLA_UNBLOAT
1908      if (olsr_cnf->debug_level > 1) {
1909        struct ipaddr_str buf;
1910        OLSR_PRINTF(3, "Alias list for %s", ip6_to_string(&buf, &mmsg->mid_origaddr.v6));
1911 @@ -156,6 +163,7 @@
1912        }
1913        OLSR_PRINTF(3, "\n");
1914      }
1915 +#endif /* SVEN_OLA_UNBLOAT */
1916    }
1917  
1918  }
1919 diff -ur olsrd-0-5-6-54e88033741d.orig/src/routing_table.c olsrd-0-5-6-54e88033741d/src/routing_table.c
1920 --- olsrd-0-5-6-54e88033741d.orig/src/routing_table.c   2009-03-25 21:44:43.000000000 +0000
1921 +++ olsrd-0-5-6-54e88033741d/src/routing_table.c        2009-03-25 21:45:02.000000000 +0000
1922 @@ -628,6 +628,7 @@
1923  /**
1924   * format a route entry into a buffer
1925   */
1926 +#ifndef SVEN_OLA_UNBLOAT
1927  char *
1928  olsr_rt_to_string(const struct rt_entry *rt)
1929  {
1930 @@ -659,11 +660,13 @@
1931  
1932    return buff;
1933  }
1934 +#endif /* SVEN_OLA_UNBLOAT */
1935  
1936  /**
1937   * Print the routingtree to STDOUT
1938   *
1939   */
1940 +#ifndef SVEN_OLA_UNBLOAT
1941  void
1942  olsr_print_routing_table(struct avl_tree *tree)
1943  {
1944 @@ -697,6 +700,7 @@
1945  #endif
1946    tree = NULL;                  /* squelch compiler warnings */
1947  }
1948 +#endif /* SVEN_OLA_UNBLOAT */
1949  
1950  /*
1951   * Local Variables:
1952 diff -ur olsrd-0-5-6-54e88033741d.orig/src/routing_table.h olsrd-0-5-6-54e88033741d/src/routing_table.h
1953 --- olsrd-0-5-6-54e88033741d.orig/src/routing_table.h   2009-03-25 21:44:43.000000000 +0000
1954 +++ olsrd-0-5-6-54e88033741d/src/routing_table.h        2009-03-25 21:45:02.000000000 +0000
1955 @@ -210,9 +210,11 @@
1956  bool olsr_cmp_rt(const struct rt_entry *, const struct rt_entry *);
1957  uint8_t olsr_fib_metric(const struct rt_metric *);
1958  
1959 +#ifndef SVEN_OLA_UNBLOAT
1960  char *olsr_rt_to_string(const struct rt_entry *);
1961  char *olsr_rtp_to_string(const struct rt_path *);
1962  void olsr_print_routing_table(struct avl_tree *);
1963 +#endif /* SVEN_OLA_UNBLOAT */
1964  
1965  const struct rt_nexthop *olsr_get_nh(const struct rt_entry *);
1966  
1967 diff -ur olsrd-0-5-6-54e88033741d.orig/src/tc_set.c olsrd-0-5-6-54e88033741d/src/tc_set.c
1968 --- olsrd-0-5-6-54e88033741d.orig/src/tc_set.c  2009-03-25 21:44:43.000000000 +0000
1969 +++ olsrd-0-5-6-54e88033741d/src/tc_set.c       2009-03-25 21:45:02.000000000 +0000
1970 @@ -336,6 +336,7 @@
1971  /**
1972   * Format tc_edge contents into a buffer.
1973   */
1974 +#ifndef SVEN_OLA_UNBLOAT
1975  char *
1976  olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
1977  {
1978 @@ -350,6 +351,7 @@
1979  
1980    return buf;
1981  }
1982 +#endif /* SVEN_OLA_UNBLOAT */
1983  
1984  /**
1985   * Wrapper for the timer callback.
1986 @@ -686,6 +688,7 @@
1987  /**
1988   * Print the topology table to stdout
1989   */
1990 +#ifndef SVEN_OLA_UNBLOAT
1991  void
1992  olsr_print_tc_table(void)
1993  {
1994 @@ -711,6 +714,7 @@
1995    } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
1996  #endif
1997  }
1998 +#endif /* SVEN_OLA_UNBLOAT */
1999  
2000  /*
2001   * calculate the border IPs of a tc edge set according to the border flags
2002 diff -ur olsrd-0-5-6-54e88033741d.orig/src/tc_set.h olsrd-0-5-6-54e88033741d/src/tc_set.h
2003 --- olsrd-0-5-6-54e88033741d.orig/src/tc_set.h  2009-03-25 21:44:43.000000000 +0000
2004 +++ olsrd-0-5-6-54e88033741d/src/tc_set.h       2009-03-25 21:45:02.000000000 +0000
2005 @@ -157,7 +157,9 @@
2006  
2007  /* tc_edge_entry manipulation */
2008  bool olsr_delete_outdated_tc_edges(struct tc_entry *);
2009 +#ifndef SVEN_OLA_UNBLOAT
2010  char *olsr_tc_edge_to_string(struct tc_edge_entry *);
2011 +#endif /* SVEN_OLA_UNBLOAT */
2012  struct tc_edge_entry *olsr_lookup_tc_edge(struct tc_entry *, union olsr_ip_addr *);
2013  struct tc_edge_entry *olsr_add_tc_edge_entry(struct tc_entry *, union olsr_ip_addr *, uint16_t);
2014  void olsr_delete_tc_entry(struct tc_entry *);
2015 diff -ur olsrd-0-5-6-54e88033741d.orig/src/two_hop_neighbor_table.c olsrd-0-5-6-54e88033741d/src/two_hop_neighbor_table.c
2016 --- olsrd-0-5-6-54e88033741d.orig/src/two_hop_neighbor_table.c  2009-03-25 21:44:43.000000000 +0000
2017 +++ olsrd-0-5-6-54e88033741d/src/two_hop_neighbor_table.c       2009-03-25 21:45:02.000000000 +0000
2018 @@ -203,6 +203,8 @@
2019    return NULL;
2020  }
2021  
2022 +#ifndef SVEN_OLA_UNBLOAT
2023 +
2024  /**
2025   *Print the two hop neighbor table to STDOUT.
2026   *
2027 @@ -240,6 +242,7 @@
2028    }
2029  #endif
2030  }
2031 +#endif /* SVEN_OLA_UNBLOAT */
2032  
2033  /*
2034   * Local Variables:
2035 diff -ur olsrd-0-5-6-54e88033741d.orig/src/unix/ifnet.c olsrd-0-5-6-54e88033741d/src/unix/ifnet.c
2036 --- olsrd-0-5-6-54e88033741d.orig/src/unix/ifnet.c      2009-03-25 21:44:43.000000000 +0000
2037 +++ olsrd-0-5-6-54e88033741d/src/unix/ifnet.c   2009-03-25 21:45:02.000000000 +0000
2038 @@ -70,6 +70,8 @@
2039  
2040  #define BUFSPACE  (127*1024)    /* max. input buffer size to request */
2041  
2042 +#ifndef SVEN_OLA_UNBLOAT
2043 +
2044  int
2045  set_flag(char *ifname, short flag __attribute__ ((unused)))
2046  {
2047 @@ -100,6 +102,8 @@
2048  
2049  }
2050  
2051 +#endif /* SVEN_OLA_UNBLOAT */
2052 +
2053  void
2054  check_interface_updates(void *foo __attribute__ ((unused)))
2055  {
2056 @@ -110,11 +114,13 @@
2057  #endif
2058  
2059    for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
2060 +#ifndef SVEN_OLA_UNBLOAT
2061      if (tmp_if->host_emul)
2062        continue;
2063  
2064      if (olsr_cnf->host_emul)    /* XXX: TEMPORARY! */
2065        continue;
2066 +#endif /* SVEN_OLA_UNBLOAT */
2067  
2068      if (!tmp_if->cnf->autodetect_chg) {
2069  #ifdef DEBUG
2070 @@ -154,8 +160,10 @@
2071    OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name);
2072  #endif
2073  
2074 +#ifndef SVEN_OLA_UNBLOAT
2075    if (iface->host_emul)
2076      return -1;
2077 +#endif /* SVEN_OLA_UNBLOAT */
2078  
2079    ifp = iface->interf;
2080  
2081 @@ -281,7 +289,9 @@
2082    } else
2083      /* IP version 4 */
2084    {
2085 +#ifndef SVEN_OLA_UNBLOAT
2086      struct ipaddr_str buf;
2087 +#endif /* SVEN_OLA_UNBLOAT */
2088      /* Check interface address (IPv4) */
2089      if (ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) {
2090        OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n");
2091 @@ -294,17 +304,21 @@
2092      if (memcmp
2093          (&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr,
2094           olsr_cnf->ipsize) != 0) {
2095 +#ifndef SVEN_OLA_UNBLOAT
2096        /* New address */
2097        OLSR_PRINTF(1, "IPv4 address changed for %s\n", ifr.ifr_name);
2098        OLSR_PRINTF(1, "\tOld:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr));
2099        OLSR_PRINTF(1, "\tNew:%s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2100 +#endif /* SVEN_OLA_UNBLOAT */
2101  
2102        ifp->int_addr = *(struct sockaddr_in *)&ifr.ifr_addr;
2103        /* deactivated to prevent change of originator IP */
2104  #if 0
2105        if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) {
2106          OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2107 +#ifndef SVEN_OLA_UNBLOAT
2108          olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2109 +#endif /* SVEN_OLA_UNBLOAT */
2110          memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize);
2111        }
2112  #endif
2113 @@ -366,7 +380,9 @@
2114  
2115  remove_interface:
2116    OLSR_PRINTF(1, "Removing interface %s\n", iface->name);
2117 +#ifndef SVEN_OLA_UNBLOAT
2118    olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
2119 +#endif /* SVEN_OLA_UNBLOAT */
2120  
2121    olsr_delete_link_entry_by_ip(&ifp->ip_addr);
2122  
2123 @@ -398,10 +414,14 @@
2124        memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
2125        OLSR_PRINTF(1, "No more interfaces...\n");
2126      } else {
2127 +#if !defined(SVEN_OLA_UNBLOAT)
2128        struct ipaddr_str buf;
2129 +#endif /* SVEN_OLA_UNBLOAT */
2130        olsr_cnf->main_addr = ifnet->ip_addr;
2131        OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2132 +#ifndef SVEN_OLA_UNBLOAT
2133        olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2134 +#endif /* SVEN_OLA_UNBLOAT */
2135      }
2136    }
2137  #endif
2138 @@ -425,7 +445,9 @@
2139  
2140    if ((ifnet == NULL) && (!olsr_cnf->allow_no_interfaces)) {
2141      OLSR_PRINTF(1, "No more active interfaces - exiting.\n");
2142 +#ifndef SVEN_OLA_UNBLOAT
2143      olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n");
2144 +#endif /* SVEN_OLA_UNBLOAT */
2145      olsr_cnf->exit_value = EXIT_FAILURE;
2146      kill(getpid(), SIGINT);
2147    }
2148 @@ -434,6 +456,8 @@
2149  
2150  }
2151  
2152 +#ifndef SVEN_OLA_UNBLOAT
2153 +
2154  /**
2155   * Initializes the special interface used in
2156   * host-client emulation
2157 @@ -583,6 +607,7 @@
2158  
2159    return 1;
2160  }
2161 +#endif /* SVEN_OLA_UNBLOAT */
2162  
2163  static char basenamestr[32];
2164  static const char *if_basename(const char *name);
2165 @@ -618,8 +643,10 @@
2166    int tos_bits = IPTOS_TOS(olsr_cnf->tos);
2167  #endif
2168  
2169 +#ifndef SVEN_OLA_UNBLOAT
2170    if (iface->host_emul)
2171      return -1;
2172 +#endif /* SVEN_OLA_UNBLOAT */
2173  
2174    memset(&ifr, 0, sizeof(struct ifreq));
2175    memset(&ifs, 0, sizeof(struct interface));
2176 @@ -726,11 +753,13 @@
2177        ifs.int_broadaddr = *(struct sockaddr_in *)&ifr.ifr_broadaddr;
2178      }
2179  
2180 +#ifndef SVEN_OLA_UNBLOAT
2181      /* Deactivate IP spoof filter */
2182      deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2183  
2184      /* Disable ICMP redirects */
2185      disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2186 +#endif /* SVEN_OLA_UNBLOAT */
2187  
2188    }
2189  
2190 @@ -760,7 +789,9 @@
2191  
2192    OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu);
2193  
2194 +#ifndef SVEN_OLA_UNBLOAT
2195    olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name);
2196 +#endif /* SVEN_OLA_UNBLOAT */
2197    OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index);
2198  
2199    if (olsr_cnf->ip_version == AF_INET) {
2200 @@ -865,10 +896,14 @@
2201     */
2202    memset(&null_addr, 0, olsr_cnf->ipsize);
2203    if (ipequal(&null_addr, &olsr_cnf->main_addr)) {
2204 +#ifndef SVEN_OLA_UNBLOAT
2205      struct ipaddr_str buf;
2206 +#endif
2207      olsr_cnf->main_addr = ifp->ip_addr;
2208 +#ifndef SVEN_OLA_UNBLOAT
2209      OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2210      olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2211 +#endif /* SVEN_OLA_UNBLOAT */
2212    }
2213  
2214    /*
2215 diff -ur olsrd-0-5-6-54e88033741d.orig/src/unix/misc.c olsrd-0-5-6-54e88033741d/src/unix/misc.c
2216 --- olsrd-0-5-6-54e88033741d.orig/src/unix/misc.c       2009-03-25 21:44:43.000000000 +0000
2217 +++ olsrd-0-5-6-54e88033741d/src/unix/misc.c    2009-03-25 21:45:02.000000000 +0000
2218 @@ -44,6 +44,7 @@
2219  #include "misc.h"
2220  #include "olsr_types.h"
2221  
2222 +#ifndef SVEN_OLA_UNBLOAT
2223  void
2224  clear_console(void)
2225  {
2226 @@ -69,6 +70,7 @@
2227  
2228    fflush(stdout);
2229  }
2230 +#endif /* SVEN_OLA_UNBLOAT */
2231  
2232  /*
2233   * Local Variables: