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 */
54 static int build_about_body(char *, uint32_t);
56 +#ifndef SVEN_OLA_UNBLOAT
57 static int build_cfgfile_body(char *, uint32_t);
58 +#endif /* SVEN_OLA_UNBLOAT */
60 static int check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr);
63 {"Admin", "admin", build_admin_body, true},
65 {"About", "about", build_about_body, true},
66 +#ifndef SVEN_OLA_UNBLOAT
67 {"FOO", "cfgfile", build_cfgfile_body, false},
68 +#endif /* SVEN_OLA_UNBLOAT */
69 {NULL, NULL, NULL, false}
72 +#ifndef SVEN_OLA_UNBLOAT
73 static const struct static_bin_file_entry static_bin_files[] = {
74 {"favicon.ico", favicon_ico, sizeof(favicon_ico)}
80 +#endif /* SVEN_OLA_UNBLOAT */
82 static const struct static_txt_file_entry static_txt_files[] = {
83 {"httpinfo.css", httpinfo_css},
85 } else if (!strcmp(req_type, "GET")) {
88 +#ifndef SVEN_OLA_UNBLOAT
89 for (i = 0; static_bin_files[i].filename; i++) {
90 if (FILENREQ_MATCH(filename, static_bin_files[i].filename)) {
96 +#endif /* SVEN_OLA_UNBLOAT */
97 while (static_txt_files[i].filename) {
98 if (FILENREQ_MATCH(filename, static_txt_files[i].filename)) {
100 @@ -461,16 +471,22 @@
101 snprintf(&body[size], sizeof(body) - size,
102 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<head>\n"
103 "<meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n"
104 - "<title>olsr.org httpinfo plugin</title>\n" "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
105 + "<title>olsr.org httpinfo plugin</title>\n"
106 +#ifndef SVEN_OLA_UNBLOAT
107 + "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
108 "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
109 +#endif /* SVEN_OLA_UNBLOAT */
110 "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n" "</head>\n"
111 "<body bgcolor=\"#ffffff\" text=\"#000000\">\n"
112 +#ifndef SVEN_OLA_UNBLOAT
113 "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%d\">\n"
114 "<tbody><tr bgcolor=\"#ffffff\">\n" "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n"
115 "<font color=\"black\" face=\"timesroman\" size=\"6\"> <a href=\"http://www.olsr.org/\">olsr.org OLSR daemon</a></font></td>\n"
116 "<td height=\"69\" valign=\"middle\" width=\"20%%\">\n"
117 "<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n" "</tr>\n"
118 - "</tbody>\n" "</table>\n", FRAMEWIDTH);
119 + "</tbody>\n" "</table>\n", FRAMEWIDTH
120 +#endif /* SVEN_OLA_UNBLOAT */
123 size += build_tabs(&body[size], sizeof(body) - size, i);
124 size += build_frame(&body[size], sizeof(body) - size, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb);
126 size += snprintf(&buf[size], bufsize - size, "<tr><td colspan=\"3\">Status: DOWN</td></tr>\n");
130 +#ifndef SVEN_OLA_UNBLOAT
131 if (olsr_cnf->ip_version == AF_INET) {
132 struct ipaddr_str addrbuf, maskbuf, bcastbuf;
135 snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n" "<td></td>\n" "</tr>\n",
136 ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
138 +#endif /* SVEN_OLA_UNBLOAT */
140 snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n" "<td>STATUS: UP</td>\n" "</tr>\n",
141 rifs->int_mtu, rifs->is_wireless ? "Yes" : "No");
142 @@ -1115,6 +1132,7 @@
146 +#ifndef SVEN_OLA_UNBLOAT
148 build_cfgfile_body(char *buf, uint32_t bufsize)
150 @@ -1149,6 +1167,7 @@
154 +#endif /* SVEN_OLA_UNBLOAT */
157 check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr)
158 --- a/lib/nameservice/src/nameservice.c
159 +++ b/lib/nameservice/src/nameservice.c
161 #include "mapwrite.h"
164 +#ifdef SVEN_OLA_UNBLOAT
166 +#define OLSR_PRINTF(...)
167 +#endif /* SVEN_OLA_UNBLOAT */
169 /* config parameters */
170 static char my_hosts_file[MAX_FILE + 1];
171 static char my_sighup_pid_file[MAX_FILE + 1];
173 name->ip = olsr_cnf->main_addr;
177 for (name = my_forwarders; name != NULL; name = name->next) {
178 if (name->ip.v4.s_addr == 0) {
179 OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name);
181 pos += sizeof(struct name);
182 pos += 1 + ((ntohs(from_packet->len) - 1) | 3);
186 OLSR_PRINTF(4, "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n", i,
187 olsr_ip_to_string(&strbuf, originator));
198 +#ifndef SVEN_OLA_UNBLOAT
201 * Interface to OS dependent power management information
203 int apm_read(struct olsr_apm_info *);
206 +#endif /* SVEN_OLA_UNBLOAT */
210 --- a/src/cfgparser/cfgfile_gen.c
211 +++ b/src/cfgparser/cfgfile_gen.c
213 struct olsr_if *in = cnf->interfaces;
214 struct plugin_entry *pe = cnf->plugins;
215 struct plugin_param *pp;
216 +#ifndef SVEN_OLA_UNBLOAT
217 struct ip_prefix_list *ie = cnf->ipc_nets;
218 +#endif /* SVEN_OLA_UNBLOAT */
219 struct olsr_lq_mult *mult;
221 char ipv6_buf[100]; /* buffer for IPv6 inet_htop */
224 fprintf(fd, "Willingness\t%d\n\n", cnf->willingness);
226 +#ifndef SVEN_OLA_UNBLOAT
228 fprintf(fd, "# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
229 fprintf(fd, "IpcConnect {\n");
233 fprintf(fd, "}\n\n");
234 +#endif /* SVEN_OLA_UNBLOAT */
237 fprintf(fd, "# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
239 struct olsr_if *in = cnf->interfaces;
240 struct plugin_entry *pe = cnf->plugins;
241 struct plugin_param *pp;
242 +#ifndef SVEN_OLA_UNBLOAT
243 struct ip_prefix_list *ie = cnf->ipc_nets;
244 +#endif /* SVEN_OLA_UNBLOAT */
245 struct olsr_lq_mult *mult;
250 WRITE_TO_BUF("Willingness\t%d\n\n", cnf->willingness);
252 +#ifndef SVEN_OLA_UNBLOAT
254 WRITE_TO_BUF("# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
255 WRITE_TO_BUF("IpcConnect {\n");
259 WRITE_TO_BUF("}\n\n");
260 +#endif /* SVEN_OLA_UNBLOAT */
263 WRITE_TO_BUF("# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
264 --- a/src/cfgparser/local.mk
265 +++ b/src/cfgparser/local.mk
267 C=$(if $(CFGDIR),$(CFGDIR)/)
269 # add the variables as we may have others already there
270 +ifeq ($(SVEN_OLA_UNBLOAT),1)
271 +SRCS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).c)
272 +OBJS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).o)
274 SRCS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).c)
275 OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o)
277 HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
279 $(C)oscan.c: $(C)oscan.lex $(C)Makefile
280 --- a/src/cfgparser/olsrd_conf.c
281 +++ b/src/cfgparser/olsrd_conf.c
285 if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) {
286 +#ifndef SVEN_OLA_UNBLOAT
287 if ((argc > 2) && (!strcmp(argv[2], "-print"))) {
288 olsrd_print_cnf(cnf);
289 olsrd_write_cnf(cnf, "./out.conf");
291 printf("Use -print to view parsed values\n");
292 +#endif /* SVEN_OLA_UNBLOAT */
293 printf("Configfile parsed OK\n");
295 printf("Failed parsing \"%s\"\n", argv[1]);
297 /* set various stuff */
298 in->configured = false;
300 +#ifndef SVEN_OLA_UNBLOAT
301 in->host_emul = false;
302 +#endif /* SVEN_OLA_UNBLOAT */
308 cnf->debug_level = DEF_DEBUGLVL;
309 cnf->no_fork = false;
310 +#ifndef SVEN_OLA_UNBLOAT
311 cnf->host_emul = false;
312 +#endif /* SVEN_OLA_UNBLOAT */
313 cnf->ip_version = AF_INET;
314 cnf->ipsize = sizeof(struct in_addr);
317 cnf->rtproto = DEF_RTPROTO;
318 cnf->rttable_default = 0;
319 cnf->willingness_auto = DEF_WILL_AUTO;
320 +#ifndef SVEN_OLA_UNBLOAT
321 cnf->ipc_connections = DEF_IPC_CONNECTIONS;
322 +#endif /* SVEN_OLA_UNBLOAT */
323 cnf->fib_metric = DEF_FIB_METRIC;
325 cnf->use_hysteresis = DEF_USE_HYST;
330 +#ifndef SVEN_OLA_UNBLOAT
332 olsrd_print_cnf(struct olsrd_config *cnf)
338 +#endif /* SVEN_OLA_UNBLOAT */
342 --- a/src/cfgparser/oparse.y
343 +++ b/src/cfgparser/oparse.y
346 %token TOK_RTTABLE_DEFAULT
347 %token TOK_WILLINGNESS
358 %token TOK_IP4BROADCAST
362 block: TOK_HNA4 hna4body
364 - | TOK_IPCCON ipcbody
372 -ipcbody: TOK_OPEN ipcstmts TOK_CLOSE
375 -ipcstmts: | ipcstmts ipcstmt
384 ifblock: ifstart ifnicks
391 -imaxipc: TOK_MAXIPC TOK_INTEGER
393 - olsr_cnf->ipc_connections = $2->integer;
398 -ipchost: TOK_HOSTLABEL TOK_IP4_ADDR
400 - union olsr_ip_addr ipaddr;
401 - PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string);
403 - if (inet_aton($2->string, &ipaddr.v4) == 0) {
404 - fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string);
408 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen);
415 -ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR
417 - union olsr_ip_addr ipaddr, netmask;
419 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
421 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
422 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
426 - if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) {
427 - fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string);
431 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask));
438 - | TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER
440 - union olsr_ip_addr ipaddr;
442 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
444 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
445 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
449 - if ($4->integer > olsr_cnf->maxplen) {
450 - fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen);
454 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer);
462 iifweight: TOK_IFWEIGHT TOK_INTEGER
464 int ifcnt = ifs_in_curr_cfg;
465 --- a/src/cfgparser/oscan.lex
466 +++ b/src/cfgparser/oscan.lex
478 return TOK_DEBUGLEVEL;
480 return TOK_WILLINGNESS;
490 return TOK_FIBMETRIC;
495 clock_t olsr_times(void);
497 +#ifndef SVEN_OLA_UNBLOAT
501 *These are moved to a plugin soon
503 int ipc_output(struct olsr *);
506 +#endif /* SVEN_OLA_UNBLOAT */
510 --- a/src/duplicate_set.c
511 +++ b/src/duplicate_set.c
513 return false; /* no duplicate */
516 +#ifndef SVEN_OLA_UNBLOAT
518 olsr_print_duplicate_table(void)
521 } OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
524 +#endif /* SVEN_OLA_UNBLOAT */
534 +#ifndef SVEN_OLA_UNBLOAT
536 olsr_print_hna_set(void)
542 +#endif /* SVEN_OLA_UNBLOAT */
545 *Process incoming HNA message.
546 --- a/src/interfaces.c
547 +++ b/src/interfaces.c
549 OLSR_PRINTF(1, "\n ---- Interface configuration ---- \n\n");
550 /* Run trough all interfaces immedeatly */
551 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
552 +#ifndef SVEN_OLA_UNBLOAT
553 if (!tmp_if->host_emul) {
554 if (!olsr_cnf->host_emul) /* XXX: TEMPORARY! */
555 +#endif /* SVEN_OLA_UNBLOAT */
556 chk_if_up(tmp_if, 1);
557 +#ifndef SVEN_OLA_UNBLOAT
561 +#endif /* SVEN_OLA_UNBLOAT */
564 /* Kick a periodic timer for the network interface update function */
569 +#ifdef SVEN_OLA_UNBLOAT
570 +queue_if(const char *name)
571 +#else /* SVEN_OLA_UNBLOAT */
572 queue_if(const char *name, int hemu)
573 +#endif /* SVEN_OLA_UNBLOAT */
575 struct olsr_if *interf_n = olsr_cnf->interfaces;
578 interf_n->interf = NULL;
579 interf_n->configured = 0;
581 +#ifndef SVEN_OLA_UNBLOAT
582 interf_n->host_emul = hemu ? true : false;
583 +#endif /* SVEN_OLA_UNBLOAT */
585 strscpy(interf_n->name, name, name_size);
586 interf_n->next = olsr_cnf->interfaces;
587 --- a/src/interfaces.h
588 +++ b/src/interfaces.h
591 struct interface *if_ifwithindex(const int if_index);
593 -struct olsr_if *queue_if(const char *, int);
595 +#ifdef SVEN_OLA_UNBLOAT
596 + queue_if(const char *);
597 +#else /* SVEN_OLA_UNBLOAT */
598 + queue_if(const char *, int);
599 +#endif /* SVEN_OLA_UNBLOAT */
601 int add_ifchgf(int (*f) (struct interface *, int));
603 --- a/src/ipc_frontend.c
604 +++ b/src/ipc_frontend.c
609 +#ifndef SVEN_OLA_UNBLOAT
610 #include "ipc_frontend.h"
611 #include "link_set.h"
617 +#endif /* SVEN_OLA_UNBLOAT */
621 --- a/src/ipc_frontend.h
622 +++ b/src/ipc_frontend.h
627 +#ifndef SVEN_OLA_UNBLOAT
629 #include <sys/types.h>
630 #include <netinet/in.h>
632 int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *);
635 +#endif /* SVEN_OLA_UNBLOAT */
645 +#ifndef SVEN_OLA_UNBLOAT
647 olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
653 +#endif /* SVEN_OLA_UNBLOAT */
655 /* see if the ipaddr is in the net. That is equivalent to the fact that the net part
656 * of both are equal. So we must compare the first <prefixlen> bits.
660 return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
663 +#ifndef SVEN_OLA_UNBLOAT
664 const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
665 +#endif /* SVEN_OLA_UNBLOAT */
667 static INLINE const char *
668 sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr)
675 +#ifndef SVEN_OLA_UNBLOAT
677 olsr_print_link_set(void)
680 } OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
683 +#endif /* SVEN_OLA_UNBLOAT */
686 * called for every LQ HELLO message.
687 --- a/src/linux/apm.c
688 +++ b/src/linux/apm.c
690 * Acpi-Power Enlightenment epplet
693 +#ifndef SVEN_OLA_UNBLOAT
698 /* No battery found */
701 +#endif /* SVEN_OLA_UNBLOAT */
705 --- a/src/linux/kernel_routes.c
706 +++ b/src/linux/kernel_routes.c
707 @@ -300,11 +300,13 @@
708 if (rt_ret > 0) rt_ret = 0; /* successful recovery */
709 else rt_ret = -1; /* unrecoverable error */
711 +#ifndef SVEN_OLA_UNBLOAT
712 //send ipc update on success
713 if ( ( cmd != RTM_NEWRULE ) & ( cmd != RTM_DELRULE ) & (flag = RT_ORIG_REQUEST) & (0 <= rt_ret && olsr_cnf->ipc_connections > 0)) {
714 ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd,
715 if_ifwithindex_name(nexthop->iif_index));
717 +#endif /* SVEN_OLA_UNBLOAT */
718 if (rt_ret == -2) olsr_syslog(OLSR_LOG_ERR,"no rtnetlink response! (no system ressources left?, everything may happen now ...)");
723 #endif /* LINUX_POLICY_ROUTING */
725 +#ifndef SVEN_OLA_UNBLOAT
726 OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
727 +#endif /* SVEN_OLA_UNBLOAT */
729 #if !LINUX_POLICY_ROUTING
730 memset(&kernel_route, 0, sizeof(struct rtentry));
732 struct in6_rtmsg kernel_route;
735 +#ifndef SVEN_OLA_UNBLOAT
736 OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
737 +#endif /* SVEN_OLA_UNBLOAT */
739 memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
743 #endif /* LINUX_POLICY_ROUTING */
745 +#ifndef SVEN_OLA_UNBLOAT
746 OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
747 +#endif /* SVEN_OLA_UNBLOAT */
749 #if !LINUX_POLICY_ROUTING
750 memset(&kernel_route, 0, sizeof(struct rtentry));
753 #endif /* LINUX_POLICY_ROUTING */
755 +#ifndef SVEN_OLA_UNBLOAT
756 OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
757 +#endif /* SVEN_OLA_UNBLOAT */
759 #if !LINUX_POLICY_ROUTING
760 memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
761 --- a/src/linux/net.c
762 +++ b/src/linux/net.c
764 #define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
766 /* The original state of the IP forwarding proc entry */
767 +#ifndef SVEN_OLA_UNBLOAT
768 static char orig_fwd_state;
769 static char orig_global_redirect_state;
770 +#endif /* SVEN_OLA_UNBLOAT */
773 *Bind a socket to a device
775 return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1);
778 +#ifndef SVEN_OLA_UNBLOAT
781 *Enable IP forwarding.
782 *Just writing "1" to the /proc/sys/net/ipv4/ip_forward
784 const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
786 if ((proc_fwd = fopen(procfile, "r")) == NULL) {
787 +#ifdef SVEN_OLA_UNBLOAT_OLD
791 if (version == AF_INET)
802 OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
804 if ((proc_fwd = fopen(procfile, "w")) == NULL) {
805 +#ifdef SVEN_OLA_UNBLOAT_OLD
808 fprintf(stderr, "Could not open %s for writing!\n", procfile);
809 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP forwarding is enabeled!\n\n");
814 syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile);
815 @@ -154,11 +166,15 @@
818 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
819 +#ifdef SVEN_OLA_UNBLOAT_OLD
823 "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",
830 orig_global_redirect_state = fgetc(proc_redirect);
834 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
835 +#ifdef SVEN_OLA_UNBLOAT_OLD
838 fprintf(stderr, "Could not open %s for writing!\n", procfile);
839 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
844 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
845 @@ -196,19 +216,27 @@
846 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name);
848 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
849 +#ifdef SVEN_OLA_UNBLOAT_OLD
853 "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",
859 iface->nic_state.redirect = fgetc(proc_redirect);
860 fclose(proc_redirect);
862 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
863 +#ifdef SVEN_OLA_UNBLOAT_OLD
866 fprintf(stderr, "Could not open %s for writing!\n", procfile);
867 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
872 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
873 @@ -234,20 +262,28 @@
874 sprintf(procfile, SPOOF_PROC, if_name);
876 if ((proc_spoof = fopen(procfile, "r")) == NULL) {
877 +#ifdef SVEN_OLA_UNBLOAT_OLD
881 "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",
888 iface->nic_state.spoof = fgetc(proc_spoof);
891 if ((proc_spoof = fopen(procfile, "w")) == NULL) {
892 +#ifdef SVEN_OLA_UNBLOAT_OLD
895 fprintf(stderr, "Could not open %s for writing!\n", procfile);
896 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabeled!\n\n");
901 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
905 if ((proc_fd = fopen(procfile, "w")) == NULL) {
906 +#ifdef SVEN_OLA_UNBLOAT_OLD
909 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
912 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state);
913 fputc(orig_fwd_state, proc_fd);
917 if ((proc_fd = fopen(procfile, "w")) == NULL) {
918 +#ifdef SVEN_OLA_UNBLOAT_OLD
921 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
924 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state);
925 fputc(orig_global_redirect_state, proc_fd);
927 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name);
929 if ((proc_fd = fopen(procfile, "w")) == NULL)
930 +#ifdef SVEN_OLA_UNBLOAT_OLD
933 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
936 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect);
939 /* Generate the procfile name */
940 sprintf(procfile, SPOOF_PROC, ifs->int_name);
941 if ((proc_fd = fopen(procfile, "w")) == NULL)
942 +#ifdef SVEN_OLA_UNBLOAT_OLD
945 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
948 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof);
954 +#endif /* SVEN_OLA_UNBLOAT */
957 *Creates a nonblocking broadcast socket.
958 *@param sa sockaddr struct. Used for bind(2).
959 --- a/src/lq_plugin.c
960 +++ b/src/lq_plugin.c
962 init_lq_handler_tree(void)
964 avl_init(&lq_handler_tree, &avl_strcasecmp);
965 +#ifndef SVEN_OLA_UNBLOAT
966 register_lq_handler(&lq_etx_float_handler, LQ_ALGORITHM_ETX_FLOAT_NAME);
967 register_lq_handler(&lq_etx_fpm_handler, LQ_ALGORITHM_ETX_FPM_NAME);
968 +#endif /* SVEN_OLA_UNBLOAT */
969 register_lq_handler(&lq_etx_ff_handler, LQ_ALGORITHM_ETX_FF_NAME);
970 +#ifndef SVEN_OLA_UNBLOAT
971 if (activate_lq_handler(olsr_cnf->lq_algorithm)) {
972 activate_lq_handler(LQ_ALGORITHM_ETX_FPM_NAME);
974 +#else /* SVEN_OLA_UNBLOAT */
975 + activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME);
976 +#endif /* SVEN_OLA_UNBLOAT */
981 * @return pointer to hello_neighbor
983 struct hello_neighbor *
984 +#ifndef SVEN_OLA_UNBLOAT
985 olsr_malloc_hello_neighbor(const char *id)
986 +#else /* SVEN_OLA_UNBLOAT */
987 +olsr_malloc_hello_neighbor(const char *id __attribute__ ((unused)))
988 +#endif /* SVEN_OLA_UNBLOAT */
990 struct hello_neighbor *h;
993 * @return pointer to tc_mpr_addr
996 +#ifndef SVEN_OLA_UNBLOAT
997 olsr_malloc_tc_mpr_addr(const char *id)
998 +#else /* SVEN_OLA_UNBLOAT */
999 +olsr_malloc_tc_mpr_addr(const char *id __attribute__ ((unused)))
1000 +#endif /* SVEN_OLA_UNBLOAT */
1002 struct tc_mpr_addr *t;
1004 @@ -461,7 +475,11 @@
1005 * @return pointer to lq_hello_neighbor
1007 struct lq_hello_neighbor *
1008 +#ifndef SVEN_OLA_UNBLOAT
1009 olsr_malloc_lq_hello_neighbor(const char *id)
1010 +#else /* SVEN_OLA_UNBLOAT */
1011 +olsr_malloc_lq_hello_neighbor(const char *id __attribute__ ((unused)))
1012 +#endif /* SVEN_OLA_UNBLOAT */
1014 struct lq_hello_neighbor *h;
1016 @@ -483,7 +501,11 @@
1017 * @return pointer to link_entry
1020 +#ifndef SVEN_OLA_UNBLOAT
1021 olsr_malloc_link_entry(const char *id)
1022 +#else /* SVEN_OLA_UNBLOAT */
1023 +olsr_malloc_link_entry(const char *id __attribute__ ((unused)))
1024 +#endif /* SVEN_OLA_UNBLOAT */
1026 struct link_entry *h;
1028 --- a/src/lq_plugin_default_float.c
1029 +++ b/src/lq_plugin_default_float.c
1034 +#ifndef SVEN_OLA_UNBLOAT
1036 #include "link_set.h"
1037 #include "olsr_spf.h"
1042 +#endif /* SVEN_OLA_UNBLOAT */
1046 --- a/src/lq_plugin_default_float.h
1047 +++ b/src/lq_plugin_default_float.h
1052 +#ifndef SVEN_OLA_UNBLOAT
1053 #ifndef LQ_PLUGIN_DEFAULT_H_
1054 #define LQ_PLUGIN_DEFAULT_H_
1057 extern struct lq_handler lq_etx_float_handler;
1059 #endif /*LQ_PLUGIN_DEFAULT_H_ */
1060 +#endif /* SVEN_OLA_UNBLOAT */
1064 --- a/src/lq_plugin_default_fpm.c
1065 +++ b/src/lq_plugin_default_fpm.c
1070 +#ifndef SVEN_OLA_UNBLOAT
1072 #include "link_set.h"
1073 #include "lq_plugin.h"
1075 snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER);
1078 +#endif /* SVEN_OLA_UNBLOAT */
1082 --- a/src/lq_plugin_default_fpm.h
1083 +++ b/src/lq_plugin_default_fpm.h
1088 +#ifndef SVEN_OLA_UNBLOAT
1093 extern struct lq_handler lq_etx_fpm_handler;
1095 #endif /*LQ_ETX_FPM_ */
1096 +#endif /* SVEN_OLA_UNBLOAT */
1102 @@ -256,13 +256,17 @@
1104 * Print configuration
1106 +#ifndef SVEN_OLA_UNBLOAT
1107 if (olsr_cnf->debug_level > 1) {
1108 olsrd_print_cnf(olsr_cnf);
1110 +#endif /* SVEN_OLA_UNBLOAT */
1112 +#ifndef SVEN_OLA_UNBLOAT
1113 /* Disable redirects globally */
1114 disable_redirects_global(olsr_cnf->ip_version);
1116 +#endif /* SVEN_OLA_UNBLOAT */
1119 * socket for ioctl calls
1122 *enable ip forwarding on host
1124 +#ifndef SVEN_OLA_UNBLOAT
1125 enable_ip_forwarding(olsr_cnf->ip_version);
1126 +#endif /* SVEN_OLA_UNBLOAT */
1128 /* Initialize parser */
1131 *Set up willingness/APM
1133 if (olsr_cnf->willingness_auto) {
1134 +#ifndef SVEN_OLA_UNBLOAT
1135 if (apm_init() < 0) {
1136 OLSR_PRINTF(1, "Could not read APM info - setting default willingness(%d)\n", WILL_DEFAULT);
1138 @@ -324,10 +331,13 @@
1139 olsr_cnf->willingness_auto = 0;
1140 olsr_cnf->willingness = WILL_DEFAULT;
1142 +#endif /* SVEN_OLA_UNBLOAT */
1143 olsr_cnf->willingness = olsr_calculate_willingness();
1145 OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int);
1146 +#ifndef SVEN_OLA_UNBLOAT
1148 +#endif /* SVEN_OLA_UNBLOAT */
1151 /* Initialize net */
1152 @@ -355,9 +365,11 @@
1154 /* Initialize the IPC socket */
1156 +#ifndef SVEN_OLA_UNBLOAT
1157 if (olsr_cnf->ipc_connections > 0) {
1160 +#endif /* SVEN_OLA_UNBLOAT */
1161 /* Initialisation of different tables to be used. */
1164 @@ -487,9 +499,11 @@
1165 OLSR_PRINTF(1, "Closing sockets...\n");
1167 /* front-end IPC socket */
1168 +#ifndef SVEN_OLA_UNBLOAT
1169 if (olsr_cnf->ipc_connections > 0) {
1172 +#endif /* SVEN_OLA_UNBLOAT */
1175 for (ifn = ifnet; ifn; ifn = ifn->int_next)
1177 olsr_close_plugins();
1179 /* Reset network settings */
1180 +#ifndef SVEN_OLA_UNBLOAT
1181 restore_settings(olsr_cnf->ip_version);
1182 +#endif /* SVEN_OLA_UNBLOAT */
1185 close(olsr_cnf->ioctl_s);
1186 @@ -540,7 +556,11 @@
1187 "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n"
1188 " [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n"
1189 " [-lql <LQ level>] [-lqw <LQ winsize>] [-lqnt <nat threshold>]\n"
1190 +#ifdef SVEN_OLA_UNBLOAT
1191 + " [-bcast <broadcastaddr>] [-delgw] (Note: no -ipc,-dispin,-dispout)\n"
1192 +#else /* SVEN_OLA_UNBLOAT */
1193 " [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n"
1194 +#endif /* SVEN_OLA_UNBLOAT */
1195 " [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n"
1196 " [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n"
1197 " [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n" " [-lql <LQ level>] [-lqa <LQ aging factor>]\n");
1198 @@ -704,12 +724,20 @@
1199 olsr_exit(__func__, EXIT_FAILURE);
1201 printf("Queuing if %s\n", *argv);
1202 +#ifdef SVEN_OLA_UNBLOAT
1204 +#else /* SVEN_OLA_UNBLOAT */
1205 queue_if(*argv, false);
1206 +#endif /* SVEN_OLA_UNBLOAT */
1208 while ((argc - 1) && (argv[1][0] != '-')) {
1210 printf("Queuing if %s\n", *argv);
1211 +#ifdef SVEN_OLA_UNBLOAT
1213 +#else /* SVEN_OLA_UNBLOAT */
1214 queue_if(*argv, false);
1215 +#endif /* SVEN_OLA_UNBLOAT */
1220 sscanf(*argv, "%f", &cnf->pollrate);
1224 +#ifndef SVEN_OLA_UNBLOAT
1226 * Should we display the contents of packages beeing sent?
1229 cnf->ipc_connections = 1;
1232 +#endif /* SVEN_OLA_UNBLOAT */
1235 * IPv6 multicast addr
1241 +#ifndef SVEN_OLA_UNBLOAT
1249 +#endif /* SVEN_OLA_UNBLOAT */
1252 * Delete possible default GWs
1253 --- a/src/neighbor_table.c
1254 +++ b/src/neighbor_table.c
1259 +#ifndef SVEN_OLA_UNBLOAT
1261 olsr_print_neighbor_table(void)
1267 +#endif /* SVEN_OLA_UNBLOAT */
1271 --- a/src/net_olsr.c
1272 +++ b/src/net_olsr.c
1277 +#ifndef SVEN_OLA_UNBLOAT
1278 #include "print_packet.h"
1279 +#endif /* SVEN_OLA_UNBLOAT */
1280 #include "link_set.h"
1281 #include "lq_packet.h"
1283 @@ -385,8 +387,10 @@
1284 *if the -dispout option was given
1285 *we print the content of the packets
1287 +#ifndef SVEN_OLA_UNBLOAT
1289 print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr);
1290 +#endif /* SVEN_OLA_UNBLOAT */
1292 if (olsr_cnf->ip_version == AF_INET) {
1294 @@ -400,12 +404,16 @@
1296 if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
1298 +#ifndef SVEN_OLA_UNBLOAT
1299 struct ipaddr_str buf;
1300 +#endif /* SVEN_OLA_UNBLOAT */
1301 perror("sendto(v6)");
1302 olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
1303 +#ifndef SVEN_OLA_UNBLOAT
1304 fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index);
1305 fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6));
1306 fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending);
1307 +#endif /* SVEN_OLA_UNBLOAT */
1316 if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) {
1317 +#ifndef SVEN_OLA_UNBLOAT
1319 +#endif /* SVEN_OLA_UNBLOAT */
1320 printf(" *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host);
1324 if (changes_neighborhood || changes_topology || changes_hna) {
1325 olsr_calculate_routing_table();
1328 +#ifndef SVEN_OLA_UNBLOAT
1329 if (olsr_cnf->debug_level > 0) {
1330 if (olsr_cnf->debug_level > 2) {
1331 olsr_print_mid_set();
1333 olsr_print_tc_table();
1336 +#endif /* SVEN_OLA_UNBLOAT */
1338 for (tmp_pc_list = pcf_list; tmp_pc_list != NULL; tmp_pc_list = tmp_pc_list->next) {
1339 tmp_pc_list->function(changes_neighborhood, changes_topology, changes_hna);
1340 @@ -420,12 +423,15 @@
1342 olsr_calculate_willingness(void)
1344 +#ifndef SVEN_OLA_UNBLOAT
1345 struct olsr_apm_info ainfo;
1346 +#endif /* SVEN_OLA_UNBLOAT */
1348 /* If fixed willingness */
1349 if (!olsr_cnf->willingness_auto)
1350 return olsr_cnf->willingness;
1352 +#ifndef SVEN_OLA_UNBLOAT
1353 if (apm_read(&ainfo) < 1)
1354 return WILL_DEFAULT;
1356 @@ -442,8 +448,12 @@
1357 * 26% > juice will: 1
1359 return (ainfo.battery_percentage / 26);
1360 +#else /* SVEN_OLA_UNBLOAT */
1361 + return WILL_DEFAULT;
1362 +#endif /* SVEN_OLA_UNBLOAT */
1365 +#ifndef SVEN_OLA_UNBLOAT
1367 olsr_msgtype_to_string(uint8_t msgtype)
1370 snprintf(type, sizeof(type), "UNKNOWN(%d)", status);
1373 +#endif /* SVEN_OLA_UNBLOAT */
1376 *Termination function to be called whenever a error occures
1379 * @return a void pointer to the memory allocated
1381 +#ifndef SVEN_OLA_UNBLOAT
1383 olsr_malloc(size_t size, const char *id)
1389 +#endif /* SVEN_OLA_UNBLOAT */
1392 *Wrapper for printf that prints to a specific
1397 uint8_t olsr_calculate_willingness(void);
1399 +#ifndef SVEN_OLA_UNBLOAT
1400 const char *olsr_msgtype_to_string(uint8_t);
1402 const char *olsr_link_to_string(uint8_t);
1404 const char *olsr_status_to_string(uint8_t);
1405 +#endif /* SVEN_OLA_UNBLOAT */
1407 void olsr_exit(const char *, int);
1409 +#ifdef SVEN_OLA_UNBLOAT
1410 +#define olsr_malloc(size, msg) calloc(1, size)
1411 +#else /* SVEN_OLA_UNBLOAT */
1412 void *olsr_malloc(size_t, const char *);
1413 +#endif /* SVEN_OLA_UNBLOAT */
1415 int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
1417 --- a/src/olsr_cfg.h
1418 +++ b/src/olsr_cfg.h
1419 @@ -149,8 +149,10 @@
1423 +#ifndef SVEN_OLA_UNBLOAT
1425 union olsr_ip_addr hemu_ip;
1426 +#endif /* SVEN_OLA_UNBLOAT */
1427 struct interface *interf;
1428 struct if_config_options *cnf;
1429 struct olsr_if *next;
1434 +#ifndef SVEN_OLA_UNBLOAT
1436 +#endif /* SVEN_OLA_UNBLOAT */
1438 bool allow_no_interfaces;
1440 @@ -202,13 +206,17 @@
1441 uint8_t rttable_default;
1442 uint8_t willingness;
1443 bool willingness_auto;
1444 +#ifndef SVEN_OLA_UNBLOAT
1445 int ipc_connections;
1446 +#endif /* SVEN_OLA_UNBLOAT */
1447 bool use_hysteresis;
1448 olsr_fib_metric_options fib_metric;
1449 struct hyst_param hysteresis_param;
1450 struct plugin_entry *plugins;
1451 struct ip_prefix_list *hna_entries;
1452 +#ifndef SVEN_OLA_UNBLOAT
1453 struct ip_prefix_list *ipc_nets;
1454 +#endif /* SVEN_OLA_UNBLOAT */
1455 struct olsr_if *interfaces;
1457 float nic_chgs_pollrate;
1460 void olsrd_free_cnf(struct olsrd_config *);
1462 +#ifndef SVEN_OLA_UNBLOAT
1463 void olsrd_print_cnf(struct olsrd_config *);
1464 +#endif /* SVEN_OLA_UNBLOAT */
1466 int olsrd_write_cnf(struct olsrd_config *, const char *);
1471 #include "rebuild_packet.h"
1474 +#ifndef SVEN_OLA_UNBLOAT
1475 #include "print_packet.h"
1476 +#endif /* SVEN_OLA_UNBLOAT */
1477 #include "net_olsr.h"
1480 @@ -281,8 +283,10 @@
1481 //printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr));
1483 /* Display packet */
1484 +#ifndef SVEN_OLA_UNBLOAT
1486 print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr);
1487 +#endif /* SVEN_OLA_UNBLOAT */
1489 if (olsr_cnf->ip_version == AF_INET)
1490 msgsize = ntohs(m->v4.olsr_msgsize);
1491 --- a/src/print_packet.c
1492 +++ b/src/print_packet.c
1497 +#ifndef SVEN_OLA_UNBLOAT
1498 #include "print_packet.h"
1500 #include "mantissa.h"
1502 remsize -= olsr_cnf->ipsize;
1505 +#endif /* SVEN_OLA_UNBLOAT */
1509 --- a/src/process_routes.c
1510 +++ b/src/process_routes.c
1513 olsr_delete_kernel_route(struct rt_entry *rt)
1515 +#ifndef SVEN_OLA_UNBLOAT
1516 if (!olsr_cnf->host_emul) {
1517 int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1519 @@ -170,6 +171,12 @@
1520 olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
1523 +#else /* SVEN_OLA_UNBLOAT */
1524 + int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1526 + olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno));
1528 +#endif /* SVEN_OLA_UNBLOAT */
1533 olsr_add_kernel_route(struct rt_entry *rt)
1536 +#ifndef SVEN_OLA_UNBLOAT
1537 if (!olsr_cnf->host_emul) {
1538 int16_t error = (olsr_cnf->ip_version == AF_INET) ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1540 @@ -199,6 +207,14 @@
1541 rt->rt_metric = rt->rt_best->rtp_metric;
1544 +#else /* SVEN_OLA_UNBLOAT */
1545 + int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1547 + olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno));
1549 + rt->rt_nexthop = rt->rt_best->rtp_nexthop;
1551 +#endif /* SVEN_OLA_UNBLOAT */
1556 /* route additions */
1557 olsr_add_kernel_routes(&add_kernel_list);
1561 olsr_print_routing_table(&routingtree);
1564 --- a/src/rebuild_packet.c
1565 +++ b/src/rebuild_packet.c
1567 mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m)
1570 +#ifndef SVEN_OLA_UNBLOAT
1571 struct mid_alias *alias, *alias_tmp;
1572 +#else /* SVEN_OLA_UNBLOAT */
1573 + struct mid_alias *alias;
1574 +#endif /* SVEN_OLA_UNBLOAT */
1577 /* Checking if everything is ok */
1582 +#ifndef SVEN_OLA_UNBLOAT
1583 if (olsr_cnf->debug_level > 1) {
1584 struct ipaddr_str buf;
1585 OLSR_PRINTF(3, "Alias list for %s: ", olsr_ip_to_string(&buf, &mmsg->mid_origaddr));
1588 OLSR_PRINTF(3, "\n");
1590 +#endif /* SVEN_OLA_UNBLOAT */
1593 const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr;
1598 +#ifndef SVEN_OLA_UNBLOAT
1599 if (olsr_cnf->debug_level > 1) {
1600 struct ipaddr_str buf;
1601 OLSR_PRINTF(3, "Alias list for %s", ip6_to_string(&buf, &mmsg->mid_origaddr.v6));
1604 OLSR_PRINTF(3, "\n");
1606 +#endif /* SVEN_OLA_UNBLOAT */
1610 --- a/src/routing_table.c
1611 +++ b/src/routing_table.c
1614 * format a route entry into a buffer
1616 +#ifndef SVEN_OLA_UNBLOAT
1618 olsr_rt_to_string(const struct rt_entry *rt)
1620 @@ -659,11 +660,13 @@
1624 +#endif /* SVEN_OLA_UNBLOAT */
1627 * Print the routingtree to STDOUT
1630 +#ifndef SVEN_OLA_UNBLOAT
1632 olsr_print_routing_table(struct avl_tree *tree)
1636 tree = NULL; /* squelch compiler warnings */
1638 +#endif /* SVEN_OLA_UNBLOAT */
1642 --- a/src/routing_table.h
1643 +++ b/src/routing_table.h
1644 @@ -210,9 +210,11 @@
1645 bool olsr_cmp_rt(const struct rt_entry *, const struct rt_entry *);
1646 uint8_t olsr_fib_metric(const struct rt_metric *);
1648 +#ifndef SVEN_OLA_UNBLOAT
1649 char *olsr_rt_to_string(const struct rt_entry *);
1650 char *olsr_rtp_to_string(const struct rt_path *);
1651 void olsr_print_routing_table(struct avl_tree *);
1652 +#endif /* SVEN_OLA_UNBLOAT */
1654 const struct rt_nexthop *olsr_get_nh(const struct rt_entry *);
1660 * Format tc_edge contents into a buffer.
1662 +#ifndef SVEN_OLA_UNBLOAT
1664 olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
1670 +#endif /* SVEN_OLA_UNBLOAT */
1673 * Wrapper for the timer callback.
1676 * Print the topology table to stdout
1678 +#ifndef SVEN_OLA_UNBLOAT
1680 olsr_print_tc_table(void)
1683 } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
1686 +#endif /* SVEN_OLA_UNBLOAT */
1689 * calculate the border IPs of a tc edge set according to the border flags
1694 /* tc_edge_entry manipulation */
1695 bool olsr_delete_outdated_tc_edges(struct tc_entry *);
1696 +#ifndef SVEN_OLA_UNBLOAT
1697 char *olsr_tc_edge_to_string(struct tc_edge_entry *);
1698 +#endif /* SVEN_OLA_UNBLOAT */
1699 struct tc_edge_entry *olsr_lookup_tc_edge(struct tc_entry *, union olsr_ip_addr *);
1700 struct tc_edge_entry *olsr_add_tc_edge_entry(struct tc_entry *, union olsr_ip_addr *, uint16_t);
1701 void olsr_delete_tc_entry(struct tc_entry *);
1702 --- a/src/two_hop_neighbor_table.c
1703 +++ b/src/two_hop_neighbor_table.c
1708 +#ifndef SVEN_OLA_UNBLOAT
1711 *Print the two hop neighbor table to STDOUT.
1717 +#endif /* SVEN_OLA_UNBLOAT */
1721 --- a/src/unix/ifnet.c
1722 +++ b/src/unix/ifnet.c
1725 #define BUFSPACE (127*1024) /* max. input buffer size to request */
1727 +#ifndef SVEN_OLA_UNBLOAT
1730 set_flag(char *ifname, short flag __attribute__ ((unused)))
1736 +#endif /* SVEN_OLA_UNBLOAT */
1739 check_interface_updates(void *foo __attribute__ ((unused)))
1741 @@ -110,11 +114,13 @@
1744 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
1745 +#ifndef SVEN_OLA_UNBLOAT
1746 if (tmp_if->host_emul)
1749 if (olsr_cnf->host_emul) /* XXX: TEMPORARY! */
1751 +#endif /* SVEN_OLA_UNBLOAT */
1753 if (!tmp_if->cnf->autodetect_chg) {
1755 @@ -154,8 +160,10 @@
1756 OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name);
1759 +#ifndef SVEN_OLA_UNBLOAT
1760 if (iface->host_emul)
1762 +#endif /* SVEN_OLA_UNBLOAT */
1764 ifp = iface->interf;
1770 +#ifndef SVEN_OLA_UNBLOAT
1771 struct ipaddr_str buf;
1772 +#endif /* SVEN_OLA_UNBLOAT */
1773 /* Check interface address (IPv4) */
1774 if (ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) {
1775 OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n");
1776 @@ -294,17 +304,21 @@
1778 (&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr,
1779 olsr_cnf->ipsize) != 0) {
1780 +#ifndef SVEN_OLA_UNBLOAT
1782 OLSR_PRINTF(1, "IPv4 address changed for %s\n", ifr.ifr_name);
1783 OLSR_PRINTF(1, "\tOld:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr));
1784 OLSR_PRINTF(1, "\tNew:%s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
1785 +#endif /* SVEN_OLA_UNBLOAT */
1787 ifp->int_addr = *(struct sockaddr_in *)&ifr.ifr_addr;
1788 /* deactivated to prevent change of originator IP */
1790 if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) {
1791 OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
1792 +#ifndef SVEN_OLA_UNBLOAT
1793 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
1794 +#endif /* SVEN_OLA_UNBLOAT */
1795 memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize);
1801 OLSR_PRINTF(1, "Removing interface %s\n", iface->name);
1802 +#ifndef SVEN_OLA_UNBLOAT
1803 olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
1804 +#endif /* SVEN_OLA_UNBLOAT */
1806 olsr_delete_link_entry_by_ip(&ifp->ip_addr);
1808 @@ -398,10 +414,14 @@
1809 memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
1810 OLSR_PRINTF(1, "No more interfaces...\n");
1812 +#if !defined(SVEN_OLA_UNBLOAT)
1813 struct ipaddr_str buf;
1814 +#endif /* SVEN_OLA_UNBLOAT */
1815 olsr_cnf->main_addr = ifnet->ip_addr;
1816 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
1817 +#ifndef SVEN_OLA_UNBLOAT
1818 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
1819 +#endif /* SVEN_OLA_UNBLOAT */
1825 if ((ifnet == NULL) && (!olsr_cnf->allow_no_interfaces)) {
1826 OLSR_PRINTF(1, "No more active interfaces - exiting.\n");
1827 +#ifndef SVEN_OLA_UNBLOAT
1828 olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n");
1829 +#endif /* SVEN_OLA_UNBLOAT */
1830 olsr_cnf->exit_value = EXIT_FAILURE;
1831 kill(getpid(), SIGINT);
1837 +#ifndef SVEN_OLA_UNBLOAT
1840 * Initializes the special interface used in
1841 * host-client emulation
1846 +#endif /* SVEN_OLA_UNBLOAT */
1848 static char basenamestr[32];
1849 static const char *if_basename(const char *name);
1850 @@ -620,8 +645,10 @@
1851 int tos_bits = IPTOS_TOS(olsr_cnf->tos);
1854 +#ifndef SVEN_OLA_UNBLOAT
1855 if (iface->host_emul)
1857 +#endif /* SVEN_OLA_UNBLOAT */
1859 memset(&ifr, 0, sizeof(struct ifreq));
1860 memset(&ifs, 0, sizeof(struct interface));
1861 @@ -728,11 +755,13 @@
1862 ifs.int_broadaddr = *(struct sockaddr_in *)&ifr.ifr_broadaddr;
1865 +#ifndef SVEN_OLA_UNBLOAT
1866 /* Deactivate IP spoof filter */
1867 deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
1869 /* Disable ICMP redirects */
1870 disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
1871 +#endif /* SVEN_OLA_UNBLOAT */
1877 OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu);
1879 +#ifndef SVEN_OLA_UNBLOAT
1880 olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name);
1881 +#endif /* SVEN_OLA_UNBLOAT */
1882 OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index);
1884 if (olsr_cnf->ip_version == AF_INET) {
1885 @@ -867,10 +898,14 @@
1887 memset(&null_addr, 0, olsr_cnf->ipsize);
1888 if (ipequal(&null_addr, &olsr_cnf->main_addr)) {
1889 +#ifndef SVEN_OLA_UNBLOAT
1890 struct ipaddr_str buf;
1892 olsr_cnf->main_addr = ifp->ip_addr;
1893 +#ifndef SVEN_OLA_UNBLOAT
1894 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
1895 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
1896 +#endif /* SVEN_OLA_UNBLOAT */
1900 --- a/src/unix/misc.c
1901 +++ b/src/unix/misc.c
1904 #include "olsr_types.h"
1906 +#ifndef SVEN_OLA_UNBLOAT
1914 +#endif /* SVEN_OLA_UNBLOAT */