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