1 diff -ur olsrd-0.5.6-r4.orig/Makefile.inc olsrd-0.5.6-r4/Makefile.inc
2 --- olsrd-0.5.6-r4.orig/Makefile.inc 2009-03-27 17:32:46.000000000 +0000
3 +++ olsrd-0.5.6-r4/Makefile.inc 2009-03-27 17:33:00.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-r4.orig/lib/bmf/src/NetworkInterfaces.c olsrd-0.5.6-r4/lib/bmf/src/NetworkInterfaces.c
16 --- olsrd-0.5.6-r4.orig/lib/bmf/src/NetworkInterfaces.c 2009-03-27 17:32:46.000000000 +0000
17 +++ olsrd-0.5.6-r4/lib/bmf/src/NetworkInterfaces.c 2009-03-27 17:33:00.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-r4.orig/lib/httpinfo/Makefile olsrd-0.5.6-r4/lib/httpinfo/Makefile
29 --- olsrd-0.5.6-r4.orig/lib/httpinfo/Makefile 2009-03-27 17:32:46.000000000 +0000
30 +++ olsrd-0.5.6-r4/lib/httpinfo/Makefile 2009-03-27 17:33:00.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-r4.orig/lib/httpinfo/src/olsrd_httpinfo.c olsrd-0.5.6-r4/lib/httpinfo/src/olsrd_httpinfo.c
44 --- olsrd-0.5.6-r4.orig/lib/httpinfo/src/olsrd_httpinfo.c 2009-03-27 17:32:46.000000000 +0000
45 +++ olsrd-0.5.6-r4/lib/httpinfo/src/olsrd_httpinfo.c 2009-03-27 17:33:00.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-r4.orig/lib/nameservice/src/nameservice.c olsrd-0.5.6-r4/lib/nameservice/src/nameservice.c
163 --- olsrd-0.5.6-r4.orig/lib/nameservice/src/nameservice.c 2009-03-27 17:32:46.000000000 +0000
164 +++ olsrd-0.5.6-r4/lib/nameservice/src/nameservice.c 2009-03-27 17:33:00.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-r4.orig/src/apm.h olsrd-0.5.6-r4/src/apm.h
467 --- olsrd-0.5.6-r4.orig/src/apm.h 2009-03-27 17:32:46.000000000 +0000
468 +++ olsrd-0.5.6-r4/src/apm.h 2009-03-27 17:33:00.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-r4.orig/src/cfgparser/cfgfile_gen.c olsrd-0.5.6-r4/src/cfgparser/cfgfile_gen.c
486 --- olsrd-0.5.6-r4.orig/src/cfgparser/cfgfile_gen.c 2009-03-27 17:32:46.000000000 +0000
487 +++ olsrd-0.5.6-r4/src/cfgparser/cfgfile_gen.c 2009-03-27 17:33:00.000000000 +0000
489 struct olsr_if *in = cnf->interfaces;
490 struct plugin_entry *pe = cnf->plugins;
491 struct plugin_param *pp;
492 +#ifndef SVEN_OLA_UNBLOAT
493 struct ip_prefix_list *ie = cnf->ipc_nets;
494 +#endif /* SVEN_OLA_UNBLOAT */
495 struct olsr_lq_mult *mult;
497 char ipv6_buf[100]; /* buffer for IPv6 inet_htop */
500 fprintf(fd, "Willingness\t%d\n\n", cnf->willingness);
502 +#ifndef SVEN_OLA_UNBLOAT
504 fprintf(fd, "# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
505 fprintf(fd, "IpcConnect {\n");
509 fprintf(fd, "}\n\n");
510 +#endif /* SVEN_OLA_UNBLOAT */
513 fprintf(fd, "# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
515 struct olsr_if *in = cnf->interfaces;
516 struct plugin_entry *pe = cnf->plugins;
517 struct plugin_param *pp;
518 +#ifndef SVEN_OLA_UNBLOAT
519 struct ip_prefix_list *ie = cnf->ipc_nets;
520 +#endif /* SVEN_OLA_UNBLOAT */
521 struct olsr_lq_mult *mult;
526 WRITE_TO_BUF("Willingness\t%d\n\n", cnf->willingness);
528 +#ifndef SVEN_OLA_UNBLOAT
530 WRITE_TO_BUF("# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
531 WRITE_TO_BUF("IpcConnect {\n");
535 WRITE_TO_BUF("}\n\n");
536 +#endif /* SVEN_OLA_UNBLOAT */
539 WRITE_TO_BUF("# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
540 diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/local.mk olsrd-0.5.6-r4/src/cfgparser/local.mk
541 --- olsrd-0.5.6-r4.orig/src/cfgparser/local.mk 2009-03-27 17:32:46.000000000 +0000
542 +++ olsrd-0.5.6-r4/src/cfgparser/local.mk 2009-03-27 17:33:00.000000000 +0000
544 C=$(if $(CFGDIR),$(CFGDIR)/)
546 # add the variables as we may have others already there
547 +ifeq ($(SVEN_OLA_UNBLOAT),1)
548 +SRCS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).c)
549 +OBJS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).o)
551 SRCS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).c)
552 OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o)
554 HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
556 $(C)oscan.c: $(C)oscan.lex $(C)Makefile
557 diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/olsrd_conf.c olsrd-0.5.6-r4/src/cfgparser/olsrd_conf.c
558 --- olsrd-0.5.6-r4.orig/src/cfgparser/olsrd_conf.c 2009-03-27 17:32:46.000000000 +0000
559 +++ olsrd-0.5.6-r4/src/cfgparser/olsrd_conf.c 2009-03-27 17:33:00.000000000 +0000
563 if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) {
564 +#ifndef SVEN_OLA_UNBLOAT
565 if ((argc > 2) && (!strcmp(argv[2], "-print"))) {
566 olsrd_print_cnf(cnf);
567 olsrd_write_cnf(cnf, "./out.conf");
569 printf("Use -print to view parsed values\n");
570 +#endif /* SVEN_OLA_UNBLOAT */
571 printf("Configfile parsed OK\n");
573 printf("Failed parsing \"%s\"\n", argv[1]);
575 /* set various stuff */
576 in->configured = false;
578 +#ifndef SVEN_OLA_UNBLOAT
579 in->host_emul = false;
580 +#endif /* SVEN_OLA_UNBLOAT */
586 cnf->debug_level = DEF_DEBUGLVL;
587 cnf->no_fork = false;
588 +#ifndef SVEN_OLA_UNBLOAT
589 cnf->host_emul = false;
590 +#endif /* SVEN_OLA_UNBLOAT */
591 cnf->ip_version = AF_INET;
592 cnf->ipsize = sizeof(struct in_addr);
595 cnf->rtproto = DEF_RTPROTO;
596 cnf->rttable_default = 0;
597 cnf->willingness_auto = DEF_WILL_AUTO;
598 +#ifndef SVEN_OLA_UNBLOAT
599 cnf->ipc_connections = DEF_IPC_CONNECTIONS;
600 +#endif /* SVEN_OLA_UNBLOAT */
601 cnf->fib_metric = DEF_FIB_METRIC;
603 cnf->use_hysteresis = DEF_USE_HYST;
608 +#ifndef SVEN_OLA_UNBLOAT
610 olsrd_print_cnf(struct olsrd_config *cnf)
616 +#endif /* SVEN_OLA_UNBLOAT */
620 diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/oparse.y olsrd-0.5.6-r4/src/cfgparser/oparse.y
621 --- olsrd-0.5.6-r4.orig/src/cfgparser/oparse.y 2009-03-27 17:32:46.000000000 +0000
622 +++ olsrd-0.5.6-r4/src/cfgparser/oparse.y 2009-03-27 17:33:00.000000000 +0000
625 %token TOK_RTTABLE_DEFAULT
626 %token TOK_WILLINGNESS
637 %token TOK_IP4BROADCAST
641 block: TOK_HNA4 hna4body
643 - | TOK_IPCCON ipcbody
651 -ipcbody: TOK_OPEN ipcstmts TOK_CLOSE
654 -ipcstmts: | ipcstmts ipcstmt
663 ifblock: ifstart ifnicks
670 -imaxipc: TOK_MAXIPC TOK_INTEGER
672 - olsr_cnf->ipc_connections = $2->integer;
677 -ipchost: TOK_HOSTLABEL TOK_IP4_ADDR
679 - union olsr_ip_addr ipaddr;
680 - PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string);
682 - if (inet_aton($2->string, &ipaddr.v4) == 0) {
683 - fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string);
687 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen);
694 -ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR
696 - union olsr_ip_addr ipaddr, netmask;
698 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
700 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
701 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
705 - if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) {
706 - fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string);
710 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask));
717 - | TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER
719 - union olsr_ip_addr ipaddr;
721 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
723 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
724 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
728 - if ($4->integer > olsr_cnf->maxplen) {
729 - fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen);
733 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer);
741 iifweight: TOK_IFWEIGHT TOK_INTEGER
743 int ifcnt = ifs_in_curr_cfg;
744 diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/oscan.lex olsrd-0.5.6-r4/src/cfgparser/oscan.lex
745 --- olsrd-0.5.6-r4.orig/src/cfgparser/oscan.lex 2009-03-27 17:32:46.000000000 +0000
746 +++ olsrd-0.5.6-r4/src/cfgparser/oscan.lex 2009-03-27 17:33:00.000000000 +0000
758 return TOK_DEBUGLEVEL;
760 return TOK_WILLINGNESS;
770 return TOK_FIBMETRIC;
771 diff -ur olsrd-0.5.6-r4.orig/src/defs.h olsrd-0.5.6-r4/src/defs.h
772 --- olsrd-0.5.6-r4.orig/src/defs.h 2009-03-27 17:32:46.000000000 +0000
773 +++ olsrd-0.5.6-r4/src/defs.h 2009-03-27 17:33:00.000000000 +0000
776 clock_t olsr_times(void);
778 +#ifndef SVEN_OLA_UNBLOAT
782 *These are moved to a plugin soon
784 int ipc_output(struct olsr *);
787 +#endif /* SVEN_OLA_UNBLOAT */
791 diff -ur olsrd-0.5.6-r4.orig/src/duplicate_set.c olsrd-0.5.6-r4/src/duplicate_set.c
792 --- olsrd-0.5.6-r4.orig/src/duplicate_set.c 2009-03-27 17:32:46.000000000 +0000
793 +++ olsrd-0.5.6-r4/src/duplicate_set.c 2009-03-27 17:33:00.000000000 +0000
795 return false; /* no duplicate */
798 +#ifndef SVEN_OLA_UNBLOAT
800 olsr_print_duplicate_table(void)
803 } OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
806 +#endif /* SVEN_OLA_UNBLOAT */
810 diff -ur olsrd-0.5.6-r4.orig/src/hna_set.c olsrd-0.5.6-r4/src/hna_set.c
811 --- olsrd-0.5.6-r4.orig/src/hna_set.c 2009-03-27 17:32:46.000000000 +0000
812 +++ olsrd-0.5.6-r4/src/hna_set.c 2009-03-27 17:33:00.000000000 +0000
817 +#ifndef SVEN_OLA_UNBLOAT
819 olsr_print_hna_set(void)
825 +#endif /* SVEN_OLA_UNBLOAT */
828 *Process incoming HNA message.
829 diff -ur olsrd-0.5.6-r4.orig/src/interfaces.c olsrd-0.5.6-r4/src/interfaces.c
830 --- olsrd-0.5.6-r4.orig/src/interfaces.c 2009-03-27 17:32:46.000000000 +0000
831 +++ olsrd-0.5.6-r4/src/interfaces.c 2009-03-27 17:33:00.000000000 +0000
833 OLSR_PRINTF(1, "\n ---- Interface configuration ---- \n\n");
834 /* Run trough all interfaces immedeatly */
835 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
836 +#ifndef SVEN_OLA_UNBLOAT
837 if (!tmp_if->host_emul) {
838 if (!olsr_cnf->host_emul) /* XXX: TEMPORARY! */
839 +#endif /* SVEN_OLA_UNBLOAT */
840 chk_if_up(tmp_if, 1);
841 +#ifndef SVEN_OLA_UNBLOAT
845 +#endif /* SVEN_OLA_UNBLOAT */
848 /* Kick a periodic timer for the network interface update function */
853 +#ifdef SVEN_OLA_UNBLOAT
854 +queue_if(const char *name)
855 +#else /* SVEN_OLA_UNBLOAT */
856 queue_if(const char *name, int hemu)
857 +#endif /* SVEN_OLA_UNBLOAT */
859 struct olsr_if *interf_n = olsr_cnf->interfaces;
862 interf_n->interf = NULL;
863 interf_n->configured = 0;
865 +#ifndef SVEN_OLA_UNBLOAT
866 interf_n->host_emul = hemu ? true : false;
867 +#endif /* SVEN_OLA_UNBLOAT */
869 strscpy(interf_n->name, name, name_size);
870 interf_n->next = olsr_cnf->interfaces;
871 diff -ur olsrd-0.5.6-r4.orig/src/interfaces.h olsrd-0.5.6-r4/src/interfaces.h
872 --- olsrd-0.5.6-r4.orig/src/interfaces.h 2009-03-27 17:32:46.000000000 +0000
873 +++ olsrd-0.5.6-r4/src/interfaces.h 2009-03-27 17:33:00.000000000 +0000
876 struct interface *if_ifwithindex(const int if_index);
878 -struct olsr_if *queue_if(const char *, int);
880 +#ifdef SVEN_OLA_UNBLOAT
881 + queue_if(const char *);
882 +#else /* SVEN_OLA_UNBLOAT */
883 + queue_if(const char *, int);
884 +#endif /* SVEN_OLA_UNBLOAT */
886 int add_ifchgf(int (*f) (struct interface *, int));
888 diff -ur olsrd-0.5.6-r4.orig/src/ipc_frontend.c olsrd-0.5.6-r4/src/ipc_frontend.c
889 --- olsrd-0.5.6-r4.orig/src/ipc_frontend.c 2009-03-27 17:32:46.000000000 +0000
890 +++ olsrd-0.5.6-r4/src/ipc_frontend.c 2009-03-27 17:33:00.000000000 +0000
895 +#ifndef SVEN_OLA_UNBLOAT
896 #include "ipc_frontend.h"
897 #include "link_set.h"
903 +#endif /* SVEN_OLA_UNBLOAT */
907 diff -ur olsrd-0.5.6-r4.orig/src/ipc_frontend.h olsrd-0.5.6-r4/src/ipc_frontend.h
908 --- olsrd-0.5.6-r4.orig/src/ipc_frontend.h 2009-03-27 17:32:46.000000000 +0000
909 +++ olsrd-0.5.6-r4/src/ipc_frontend.h 2009-03-27 17:33:00.000000000 +0000
914 +#ifndef SVEN_OLA_UNBLOAT
916 #include <sys/types.h>
917 #include <netinet/in.h>
919 int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *);
922 +#endif /* SVEN_OLA_UNBLOAT */
926 diff -ur olsrd-0.5.6-r4.orig/src/ipcalc.c olsrd-0.5.6-r4/src/ipcalc.c
927 --- olsrd-0.5.6-r4.orig/src/ipcalc.c 2009-03-27 17:32:46.000000000 +0000
928 +++ olsrd-0.5.6-r4/src/ipcalc.c 2009-03-27 17:33:00.000000000 +0000
933 +#ifndef SVEN_OLA_UNBLOAT
935 olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
941 +#endif /* SVEN_OLA_UNBLOAT */
943 /* see if the ipaddr is in the net. That is equivalent to the fact that the net part
944 * of both are equal. So we must compare the first <prefixlen> bits.
945 diff -ur olsrd-0.5.6-r4.orig/src/ipcalc.h olsrd-0.5.6-r4/src/ipcalc.h
946 --- olsrd-0.5.6-r4.orig/src/ipcalc.h 2009-03-27 17:32:46.000000000 +0000
947 +++ olsrd-0.5.6-r4/src/ipcalc.h 2009-03-27 17:33:00.000000000 +0000
949 return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
952 +#ifndef SVEN_OLA_UNBLOAT
953 const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
954 +#endif /* SVEN_OLA_UNBLOAT */
956 static INLINE const char *
957 sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr)
958 diff -ur olsrd-0.5.6-r4.orig/src/link_set.c olsrd-0.5.6-r4/src/link_set.c
959 --- olsrd-0.5.6-r4.orig/src/link_set.c 2009-03-27 17:32:46.000000000 +0000
960 +++ olsrd-0.5.6-r4/src/link_set.c 2009-03-27 17:33:00.000000000 +0000
965 +#ifndef SVEN_OLA_UNBLOAT
967 olsr_print_link_set(void)
970 } OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
973 +#endif /* SVEN_OLA_UNBLOAT */
976 * called for every LQ HELLO message.
977 diff -ur olsrd-0.5.6-r4.orig/src/linux/apm.c olsrd-0.5.6-r4/src/linux/apm.c
978 --- olsrd-0.5.6-r4.orig/src/linux/apm.c 2009-03-27 17:32:46.000000000 +0000
979 +++ olsrd-0.5.6-r4/src/linux/apm.c 2009-03-27 17:33:00.000000000 +0000
981 * Acpi-Power Enlightenment epplet
984 +#ifndef SVEN_OLA_UNBLOAT
989 /* No battery found */
992 +#endif /* SVEN_OLA_UNBLOAT */
996 diff -ur olsrd-0.5.6-r4.orig/src/linux/kernel_routes.c olsrd-0.5.6-r4/src/linux/kernel_routes.c
997 --- olsrd-0.5.6-r4.orig/src/linux/kernel_routes.c 2009-03-27 17:32:46.000000000 +0000
998 +++ olsrd-0.5.6-r4/src/linux/kernel_routes.c 2009-03-27 17:33:00.000000000 +0000
999 @@ -300,11 +300,13 @@
1000 if (rt_ret > 0) rt_ret = 0; /* successful recovery */
1001 else rt_ret = -1; /* unrecoverable error */
1003 +#ifndef SVEN_OLA_UNBLOAT
1004 //send ipc update on success
1005 if ( ( cmd != RTM_NEWRULE ) & ( cmd != RTM_DELRULE ) & (flag = RT_ORIG_REQUEST) & (0 <= rt_ret && olsr_cnf->ipc_connections > 0)) {
1006 ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd,
1007 if_ifwithindex_name(nexthop->iif_index));
1009 +#endif /* SVEN_OLA_UNBLOAT */
1010 if (rt_ret == -2) olsr_syslog(OLSR_LOG_ERR,"no rtnetlink response! (no system ressources left?, everything may happen now ...)");
1015 #endif /* LINUX_POLICY_ROUTING */
1017 +#ifndef SVEN_OLA_UNBLOAT
1018 OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
1019 +#endif /* SVEN_OLA_UNBLOAT */
1021 #if !LINUX_POLICY_ROUTING
1022 memset(&kernel_route, 0, sizeof(struct rtentry));
1024 struct in6_rtmsg kernel_route;
1027 +#ifndef SVEN_OLA_UNBLOAT
1028 OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
1029 +#endif /* SVEN_OLA_UNBLOAT */
1031 memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
1035 #endif /* LINUX_POLICY_ROUTING */
1037 +#ifndef SVEN_OLA_UNBLOAT
1038 OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
1039 +#endif /* SVEN_OLA_UNBLOAT */
1041 #if !LINUX_POLICY_ROUTING
1042 memset(&kernel_route, 0, sizeof(struct rtentry));
1045 #endif /* LINUX_POLICY_ROUTING */
1047 +#ifndef SVEN_OLA_UNBLOAT
1048 OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
1049 +#endif /* SVEN_OLA_UNBLOAT */
1051 #if !LINUX_POLICY_ROUTING
1052 memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
1053 diff -ur olsrd-0.5.6-r4.orig/src/linux/net.c olsrd-0.5.6-r4/src/linux/net.c
1054 --- olsrd-0.5.6-r4.orig/src/linux/net.c 2009-03-27 17:32:46.000000000 +0000
1055 +++ olsrd-0.5.6-r4/src/linux/net.c 2009-03-27 17:33:00.000000000 +0000
1057 #define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
1059 /* The original state of the IP forwarding proc entry */
1060 +#ifndef SVEN_OLA_UNBLOAT
1061 static char orig_fwd_state;
1062 static char orig_global_redirect_state;
1063 +#endif /* SVEN_OLA_UNBLOAT */
1066 *Bind a socket to a device
1068 return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1);
1071 +#ifndef SVEN_OLA_UNBLOAT
1074 *Enable IP forwarding.
1075 *Just writing "1" to the /proc/sys/net/ipv4/ip_forward
1077 const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
1079 if ((proc_fwd = fopen(procfile, "r")) == NULL) {
1080 +#ifdef SVEN_OLA_UNBLOAT_OLD
1084 if (version == AF_INET)
1094 @@ -131,9 +139,13 @@
1095 OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
1097 if ((proc_fwd = fopen(procfile, "w")) == NULL) {
1098 +#ifdef SVEN_OLA_UNBLOAT_OLD
1101 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1102 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP forwarding is enabeled!\n\n");
1107 syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile);
1108 @@ -154,11 +166,15 @@
1111 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1112 +#ifdef SVEN_OLA_UNBLOAT_OLD
1116 "WARNING! Could not open the %s file to check/disable ICMP redirects!\nAre you using the procfile filesystem?\nDoes your system support IPv4?\nI will continue(in 3 sec) - but you should mannually ensure that ICMP redirects are disabled!\n\n",
1123 orig_global_redirect_state = fgetc(proc_redirect);
1124 @@ -168,9 +184,13 @@
1127 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1128 +#ifdef SVEN_OLA_UNBLOAT_OLD
1131 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1132 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1137 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1138 @@ -196,19 +216,27 @@
1139 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name);
1141 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1142 +#ifdef SVEN_OLA_UNBLOAT_OLD
1146 "WARNING! Could not open the %s file to check/disable ICMP redirects!\nAre you using the procfile filesystem?\nDoes your system support IPv4?\nI will continue(in 3 sec) - but you should mannually ensure that ICMP redirects are disabled!\n\n",
1152 iface->nic_state.redirect = fgetc(proc_redirect);
1153 fclose(proc_redirect);
1155 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1156 +#ifdef SVEN_OLA_UNBLOAT_OLD
1159 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1160 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1165 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1166 @@ -234,20 +262,28 @@
1167 sprintf(procfile, SPOOF_PROC, if_name);
1169 if ((proc_spoof = fopen(procfile, "r")) == NULL) {
1170 +#ifdef SVEN_OLA_UNBLOAT_OLD
1174 "WARNING! Could not open the %s file to check/disable the IP spoof filter!\nAre you using the procfile filesystem?\nDoes your system support IPv4?\nI will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabled!\n\n",
1181 iface->nic_state.spoof = fgetc(proc_spoof);
1184 if ((proc_spoof = fopen(procfile, "w")) == NULL) {
1185 +#ifdef SVEN_OLA_UNBLOAT_OLD
1188 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1189 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabeled!\n\n");
1194 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1195 @@ -272,7 +308,11 @@
1198 if ((proc_fd = fopen(procfile, "w")) == NULL) {
1199 +#ifdef SVEN_OLA_UNBLOAT_OLD
1202 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1205 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state);
1206 fputc(orig_fwd_state, proc_fd);
1207 @@ -287,7 +327,11 @@
1210 if ((proc_fd = fopen(procfile, "w")) == NULL) {
1211 +#ifdef SVEN_OLA_UNBLOAT_OLD
1214 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1217 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state);
1218 fputc(orig_global_redirect_state, proc_fd);
1219 @@ -311,7 +355,11 @@
1220 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name);
1222 if ((proc_fd = fopen(procfile, "w")) == NULL)
1223 +#ifdef SVEN_OLA_UNBLOAT_OLD
1226 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1229 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect);
1231 @@ -324,7 +372,11 @@
1232 /* Generate the procfile name */
1233 sprintf(procfile, SPOOF_PROC, ifs->int_name);
1234 if ((proc_fd = fopen(procfile, "w")) == NULL)
1235 +#ifdef SVEN_OLA_UNBLOAT_OLD
1238 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1241 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof);
1247 +#endif /* SVEN_OLA_UNBLOAT */
1250 *Creates a nonblocking broadcast socket.
1251 *@param sa sockaddr struct. Used for bind(2).
1252 diff -ur olsrd-0.5.6-r4.orig/src/lq_plugin.c olsrd-0.5.6-r4/src/lq_plugin.c
1253 --- olsrd-0.5.6-r4.orig/src/lq_plugin.c 2009-03-27 17:32:46.000000000 +0000
1254 +++ olsrd-0.5.6-r4/src/lq_plugin.c 2009-03-27 17:33:00.000000000 +0000
1256 init_lq_handler_tree(void)
1258 avl_init(&lq_handler_tree, &avl_strcasecmp);
1259 +#ifndef SVEN_OLA_UNBLOAT
1260 register_lq_handler(&lq_etx_float_handler, LQ_ALGORITHM_ETX_FLOAT_NAME);
1261 register_lq_handler(&lq_etx_fpm_handler, LQ_ALGORITHM_ETX_FPM_NAME);
1262 +#endif /* SVEN_OLA_UNBLOAT */
1263 register_lq_handler(&lq_etx_ff_handler, LQ_ALGORITHM_ETX_FF_NAME);
1264 +#ifndef SVEN_OLA_UNBLOAT
1265 if (activate_lq_handler(olsr_cnf->lq_algorithm)) {
1266 activate_lq_handler(LQ_ALGORITHM_ETX_FPM_NAME);
1268 +#else /* SVEN_OLA_UNBLOAT */
1269 + activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME);
1270 +#endif /* SVEN_OLA_UNBLOAT */
1274 @@ -417,7 +423,11 @@
1275 * @return pointer to hello_neighbor
1277 struct hello_neighbor *
1278 +#ifndef SVEN_OLA_UNBLOAT
1279 olsr_malloc_hello_neighbor(const char *id)
1280 +#else /* SVEN_OLA_UNBLOAT */
1281 +olsr_malloc_hello_neighbor(const char *id __attribute__ ((unused)))
1282 +#endif /* SVEN_OLA_UNBLOAT */
1284 struct hello_neighbor *h;
1286 @@ -439,7 +449,11 @@
1287 * @return pointer to tc_mpr_addr
1289 struct tc_mpr_addr *
1290 +#ifndef SVEN_OLA_UNBLOAT
1291 olsr_malloc_tc_mpr_addr(const char *id)
1292 +#else /* SVEN_OLA_UNBLOAT */
1293 +olsr_malloc_tc_mpr_addr(const char *id __attribute__ ((unused)))
1294 +#endif /* SVEN_OLA_UNBLOAT */
1296 struct tc_mpr_addr *t;
1298 @@ -461,7 +475,11 @@
1299 * @return pointer to lq_hello_neighbor
1301 struct lq_hello_neighbor *
1302 +#ifndef SVEN_OLA_UNBLOAT
1303 olsr_malloc_lq_hello_neighbor(const char *id)
1304 +#else /* SVEN_OLA_UNBLOAT */
1305 +olsr_malloc_lq_hello_neighbor(const char *id __attribute__ ((unused)))
1306 +#endif /* SVEN_OLA_UNBLOAT */
1308 struct lq_hello_neighbor *h;
1310 @@ -483,7 +501,11 @@
1311 * @return pointer to link_entry
1314 +#ifndef SVEN_OLA_UNBLOAT
1315 olsr_malloc_link_entry(const char *id)
1316 +#else /* SVEN_OLA_UNBLOAT */
1317 +olsr_malloc_link_entry(const char *id __attribute__ ((unused)))
1318 +#endif /* SVEN_OLA_UNBLOAT */
1320 struct link_entry *h;
1322 diff -ur olsrd-0.5.6-r4.orig/src/lq_plugin_default_float.c olsrd-0.5.6-r4/src/lq_plugin_default_float.c
1323 --- olsrd-0.5.6-r4.orig/src/lq_plugin_default_float.c 2009-03-27 17:32:46.000000000 +0000
1324 +++ olsrd-0.5.6-r4/src/lq_plugin_default_float.c 2009-03-27 17:33:00.000000000 +0000
1329 +#ifndef SVEN_OLA_UNBLOAT
1331 #include "link_set.h"
1332 #include "olsr_spf.h"
1337 +#endif /* SVEN_OLA_UNBLOAT */
1341 diff -ur olsrd-0.5.6-r4.orig/src/lq_plugin_default_float.h olsrd-0.5.6-r4/src/lq_plugin_default_float.h
1342 --- olsrd-0.5.6-r4.orig/src/lq_plugin_default_float.h 2009-03-27 17:32:46.000000000 +0000
1343 +++ olsrd-0.5.6-r4/src/lq_plugin_default_float.h 2009-03-27 17:33:00.000000000 +0000
1348 +#ifndef SVEN_OLA_UNBLOAT
1349 #ifndef LQ_PLUGIN_DEFAULT_H_
1350 #define LQ_PLUGIN_DEFAULT_H_
1353 extern struct lq_handler lq_etx_float_handler;
1355 #endif /*LQ_PLUGIN_DEFAULT_H_ */
1356 +#endif /* SVEN_OLA_UNBLOAT */
1360 diff -ur olsrd-0.5.6-r4.orig/src/lq_plugin_default_fpm.c olsrd-0.5.6-r4/src/lq_plugin_default_fpm.c
1361 --- olsrd-0.5.6-r4.orig/src/lq_plugin_default_fpm.c 2009-03-27 17:32:46.000000000 +0000
1362 +++ olsrd-0.5.6-r4/src/lq_plugin_default_fpm.c 2009-03-27 17:33:00.000000000 +0000
1367 +#ifndef SVEN_OLA_UNBLOAT
1369 #include "link_set.h"
1370 #include "lq_plugin.h"
1372 snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER);
1375 +#endif /* SVEN_OLA_UNBLOAT */
1379 diff -ur olsrd-0.5.6-r4.orig/src/lq_plugin_default_fpm.h olsrd-0.5.6-r4/src/lq_plugin_default_fpm.h
1380 --- olsrd-0.5.6-r4.orig/src/lq_plugin_default_fpm.h 2009-03-27 17:32:46.000000000 +0000
1381 +++ olsrd-0.5.6-r4/src/lq_plugin_default_fpm.h 2009-03-27 17:33:00.000000000 +0000
1386 +#ifndef SVEN_OLA_UNBLOAT
1391 extern struct lq_handler lq_etx_fpm_handler;
1393 #endif /*LQ_ETX_FPM_ */
1394 +#endif /* SVEN_OLA_UNBLOAT */
1398 diff -ur olsrd-0.5.6-r4.orig/src/main.c olsrd-0.5.6-r4/src/main.c
1399 --- olsrd-0.5.6-r4.orig/src/main.c 2009-03-27 17:32:46.000000000 +0000
1400 +++ olsrd-0.5.6-r4/src/main.c 2009-03-27 17:33:00.000000000 +0000
1401 @@ -256,13 +256,17 @@
1403 * Print configuration
1405 +#ifndef SVEN_OLA_UNBLOAT
1406 if (olsr_cnf->debug_level > 1) {
1407 olsrd_print_cnf(olsr_cnf);
1409 +#endif /* SVEN_OLA_UNBLOAT */
1411 +#ifndef SVEN_OLA_UNBLOAT
1412 /* Disable redirects globally */
1413 disable_redirects_global(olsr_cnf->ip_version);
1415 +#endif /* SVEN_OLA_UNBLOAT */
1418 * socket for ioctl calls
1421 *enable ip forwarding on host
1423 +#ifndef SVEN_OLA_UNBLOAT
1424 enable_ip_forwarding(olsr_cnf->ip_version);
1425 +#endif /* SVEN_OLA_UNBLOAT */
1427 /* Initialize parser */
1430 *Set up willingness/APM
1432 if (olsr_cnf->willingness_auto) {
1433 +#ifndef SVEN_OLA_UNBLOAT
1434 if (apm_init() < 0) {
1435 OLSR_PRINTF(1, "Could not read APM info - setting default willingness(%d)\n", WILL_DEFAULT);
1437 @@ -324,10 +331,13 @@
1438 olsr_cnf->willingness_auto = 0;
1439 olsr_cnf->willingness = WILL_DEFAULT;
1441 +#endif /* SVEN_OLA_UNBLOAT */
1442 olsr_cnf->willingness = olsr_calculate_willingness();
1444 OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int);
1445 +#ifndef SVEN_OLA_UNBLOAT
1447 +#endif /* SVEN_OLA_UNBLOAT */
1450 /* Initialize net */
1451 @@ -362,9 +372,11 @@
1453 /* Initialize the IPC socket */
1455 +#ifndef SVEN_OLA_UNBLOAT
1456 if (olsr_cnf->ipc_connections > 0) {
1459 +#endif /* SVEN_OLA_UNBLOAT */
1460 /* Initialisation of different tables to be used. */
1463 @@ -487,9 +499,11 @@
1464 OLSR_PRINTF(1, "Closing sockets...\n");
1466 /* front-end IPC socket */
1467 +#ifndef SVEN_OLA_UNBLOAT
1468 if (olsr_cnf->ipc_connections > 0) {
1471 +#endif /* SVEN_OLA_UNBLOAT */
1474 for (ifn = ifnet; ifn; ifn = ifn->int_next)
1476 olsr_close_plugins();
1478 /* Reset network settings */
1479 +#ifndef SVEN_OLA_UNBLOAT
1480 restore_settings(olsr_cnf->ip_version);
1481 +#endif /* SVEN_OLA_UNBLOAT */
1484 close(olsr_cnf->ioctl_s);
1485 @@ -540,7 +556,11 @@
1486 "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n"
1487 " [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n"
1488 " [-lql <LQ level>] [-lqw <LQ winsize>] [-lqnt <nat threshold>]\n"
1489 +#ifdef SVEN_OLA_UNBLOAT
1490 + " [-bcast <broadcastaddr>] [-delgw] (Note: no -ipc,-dispin,-dispout)\n"
1491 +#else /* SVEN_OLA_UNBLOAT */
1492 " [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n"
1493 +#endif /* SVEN_OLA_UNBLOAT */
1494 " [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n"
1495 " [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n"
1496 " [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n" " [-lql <LQ level>] [-lqa <LQ aging factor>]\n");
1497 @@ -704,12 +724,20 @@
1498 olsr_exit(__func__, EXIT_FAILURE);
1500 printf("Queuing if %s\n", *argv);
1501 +#ifdef SVEN_OLA_UNBLOAT
1503 +#else /* SVEN_OLA_UNBLOAT */
1504 queue_if(*argv, false);
1505 +#endif /* SVEN_OLA_UNBLOAT */
1507 while ((argc - 1) && (argv[1][0] != '-')) {
1509 printf("Queuing if %s\n", *argv);
1510 +#ifdef SVEN_OLA_UNBLOAT
1512 +#else /* SVEN_OLA_UNBLOAT */
1513 queue_if(*argv, false);
1514 +#endif /* SVEN_OLA_UNBLOAT */
1519 sscanf(*argv, "%f", &cnf->pollrate);
1523 +#ifndef SVEN_OLA_UNBLOAT
1525 * Should we display the contents of packages beeing sent?
1528 cnf->ipc_connections = 1;
1531 +#endif /* SVEN_OLA_UNBLOAT */
1534 * IPv6 multicast addr
1540 +#ifndef SVEN_OLA_UNBLOAT
1548 +#endif /* SVEN_OLA_UNBLOAT */
1551 * Delete possible default GWs
1552 diff -ur olsrd-0.5.6-r4.orig/src/neighbor_table.c olsrd-0.5.6-r4/src/neighbor_table.c
1553 --- olsrd-0.5.6-r4.orig/src/neighbor_table.c 2009-03-27 17:32:46.000000000 +0000
1554 +++ olsrd-0.5.6-r4/src/neighbor_table.c 2009-03-27 17:33:00.000000000 +0000
1559 +#ifndef SVEN_OLA_UNBLOAT
1561 olsr_print_neighbor_table(void)
1567 +#endif /* SVEN_OLA_UNBLOAT */
1571 diff -ur olsrd-0.5.6-r4.orig/src/net_olsr.c olsrd-0.5.6-r4/src/net_olsr.c
1572 --- olsrd-0.5.6-r4.orig/src/net_olsr.c 2009-03-27 17:32:46.000000000 +0000
1573 +++ olsrd-0.5.6-r4/src/net_olsr.c 2009-03-27 17:33:00.000000000 +0000
1578 +#ifndef SVEN_OLA_UNBLOAT
1579 #include "print_packet.h"
1580 +#endif /* SVEN_OLA_UNBLOAT */
1581 #include "link_set.h"
1582 #include "lq_packet.h"
1584 @@ -385,8 +387,10 @@
1585 *if the -dispout option was given
1586 *we print the content of the packets
1588 +#ifndef SVEN_OLA_UNBLOAT
1590 print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr);
1591 +#endif /* SVEN_OLA_UNBLOAT */
1593 if (olsr_cnf->ip_version == AF_INET) {
1595 @@ -400,12 +404,16 @@
1597 if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
1599 +#ifndef SVEN_OLA_UNBLOAT
1600 struct ipaddr_str buf;
1601 +#endif /* SVEN_OLA_UNBLOAT */
1602 perror("sendto(v6)");
1603 olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
1604 +#ifndef SVEN_OLA_UNBLOAT
1605 fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index);
1606 fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6));
1607 fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending);
1608 +#endif /* SVEN_OLA_UNBLOAT */
1612 diff -ur olsrd-0.5.6-r4.orig/src/olsr.c olsrd-0.5.6-r4/src/olsr.c
1613 --- olsrd-0.5.6-r4.orig/src/olsr.c 2009-03-27 17:32:46.000000000 +0000
1614 +++ olsrd-0.5.6-r4/src/olsr.c 2009-03-27 17:33:00.000000000 +0000
1618 if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) {
1619 +#ifndef SVEN_OLA_UNBLOAT
1621 +#endif /* SVEN_OLA_UNBLOAT */
1622 printf(" *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host);
1626 if (changes_neighborhood || changes_topology || changes_hna) {
1627 olsr_calculate_routing_table();
1630 +#ifndef SVEN_OLA_UNBLOAT
1631 if (olsr_cnf->debug_level > 0) {
1632 if (olsr_cnf->debug_level > 2) {
1633 olsr_print_mid_set();
1635 olsr_print_tc_table();
1638 +#endif /* SVEN_OLA_UNBLOAT */
1640 for (tmp_pc_list = pcf_list; tmp_pc_list != NULL; tmp_pc_list = tmp_pc_list->next) {
1641 tmp_pc_list->function(changes_neighborhood, changes_topology, changes_hna);
1642 @@ -420,12 +423,15 @@
1644 olsr_calculate_willingness(void)
1646 +#ifndef SVEN_OLA_UNBLOAT
1647 struct olsr_apm_info ainfo;
1648 +#endif /* SVEN_OLA_UNBLOAT */
1650 /* If fixed willingness */
1651 if (!olsr_cnf->willingness_auto)
1652 return olsr_cnf->willingness;
1654 +#ifndef SVEN_OLA_UNBLOAT
1655 if (apm_read(&ainfo) < 1)
1656 return WILL_DEFAULT;
1658 @@ -442,8 +448,12 @@
1659 * 26% > juice will: 1
1661 return (ainfo.battery_percentage / 26);
1662 +#else /* SVEN_OLA_UNBLOAT */
1663 + return WILL_DEFAULT;
1664 +#endif /* SVEN_OLA_UNBLOAT */
1667 +#ifndef SVEN_OLA_UNBLOAT
1669 olsr_msgtype_to_string(uint8_t msgtype)
1672 snprintf(type, sizeof(type), "UNKNOWN(%d)", status);
1675 +#endif /* SVEN_OLA_UNBLOAT */
1678 *Termination function to be called whenever a error occures
1681 * @return a void pointer to the memory allocated
1683 +#ifndef SVEN_OLA_UNBLOAT
1685 olsr_malloc(size_t size, const char *id)
1691 +#endif /* SVEN_OLA_UNBLOAT */
1694 *Wrapper for printf that prints to a specific
1695 diff -ur olsrd-0.5.6-r4.orig/src/olsr.h olsrd-0.5.6-r4/src/olsr.h
1696 --- olsrd-0.5.6-r4.orig/src/olsr.h 2009-03-27 17:32:46.000000000 +0000
1697 +++ olsrd-0.5.6-r4/src/olsr.h 2009-03-27 17:33:00.000000000 +0000
1700 uint8_t olsr_calculate_willingness(void);
1702 +#ifndef SVEN_OLA_UNBLOAT
1703 const char *olsr_msgtype_to_string(uint8_t);
1705 const char *olsr_link_to_string(uint8_t);
1707 const char *olsr_status_to_string(uint8_t);
1708 +#endif /* SVEN_OLA_UNBLOAT */
1710 void olsr_exit(const char *, int);
1712 +#ifdef SVEN_OLA_UNBLOAT
1713 +#define olsr_malloc(size, msg) calloc(1, size)
1714 +#else /* SVEN_OLA_UNBLOAT */
1715 void *olsr_malloc(size_t, const char *);
1716 +#endif /* SVEN_OLA_UNBLOAT */
1718 int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
1720 diff -ur olsrd-0.5.6-r4.orig/src/olsr_cfg.h olsrd-0.5.6-r4/src/olsr_cfg.h
1721 --- olsrd-0.5.6-r4.orig/src/olsr_cfg.h 2009-03-27 17:32:46.000000000 +0000
1722 +++ olsrd-0.5.6-r4/src/olsr_cfg.h 2009-03-27 17:33:00.000000000 +0000
1723 @@ -148,8 +148,10 @@
1727 +#ifndef SVEN_OLA_UNBLOAT
1729 union olsr_ip_addr hemu_ip;
1730 +#endif /* SVEN_OLA_UNBLOAT */
1731 struct interface *interf;
1732 struct if_config_options *cnf;
1733 struct olsr_if *next;
1738 +#ifndef SVEN_OLA_UNBLOAT
1740 +#endif /* SVEN_OLA_UNBLOAT */
1742 bool allow_no_interfaces;
1744 @@ -201,13 +205,17 @@
1745 uint8_t rttable_default;
1746 uint8_t willingness;
1747 bool willingness_auto;
1748 +#ifndef SVEN_OLA_UNBLOAT
1749 int ipc_connections;
1750 +#endif /* SVEN_OLA_UNBLOAT */
1751 bool use_hysteresis;
1752 olsr_fib_metric_options fib_metric;
1753 struct hyst_param hysteresis_param;
1754 struct plugin_entry *plugins;
1755 struct ip_prefix_list *hna_entries;
1756 +#ifndef SVEN_OLA_UNBLOAT
1757 struct ip_prefix_list *ipc_nets;
1758 +#endif /* SVEN_OLA_UNBLOAT */
1759 struct olsr_if *interfaces;
1761 float nic_chgs_pollrate;
1764 void olsrd_free_cnf(struct olsrd_config *);
1766 +#ifndef SVEN_OLA_UNBLOAT
1767 void olsrd_print_cnf(struct olsrd_config *);
1768 +#endif /* SVEN_OLA_UNBLOAT */
1770 int olsrd_write_cnf(struct olsrd_config *, const char *);
1772 diff -ur olsrd-0.5.6-r4.orig/src/parser.c olsrd-0.5.6-r4/src/parser.c
1773 --- olsrd-0.5.6-r4.orig/src/parser.c 2009-03-27 17:32:46.000000000 +0000
1774 +++ olsrd-0.5.6-r4/src/parser.c 2009-03-27 17:33:00.000000000 +0000
1776 #include "rebuild_packet.h"
1779 +#ifndef SVEN_OLA_UNBLOAT
1780 #include "print_packet.h"
1781 +#endif /* SVEN_OLA_UNBLOAT */
1782 #include "net_olsr.h"
1785 @@ -281,8 +283,10 @@
1786 //printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr));
1788 /* Display packet */
1789 +#ifndef SVEN_OLA_UNBLOAT
1791 print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr);
1792 +#endif /* SVEN_OLA_UNBLOAT */
1794 if (olsr_cnf->ip_version == AF_INET)
1795 msgsize = ntohs(m->v4.olsr_msgsize);
1796 diff -ur olsrd-0.5.6-r4.orig/src/print_packet.c olsrd-0.5.6-r4/src/print_packet.c
1797 --- olsrd-0.5.6-r4.orig/src/print_packet.c 2009-03-27 17:32:46.000000000 +0000
1798 +++ olsrd-0.5.6-r4/src/print_packet.c 2009-03-27 17:33:00.000000000 +0000
1803 +#ifndef SVEN_OLA_UNBLOAT
1804 #include "print_packet.h"
1806 #include "mantissa.h"
1808 remsize -= olsr_cnf->ipsize;
1811 +#endif /* SVEN_OLA_UNBLOAT */
1815 diff -ur olsrd-0.5.6-r4.orig/src/process_routes.c olsrd-0.5.6-r4/src/process_routes.c
1816 --- olsrd-0.5.6-r4.orig/src/process_routes.c 2009-03-27 17:32:46.000000000 +0000
1817 +++ olsrd-0.5.6-r4/src/process_routes.c 2009-03-27 17:33:00.000000000 +0000
1820 olsr_delete_kernel_route(struct rt_entry *rt)
1822 +#ifndef SVEN_OLA_UNBLOAT
1823 if (!olsr_cnf->host_emul) {
1824 int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1826 @@ -170,6 +171,12 @@
1827 olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
1830 +#else /* SVEN_OLA_UNBLOAT */
1831 + int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1833 + olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno));
1835 +#endif /* SVEN_OLA_UNBLOAT */
1840 olsr_add_kernel_route(struct rt_entry *rt)
1843 +#ifndef SVEN_OLA_UNBLOAT
1844 if (!olsr_cnf->host_emul) {
1845 int16_t error = (olsr_cnf->ip_version == AF_INET) ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1847 @@ -199,6 +207,14 @@
1848 rt->rt_metric = rt->rt_best->rtp_metric;
1851 +#else /* SVEN_OLA_UNBLOAT */
1852 + int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1854 + olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno));
1856 + rt->rt_nexthop = rt->rt_best->rtp_nexthop;
1858 +#endif /* SVEN_OLA_UNBLOAT */
1863 /* route additions */
1864 olsr_add_kernel_routes(&add_kernel_list);
1868 olsr_print_routing_table(&routingtree);
1871 diff -ur olsrd-0.5.6-r4.orig/src/rebuild_packet.c olsrd-0.5.6-r4/src/rebuild_packet.c
1872 --- olsrd-0.5.6-r4.orig/src/rebuild_packet.c 2009-03-27 17:32:46.000000000 +0000
1873 +++ olsrd-0.5.6-r4/src/rebuild_packet.c 2009-03-27 17:33:00.000000000 +0000
1875 mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m)
1878 +#ifndef SVEN_OLA_UNBLOAT
1879 struct mid_alias *alias, *alias_tmp;
1880 +#else /* SVEN_OLA_UNBLOAT */
1881 + struct mid_alias *alias;
1882 +#endif /* SVEN_OLA_UNBLOAT */
1885 /* Checking if everything is ok */
1890 +#ifndef SVEN_OLA_UNBLOAT
1891 if (olsr_cnf->debug_level > 1) {
1892 struct ipaddr_str buf;
1893 OLSR_PRINTF(3, "Alias list for %s: ", olsr_ip_to_string(&buf, &mmsg->mid_origaddr));
1896 OLSR_PRINTF(3, "\n");
1898 +#endif /* SVEN_OLA_UNBLOAT */
1901 const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr;
1906 +#ifndef SVEN_OLA_UNBLOAT
1907 if (olsr_cnf->debug_level > 1) {
1908 struct ipaddr_str buf;
1909 OLSR_PRINTF(3, "Alias list for %s", ip6_to_string(&buf, &mmsg->mid_origaddr.v6));
1912 OLSR_PRINTF(3, "\n");
1914 +#endif /* SVEN_OLA_UNBLOAT */
1918 diff -ur olsrd-0.5.6-r4.orig/src/routing_table.c olsrd-0.5.6-r4/src/routing_table.c
1919 --- olsrd-0.5.6-r4.orig/src/routing_table.c 2009-03-27 17:32:46.000000000 +0000
1920 +++ olsrd-0.5.6-r4/src/routing_table.c 2009-03-27 17:33:00.000000000 +0000
1923 * format a route entry into a buffer
1925 +#ifndef SVEN_OLA_UNBLOAT
1927 olsr_rt_to_string(const struct rt_entry *rt)
1929 @@ -659,11 +660,13 @@
1933 +#endif /* SVEN_OLA_UNBLOAT */
1936 * Print the routingtree to STDOUT
1939 +#ifndef SVEN_OLA_UNBLOAT
1941 olsr_print_routing_table(struct avl_tree *tree)
1945 tree = NULL; /* squelch compiler warnings */
1947 +#endif /* SVEN_OLA_UNBLOAT */
1951 diff -ur olsrd-0.5.6-r4.orig/src/routing_table.h olsrd-0.5.6-r4/src/routing_table.h
1952 --- olsrd-0.5.6-r4.orig/src/routing_table.h 2009-03-27 17:32:46.000000000 +0000
1953 +++ olsrd-0.5.6-r4/src/routing_table.h 2009-03-27 17:33:00.000000000 +0000
1954 @@ -210,9 +210,11 @@
1955 bool olsr_cmp_rt(const struct rt_entry *, const struct rt_entry *);
1956 uint8_t olsr_fib_metric(const struct rt_metric *);
1958 +#ifndef SVEN_OLA_UNBLOAT
1959 char *olsr_rt_to_string(const struct rt_entry *);
1960 char *olsr_rtp_to_string(const struct rt_path *);
1961 void olsr_print_routing_table(struct avl_tree *);
1962 +#endif /* SVEN_OLA_UNBLOAT */
1964 const struct rt_nexthop *olsr_get_nh(const struct rt_entry *);
1966 diff -ur olsrd-0.5.6-r4.orig/src/tc_set.c olsrd-0.5.6-r4/src/tc_set.c
1967 --- olsrd-0.5.6-r4.orig/src/tc_set.c 2009-03-27 17:32:46.000000000 +0000
1968 +++ olsrd-0.5.6-r4/src/tc_set.c 2009-03-27 17:33:00.000000000 +0000
1971 * Format tc_edge contents into a buffer.
1973 +#ifndef SVEN_OLA_UNBLOAT
1975 olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
1981 +#endif /* SVEN_OLA_UNBLOAT */
1984 * Wrapper for the timer callback.
1987 * Print the topology table to stdout
1989 +#ifndef SVEN_OLA_UNBLOAT
1991 olsr_print_tc_table(void)
1994 } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
1997 +#endif /* SVEN_OLA_UNBLOAT */
2000 * calculate the border IPs of a tc edge set according to the border flags
2001 diff -ur olsrd-0.5.6-r4.orig/src/tc_set.h olsrd-0.5.6-r4/src/tc_set.h
2002 --- olsrd-0.5.6-r4.orig/src/tc_set.h 2009-03-27 17:32:46.000000000 +0000
2003 +++ olsrd-0.5.6-r4/src/tc_set.h 2009-03-27 17:33:00.000000000 +0000
2006 /* tc_edge_entry manipulation */
2007 bool olsr_delete_outdated_tc_edges(struct tc_entry *);
2008 +#ifndef SVEN_OLA_UNBLOAT
2009 char *olsr_tc_edge_to_string(struct tc_edge_entry *);
2010 +#endif /* SVEN_OLA_UNBLOAT */
2011 struct tc_edge_entry *olsr_lookup_tc_edge(struct tc_entry *, union olsr_ip_addr *);
2012 struct tc_edge_entry *olsr_add_tc_edge_entry(struct tc_entry *, union olsr_ip_addr *, uint16_t);
2013 void olsr_delete_tc_entry(struct tc_entry *);
2014 diff -ur olsrd-0.5.6-r4.orig/src/two_hop_neighbor_table.c olsrd-0.5.6-r4/src/two_hop_neighbor_table.c
2015 --- olsrd-0.5.6-r4.orig/src/two_hop_neighbor_table.c 2009-03-27 17:32:46.000000000 +0000
2016 +++ olsrd-0.5.6-r4/src/two_hop_neighbor_table.c 2009-03-27 17:33:00.000000000 +0000
2021 +#ifndef SVEN_OLA_UNBLOAT
2024 *Print the two hop neighbor table to STDOUT.
2030 +#endif /* SVEN_OLA_UNBLOAT */
2034 diff -ur olsrd-0.5.6-r4.orig/src/unix/ifnet.c olsrd-0.5.6-r4/src/unix/ifnet.c
2035 --- olsrd-0.5.6-r4.orig/src/unix/ifnet.c 2009-03-27 17:32:46.000000000 +0000
2036 +++ olsrd-0.5.6-r4/src/unix/ifnet.c 2009-03-27 17:33:00.000000000 +0000
2039 #define BUFSPACE (127*1024) /* max. input buffer size to request */
2041 +#ifndef SVEN_OLA_UNBLOAT
2044 set_flag(char *ifname, short flag __attribute__ ((unused)))
2050 +#endif /* SVEN_OLA_UNBLOAT */
2053 check_interface_updates(void *foo __attribute__ ((unused)))
2055 @@ -110,11 +114,13 @@
2058 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
2059 +#ifndef SVEN_OLA_UNBLOAT
2060 if (tmp_if->host_emul)
2063 if (olsr_cnf->host_emul) /* XXX: TEMPORARY! */
2065 +#endif /* SVEN_OLA_UNBLOAT */
2067 if (!tmp_if->cnf->autodetect_chg) {
2069 @@ -154,8 +160,10 @@
2070 OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name);
2073 +#ifndef SVEN_OLA_UNBLOAT
2074 if (iface->host_emul)
2076 +#endif /* SVEN_OLA_UNBLOAT */
2078 ifp = iface->interf;
2084 +#ifndef SVEN_OLA_UNBLOAT
2085 struct ipaddr_str buf;
2086 +#endif /* SVEN_OLA_UNBLOAT */
2087 /* Check interface address (IPv4) */
2088 if (ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) {
2089 OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n");
2090 @@ -294,17 +304,21 @@
2092 (&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr,
2093 olsr_cnf->ipsize) != 0) {
2094 +#ifndef SVEN_OLA_UNBLOAT
2096 OLSR_PRINTF(1, "IPv4 address changed for %s\n", ifr.ifr_name);
2097 OLSR_PRINTF(1, "\tOld:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr));
2098 OLSR_PRINTF(1, "\tNew:%s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2099 +#endif /* SVEN_OLA_UNBLOAT */
2101 ifp->int_addr = *(struct sockaddr_in *)&ifr.ifr_addr;
2102 /* deactivated to prevent change of originator IP */
2104 if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) {
2105 OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2106 +#ifndef SVEN_OLA_UNBLOAT
2107 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2108 +#endif /* SVEN_OLA_UNBLOAT */
2109 memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize);
2115 OLSR_PRINTF(1, "Removing interface %s\n", iface->name);
2116 +#ifndef SVEN_OLA_UNBLOAT
2117 olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
2118 +#endif /* SVEN_OLA_UNBLOAT */
2120 olsr_delete_link_entry_by_ip(&ifp->ip_addr);
2122 @@ -398,10 +414,14 @@
2123 memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
2124 OLSR_PRINTF(1, "No more interfaces...\n");
2126 +#if !defined(SVEN_OLA_UNBLOAT)
2127 struct ipaddr_str buf;
2128 +#endif /* SVEN_OLA_UNBLOAT */
2129 olsr_cnf->main_addr = ifnet->ip_addr;
2130 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2131 +#ifndef SVEN_OLA_UNBLOAT
2132 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2133 +#endif /* SVEN_OLA_UNBLOAT */
2139 if ((ifnet == NULL) && (!olsr_cnf->allow_no_interfaces)) {
2140 OLSR_PRINTF(1, "No more active interfaces - exiting.\n");
2141 +#ifndef SVEN_OLA_UNBLOAT
2142 olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n");
2143 +#endif /* SVEN_OLA_UNBLOAT */
2144 olsr_cnf->exit_value = EXIT_FAILURE;
2145 kill(getpid(), SIGINT);
2151 +#ifndef SVEN_OLA_UNBLOAT
2154 * Initializes the special interface used in
2155 * host-client emulation
2160 +#endif /* SVEN_OLA_UNBLOAT */
2162 static char basenamestr[32];
2163 static const char *if_basename(const char *name);
2164 @@ -618,8 +643,10 @@
2165 int tos_bits = IPTOS_TOS(olsr_cnf->tos);
2168 +#ifndef SVEN_OLA_UNBLOAT
2169 if (iface->host_emul)
2171 +#endif /* SVEN_OLA_UNBLOAT */
2173 memset(&ifr, 0, sizeof(struct ifreq));
2174 memset(&ifs, 0, sizeof(struct interface));
2175 @@ -726,11 +753,13 @@
2176 ifs.int_broadaddr = *(struct sockaddr_in *)&ifr.ifr_broadaddr;
2179 +#ifndef SVEN_OLA_UNBLOAT
2180 /* Deactivate IP spoof filter */
2181 deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2183 /* Disable ICMP redirects */
2184 disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2185 +#endif /* SVEN_OLA_UNBLOAT */
2191 OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu);
2193 +#ifndef SVEN_OLA_UNBLOAT
2194 olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name);
2195 +#endif /* SVEN_OLA_UNBLOAT */
2196 OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index);
2198 if (olsr_cnf->ip_version == AF_INET) {
2199 @@ -865,10 +896,14 @@
2201 memset(&null_addr, 0, olsr_cnf->ipsize);
2202 if (ipequal(&null_addr, &olsr_cnf->main_addr)) {
2203 +#ifndef SVEN_OLA_UNBLOAT
2204 struct ipaddr_str buf;
2206 olsr_cnf->main_addr = ifp->ip_addr;
2207 +#ifndef SVEN_OLA_UNBLOAT
2208 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2209 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2210 +#endif /* SVEN_OLA_UNBLOAT */
2214 diff -ur olsrd-0.5.6-r4.orig/src/unix/misc.c olsrd-0.5.6-r4/src/unix/misc.c
2215 --- olsrd-0.5.6-r4.orig/src/unix/misc.c 2009-03-27 17:32:46.000000000 +0000
2216 +++ olsrd-0.5.6-r4/src/unix/misc.c 2009-03-27 17:33:00.000000000 +0000
2219 #include "olsr_types.h"
2221 +#ifndef SVEN_OLA_UNBLOAT
2229 +#endif /* SVEN_OLA_UNBLOAT */