1 diff -ur olsrd-0-5-6-fc691af9a18d.orig/Makefile.inc olsrd-0-5-6-fc691af9a18d/Makefile.inc
2 --- olsrd-0-5-6-fc691af9a18d.orig/Makefile.inc 2009-03-14 22:39:09.000000000 +0000
3 +++ olsrd-0-5-6-fc691af9a18d/Makefile.inc 2009-03-15 16:32:39.000000000 +0000
5 $(warning Use CPPFLAGS instead of DEFINES for -D)
8 +ifeq ($(SVEN_OLA_UNBLOAT),1)
9 +CPPFLAGS += -DSVEN_OLA_UNBLOAT -DNODEBUG
15 diff -ur olsrd-0-5-6-fc691af9a18d.orig/lib/bmf/src/NetworkInterfaces.c olsrd-0-5-6-fc691af9a18d/lib/bmf/src/NetworkInterfaces.c
16 --- olsrd-0-5-6-fc691af9a18d.orig/lib/bmf/src/NetworkInterfaces.c 2009-03-14 22:39:09.000000000 +0000
17 +++ olsrd-0-5-6-fc691af9a18d/lib/bmf/src/NetworkInterfaces.c 2009-03-15 16:32:39.000000000 +0000
19 OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: no link found\n", PLUGIN_NAME_SHORT,
20 olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
23 struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr);
26 OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %5.2f\n",
27 PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), bestIntf->int_name,
28 diff -ur olsrd-0-5-6-fc691af9a18d.orig/lib/httpinfo/Makefile olsrd-0-5-6-fc691af9a18d/lib/httpinfo/Makefile
29 --- olsrd-0-5-6-fc691af9a18d.orig/lib/httpinfo/Makefile 2009-03-14 22:39:09.000000000 +0000
30 +++ olsrd-0-5-6-fc691af9a18d/lib/httpinfo/Makefile 2009-03-15 16:32:39.000000000 +0000
32 CPPFLAGS += -DADMIN_INTERFACE
35 +ifdef SVEN_OLA_UNBLOAT
36 + CFLAGS += -DSVEN_OLA
38 OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o
41 default_target: $(PLUGIN_FULLNAME)
43 diff -ur olsrd-0-5-6-fc691af9a18d.orig/lib/httpinfo/src/olsrd_httpinfo.c olsrd-0-5-6-fc691af9a18d/lib/httpinfo/src/olsrd_httpinfo.c
44 --- olsrd-0-5-6-fc691af9a18d.orig/lib/httpinfo/src/olsrd_httpinfo.c 2009-03-14 22:39:09.000000000 +0000
45 +++ olsrd-0-5-6-fc691af9a18d/lib/httpinfo/src/olsrd_httpinfo.c 2009-03-15 16:59:39.000000000 +0000
48 #include "olsrd_httpinfo.h"
49 #include "admin_interface.h"
50 +#ifndef SVEN_OLA_UNBLOAT
52 +#endif /* SVEN_OLA_UNBLOAT */
58 static int build_about_body(char *, uint32_t);
60 +#ifndef SVEN_OLA_UNBLOAT
61 static int build_cfgfile_body(char *, uint32_t);
62 +#endif /* SVEN_OLA_UNBLOAT */
64 static int check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr);
67 {"Admin", "admin", build_admin_body, true},
69 {"About", "about", build_about_body, true},
70 +#ifndef SVEN_OLA_UNBLOAT
71 {"FOO", "cfgfile", build_cfgfile_body, false},
72 +#endif /* SVEN_OLA_UNBLOAT */
73 {NULL, NULL, NULL, false}
76 +#ifndef SVEN_OLA_UNBLOAT
77 static const struct static_bin_file_entry static_bin_files[] = {
78 {"favicon.ico", favicon_ico, sizeof(favicon_ico)}
84 +#endif /* SVEN_OLA_UNBLOAT */
86 static const struct static_txt_file_entry static_txt_files[] = {
87 {"httpinfo.css", httpinfo_css},
89 } else if (!strcmp(req_type, "GET")) {
92 +#ifndef SVEN_OLA_UNBLOAT
93 for (i = 0; static_bin_files[i].filename; i++) {
94 if (FILENREQ_MATCH(filename, static_bin_files[i].filename)) {
100 +#endif /* SVEN_OLA_UNBLOAT */
101 while (static_txt_files[i].filename) {
102 if (FILENREQ_MATCH(filename, static_txt_files[i].filename)) {
104 @@ -461,16 +471,22 @@
105 snprintf(&body[size], sizeof(body) - size,
106 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<head>\n"
107 "<meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n"
108 - "<title>olsr.org httpinfo plugin</title>\n" "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
109 + "<title>olsr.org httpinfo plugin</title>\n"
110 +#ifndef SVEN_OLA_UNBLOAT
111 + "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
112 "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
113 +#endif /* SVEN_OLA_UNBLOAT */
114 "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n" "</head>\n"
115 "<body bgcolor=\"#ffffff\" text=\"#000000\">\n"
116 +#ifndef SVEN_OLA_UNBLOAT
117 "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%d\">\n"
118 "<tbody><tr bgcolor=\"#ffffff\">\n" "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n"
119 "<font color=\"black\" face=\"timesroman\" size=\"6\"> <a href=\"http://www.olsr.org/\">olsr.org OLSR daemon</a></font></td>\n"
120 "<td height=\"69\" valign=\"middle\" width=\"20%%\">\n"
121 "<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n" "</tr>\n"
122 - "</tbody>\n" "</table>\n", FRAMEWIDTH);
123 + "</tbody>\n" "</table>\n", FRAMEWIDTH
124 +#endif /* SVEN_OLA_UNBLOAT */
127 size += build_tabs(&body[size], sizeof(body) - size, i);
128 size += build_frame(&body[size], sizeof(body) - size, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb);
130 size += snprintf(&buf[size], bufsize - size, "<tr><td colspan=\"3\">Status: DOWN</td></tr>\n");
134 +#ifndef SVEN_OLA_UNBLOAT
135 if (olsr_cnf->ip_version == AF_INET) {
136 struct ipaddr_str addrbuf, maskbuf, bcastbuf;
139 snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n" "<td></td>\n" "</tr>\n",
140 ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
142 +#endif /* SVEN_OLA_UNBLOAT */
144 snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n" "<td>STATUS: UP</td>\n" "</tr>\n",
145 rifs->int_mtu, rifs->is_wireless ? "Yes" : "No");
146 @@ -1115,6 +1132,7 @@
150 +#ifndef SVEN_OLA_UNBLOAT
152 build_cfgfile_body(char *buf, uint32_t bufsize)
154 @@ -1149,6 +1167,7 @@
158 +#endif /* SVEN_OLA_UNBLOAT */
161 check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr)
162 diff -ur olsrd-0-5-6-fc691af9a18d.orig/lib/nameservice/src/nameservice.c olsrd-0-5-6-fc691af9a18d/lib/nameservice/src/nameservice.c
163 --- olsrd-0-5-6-fc691af9a18d.orig/lib/nameservice/src/nameservice.c 2009-03-14 22:39:09.000000000 +0000
164 +++ olsrd-0-5-6-fc691af9a18d/lib/nameservice/src/nameservice.c 2009-03-15 17:04:54.000000000 +0000
166 #include "mapwrite.h"
169 +#ifdef SVEN_OLA_UNBLOAT
171 +#define OLSR_PRINTF(...)
172 +#endif /* SVEN_OLA_UNBLOAT */
174 /* config parameters */
175 static char my_hosts_file[MAX_FILE + 1];
176 static char my_sighup_pid_file[MAX_FILE + 1];
178 static char my_suffix[MAX_SUFFIX];
179 static int my_interval = EMISSION_INTERVAL;
180 static double my_timeout = NAME_VALID_TIME;
181 +#ifndef SVEN_OLA_UNBLOAT
182 static char my_resolv_file[MAX_FILE + 1];
183 +#endif /* SVEN_OLA_UNBLOAT */
184 static char my_services_file[MAX_FILE + 1];
185 static char my_macs_file[MAX_FILE + 1];
186 +#ifndef SVEN_OLA_UNBLOAT
187 static char my_name_change_script[MAX_FILE + 1];
188 static char my_services_change_script[MAX_FILE + 1];
189 static char my_macs_change_script[MAX_FILE + 1];
191 static char latlon_in_file[MAX_FILE + 1];
192 static char my_latlon_file[MAX_FILE + 1];
193 float my_lat = 0.0, my_lon = 0.0;
195 static struct name_entry *my_macs = NULL;
196 static bool mac_table_changed = true;
198 +#ifndef SVEN_OLA_UNBLOAT
199 static struct list_node forwarder_list[HASHSIZE];
200 static struct name_entry *my_forwarders = NULL;
201 static bool forwarder_table_changed = true;
202 +#endif /* SVEN_OLA_UNBLOAT */
204 struct list_node latlon_list[HASHSIZE];
205 static bool latlon_table_changed = true;
207 GetWindowsDirectory(my_hosts_file, MAX_FILE - 12);
208 GetWindowsDirectory(my_services_file, MAX_FILE - 12);
209 GetWindowsDirectory(my_macs_file, MAX_FILE - 12);
210 +#ifndef SVEN_OLA_UNBLOAT
211 GetWindowsDirectory(my_resolv_file, MAX_FILE - 12);
212 +#endif /* SVEN_OLA_UNBLOAT */
214 len = strlen(my_hosts_file);
215 if (my_hosts_file[len - 1] != '\\')
216 @@ -155,15 +168,19 @@
217 strscat(my_macs_file, "\\", sizeof(my_macs_file));
218 strscat(my_macs_file, "macs_olsr", sizeof(my_macs_file));
220 +#ifndef SVEN_OLA_UNBLOAT
221 len = strlen(my_resolv_file);
222 if (my_resolv_file[len - 1] != '\\')
223 strscat(my_resolv_file, "\\", sizeof(my_resolv_file));
224 strscat(my_resolv_file, "resolvconf_olsr", sizeof(my_resolv_file));
225 +#endif /* SVEN_OLA_UNBLOAT */
227 strscpy(my_hosts_file, "/var/run/hosts_olsr", sizeof(my_hosts_file));
228 strscpy(my_services_file, "/var/run/services_olsr", sizeof(my_services_file));
229 strscpy(my_macs_file, "/var/run/macs_olsr", sizeof(my_macs_file));
230 +#ifndef SVEN_OLA_UNBLOAT
231 strscpy(my_resolv_file, "/var/run/resolvconf_olsr", sizeof(my_resolv_file));
232 +#endif /* SVEN_OLA_UNBLOAT */
233 *my_sighup_pid_file = 0;
236 @@ -171,14 +188,18 @@
237 my_add_hosts[0] = '\0';
238 my_latlon_file[0] = '\0';
239 latlon_in_file[0] = '\0';
240 +#ifndef SVEN_OLA_UNBLOAT
241 my_name_change_script[0] = '\0';
242 my_services_change_script[0] = '\0';
243 my_macs_change_script[0] = '\0';
244 +#endif /* SVEN_OLA_UNBLOAT */
246 /* init the lists heads */
247 for (i = 0; i < HASHSIZE; i++) {
248 list_head_init(&name_list[i]);
249 +#ifndef SVEN_OLA_UNBLOAT
250 list_head_init(&forwarder_list[i]);
251 +#endif /* SVEN_OLA_UNBLOAT */
252 list_head_init(&service_list[i]);
253 list_head_init(&mac_list[i]);
254 list_head_init(&latlon_list[i]);
259 +#ifndef SVEN_OLA_UNBLOAT
261 set_nameservice_server(const char *value, void *data, set_plugin_parameter_addon addon)
267 +#endif /* SVEN_OLA_UNBLOAT */
270 set_nameservice_name(const char *value, void *data, set_plugin_parameter_addon addon)
271 @@ -253,10 +276,12 @@
272 { .name = "timeout", .set_plugin_parameter = &set_nameservice_float, .data = &my_timeout },
273 { .name = "sighup-pid-file", .set_plugin_parameter = &set_plugin_string, .data = &my_sighup_pid_file, .addon = {sizeof(my_sighup_pid_file)} },
274 { .name = "hosts-file", .set_plugin_parameter = &set_plugin_string, .data = &my_hosts_file, .addon = {sizeof(my_hosts_file)} },
275 +#ifndef SVEN_OLA_UNBLOAT
276 { .name = "name-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_name_change_script, .addon = {sizeof(my_name_change_script)} },
277 { .name = "services-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_services_change_script, .addon = {sizeof(my_services_change_script)} },
278 { .name = "macs-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_macs_change_script, .addon = {sizeof(my_macs_change_script)} },
279 { .name = "resolv-file", .set_plugin_parameter = &set_plugin_string, .data = &my_resolv_file, .addon = {sizeof(my_resolv_file)} },
280 +#endif /* SVEN_OLA_UNBLOAT */
281 { .name = "suffix", .set_plugin_parameter = &set_plugin_string, .data = &my_suffix, .addon = {sizeof(my_suffix)} },
282 { .name = "add-hosts", .set_plugin_parameter = &set_plugin_string, .data = &my_add_hosts, .addon = {sizeof(my_add_hosts)} },
283 { .name = "services-file", .set_plugin_parameter = &set_plugin_string, .data = &my_services_file, .addon = {sizeof(my_services_file)} },
285 { .name = "lon", .set_plugin_parameter = &set_nameservice_float, .data = &my_lon },
286 { .name = "latlon-file", .set_plugin_parameter = &set_plugin_string, .data = &my_latlon_file, .addon = {sizeof(my_latlon_file)} },
287 { .name = "latlon-infile", .set_plugin_parameter = &set_plugin_string, .data = &latlon_in_file, .addon = {sizeof(latlon_in_file)} },
288 +#ifndef SVEN_OLA_UNBLOAT
289 { .name = "dns-server", .set_plugin_parameter = &set_nameservice_server, .data = &my_forwarders, .addon = {NAME_FORWARDER} },
290 +#endif /* SVEN_OLA_UNBLOAT */
291 { .name = "name", .set_plugin_parameter = &set_nameservice_name, .data = &my_names, .addon = {NAME_HOST} },
292 { .name = "service", .set_plugin_parameter = &set_nameservice_name, .data = &my_services, .addon = {NAME_SERVICE} },
293 { .name = "mac", .set_plugin_parameter = &set_nameservice_name, .data = &my_macs, .addon = {NAME_MACADDR} },
294 @@ -381,16 +408,20 @@
295 name->ip = olsr_cnf->main_addr;
298 +#ifndef SVEN_OLA_UNBLOAT
299 for (name = my_forwarders; name != NULL; name = name->next) {
300 if (name->ip.v4.s_addr == 0) {
301 OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name);
302 name->ip = olsr_cnf->main_addr;
305 +#endif /* SVEN_OLA_UNBLOAT */
307 //check if entries I want to announce myself are valid and allowed
308 my_names = remove_nonvalid_names_from_list(my_names, NAME_HOST);
309 +#ifndef SVEN_OLA_UNBLOAT
310 my_forwarders = remove_nonvalid_names_from_list(my_forwarders, NAME_FORWARDER);
311 +#endif /* SVEN_OLA_UNBLOAT */
312 my_services = remove_nonvalid_names_from_list(my_services, NAME_SERVICE);
313 my_macs = remove_nonvalid_names_from_list(my_macs, NAME_MACADDR);
315 @@ -463,12 +494,16 @@
316 free_name_entry_list(&my_names);
317 free_name_entry_list(&my_services);
318 free_name_entry_list(&my_macs);
319 +#ifndef SVEN_OLA_UNBLOAT
320 free_name_entry_list(&my_forwarders);
321 +#endif /* SVEN_OLA_UNBLOAT */
323 free_all_list_entries(name_list);
324 free_all_list_entries(service_list);
325 free_all_list_entries(mac_list);
326 +#ifndef SVEN_OLA_UNBLOAT
327 free_all_list_entries(forwarder_list);
328 +#endif /* SVEN_OLA_UNBLOAT */
329 free_all_list_entries(latlon_list);
331 olsr_stop_timer(write_file_timer);
334 write_file_timer = NULL;
336 +#ifndef SVEN_OLA_UNBLOAT
337 write_resolv_file(); /* if forwarder_table_changed */
338 +#endif /* SVEN_OLA_UNBLOAT */
339 write_hosts_file(); /* if name_table_changed */
340 write_services_file(false); /* if service_table_changed */
341 write_services_file(true); /* if mac_table_changed */
342 @@ -693,11 +730,13 @@
343 pos = create_packet((struct name *)pos, my_name);
346 +#ifndef SVEN_OLA_UNBLOAT
348 for (my_name = my_forwarders; my_name != NULL; my_name = my_name->next) {
349 pos = create_packet((struct name *)pos, my_name);
352 +#endif /* SVEN_OLA_UNBLOAT */
354 for (my_name = my_services; my_name != NULL; my_name = my_name->next) {
355 pos = create_packet((struct name *)pos, my_name);
358 insert_new_name_in_list(originator, name_list, from_packet, &name_table_changed, vtime);
360 +#ifndef SVEN_OLA_UNBLOAT
362 insert_new_name_in_list(originator, forwarder_list, from_packet, &forwarder_table_changed, vtime);
364 +#endif /* SVEN_OLA_UNBLOAT */
366 insert_new_name_in_list(originator, service_list, from_packet, &service_table_changed, vtime);
369 pos += sizeof(struct name);
370 pos += 1 + ((ntohs(from_packet->len) - 1) | 3);
374 OLSR_PRINTF(4, "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n", i,
375 olsr_ip_to_string(&strbuf, originator));
380 @@ -1120,6 +1163,7 @@
382 name_table_changed = false;
384 +#ifndef SVEN_OLA_UNBLOAT
385 // Executes my_name_change_script after writing the hosts file
386 if (my_name_change_script[0] != '\0') {
387 if (system(my_name_change_script) != -1) {
388 @@ -1128,6 +1172,7 @@
389 OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on hosts change\n", my_name_change_script);
392 +#endif /* SVEN_OLA_UNBLOAT */
396 @@ -1193,6 +1238,7 @@
400 +#ifndef SVEN_OLA_UNBLOAT
401 // Executes my_macs_change_script after writing the macs file
402 if (my_macs_change_script[0] != '\0') {
403 if (system(my_macs_change_script) != -1) {
404 @@ -1201,9 +1247,11 @@
405 OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on mac change\n", my_macs_change_script);
408 +#endif /* SVEN_OLA_UNBLOAT */
409 mac_table_changed = false;
412 +#ifndef SVEN_OLA_UNBLOAT
413 // Executes my_services_change_script after writing the services file
414 if (my_services_change_script[0] != '\0') {
415 if (system(my_services_change_script) != -1) {
416 @@ -1212,6 +1260,7 @@
417 OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on service change\n", my_services_change_script);
420 +#endif /* SVEN_OLA_UNBLOAT */
421 service_table_changed = false;
424 @@ -1222,6 +1271,7 @@
425 * fresh entries are at the beginning of the array and
426 * the best entry is at the end of the array.
428 +#ifndef SVEN_OLA_UNBLOAT
430 select_best_nameserver(struct rt_entry **rt)
432 @@ -1253,11 +1303,13 @@
436 +#endif /* SVEN_OLA_UNBLOAT */
439 * write the 3 best upstream DNS servers to resolv.conf file
440 * best means the 3 with the best etx value in routing table
442 +#ifndef SVEN_OLA_UNBLOAT
444 write_resolv_file(void)
446 @@ -1341,6 +1393,7 @@
448 forwarder_table_changed = false;
450 +#endif /* SVEN_OLA_UNBLOAT */
453 * completely free a list of name_entries
454 @@ -1359,9 +1412,11 @@
456 name_table_changed = true;
458 +#ifndef SVEN_OLA_UNBLOAT
460 forwarder_table_changed = true;
462 +#endif /* SVEN_OLA_UNBLOAT */
464 service_table_changed = true;
466 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/apm.h olsrd-0-5-6-fc691af9a18d/src/apm.h
467 --- olsrd-0-5-6-fc691af9a18d.orig/src/apm.h 2009-03-14 22:39:09.000000000 +0000
468 +++ olsrd-0-5-6-fc691af9a18d/src/apm.h 2009-03-15 16:32:39.000000000 +0000
473 +#ifndef SVEN_OLA_UNBLOAT
476 * Interface to OS dependent power management information
478 int apm_read(struct olsr_apm_info *);
481 +#endif /* SVEN_OLA_UNBLOAT */
485 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/local.mk olsrd-0-5-6-fc691af9a18d/src/cfgparser/local.mk
486 --- olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/local.mk 2009-03-14 22:39:09.000000000 +0000
487 +++ olsrd-0-5-6-fc691af9a18d/src/cfgparser/local.mk 2009-03-15 16:32:39.000000000 +0000
489 C=$(if $(CFGDIR),$(CFGDIR)/)
491 # add the variables as we may have others already there
492 +ifeq ($(SVEN_OLA_UNBLOAT),1)
493 +SRCS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).c)
494 +OBJS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).o)
496 SRCS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).c)
497 OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o)
499 HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
501 $(C)oscan.c: $(C)oscan.lex $(C)Makefile
502 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/olsrd_conf.c olsrd-0-5-6-fc691af9a18d/src/cfgparser/olsrd_conf.c
503 --- olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/olsrd_conf.c 2009-03-14 22:39:09.000000000 +0000
504 +++ olsrd-0-5-6-fc691af9a18d/src/cfgparser/olsrd_conf.c 2009-03-15 16:53:43.000000000 +0000
508 if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) {
509 +#ifndef SVEN_OLA_UNBLOAT
510 if ((argc > 2) && (!strcmp(argv[2], "-print"))) {
511 olsrd_print_cnf(cnf);
512 olsrd_write_cnf(cnf, "./out.conf");
514 printf("Use -print to view parsed values\n");
515 +#endif /* SVEN_OLA_UNBLOAT */
516 printf("Configfile parsed OK\n");
518 printf("Failed parsing \"%s\"\n", argv[1]);
520 /* set various stuff */
521 in->configured = false;
523 +#ifndef SVEN_OLA_UNBLOAT
524 in->host_emul = false;
525 +#endif /* SVEN_OLA_UNBLOAT */
531 cnf->debug_level = DEF_DEBUGLVL;
532 cnf->no_fork = false;
533 +#ifndef SVEN_OLA_UNBLOAT
534 cnf->host_emul = false;
535 +#endif /* SVEN_OLA_UNBLOAT */
536 cnf->ip_version = AF_INET;
537 cnf->ipsize = sizeof(struct in_addr);
541 cnf->rttable_default = 0;
542 cnf->willingness_auto = DEF_WILL_AUTO;
543 +#ifndef SVEN_OLA_UNBLOAT
544 cnf->ipc_connections = DEF_IPC_CONNECTIONS;
545 +#endif /* SVEN_OLA_UNBLOAT */
546 cnf->fib_metric = DEF_FIB_METRIC;
548 cnf->use_hysteresis = DEF_USE_HYST;
553 +#ifndef SVEN_OLA_UNBLOAT
555 olsrd_print_cnf(struct olsrd_config *cnf)
561 +#endif /* SVEN_OLA_UNBLOAT */
565 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/oparse.y olsrd-0-5-6-fc691af9a18d/src/cfgparser/oparse.y
566 --- olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/oparse.y 2009-03-14 22:39:09.000000000 +0000
567 +++ olsrd-0-5-6-fc691af9a18d/src/cfgparser/oparse.y 2009-03-15 16:32:39.000000000 +0000
570 %token TOK_RTTABLE_DEFAULT
571 %token TOK_WILLINGNESS
582 %token TOK_IP4BROADCAST
583 %token TOK_IP6ADDRTYPE
586 block: TOK_HNA4 hna4body
588 - | TOK_IPCCON ipcbody
596 -ipcbody: TOK_OPEN ipcstmts TOK_CLOSE
599 -ipcstmts: | ipcstmts ipcstmt
608 ifblock: ifstart ifnicks
615 -imaxipc: TOK_MAXIPC TOK_INTEGER
617 - olsr_cnf->ipc_connections = $2->integer;
622 -ipchost: TOK_HOSTLABEL TOK_IP4_ADDR
624 - union olsr_ip_addr ipaddr;
625 - PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string);
627 - if (inet_aton($2->string, &ipaddr.v4) == 0) {
628 - fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string);
632 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen);
639 -ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR
641 - union olsr_ip_addr ipaddr, netmask;
643 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
645 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
646 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
650 - if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) {
651 - fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string);
655 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask));
662 - | TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER
664 - union olsr_ip_addr ipaddr;
666 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
668 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
669 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
673 - if ($4->integer > olsr_cnf->maxplen) {
674 - fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen);
678 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer);
686 iifweight: TOK_IFWEIGHT TOK_INTEGER
688 int ifcnt = ifs_in_curr_cfg;
689 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/oscan.lex olsrd-0-5-6-fc691af9a18d/src/cfgparser/oscan.lex
690 --- olsrd-0-5-6-fc691af9a18d.orig/src/cfgparser/oscan.lex 2009-03-14 22:39:09.000000000 +0000
691 +++ olsrd-0-5-6-fc691af9a18d/src/cfgparser/oscan.lex 2009-03-15 16:32:39.000000000 +0000
703 return TOK_DEBUGLEVEL;
705 return TOK_WILLINGNESS;
715 return TOK_FIBMETRIC;
716 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/defs.h olsrd-0-5-6-fc691af9a18d/src/defs.h
717 --- olsrd-0-5-6-fc691af9a18d.orig/src/defs.h 2009-03-14 22:39:09.000000000 +0000
718 +++ olsrd-0-5-6-fc691af9a18d/src/defs.h 2009-03-15 16:32:39.000000000 +0000
721 clock_t olsr_times(void);
723 +#ifndef SVEN_OLA_UNBLOAT
727 *These are moved to a plugin soon
729 int ipc_output(struct olsr *);
732 +#endif /* SVEN_OLA_UNBLOAT */
736 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/duplicate_set.c olsrd-0-5-6-fc691af9a18d/src/duplicate_set.c
737 --- olsrd-0-5-6-fc691af9a18d.orig/src/duplicate_set.c 2009-03-14 22:39:09.000000000 +0000
738 +++ olsrd-0-5-6-fc691af9a18d/src/duplicate_set.c 2009-03-15 16:32:39.000000000 +0000
740 return false; /* no duplicate */
743 +#ifndef SVEN_OLA_UNBLOAT
745 olsr_print_duplicate_table(void)
748 } OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
751 +#endif /* SVEN_OLA_UNBLOAT */
755 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/hna_set.c olsrd-0-5-6-fc691af9a18d/src/hna_set.c
756 --- olsrd-0-5-6-fc691af9a18d.orig/src/hna_set.c 2009-03-14 22:39:09.000000000 +0000
757 +++ olsrd-0-5-6-fc691af9a18d/src/hna_set.c 2009-03-15 16:32:39.000000000 +0000
762 +#ifndef SVEN_OLA_UNBLOAT
764 olsr_print_hna_set(void)
770 +#endif /* SVEN_OLA_UNBLOAT */
773 *Process incoming HNA message.
774 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/interfaces.c olsrd-0-5-6-fc691af9a18d/src/interfaces.c
775 --- olsrd-0-5-6-fc691af9a18d.orig/src/interfaces.c 2009-03-14 22:39:09.000000000 +0000
776 +++ olsrd-0-5-6-fc691af9a18d/src/interfaces.c 2009-03-15 16:54:47.000000000 +0000
778 OLSR_PRINTF(1, "\n ---- Interface configuration ---- \n\n");
779 /* Run trough all interfaces immedeatly */
780 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
781 +#ifndef SVEN_OLA_UNBLOAT
782 if (!tmp_if->host_emul) {
783 if (!olsr_cnf->host_emul) /* XXX: TEMPORARY! */
784 +#endif /* SVEN_OLA_UNBLOAT */
785 chk_if_up(tmp_if, 1);
786 +#ifndef SVEN_OLA_UNBLOAT
790 +#endif /* SVEN_OLA_UNBLOAT */
793 /* Kick a periodic timer for the network interface update function */
798 +#ifdef SVEN_OLA_UNBLOAT
799 +queue_if(const char *name)
800 +#else /* SVEN_OLA_UNBLOAT */
801 queue_if(const char *name, int hemu)
802 +#endif /* SVEN_OLA_UNBLOAT */
804 struct olsr_if *interf_n = olsr_cnf->interfaces;
807 interf_n->interf = NULL;
808 interf_n->configured = 0;
810 +#ifndef SVEN_OLA_UNBLOAT
811 interf_n->host_emul = hemu ? true : false;
812 +#endif /* SVEN_OLA_UNBLOAT */
814 strscpy(interf_n->name, name, name_size);
815 interf_n->next = olsr_cnf->interfaces;
816 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/interfaces.h olsrd-0-5-6-fc691af9a18d/src/interfaces.h
817 --- olsrd-0-5-6-fc691af9a18d.orig/src/interfaces.h 2009-03-14 22:39:09.000000000 +0000
818 +++ olsrd-0-5-6-fc691af9a18d/src/interfaces.h 2009-03-15 16:32:39.000000000 +0000
821 struct interface *if_ifwithindex(const int if_index);
823 -struct olsr_if *queue_if(const char *, int);
825 +#ifdef SVEN_OLA_UNBLOAT
826 + queue_if(const char *);
827 +#else /* SVEN_OLA_UNBLOAT */
828 + queue_if(const char *, int);
829 +#endif /* SVEN_OLA_UNBLOAT */
831 int add_ifchgf(int (*f) (struct interface *, int));
833 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/ipc_frontend.c olsrd-0-5-6-fc691af9a18d/src/ipc_frontend.c
834 --- olsrd-0-5-6-fc691af9a18d.orig/src/ipc_frontend.c 2009-03-14 22:39:09.000000000 +0000
835 +++ olsrd-0-5-6-fc691af9a18d/src/ipc_frontend.c 2009-03-15 16:32:39.000000000 +0000
840 +#ifndef SVEN_OLA_UNBLOAT
841 #include "ipc_frontend.h"
842 #include "link_set.h"
848 +#endif /* SVEN_OLA_UNBLOAT */
852 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/ipc_frontend.h olsrd-0-5-6-fc691af9a18d/src/ipc_frontend.h
853 --- olsrd-0-5-6-fc691af9a18d.orig/src/ipc_frontend.h 2009-03-14 22:39:09.000000000 +0000
854 +++ olsrd-0-5-6-fc691af9a18d/src/ipc_frontend.h 2009-03-15 16:32:39.000000000 +0000
859 +#ifndef SVEN_OLA_UNBLOAT
861 #include <sys/types.h>
862 #include <netinet/in.h>
864 int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *);
867 +#endif /* SVEN_OLA_UNBLOAT */
871 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/ipcalc.c olsrd-0-5-6-fc691af9a18d/src/ipcalc.c
872 --- olsrd-0-5-6-fc691af9a18d.orig/src/ipcalc.c 2009-03-14 22:39:09.000000000 +0000
873 +++ olsrd-0-5-6-fc691af9a18d/src/ipcalc.c 2009-03-15 16:32:39.000000000 +0000
878 +#ifndef SVEN_OLA_UNBLOAT
880 olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
886 +#endif /* SVEN_OLA_UNBLOAT */
888 /* see if the ipaddr is in the net. That is equivalent to the fact that the net part
889 * of both are equal. So we must compare the first <prefixlen> bits.
890 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/ipcalc.h olsrd-0-5-6-fc691af9a18d/src/ipcalc.h
891 --- olsrd-0-5-6-fc691af9a18d.orig/src/ipcalc.h 2009-03-14 22:39:09.000000000 +0000
892 +++ olsrd-0-5-6-fc691af9a18d/src/ipcalc.h 2009-03-15 16:32:39.000000000 +0000
894 return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
897 +#ifndef SVEN_OLA_UNBLOAT
898 const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
899 +#endif /* SVEN_OLA_UNBLOAT */
901 static INLINE const char *
902 sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr)
903 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/link_set.c olsrd-0-5-6-fc691af9a18d/src/link_set.c
904 --- olsrd-0-5-6-fc691af9a18d.orig/src/link_set.c 2009-03-14 22:39:09.000000000 +0000
905 +++ olsrd-0-5-6-fc691af9a18d/src/link_set.c 2009-03-15 16:32:39.000000000 +0000
910 +#ifndef SVEN_OLA_UNBLOAT
912 olsr_print_link_set(void)
915 } OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
918 +#endif /* SVEN_OLA_UNBLOAT */
921 * called for every LQ HELLO message.
922 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/linux/apm.c olsrd-0-5-6-fc691af9a18d/src/linux/apm.c
923 --- olsrd-0-5-6-fc691af9a18d.orig/src/linux/apm.c 2009-03-14 22:39:09.000000000 +0000
924 +++ olsrd-0-5-6-fc691af9a18d/src/linux/apm.c 2009-03-15 16:32:39.000000000 +0000
926 * Acpi-Power Enlightenment epplet
929 +#ifndef SVEN_OLA_UNBLOAT
934 /* No battery found */
937 +#endif /* SVEN_OLA_UNBLOAT */
941 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/linux/kernel_routes.c olsrd-0-5-6-fc691af9a18d/src/linux/kernel_routes.c
942 --- olsrd-0-5-6-fc691af9a18d.orig/src/linux/kernel_routes.c 2009-03-14 22:39:09.000000000 +0000
943 +++ olsrd-0-5-6-fc691af9a18d/src/linux/kernel_routes.c 2009-03-15 16:49:14.000000000 +0000
944 @@ -288,11 +288,13 @@
945 if (rt_ret > 0) rt_ret = 0;//0 means successful recovery
946 else rt_ret = -1;//unrecoverable error
948 +#ifndef SVEN_OLA_UNBLOAT
949 //send ipc update on success
950 if ( ( cmd != RTM_NEWRULE ) & ( cmd != RTM_DELRULE ) & (flag = RT_ORIG_REQUEST) & (0 <= rt_ret && olsr_cnf->ipc_connections > 0)) {
951 ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd,
952 if_ifwithindex_name(nexthop->iif_index));
954 +#endif /* SVEN_OLA_UNBLOAT */
955 if (rt_ret == -2) olsr_syslog(OLSR_LOG_ERR,"no rtnetlink response was received! (no more system ressources?, everything may happen now ...)");
958 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/linux/net.c olsrd-0-5-6-fc691af9a18d/src/linux/net.c
959 --- olsrd-0-5-6-fc691af9a18d.orig/src/linux/net.c 2009-03-14 22:39:09.000000000 +0000
960 +++ olsrd-0-5-6-fc691af9a18d/src/linux/net.c 2009-03-15 16:32:39.000000000 +0000
962 #define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
964 /* The original state of the IP forwarding proc entry */
965 +#ifndef SVEN_OLA_UNBLOAT
966 static char orig_fwd_state;
967 static char orig_global_redirect_state;
968 +#endif /* SVEN_OLA_UNBLOAT */
971 *Bind a socket to a device
973 return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1);
976 +#ifndef SVEN_OLA_UNBLOAT
979 *Enable IP forwarding.
980 *Just writing "1" to the /proc/sys/net/ipv4/ip_forward
982 const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
984 if ((proc_fwd = fopen(procfile, "r")) == NULL) {
985 +#ifdef SVEN_OLA_UNBLOAT_OLD
989 if (version == AF_INET)
1000 OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
1002 if ((proc_fwd = fopen(procfile, "w")) == NULL) {
1003 +#ifdef SVEN_OLA_UNBLOAT_OLD
1006 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1007 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP forwarding is enabeled!\n\n");
1012 syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile);
1013 @@ -154,11 +166,15 @@
1016 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1017 +#ifdef SVEN_OLA_UNBLOAT_OLD
1021 "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",
1028 orig_global_redirect_state = fgetc(proc_redirect);
1029 @@ -168,9 +184,13 @@
1032 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1033 +#ifdef SVEN_OLA_UNBLOAT_OLD
1036 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1037 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1042 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1043 @@ -196,19 +216,27 @@
1044 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name);
1046 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1047 +#ifdef SVEN_OLA_UNBLOAT_OLD
1051 "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",
1057 iface->nic_state.redirect = fgetc(proc_redirect);
1058 fclose(proc_redirect);
1060 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1061 +#ifdef SVEN_OLA_UNBLOAT_OLD
1064 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1065 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1070 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1071 @@ -234,20 +262,28 @@
1072 sprintf(procfile, SPOOF_PROC, if_name);
1074 if ((proc_spoof = fopen(procfile, "r")) == NULL) {
1075 +#ifdef SVEN_OLA_UNBLOAT_OLD
1079 "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",
1086 iface->nic_state.spoof = fgetc(proc_spoof);
1089 if ((proc_spoof = fopen(procfile, "w")) == NULL) {
1090 +#ifdef SVEN_OLA_UNBLOAT_OLD
1093 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1094 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabeled!\n\n");
1099 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1100 @@ -272,7 +308,11 @@
1103 if ((proc_fd = fopen(procfile, "w")) == NULL) {
1104 +#ifdef SVEN_OLA_UNBLOAT_OLD
1107 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1110 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state);
1111 fputc(orig_fwd_state, proc_fd);
1112 @@ -287,7 +327,11 @@
1115 if ((proc_fd = fopen(procfile, "w")) == NULL) {
1116 +#ifdef SVEN_OLA_UNBLOAT_OLD
1119 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1122 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state);
1123 fputc(orig_global_redirect_state, proc_fd);
1124 @@ -311,7 +355,11 @@
1125 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name);
1127 if ((proc_fd = fopen(procfile, "w")) == NULL)
1128 +#ifdef SVEN_OLA_UNBLOAT_OLD
1131 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1134 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect);
1136 @@ -324,7 +372,11 @@
1137 /* Generate the procfile name */
1138 sprintf(procfile, SPOOF_PROC, ifs->int_name);
1139 if ((proc_fd = fopen(procfile, "w")) == NULL)
1140 +#ifdef SVEN_OLA_UNBLOAT_OLD
1143 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1146 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof);
1152 +#endif /* SVEN_OLA_UNBLOAT */
1155 *Creates a nonblocking broadcast socket.
1156 *@param sa sockaddr struct. Used for bind(2).
1157 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin.c olsrd-0-5-6-fc691af9a18d/src/lq_plugin.c
1158 --- olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin.c 2009-03-14 22:39:09.000000000 +0000
1159 +++ olsrd-0-5-6-fc691af9a18d/src/lq_plugin.c 2009-03-15 16:32:39.000000000 +0000
1161 init_lq_handler_tree(void)
1163 avl_init(&lq_handler_tree, &avl_strcasecmp);
1164 +#ifndef SVEN_OLA_UNBLOAT
1165 register_lq_handler(&lq_etx_float_handler, LQ_ALGORITHM_ETX_FLOAT_NAME);
1166 register_lq_handler(&lq_etx_fpm_handler, LQ_ALGORITHM_ETX_FPM_NAME);
1167 +#endif /* SVEN_OLA_UNBLOAT */
1168 register_lq_handler(&lq_etx_ff_handler, LQ_ALGORITHM_ETX_FF_NAME);
1169 +#ifndef SVEN_OLA_UNBLOAT
1170 if (activate_lq_handler(olsr_cnf->lq_algorithm)) {
1171 activate_lq_handler(LQ_ALGORITHM_ETX_FPM_NAME);
1173 +#else /* SVEN_OLA_UNBLOAT */
1174 + activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME);
1175 +#endif /* SVEN_OLA_UNBLOAT */
1179 @@ -417,7 +423,11 @@
1180 * @return pointer to hello_neighbor
1182 struct hello_neighbor *
1183 +#ifndef SVEN_OLA_UNBLOAT
1184 olsr_malloc_hello_neighbor(const char *id)
1185 +#else /* SVEN_OLA_UNBLOAT */
1186 +olsr_malloc_hello_neighbor(const char *id __attribute__ ((unused)))
1187 +#endif /* SVEN_OLA_UNBLOAT */
1189 struct hello_neighbor *h;
1191 @@ -439,7 +449,11 @@
1192 * @return pointer to tc_mpr_addr
1194 struct tc_mpr_addr *
1195 +#ifndef SVEN_OLA_UNBLOAT
1196 olsr_malloc_tc_mpr_addr(const char *id)
1197 +#else /* SVEN_OLA_UNBLOAT */
1198 +olsr_malloc_tc_mpr_addr(const char *id __attribute__ ((unused)))
1199 +#endif /* SVEN_OLA_UNBLOAT */
1201 struct tc_mpr_addr *t;
1203 @@ -461,7 +475,11 @@
1204 * @return pointer to lq_hello_neighbor
1206 struct lq_hello_neighbor *
1207 +#ifndef SVEN_OLA_UNBLOAT
1208 olsr_malloc_lq_hello_neighbor(const char *id)
1209 +#else /* SVEN_OLA_UNBLOAT */
1210 +olsr_malloc_lq_hello_neighbor(const char *id __attribute__ ((unused)))
1211 +#endif /* SVEN_OLA_UNBLOAT */
1213 struct lq_hello_neighbor *h;
1215 @@ -483,7 +501,11 @@
1216 * @return pointer to link_entry
1219 +#ifndef SVEN_OLA_UNBLOAT
1220 olsr_malloc_link_entry(const char *id)
1221 +#else /* SVEN_OLA_UNBLOAT */
1222 +olsr_malloc_link_entry(const char *id __attribute__ ((unused)))
1223 +#endif /* SVEN_OLA_UNBLOAT */
1225 struct link_entry *h;
1227 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_float.c olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_float.c
1228 --- olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_float.c 2009-03-14 22:39:09.000000000 +0000
1229 +++ olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_float.c 2009-03-15 16:32:39.000000000 +0000
1234 +#ifndef SVEN_OLA_UNBLOAT
1236 #include "link_set.h"
1237 #include "olsr_spf.h"
1242 +#endif /* SVEN_OLA_UNBLOAT */
1246 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_float.h olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_float.h
1247 --- olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_float.h 2009-03-14 22:39:09.000000000 +0000
1248 +++ olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_float.h 2009-03-15 16:32:39.000000000 +0000
1253 +#ifndef SVEN_OLA_UNBLOAT
1254 #ifndef LQ_PLUGIN_DEFAULT_H_
1255 #define LQ_PLUGIN_DEFAULT_H_
1258 extern struct lq_handler lq_etx_float_handler;
1260 #endif /*LQ_PLUGIN_DEFAULT_H_ */
1261 +#endif /* SVEN_OLA_UNBLOAT */
1265 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_fpm.c olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_fpm.c
1266 --- olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_fpm.c 2009-03-14 22:39:09.000000000 +0000
1267 +++ olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_fpm.c 2009-03-15 16:32:39.000000000 +0000
1272 +#ifndef SVEN_OLA_UNBLOAT
1274 #include "link_set.h"
1275 #include "lq_plugin.h"
1277 snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER);
1280 +#endif /* SVEN_OLA_UNBLOAT */
1284 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_fpm.h olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_fpm.h
1285 --- olsrd-0-5-6-fc691af9a18d.orig/src/lq_plugin_default_fpm.h 2009-03-14 22:39:09.000000000 +0000
1286 +++ olsrd-0-5-6-fc691af9a18d/src/lq_plugin_default_fpm.h 2009-03-15 16:32:39.000000000 +0000
1291 +#ifndef SVEN_OLA_UNBLOAT
1296 extern struct lq_handler lq_etx_fpm_handler;
1298 #endif /*LQ_ETX_FPM_ */
1299 +#endif /* SVEN_OLA_UNBLOAT */
1303 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/main.c olsrd-0-5-6-fc691af9a18d/src/main.c
1304 --- olsrd-0-5-6-fc691af9a18d.orig/src/main.c 2009-03-14 22:39:09.000000000 +0000
1305 +++ olsrd-0-5-6-fc691af9a18d/src/main.c 2009-03-15 16:52:17.000000000 +0000
1306 @@ -258,13 +258,17 @@
1308 * Print configuration
1310 +#ifndef SVEN_OLA_UNBLOAT
1311 if (olsr_cnf->debug_level > 1) {
1312 olsrd_print_cnf(olsr_cnf);
1314 +#endif /* SVEN_OLA_UNBLOAT */
1316 +#ifndef SVEN_OLA_UNBLOAT
1317 /* Disable redirects globally */
1318 disable_redirects_global(olsr_cnf->ip_version);
1320 +#endif /* SVEN_OLA_UNBLOAT */
1323 * socket for ioctl calls
1326 *enable ip forwarding on host
1328 +#ifndef SVEN_OLA_UNBLOAT
1329 enable_ip_forwarding(olsr_cnf->ip_version);
1330 +#endif /* SVEN_OLA_UNBLOAT */
1332 /* Initialize parser */
1335 *Set up willingness/APM
1337 if (olsr_cnf->willingness_auto) {
1338 +#ifndef SVEN_OLA_UNBLOAT
1339 if (apm_init() < 0) {
1340 OLSR_PRINTF(1, "Could not read APM info - setting default willingness(%d)\n", WILL_DEFAULT);
1342 @@ -326,10 +333,13 @@
1343 olsr_cnf->willingness_auto = 0;
1344 olsr_cnf->willingness = WILL_DEFAULT;
1346 +#endif /* SVEN_OLA_UNBLOAT */
1347 olsr_cnf->willingness = olsr_calculate_willingness();
1349 OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int);
1350 +#ifndef SVEN_OLA_UNBLOAT
1352 +#endif /* SVEN_OLA_UNBLOAT */
1355 /* Initialize net */
1356 @@ -364,9 +374,11 @@
1358 /* Initialize the IPC socket */
1360 +#ifndef SVEN_OLA_UNBLOAT
1361 if (olsr_cnf->ipc_connections > 0) {
1364 +#endif /* SVEN_OLA_UNBLOAT */
1365 /* Initialisation of different tables to be used. */
1368 @@ -489,9 +501,11 @@
1369 OLSR_PRINTF(1, "Closing sockets...\n");
1371 /* front-end IPC socket */
1372 +#ifndef SVEN_OLA_UNBLOAT
1373 if (olsr_cnf->ipc_connections > 0) {
1376 +#endif /* SVEN_OLA_UNBLOAT */
1379 for (ifn = ifnet; ifn; ifn = ifn->int_next)
1381 olsr_close_plugins();
1383 /* Reset network settings */
1384 +#ifndef SVEN_OLA_UNBLOAT
1385 restore_settings(olsr_cnf->ip_version);
1386 +#endif /* SVEN_OLA_UNBLOAT */
1389 close(olsr_cnf->ioctl_s);
1390 @@ -542,7 +558,11 @@
1391 "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n"
1392 " [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n"
1393 " [-lql <LQ level>] [-lqw <LQ winsize>] [-lqnt <nat threshold>]\n"
1394 +#ifdef SVEN_OLA_UNBLOAT
1395 + " [-bcast <broadcastaddr>] [-delgw] (Note: no -ipc,-dispin,-dispout)\n"
1396 +#else /* SVEN_OLA_UNBLOAT */
1397 " [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n"
1398 +#endif /* SVEN_OLA_UNBLOAT */
1399 " [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n"
1400 " [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n"
1401 " [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n" " [-lql <LQ level>] [-lqa <LQ aging factor>]\n");
1402 @@ -706,12 +726,20 @@
1403 olsr_exit(__func__, EXIT_FAILURE);
1405 printf("Queuing if %s\n", *argv);
1406 +#ifdef SVEN_OLA_UNBLOAT
1408 +#else /* SVEN_OLA_UNBLOAT */
1409 queue_if(*argv, false);
1410 +#endif /* SVEN_OLA_UNBLOAT */
1412 while ((argc - 1) && (argv[1][0] != '-')) {
1414 printf("Queuing if %s\n", *argv);
1415 +#ifdef SVEN_OLA_UNBLOAT
1417 +#else /* SVEN_OLA_UNBLOAT */
1418 queue_if(*argv, false);
1419 +#endif /* SVEN_OLA_UNBLOAT */
1424 sscanf(*argv, "%f", &cnf->pollrate);
1428 +#ifndef SVEN_OLA_UNBLOAT
1430 * Should we display the contents of packages beeing sent?
1433 cnf->ipc_connections = 1;
1436 +#endif /* SVEN_OLA_UNBLOAT */
1439 * IPv6 multicast addr
1445 +#ifndef SVEN_OLA_UNBLOAT
1453 +#endif /* SVEN_OLA_UNBLOAT */
1456 * Delete possible default GWs
1457 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/neighbor_table.c olsrd-0-5-6-fc691af9a18d/src/neighbor_table.c
1458 --- olsrd-0-5-6-fc691af9a18d.orig/src/neighbor_table.c 2009-03-14 22:39:09.000000000 +0000
1459 +++ olsrd-0-5-6-fc691af9a18d/src/neighbor_table.c 2009-03-15 16:32:39.000000000 +0000
1464 +#ifndef SVEN_OLA_UNBLOAT
1466 olsr_print_neighbor_table(void)
1472 +#endif /* SVEN_OLA_UNBLOAT */
1476 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/net_olsr.c olsrd-0-5-6-fc691af9a18d/src/net_olsr.c
1477 --- olsrd-0-5-6-fc691af9a18d.orig/src/net_olsr.c 2009-03-15 17:06:26.000000000 +0000
1478 +++ olsrd-0-5-6-fc691af9a18d/src/net_olsr.c 2009-03-15 16:32:39.000000000 +0000
1483 +#ifndef SVEN_OLA_UNBLOAT
1484 #include "print_packet.h"
1485 +#endif /* SVEN_OLA_UNBLOAT */
1486 #include "link_set.h"
1487 #include "lq_packet.h"
1489 @@ -385,8 +387,10 @@
1490 *if the -dispout option was given
1491 *we print the content of the packets
1493 +#ifndef SVEN_OLA_UNBLOAT
1495 print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr);
1496 +#endif /* SVEN_OLA_UNBLOAT */
1498 if (olsr_cnf->ip_version == AF_INET) {
1500 @@ -400,12 +404,16 @@
1502 if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
1504 +#ifndef SVEN_OLA_UNBLOAT
1505 struct ipaddr_str buf;
1506 +#endif /* SVEN_OLA_UNBLOAT */
1507 perror("sendto(v6)");
1508 olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
1509 +#ifndef SVEN_OLA_UNBLOAT
1510 fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index);
1511 fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6));
1512 fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending);
1513 +#endif /* SVEN_OLA_UNBLOAT */
1517 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/olsr.c olsrd-0-5-6-fc691af9a18d/src/olsr.c
1518 --- olsrd-0-5-6-fc691af9a18d.orig/src/olsr.c 2009-03-14 22:39:09.000000000 +0000
1519 +++ olsrd-0-5-6-fc691af9a18d/src/olsr.c 2009-03-15 16:32:39.000000000 +0000
1523 if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) {
1524 +#ifndef SVEN_OLA_UNBLOAT
1526 +#endif /* SVEN_OLA_UNBLOAT */
1527 printf(" *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host);
1531 if (changes_neighborhood || changes_topology || changes_hna) {
1532 olsr_calculate_routing_table();
1535 +#ifndef SVEN_OLA_UNBLOAT
1536 if (olsr_cnf->debug_level > 0) {
1537 if (olsr_cnf->debug_level > 2) {
1538 olsr_print_mid_set();
1540 olsr_print_tc_table();
1543 +#endif /* SVEN_OLA_UNBLOAT */
1545 for (tmp_pc_list = pcf_list; tmp_pc_list != NULL; tmp_pc_list = tmp_pc_list->next) {
1546 tmp_pc_list->function(changes_neighborhood, changes_topology, changes_hna);
1547 @@ -415,12 +418,15 @@
1549 olsr_calculate_willingness(void)
1551 +#ifndef SVEN_OLA_UNBLOAT
1552 struct olsr_apm_info ainfo;
1553 +#endif /* SVEN_OLA_UNBLOAT */
1555 /* If fixed willingness */
1556 if (!olsr_cnf->willingness_auto)
1557 return olsr_cnf->willingness;
1559 +#ifndef SVEN_OLA_UNBLOAT
1560 if (apm_read(&ainfo) < 1)
1561 return WILL_DEFAULT;
1563 @@ -437,8 +443,12 @@
1564 * 26% > juice will: 1
1566 return (ainfo.battery_percentage / 26);
1567 +#else /* SVEN_OLA_UNBLOAT */
1568 + return WILL_DEFAULT;
1569 +#endif /* SVEN_OLA_UNBLOAT */
1572 +#ifndef SVEN_OLA_UNBLOAT
1574 olsr_msgtype_to_string(uint8_t msgtype)
1577 snprintf(type, sizeof(type), "UNKNOWN(%d)", status);
1580 +#endif /* SVEN_OLA_UNBLOAT */
1583 *Termination function to be called whenever a error occures
1586 * @return a void pointer to the memory allocated
1588 +#ifndef SVEN_OLA_UNBLOAT
1590 olsr_malloc(size_t size, const char *id)
1596 +#endif /* SVEN_OLA_UNBLOAT */
1599 *Wrapper for printf that prints to a specific
1600 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/olsr.h olsrd-0-5-6-fc691af9a18d/src/olsr.h
1601 --- olsrd-0-5-6-fc691af9a18d.orig/src/olsr.h 2009-03-14 22:39:09.000000000 +0000
1602 +++ olsrd-0-5-6-fc691af9a18d/src/olsr.h 2009-03-15 16:42:54.000000000 +0000
1605 uint8_t olsr_calculate_willingness(void);
1607 +#ifndef SVEN_OLA_UNBLOAT
1608 const char *olsr_msgtype_to_string(uint8_t);
1610 const char *olsr_link_to_string(uint8_t);
1612 const char *olsr_status_to_string(uint8_t);
1613 +#endif /* SVEN_OLA_UNBLOAT */
1615 void olsr_exit(const char *, int);
1617 +#ifdef SVEN_OLA_UNBLOAT
1618 +#define olsr_malloc(size, msg) calloc(1, size)
1619 +#else /* SVEN_OLA_UNBLOAT */
1620 void *olsr_malloc(size_t, const char *);
1621 +#endif /* SVEN_OLA_UNBLOAT */
1623 int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
1625 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/olsr_cfg.h olsrd-0-5-6-fc691af9a18d/src/olsr_cfg.h
1626 --- olsrd-0-5-6-fc691af9a18d.orig/src/olsr_cfg.h 2009-03-14 22:39:09.000000000 +0000
1627 +++ olsrd-0-5-6-fc691af9a18d/src/olsr_cfg.h 2009-03-15 16:45:53.000000000 +0000
1628 @@ -140,8 +140,10 @@
1632 +#ifndef SVEN_OLA_UNBLOAT
1634 union olsr_ip_addr hemu_ip;
1635 +#endif /* SVEN_OLA_UNBLOAT */
1636 struct interface *interf;
1637 struct if_config_options *cnf;
1638 struct olsr_if *next;
1640 struct olsrd_config {
1643 +#ifndef SVEN_OLA_UNBLOAT
1645 +#endif /* SVEN_OLA_UNBLOAT */
1647 bool allow_no_interfaces;
1649 @@ -191,13 +195,17 @@
1650 uint8_t rttable_default;
1651 uint8_t willingness;
1652 bool willingness_auto;
1653 +#ifndef SVEN_OLA_UNBLOAT
1654 int ipc_connections;
1655 +#endif /* SVEN_OLA_UNBLOAT */
1656 bool use_hysteresis;
1657 olsr_fib_metric_options fib_metric;
1658 struct hyst_param hysteresis_param;
1659 struct plugin_entry *plugins;
1660 struct ip_prefix_list *hna_entries;
1661 +#ifndef SVEN_OLA_UNBLOAT
1662 struct ip_prefix_list *ipc_nets;
1663 +#endif /* SVEN_OLA_UNBLOAT */
1664 struct olsr_if *interfaces;
1666 float nic_chgs_pollrate;
1669 void olsrd_free_cnf(struct olsrd_config *);
1671 +#ifndef SVEN_OLA_UNBLOAT
1672 void olsrd_print_cnf(struct olsrd_config *);
1673 +#endif /* SVEN_OLA_UNBLOAT */
1675 int olsrd_write_cnf(struct olsrd_config *, const char *);
1677 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/parser.c olsrd-0-5-6-fc691af9a18d/src/parser.c
1678 --- olsrd-0-5-6-fc691af9a18d.orig/src/parser.c 2009-03-14 22:39:09.000000000 +0000
1679 +++ olsrd-0-5-6-fc691af9a18d/src/parser.c 2009-03-15 16:32:39.000000000 +0000
1681 #include "rebuild_packet.h"
1684 +#ifndef SVEN_OLA_UNBLOAT
1685 #include "print_packet.h"
1686 +#endif /* SVEN_OLA_UNBLOAT */
1687 #include "net_olsr.h"
1690 @@ -280,8 +282,10 @@
1691 //printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr));
1693 /* Display packet */
1694 +#ifndef SVEN_OLA_UNBLOAT
1696 print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr);
1697 +#endif /* SVEN_OLA_UNBLOAT */
1699 if (olsr_cnf->ip_version == AF_INET)
1700 msgsize = ntohs(m->v4.olsr_msgsize);
1701 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/print_packet.c olsrd-0-5-6-fc691af9a18d/src/print_packet.c
1702 --- olsrd-0-5-6-fc691af9a18d.orig/src/print_packet.c 2009-03-14 22:39:09.000000000 +0000
1703 +++ olsrd-0-5-6-fc691af9a18d/src/print_packet.c 2009-03-15 16:32:39.000000000 +0000
1708 +#ifndef SVEN_OLA_UNBLOAT
1709 #include "print_packet.h"
1711 #include "mantissa.h"
1713 remsize -= olsr_cnf->ipsize;
1716 +#endif /* SVEN_OLA_UNBLOAT */
1720 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/process_routes.c olsrd-0-5-6-fc691af9a18d/src/process_routes.c
1721 --- olsrd-0-5-6-fc691af9a18d.orig/src/process_routes.c 2009-03-14 22:39:09.000000000 +0000
1722 +++ olsrd-0-5-6-fc691af9a18d/src/process_routes.c 2009-03-15 16:32:39.000000000 +0000
1725 olsr_delete_kernel_route(struct rt_entry *rt)
1727 +#ifndef SVEN_OLA_UNBLOAT
1728 if (!olsr_cnf->host_emul) {
1729 int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1731 @@ -170,6 +171,12 @@
1732 olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
1735 +#else /* SVEN_OLA_UNBLOAT */
1736 + olsr_16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1738 + olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno));
1740 +#endif /* SVEN_OLA_UNBLOAT */
1745 olsr_add_kernel_route(struct rt_entry *rt)
1748 +#ifndef SVEN_OLA_UNBLOAT
1749 if (!olsr_cnf->host_emul) {
1750 int16_t error = (olsr_cnf->ip_version == AF_INET) ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1752 @@ -199,6 +207,14 @@
1753 rt->rt_metric = rt->rt_best->rtp_metric;
1756 +#else /* SVEN_OLA_UNBLOAT */
1757 + olsr_16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1759 + olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno));
1761 + rt->rt_nexthop = rt->rt_best->rtp_nexthop;
1763 +#endif /* SVEN_OLA_UNBLOAT */
1768 /* route additions */
1769 olsr_add_kernel_routes(&add_kernel_list);
1773 olsr_print_routing_table(&routingtree);
1776 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/rebuild_packet.c olsrd-0-5-6-fc691af9a18d/src/rebuild_packet.c
1777 --- olsrd-0-5-6-fc691af9a18d.orig/src/rebuild_packet.c 2009-03-14 22:39:09.000000000 +0000
1778 +++ olsrd-0-5-6-fc691af9a18d/src/rebuild_packet.c 2009-03-15 16:32:39.000000000 +0000
1780 mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m)
1783 +#ifndef SVEN_OLA_UNBLOAT
1784 struct mid_alias *alias, *alias_tmp;
1785 +#else /* SVEN_OLA_UNBLOAT */
1786 + struct mid_alias *alias;
1787 +#endif /* SVEN_OLA_UNBLOAT */
1790 /* Checking if everything is ok */
1795 +#ifndef SVEN_OLA_UNBLOAT
1796 if (olsr_cnf->debug_level > 1) {
1797 struct ipaddr_str buf;
1798 OLSR_PRINTF(3, "Alias list for %s: ", olsr_ip_to_string(&buf, &mmsg->mid_origaddr));
1801 OLSR_PRINTF(3, "\n");
1803 +#endif /* SVEN_OLA_UNBLOAT */
1806 const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr;
1811 +#ifndef SVEN_OLA_UNBLOAT
1812 if (olsr_cnf->debug_level > 1) {
1813 struct ipaddr_str buf;
1814 OLSR_PRINTF(3, "Alias list for %s", ip6_to_string(&buf, &mmsg->mid_origaddr.v6));
1817 OLSR_PRINTF(3, "\n");
1819 +#endif /* SVEN_OLA_UNBLOAT */
1823 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/routing_table.c olsrd-0-5-6-fc691af9a18d/src/routing_table.c
1824 --- olsrd-0-5-6-fc691af9a18d.orig/src/routing_table.c 2009-03-14 22:39:09.000000000 +0000
1825 +++ olsrd-0-5-6-fc691af9a18d/src/routing_table.c 2009-03-15 16:32:39.000000000 +0000
1828 * format a route entry into a buffer
1830 +#ifndef SVEN_OLA_UNBLOAT
1832 olsr_rt_to_string(const struct rt_entry *rt)
1834 @@ -654,11 +655,13 @@
1838 +#endif /* SVEN_OLA_UNBLOAT */
1841 * Print the routingtree to STDOUT
1844 +#ifndef SVEN_OLA_UNBLOAT
1846 olsr_print_routing_table(struct avl_tree *tree)
1850 tree = NULL; /* squelch compiler warnings */
1852 +#endif /* SVEN_OLA_UNBLOAT */
1856 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/routing_table.h olsrd-0-5-6-fc691af9a18d/src/routing_table.h
1857 --- olsrd-0-5-6-fc691af9a18d.orig/src/routing_table.h 2009-03-14 22:39:09.000000000 +0000
1858 +++ olsrd-0-5-6-fc691af9a18d/src/routing_table.h 2009-03-15 16:32:39.000000000 +0000
1859 @@ -210,9 +210,11 @@
1860 bool olsr_cmp_rt(const struct rt_entry *, const struct rt_entry *);
1861 uint8_t olsr_fib_metric(const struct rt_metric *);
1863 +#ifndef SVEN_OLA_UNBLOAT
1864 char *olsr_rt_to_string(const struct rt_entry *);
1865 char *olsr_rtp_to_string(const struct rt_path *);
1866 void olsr_print_routing_table(struct avl_tree *);
1867 +#endif /* SVEN_OLA_UNBLOAT */
1869 const struct rt_nexthop *olsr_get_nh(const struct rt_entry *);
1871 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/tc_set.c olsrd-0-5-6-fc691af9a18d/src/tc_set.c
1872 --- olsrd-0-5-6-fc691af9a18d.orig/src/tc_set.c 2009-03-14 22:39:09.000000000 +0000
1873 +++ olsrd-0-5-6-fc691af9a18d/src/tc_set.c 2009-03-15 16:32:39.000000000 +0000
1876 * Format tc_edge contents into a buffer.
1878 +#ifndef SVEN_OLA_UNBLOAT
1880 olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
1886 +#endif /* SVEN_OLA_UNBLOAT */
1889 * Wrapper for the timer callback.
1892 * Print the topology table to stdout
1894 +#ifndef SVEN_OLA_UNBLOAT
1896 olsr_print_tc_table(void)
1899 } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
1902 +#endif /* SVEN_OLA_UNBLOAT */
1905 * calculate the border IPs of a tc edge set according to the border flags
1906 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/tc_set.h olsrd-0-5-6-fc691af9a18d/src/tc_set.h
1907 --- olsrd-0-5-6-fc691af9a18d.orig/src/tc_set.h 2009-03-14 22:39:09.000000000 +0000
1908 +++ olsrd-0-5-6-fc691af9a18d/src/tc_set.h 2009-03-15 16:47:08.000000000 +0000
1911 /* tc_edge_entry manipulation */
1912 bool olsr_delete_outdated_tc_edges(struct tc_entry *);
1913 +#ifndef SVEN_OLA_UNBLOAT
1914 char *olsr_tc_edge_to_string(struct tc_edge_entry *);
1915 +#endif /* SVEN_OLA_UNBLOAT */
1916 struct tc_edge_entry *olsr_lookup_tc_edge(struct tc_entry *, union olsr_ip_addr *);
1917 struct tc_edge_entry *olsr_add_tc_edge_entry(struct tc_entry *, union olsr_ip_addr *, uint16_t);
1918 void olsr_delete_tc_entry(struct tc_entry *);
1919 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/two_hop_neighbor_table.c olsrd-0-5-6-fc691af9a18d/src/two_hop_neighbor_table.c
1920 --- olsrd-0-5-6-fc691af9a18d.orig/src/two_hop_neighbor_table.c 2009-03-14 22:39:09.000000000 +0000
1921 +++ olsrd-0-5-6-fc691af9a18d/src/two_hop_neighbor_table.c 2009-03-15 16:32:39.000000000 +0000
1926 +#ifndef SVEN_OLA_UNBLOAT
1929 *Print the two hop neighbor table to STDOUT.
1935 +#endif /* SVEN_OLA_UNBLOAT */
1939 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/unix/ifnet.c olsrd-0-5-6-fc691af9a18d/src/unix/ifnet.c
1940 --- olsrd-0-5-6-fc691af9a18d.orig/src/unix/ifnet.c 2009-03-14 22:39:09.000000000 +0000
1941 +++ olsrd-0-5-6-fc691af9a18d/src/unix/ifnet.c 2009-03-15 16:32:39.000000000 +0000
1944 #define BUFSPACE (127*1024) /* max. input buffer size to request */
1946 +#ifndef SVEN_OLA_UNBLOAT
1949 set_flag(char *ifname, short flag __attribute__ ((unused)))
1955 +#endif /* SVEN_OLA_UNBLOAT */
1958 check_interface_updates(void *foo __attribute__ ((unused)))
1960 @@ -110,11 +114,13 @@
1963 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
1964 +#ifndef SVEN_OLA_UNBLOAT
1965 if (tmp_if->host_emul)
1968 if (olsr_cnf->host_emul) /* XXX: TEMPORARY! */
1970 +#endif /* SVEN_OLA_UNBLOAT */
1972 if (!tmp_if->cnf->autodetect_chg) {
1974 @@ -154,8 +160,10 @@
1975 OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name);
1978 +#ifndef SVEN_OLA_UNBLOAT
1979 if (iface->host_emul)
1981 +#endif /* SVEN_OLA_UNBLOAT */
1983 ifp = iface->interf;
1989 +#ifndef SVEN_OLA_UNBLOAT
1990 struct ipaddr_str buf;
1991 +#endif /* SVEN_OLA_UNBLOAT */
1992 /* Check interface address (IPv4) */
1993 if (ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) {
1994 OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n");
1997 if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) {
1998 OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
1999 +#ifndef SVEN_OLA_UNBLOAT
2000 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2001 +#endif /* SVEN_OLA_UNBLOAT */
2002 memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize);
2008 OLSR_PRINTF(1, "Removing interface %s\n", iface->name);
2009 +#ifndef SVEN_OLA_UNBLOAT
2010 olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
2011 +#endif /* SVEN_OLA_UNBLOAT */
2013 olsr_delete_link_entry_by_ip(&ifp->ip_addr);
2015 @@ -398,10 +412,14 @@
2016 memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
2017 OLSR_PRINTF(1, "No more interfaces...\n");
2019 +#if !defined(SVEN_OLA_UNBLOAT)
2020 struct ipaddr_str buf;
2021 +#endif /* SVEN_OLA_UNBLOAT */
2022 olsr_cnf->main_addr = ifnet->ip_addr;
2023 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2024 +#ifndef SVEN_OLA_UNBLOAT
2025 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2026 +#endif /* SVEN_OLA_UNBLOAT */
2032 if ((ifnet == NULL) && (!olsr_cnf->allow_no_interfaces)) {
2033 OLSR_PRINTF(1, "No more active interfaces - exiting.\n");
2034 +#ifndef SVEN_OLA_UNBLOAT
2035 olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n");
2036 +#endif /* SVEN_OLA_UNBLOAT */
2037 olsr_cnf->exit_value = EXIT_FAILURE;
2038 kill(getpid(), SIGINT);
2044 +#ifndef SVEN_OLA_UNBLOAT
2047 * Initializes the special interface used in
2048 * host-client emulation
2053 +#endif /* SVEN_OLA_UNBLOAT */
2055 static char basenamestr[32];
2056 static const char *if_basename(const char *name);
2057 @@ -618,8 +641,10 @@
2058 int tos_bits = IPTOS_TOS(olsr_cnf->tos);
2061 +#ifndef SVEN_OLA_UNBLOAT
2062 if (iface->host_emul)
2064 +#endif /* SVEN_OLA_UNBLOAT */
2066 memset(&ifr, 0, sizeof(struct ifreq));
2067 memset(&ifs, 0, sizeof(struct interface));
2068 @@ -726,11 +751,13 @@
2069 ifs.int_broadaddr = *(struct sockaddr_in *)&ifr.ifr_broadaddr;
2072 +#ifndef SVEN_OLA_UNBLOAT
2073 /* Deactivate IP spoof filter */
2074 deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2076 /* Disable ICMP redirects */
2077 disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2078 +#endif /* SVEN_OLA_UNBLOAT */
2084 OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu);
2086 +#ifndef SVEN_OLA_UNBLOAT
2087 olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name);
2088 +#endif /* SVEN_OLA_UNBLOAT */
2089 OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index);
2091 if (olsr_cnf->ip_version == AF_INET) {
2092 @@ -865,10 +894,14 @@
2094 memset(&null_addr, 0, olsr_cnf->ipsize);
2095 if (ipequal(&null_addr, &olsr_cnf->main_addr)) {
2096 +#ifndef SVEN_OLA_UNBLOAT
2097 struct ipaddr_str buf;
2099 olsr_cnf->main_addr = ifp->ip_addr;
2100 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2101 +#ifndef SVEN_OLA_UNBLOAT
2102 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2103 +#endif /* SVEN_OLA_UNBLOAT */
2107 diff -ur olsrd-0-5-6-fc691af9a18d.orig/src/unix/misc.c olsrd-0-5-6-fc691af9a18d/src/unix/misc.c
2108 --- olsrd-0-5-6-fc691af9a18d.orig/src/unix/misc.c 2009-03-14 22:39:09.000000000 +0000
2109 +++ olsrd-0-5-6-fc691af9a18d/src/unix/misc.c 2009-03-15 16:32:39.000000000 +0000
2112 #include "olsr_types.h"
2114 +#ifndef SVEN_OLA_UNBLOAT
2122 +#endif /* SVEN_OLA_UNBLOAT */