4 $(warning Use CPPFLAGS instead of DEFINES for -D)
7 +ifeq ($(SVEN_OLA_UNBLOAT),1)
8 +CPPFLAGS += -DSVEN_OLA_UNBLOAT -DNODEBUG
14 --- a/lib/bmf/src/NetworkInterfaces.c
15 +++ b/lib/bmf/src/NetworkInterfaces.c
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));
21 struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr);
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
29 CPPFLAGS += -DADMIN_INTERFACE
32 +ifdef SVEN_OLA_UNBLOAT
33 + CFLAGS += -DSVEN_OLA
35 OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o
38 default_target: $(PLUGIN_FULLNAME)
40 --- a/lib/httpinfo/src/olsrd_httpinfo.c
41 +++ b/lib/httpinfo/src/olsrd_httpinfo.c
44 #include "olsrd_httpinfo.h"
45 #include "admin_interface.h"
46 +#ifndef SVEN_OLA_UNBLOAT
48 +#endif /* SVEN_OLA_UNBLOAT */
53 {"Admin", "admin", build_admin_body, true},
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}
62 +#ifndef SVEN_OLA_UNBLOAT
63 static const struct static_bin_file_entry static_bin_files[] = {
64 {"favicon.ico", favicon_ico, sizeof(favicon_ico)}
70 +#endif /* SVEN_OLA_UNBLOAT */
72 static const struct static_txt_file_entry static_txt_files[] = {
73 {"httpinfo.css", httpinfo_css},
75 } else if (!strcmp(req_type, "GET")) {
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)) {
86 +#endif /* SVEN_OLA_UNBLOAT */
87 while (static_txt_files[i].filename) {
88 if (FILENREQ_MATCH(filename, static_txt_files[i].filename)) {
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\"> <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 */
113 build_tabs(&body_abuf, i);
114 build_frame(&body_abuf, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb);
116 abuf_puts(abuf, "<tr><td colspan=\"3\">Status: DOWN</td></tr>\n");
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",
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));
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");
132 @@ -1155,6 +1170,7 @@
136 +#ifndef SVEN_OLA_UNBLOAT
138 check_allowed_ip(const struct allowed_net *const my_allowed_nets, const union olsr_ip_addr *const addr)
140 @@ -1166,6 +1182,7 @@
144 +#endif /* SVEN_OLA_UNBLOAT */
148 --- a/lib/nameservice/src/nameservice.c
149 +++ b/lib/nameservice/src/nameservice.c
151 #include "mapwrite.h"
154 +#ifdef SVEN_OLA_UNBLOAT
156 +#define OLSR_PRINTF(...)
157 +#endif /* SVEN_OLA_UNBLOAT */
159 /* config parameters */
160 static char my_hosts_file[MAX_FILE + 1];
161 static char my_sighup_pid_file[MAX_FILE + 1];
163 name->ip = olsr_cnf->main_addr;
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);
171 pos += sizeof(struct name);
172 pos += 1 + ((ntohs(from_packet->len) - 1) | 3);
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));
188 +#ifndef SVEN_OLA_UNBLOAT
191 * Interface to OS dependent power management information
193 int apm_read(struct olsr_apm_info *);
196 +#endif /* SVEN_OLA_UNBLOAT */
200 --- a/src/cfgparser/cfgfile_gen.c
201 +++ b/src/cfgparser/cfgfile_gen.c
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;
211 char ipv6_buf[100]; /* buffer for IPv6 inet_htop */
214 fprintf(fd, "Willingness\t%d\n\n", cnf->willingness);
216 +#ifndef SVEN_OLA_UNBLOAT
218 fprintf(fd, "# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
219 fprintf(fd, "IpcConnect {\n");
223 fprintf(fd, "}\n\n");
224 +#endif /* SVEN_OLA_UNBLOAT */
227 fprintf(fd, "# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
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;
240 WRITE_TO_BUF("Willingness\t%d\n\n", cnf->willingness);
242 +#ifndef SVEN_OLA_UNBLOAT
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");
249 WRITE_TO_BUF("}\n\n");
250 +#endif /* SVEN_OLA_UNBLOAT */
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
257 C=$(if $(CFGDIR),$(CFGDIR)/)
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)
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)
267 HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
269 $(C)oscan.c: $(C)oscan.lex $(C)Makefile
270 --- a/src/cfgparser/olsrd_conf.c
271 +++ b/src/cfgparser/olsrd_conf.c
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");
281 printf("Use -print to view parsed values\n");
282 +#endif /* SVEN_OLA_UNBLOAT */
283 printf("Configfile parsed OK\n");
285 printf("Failed parsing \"%s\"\n", argv[1]);
287 /* set various stuff */
288 in->configured = false;
290 +#ifndef SVEN_OLA_UNBLOAT
291 in->host_emul = false;
292 +#endif /* SVEN_OLA_UNBLOAT */
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);
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;
315 cnf->use_hysteresis = DEF_USE_HYST;
320 +#ifndef SVEN_OLA_UNBLOAT
322 olsrd_print_cnf(struct olsrd_config *cnf)
328 +#endif /* SVEN_OLA_UNBLOAT */
332 --- a/src/cfgparser/oparse.y
333 +++ b/src/cfgparser/oparse.y
336 %token TOK_RTTABLE_DEFAULT
337 %token TOK_WILLINGNESS
348 %token TOK_IP4BROADCAST
352 block: TOK_HNA4 hna4body
354 - | TOK_IPCCON ipcbody
362 -ipcbody: TOK_OPEN ipcstmts TOK_CLOSE
365 -ipcstmts: | ipcstmts ipcstmt
374 ifblock: ifstart ifnicks
381 -imaxipc: TOK_MAXIPC TOK_INTEGER
383 - olsr_cnf->ipc_connections = $2->integer;
388 -ipchost: TOK_HOSTLABEL TOK_IP4_ADDR
390 - union olsr_ip_addr ipaddr;
391 - PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string);
393 - if (inet_aton($2->string, &ipaddr.v4) == 0) {
394 - fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string);
398 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen);
405 -ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR
407 - union olsr_ip_addr ipaddr, netmask;
409 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
411 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
412 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
416 - if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) {
417 - fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string);
421 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask));
428 - | TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER
430 - union olsr_ip_addr ipaddr;
432 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
434 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
435 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
439 - if ($4->integer > olsr_cnf->maxplen) {
440 - fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen);
444 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer);
452 iifweight: TOK_IFWEIGHT TOK_INTEGER
454 int ifcnt = ifs_in_curr_cfg;
455 --- a/src/cfgparser/oscan.lex
456 +++ b/src/cfgparser/oscan.lex
468 return TOK_DEBUGLEVEL;
470 return TOK_WILLINGNESS;
480 return TOK_FIBMETRIC;
485 uint32_t olsr_times(void);
487 +#ifndef SVEN_OLA_UNBLOAT
491 *These are moved to a plugin soon
493 int ipc_output(struct olsr *);
496 +#endif /* SVEN_OLA_UNBLOAT */
500 --- a/src/duplicate_set.c
501 +++ b/src/duplicate_set.c
503 return false; /* no duplicate */
506 +#ifndef SVEN_OLA_UNBLOAT
508 olsr_print_duplicate_table(void)
511 } OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
514 +#endif /* SVEN_OLA_UNBLOAT */
524 +#ifndef SVEN_OLA_UNBLOAT
526 olsr_print_hna_set(void)
532 +#endif /* SVEN_OLA_UNBLOAT */
535 *Process incoming HNA message.
536 --- a/src/interfaces.c
537 +++ b/src/interfaces.c
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
551 +#endif /* SVEN_OLA_UNBLOAT */
554 /* Kick a periodic timer for the network interface update function */
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 */
565 struct olsr_if *interf_n = olsr_cnf->interfaces;
568 interf_n->interf = NULL;
569 interf_n->configured = 0;
571 +#ifndef SVEN_OLA_UNBLOAT
572 interf_n->host_emul = hemu ? true : false;
573 +#endif /* SVEN_OLA_UNBLOAT */
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
581 struct interface *if_ifwithindex(const int if_index);
583 -struct olsr_if *queue_if(const char *, int);
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 */
591 int add_ifchgf(int (*f) (struct interface *, int));
593 --- a/src/ipc_frontend.c
594 +++ b/src/ipc_frontend.c
599 +#ifndef SVEN_OLA_UNBLOAT
600 #include "ipc_frontend.h"
601 #include "link_set.h"
607 +#endif /* SVEN_OLA_UNBLOAT */
611 --- a/src/ipc_frontend.h
612 +++ b/src/ipc_frontend.h
617 +#ifndef SVEN_OLA_UNBLOAT
619 #include <sys/types.h>
620 #include <netinet/in.h>
622 int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *);
625 +#endif /* SVEN_OLA_UNBLOAT */
635 +#ifndef SVEN_OLA_UNBLOAT
637 olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
643 +#endif /* SVEN_OLA_UNBLOAT */
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.
650 return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
653 +#ifndef SVEN_OLA_UNBLOAT
654 const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
655 +#endif /* SVEN_OLA_UNBLOAT */
657 static INLINE const char *
658 sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr)
665 +#ifndef SVEN_OLA_UNBLOAT
667 olsr_print_link_set(void)
670 } OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
673 +#endif /* SVEN_OLA_UNBLOAT */
676 * called for every LQ HELLO message.
677 --- a/src/linux/apm.c
678 +++ b/src/linux/apm.c
680 * Acpi-Power Enlightenment epplet
683 +#ifndef SVEN_OLA_UNBLOAT
688 /* No battery found */
691 +#endif /* SVEN_OLA_UNBLOAT */
695 --- a/src/linux/kernel_routes.c
696 +++ b/src/linux/kernel_routes.c
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 */
707 ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric,
708 RTM_NEWROUTE == cmd, if_ifwithindex_name(nexthop->iif_index));
712 #endif /* LINUX_POLICY_ROUTING */
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 */
718 #if !LINUX_POLICY_ROUTING
719 memset(&kernel_route, 0, sizeof(struct rtentry));
721 struct in6_rtmsg kernel_route;
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 */
728 memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
732 #endif /* LINUX_POLICY_ROUTING */
734 +#ifndef SVEN_OLA_UNBLOAT
735 OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
736 +#endif /* SVEN_OLA_UNBLOAT */
738 #if !LINUX_POLICY_ROUTING
739 memset(&kernel_route, 0, sizeof(struct rtentry));
742 #endif /* LINUX_POLICY_ROUTING */
744 +#ifndef SVEN_OLA_UNBLOAT
745 OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
746 +#endif /* SVEN_OLA_UNBLOAT */
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
753 #define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
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 */
762 *Bind a socket to a device
764 return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1);
767 +#ifndef SVEN_OLA_UNBLOAT
770 *Enable IP forwarding.
771 *Just writing "1" to the /proc/sys/net/ipv4/ip_forward
773 const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
775 if ((proc_fwd = fopen(procfile, "r")) == NULL) {
776 +#ifdef SVEN_OLA_UNBLOAT_OLD
780 if (version == AF_INET)
791 OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
793 if ((proc_fwd = fopen(procfile, "w")) == NULL) {
794 +#ifdef SVEN_OLA_UNBLOAT_OLD
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");
803 syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile);
804 @@ -155,11 +167,15 @@
807 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
808 +#ifdef SVEN_OLA_UNBLOAT_OLD
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",
819 orig_global_redirect_state = fgetc(proc_redirect);
823 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
824 +#ifdef SVEN_OLA_UNBLOAT_OLD
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");
833 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
834 @@ -197,19 +217,27 @@
835 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name);
837 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
838 +#ifdef SVEN_OLA_UNBLOAT_OLD
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",
848 iface->nic_state.redirect = fgetc(proc_redirect);
849 fclose(proc_redirect);
851 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
852 +#ifdef SVEN_OLA_UNBLOAT_OLD
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");
861 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
862 @@ -235,20 +263,28 @@
863 sprintf(procfile, SPOOF_PROC, if_name);
865 if ((proc_spoof = fopen(procfile, "r")) == NULL) {
866 +#ifdef SVEN_OLA_UNBLOAT_OLD
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",
877 iface->nic_state.spoof = fgetc(proc_spoof);
880 if ((proc_spoof = fopen(procfile, "w")) == NULL) {
881 +#ifdef SVEN_OLA_UNBLOAT_OLD
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");
890 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
894 if ((proc_fd = fopen(procfile, "w")) == NULL) {
895 +#ifdef SVEN_OLA_UNBLOAT_OLD
898 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
901 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state);
902 fputc(orig_fwd_state, proc_fd);
906 if ((proc_fd = fopen(procfile, "w")) == NULL) {
907 +#ifdef SVEN_OLA_UNBLOAT_OLD
910 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
913 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state);
914 fputc(orig_global_redirect_state, proc_fd);
916 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name);
918 if ((proc_fd = fopen(procfile, "w")) == NULL)
919 +#ifdef SVEN_OLA_UNBLOAT_OLD
922 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
925 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect);
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
934 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
937 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof);
943 +#endif /* SVEN_OLA_UNBLOAT */
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
951 init_lq_handler_tree(void)
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);
963 +#else /* SVEN_OLA_UNBLOAT */
964 + activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME);
965 +#endif /* SVEN_OLA_UNBLOAT */
970 * @return pointer to hello_neighbor
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 */
979 struct hello_neighbor *h;
982 * @return pointer to 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 */
991 struct tc_mpr_addr *t;
994 * @return pointer to lq_hello_neighbor
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 */
1003 struct lq_hello_neighbor *h;
1005 @@ -465,7 +483,11 @@
1006 * @return pointer to 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 */
1015 struct link_entry *h;
1017 --- a/src/lq_plugin_default_float.c
1018 +++ b/src/lq_plugin_default_float.c
1023 +#ifndef SVEN_OLA_UNBLOAT
1025 #include "link_set.h"
1026 #include "olsr_spf.h"
1031 +#endif /* SVEN_OLA_UNBLOAT */
1035 --- a/src/lq_plugin_default_float.h
1036 +++ b/src/lq_plugin_default_float.h
1041 +#ifndef SVEN_OLA_UNBLOAT
1042 #ifndef LQ_PLUGIN_DEFAULT_H_
1043 #define LQ_PLUGIN_DEFAULT_H_
1046 extern struct lq_handler lq_etx_float_handler;
1048 #endif /*LQ_PLUGIN_DEFAULT_H_ */
1049 +#endif /* SVEN_OLA_UNBLOAT */
1053 --- a/src/lq_plugin_default_fpm.c
1054 +++ b/src/lq_plugin_default_fpm.c
1059 +#ifndef SVEN_OLA_UNBLOAT
1061 #include "link_set.h"
1062 #include "lq_plugin.h"
1064 snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER);
1067 +#endif /* SVEN_OLA_UNBLOAT */
1071 --- a/src/lq_plugin_default_fpm.h
1072 +++ b/src/lq_plugin_default_fpm.h
1077 +#ifndef SVEN_OLA_UNBLOAT
1082 extern struct lq_handler lq_etx_fpm_handler;
1084 #endif /*LQ_ETX_FPM_ */
1085 +#endif /* SVEN_OLA_UNBLOAT */
1091 @@ -289,13 +289,17 @@
1093 * Print configuration
1095 +#ifndef SVEN_OLA_UNBLOAT
1096 if (olsr_cnf->debug_level > 1) {
1097 olsrd_print_cnf(olsr_cnf);
1099 +#endif /* SVEN_OLA_UNBLOAT */
1101 +#ifndef SVEN_OLA_UNBLOAT
1102 /* Disable redirects globally */
1103 disable_redirects_global(olsr_cnf->ip_version);
1105 +#endif /* SVEN_OLA_UNBLOAT */
1108 * socket for ioctl calls
1111 *enable ip forwarding on host
1113 +#ifndef SVEN_OLA_UNBLOAT
1114 enable_ip_forwarding(olsr_cnf->ip_version);
1115 +#endif /* SVEN_OLA_UNBLOAT */
1117 /* Initialize parser */
1120 *Set up willingness/APM
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);
1127 @@ -359,10 +366,13 @@
1128 olsr_cnf->willingness_auto = 0;
1129 olsr_cnf->willingness = WILL_DEFAULT;
1131 +#endif /* SVEN_OLA_UNBLOAT */
1132 olsr_cnf->willingness = olsr_calculate_willingness();
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
1137 +#endif /* SVEN_OLA_UNBLOAT */
1140 /* Initialize net */
1141 @@ -392,9 +402,11 @@
1143 /* Initialize the IPC socket */
1145 +#ifndef SVEN_OLA_UNBLOAT
1146 if (olsr_cnf->ipc_connections > 0) {
1149 +#endif /* SVEN_OLA_UNBLOAT */
1150 /* Initialisation of different tables to be used. */
1153 @@ -533,9 +545,11 @@
1154 OLSR_PRINTF(1, "Closing sockets...\n");
1156 /* front-end IPC socket */
1157 +#ifndef SVEN_OLA_UNBLOAT
1158 if (olsr_cnf->ipc_connections > 0) {
1161 +#endif /* SVEN_OLA_UNBLOAT */
1164 for (ifn = ifnet; ifn; ifn = ifn->int_next)
1166 olsr_close_plugins();
1168 /* Reset network settings */
1169 +#ifndef SVEN_OLA_UNBLOAT
1170 restore_settings(olsr_cnf->ip_version);
1171 +#endif /* SVEN_OLA_UNBLOAT */
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"
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);
1190 printf("Queuing if %s\n", *argv);
1191 +#ifdef SVEN_OLA_UNBLOAT
1193 +#else /* SVEN_OLA_UNBLOAT */
1194 queue_if(*argv, false);
1195 +#endif /* SVEN_OLA_UNBLOAT */
1197 while ((argc - 1) && (argv[1][0] != '-')) {
1199 printf("Queuing if %s\n", *argv);
1200 +#ifdef SVEN_OLA_UNBLOAT
1202 +#else /* SVEN_OLA_UNBLOAT */
1203 queue_if(*argv, false);
1204 +#endif /* SVEN_OLA_UNBLOAT */
1209 sscanf(*argv, "%f", &cnf->pollrate);
1213 +#ifndef SVEN_OLA_UNBLOAT
1215 * Should we display the contents of packages beeing sent?
1218 cnf->ipc_connections = 1;
1221 +#endif /* SVEN_OLA_UNBLOAT */
1224 * IPv6 multicast addr
1230 +#ifndef SVEN_OLA_UNBLOAT
1238 +#endif /* SVEN_OLA_UNBLOAT */
1241 * Delete possible default GWs
1242 --- a/src/neighbor_table.c
1243 +++ b/src/neighbor_table.c
1248 +#ifndef SVEN_OLA_UNBLOAT
1250 olsr_print_neighbor_table(void)
1256 +#endif /* SVEN_OLA_UNBLOAT */
1260 --- a/src/net_olsr.c
1261 +++ b/src/net_olsr.c
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"
1272 @@ -385,8 +387,10 @@
1273 *if the -dispout option was given
1274 *we print the content of the packets
1276 +#ifndef SVEN_OLA_UNBLOAT
1278 print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr);
1279 +#endif /* SVEN_OLA_UNBLOAT */
1281 if (olsr_cnf->ip_version == AF_INET) {
1283 @@ -400,12 +404,16 @@
1285 if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
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 */
1305 if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) {
1306 +#ifndef SVEN_OLA_UNBLOAT
1308 +#endif /* SVEN_OLA_UNBLOAT */
1309 printf(" *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host);
1313 if (changes_neighborhood || changes_topology || changes_hna) {
1314 olsr_calculate_routing_table();
1317 +#ifndef SVEN_OLA_UNBLOAT
1318 if (olsr_cnf->debug_level > 0) {
1319 if (olsr_cnf->debug_level > 2) {
1320 olsr_print_mid_set();
1322 olsr_print_tc_table();
1325 +#endif /* SVEN_OLA_UNBLOAT */
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 @@
1331 olsr_calculate_willingness(void)
1333 +#ifndef SVEN_OLA_UNBLOAT
1334 struct olsr_apm_info ainfo;
1335 +#endif /* SVEN_OLA_UNBLOAT */
1337 /* If fixed willingness */
1338 if (!olsr_cnf->willingness_auto)
1339 return olsr_cnf->willingness;
1341 +#ifndef SVEN_OLA_UNBLOAT
1342 if (apm_read(&ainfo) < 1)
1343 return WILL_DEFAULT;
1345 @@ -443,8 +449,12 @@
1346 * 26% > juice will: 1
1348 return (ainfo.battery_percentage / 26);
1349 +#else /* SVEN_OLA_UNBLOAT */
1350 + return WILL_DEFAULT;
1351 +#endif /* SVEN_OLA_UNBLOAT */
1354 +#ifndef SVEN_OLA_UNBLOAT
1356 olsr_msgtype_to_string(uint8_t msgtype)
1359 snprintf(type, sizeof(type), "UNKNOWN(%d)", status);
1362 +#endif /* SVEN_OLA_UNBLOAT */
1365 *Termination function to be called whenever a error occures
1368 * @return a void pointer to the memory allocated
1370 +#ifndef SVEN_OLA_UNBLOAT
1372 olsr_malloc(size_t size, const char *id)
1378 +#endif /* SVEN_OLA_UNBLOAT */
1381 *Wrapper for printf that prints to a specific
1386 uint8_t olsr_calculate_willingness(void);
1388 +#ifndef SVEN_OLA_UNBLOAT
1389 const char *olsr_msgtype_to_string(uint8_t);
1391 const char *olsr_link_to_string(uint8_t);
1393 const char *olsr_status_to_string(uint8_t);
1394 +#endif /* SVEN_OLA_UNBLOAT */
1396 void olsr_exit(const char *, int);
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 */
1404 int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
1406 --- a/src/olsr_cfg.h
1407 +++ b/src/olsr_cfg.h
1408 @@ -154,8 +154,10 @@
1412 +#ifndef SVEN_OLA_UNBLOAT
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;
1423 +#ifndef SVEN_OLA_UNBLOAT
1425 +#endif /* SVEN_OLA_UNBLOAT */
1427 bool allow_no_interfaces;
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;
1446 float nic_chgs_pollrate;
1449 void olsrd_free_cnf(struct olsrd_config *);
1451 +#ifndef SVEN_OLA_UNBLOAT
1452 void olsrd_print_cnf(struct olsrd_config *);
1453 +#endif /* SVEN_OLA_UNBLOAT */
1455 int olsrd_write_cnf(struct olsrd_config *, const char *);
1460 #include "rebuild_packet.h"
1463 +#ifndef SVEN_OLA_UNBLOAT
1464 #include "print_packet.h"
1465 +#endif /* SVEN_OLA_UNBLOAT */
1466 #include "net_olsr.h"
1469 @@ -281,8 +283,10 @@
1470 //printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr));
1472 /* Display packet */
1473 +#ifndef SVEN_OLA_UNBLOAT
1475 print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr);
1476 +#endif /* SVEN_OLA_UNBLOAT */
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
1486 +#ifndef SVEN_OLA_UNBLOAT
1487 #include "print_packet.h"
1489 #include "mantissa.h"
1491 remsize -= olsr_cnf->ipsize;
1494 +#endif /* SVEN_OLA_UNBLOAT */
1498 --- a/src/process_routes.c
1499 +++ b/src/process_routes.c
1502 olsr_delete_kernel_route(struct rt_entry *rt)
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);
1508 @@ -170,6 +171,12 @@
1509 olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
1512 +#else /* SVEN_OLA_UNBLOAT */
1513 + int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1515 + olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno));
1517 +#endif /* SVEN_OLA_UNBLOAT */
1522 olsr_add_kernel_route(struct rt_entry *rt)
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);
1529 @@ -199,6 +207,14 @@
1530 rt->rt_metric = rt->rt_best->rtp_metric;
1533 +#else /* SVEN_OLA_UNBLOAT */
1534 + int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1536 + olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno));
1538 + rt->rt_nexthop = rt->rt_best->rtp_nexthop;
1540 +#endif /* SVEN_OLA_UNBLOAT */
1544 @@ -388,9 +404,11 @@
1545 /* route additions */
1546 olsr_add_kernel_routes(&add_kernel_list);
1549 +#ifndef SVEN_OLA_UNBLOAT
1551 olsr_print_routing_table(&routingtree);
1553 +#endif /* SVEN_OLA_UNBLOAT */
1557 --- a/src/rebuild_packet.c
1558 +++ b/src/rebuild_packet.c
1560 mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m)
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 */
1570 /* Checking if everything is ok */
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));
1581 OLSR_PRINTF(3, "\n");
1583 +#endif /* SVEN_OLA_UNBLOAT */
1586 const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr;
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));
1597 OLSR_PRINTF(3, "\n");
1599 +#endif /* SVEN_OLA_UNBLOAT */
1603 --- a/src/routing_table.c
1604 +++ b/src/routing_table.c
1607 * format a route entry into a buffer
1609 +#ifndef SVEN_OLA_UNBLOAT
1611 olsr_rt_to_string(const struct rt_entry *rt)
1613 @@ -659,11 +660,13 @@
1617 +#endif /* SVEN_OLA_UNBLOAT */
1620 * Print the routingtree to STDOUT
1623 +#ifndef SVEN_OLA_UNBLOAT
1625 olsr_print_routing_table(struct avl_tree *tree)
1629 tree = NULL; /* squelch compiler warnings */
1631 +#endif /* SVEN_OLA_UNBLOAT */
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 *);
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 */
1647 const struct rt_nexthop *olsr_get_nh(const struct rt_entry *);
1653 * Format tc_edge contents into a buffer.
1655 +#ifndef SVEN_OLA_UNBLOAT
1657 olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
1663 +#endif /* SVEN_OLA_UNBLOAT */
1666 * Wrapper for the timer callback.
1669 * Print the topology table to stdout
1671 +#ifndef SVEN_OLA_UNBLOAT
1673 olsr_print_tc_table(void)
1676 } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
1679 +#endif /* SVEN_OLA_UNBLOAT */
1682 * calculate the border IPs of a tc edge set according to the border flags
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
1701 +#ifndef SVEN_OLA_UNBLOAT
1704 *Print the two hop neighbor table to STDOUT.
1710 +#endif /* SVEN_OLA_UNBLOAT */
1714 --- a/src/unix/ifnet.c
1715 +++ b/src/unix/ifnet.c
1718 #define BUFSPACE (127*1024) /* max. input buffer size to request */
1720 +#ifndef SVEN_OLA_UNBLOAT
1723 set_flag(char *ifname, short flag __attribute__ ((unused)))
1729 +#endif /* SVEN_OLA_UNBLOAT */
1732 check_interface_updates(void *foo __attribute__ ((unused)))
1734 @@ -110,11 +114,13 @@
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)
1742 if (olsr_cnf->host_emul) /* XXX: TEMPORARY! */
1744 +#endif /* SVEN_OLA_UNBLOAT */
1746 if (!tmp_if->cnf->autodetect_chg) {
1748 @@ -154,8 +160,10 @@
1749 OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name);
1752 +#ifndef SVEN_OLA_UNBLOAT
1753 if (iface->host_emul)
1755 +#endif /* SVEN_OLA_UNBLOAT */
1757 ifp = iface->interf;
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 @@
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
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 */
1780 ifp->int_addr = *(struct sockaddr_in *)(ARM_NOWARN_ALIGN)&ifr.ifr_addr;
1781 /* deactivated to prevent change of originator IP */
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);
1792 ifp = iface->interf;
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 */
1799 olsr_delete_link_entry_by_ip(&ifp->ip_addr);
1801 @@ -417,10 +433,14 @@
1802 memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
1803 OLSR_PRINTF(1, "No more interfaces...\n");
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 */
1816 @@ -444,13 +464,17 @@
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);
1829 +#ifndef SVEN_OLA_UNBLOAT
1832 * Initializes the special interface used in
1833 * host-client emulation
1838 +#endif /* SVEN_OLA_UNBLOAT */
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);
1846 +#ifndef SVEN_OLA_UNBLOAT
1847 if (iface->host_emul)
1849 +#endif /* SVEN_OLA_UNBLOAT */
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;
1857 +#ifndef SVEN_OLA_UNBLOAT
1858 /* Deactivate IP spoof filter */
1859 deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
1861 /* Disable ICMP redirects */
1862 disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
1863 +#endif /* SVEN_OLA_UNBLOAT */
1869 OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu);
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);
1876 if (olsr_cnf->ip_version == AF_INET) {
1877 @@ -884,10 +915,14 @@
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;
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 */
1892 --- a/src/unix/misc.c
1893 +++ b/src/unix/misc.c
1896 #include "olsr_types.h"
1898 +#ifndef SVEN_OLA_UNBLOAT
1906 +#endif /* SVEN_OLA_UNBLOAT */