1 diff -Nur olsrd-0.5.6-r3.orig/lib/bmf/src/NetworkInterfaces.c olsrd-0.5.6-r3/lib/bmf/src/NetworkInterfaces.c
2 --- olsrd-0.5.6-r3.orig/lib/bmf/src/NetworkInterfaces.c 2008-12-02 11:50:01.000000000 +0100
3 +++ olsrd-0.5.6-r3/lib/bmf/src/NetworkInterfaces.c 2008-12-03 10:01:07.000000000 +0100
5 OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: no link found\n", PLUGIN_NAME_SHORT,
6 olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
9 struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr);
12 OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %5.2f\n",
13 PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), bestIntf->int_name,
14 diff -Nur olsrd-0.5.6-r3.orig/lib/httpinfo/Makefile olsrd-0.5.6-r3/lib/httpinfo/Makefile
15 --- olsrd-0.5.6-r3.orig/lib/httpinfo/Makefile 2008-12-02 11:50:01.000000000 +0100
16 +++ olsrd-0.5.6-r3/lib/httpinfo/Makefile 2008-12-03 10:01:07.000000000 +0100
18 CPPFLAGS += -DADMIN_INTERFACE
21 +ifdef SVEN_OLA_UNBLOAT
22 + CFLAGS += -DSVEN_OLA
24 OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o
27 default_target: $(PLUGIN_FULLNAME)
29 diff -Nur olsrd-0.5.6-r3.orig/lib/httpinfo/src/olsrd_httpinfo.c olsrd-0.5.6-r3/lib/httpinfo/src/olsrd_httpinfo.c
30 --- olsrd-0.5.6-r3.orig/lib/httpinfo/src/olsrd_httpinfo.c 2008-12-02 11:50:01.000000000 +0100
31 +++ olsrd-0.5.6-r3/lib/httpinfo/src/olsrd_httpinfo.c 2008-12-03 10:01:07.000000000 +0100
34 #include "olsrd_httpinfo.h"
35 #include "admin_interface.h"
36 +#ifndef SVEN_OLA_UNBLOAT
38 +#endif /* SVEN_OLA_UNBLOAT */
44 static int build_about_body(char *, olsr_u32_t);
46 +#ifndef SVEN_OLA_UNBLOAT
47 static int build_cfgfile_body(char *, olsr_u32_t);
48 +#endif /* SVEN_OLA_UNBLOAT */
50 static int check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr);
53 {"Admin", "admin", build_admin_body, OLSR_TRUE},
55 {"About", "about", build_about_body, OLSR_TRUE},
56 +#ifndef SVEN_OLA_UNBLOAT
57 {"FOO", "cfgfile", build_cfgfile_body, OLSR_FALSE},
58 +#endif /* SVEN_OLA_UNBLOAT */
59 {NULL, NULL, NULL, OLSR_FALSE}
62 +#ifndef SVEN_OLA_UNBLOAT
63 static const struct static_bin_file_entry static_bin_files[] = {
64 {"favicon.ico", favicon_ico, sizeof(favicon_ico)}
70 +#endif /* SVEN_OLA_UNBLOAT */
72 static const struct static_txt_file_entry static_txt_files[] = {
73 {"httpinfo.css", httpinfo_css},
75 } else if (!strcmp(req_type, "GET")) {
78 +#ifndef SVEN_OLA_UNBLOAT
79 for (i = 0; static_bin_files[i].filename; i++) {
80 if (FILENREQ_MATCH(filename, static_bin_files[i].filename)) {
86 +#endif /* SVEN_OLA_UNBLOAT */
87 while (static_txt_files[i].filename) {
88 if (FILENREQ_MATCH(filename, static_txt_files[i].filename)) {
91 snprintf(&body[size], sizeof(body) - size,
92 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<head>\n"
93 "<meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n"
94 - "<title>olsr.org httpinfo plugin</title>\n" "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
95 + "<title>olsr.org httpinfo plugin</title>\n"
96 +#ifndef SVEN_OLA_UNBLOAT
97 + "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
98 "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
99 +#endif /* SVEN_OLA_UNBLOAT */
100 "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n" "</head>\n"
101 "<body bgcolor=\"#ffffff\" text=\"#000000\">\n"
102 +#ifndef SVEN_OLA_UNBLOAT
103 "<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%d\">\n"
104 "<tbody><tr bgcolor=\"#ffffff\">\n" "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n"
105 "<font color=\"black\" face=\"timesroman\" size=\"6\"> <a href=\"http://www.olsr.org/\">olsr.org OLSR daemon</a></font></td>\n"
106 "<td align=\"right\" height=\"69\" valign=\"middle\" width=\"20%%\">\n"
107 "<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n" "</tr>\n"
108 - "</tbody>\n" "</table>\n", FRAMEWIDTH);
109 + "</tbody>\n" "</table>\n", FRAMEWIDTH
110 +#endif /* SVEN_OLA_UNBLOAT */
113 size += build_tabs(&body[size], sizeof(body) - size, i);
114 size += build_frame(&body[size], sizeof(body) - size, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb);
116 size += snprintf(&buf[size], bufsize - size, "<tr><td colspan=\"3\">Status: DOWN</td></tr>\n");
120 +#ifndef SVEN_OLA_UNBLOAT
121 if (olsr_cnf->ip_version == AF_INET) {
122 struct ipaddr_str addrbuf, maskbuf, bcastbuf;
125 snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n" "<td></td>\n" "</tr>\n",
126 ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
128 +#endif /* SVEN_OLA_UNBLOAT */
130 snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n" "<td>STATUS: UP</td>\n" "</tr>\n",
131 rifs->int_mtu, rifs->is_wireless ? "Yes" : "No");
132 @@ -1116,6 +1133,7 @@
136 +#ifndef SVEN_OLA_UNBLOAT
138 build_cfgfile_body(char *buf, olsr_u32_t bufsize)
140 @@ -1150,6 +1168,7 @@
144 +#endif /* SVEN_OLA_UNBLOAT */
147 check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr)
148 diff -Nur olsrd-0.5.6-r3.orig/lib/nameservice/src/nameservice.c olsrd-0.5.6-r3/lib/nameservice/src/nameservice.c
149 --- olsrd-0.5.6-r3.orig/lib/nameservice/src/nameservice.c 2008-12-03 10:01:07.000000000 +0100
150 +++ olsrd-0.5.6-r3/lib/nameservice/src/nameservice.c 2008-12-03 10:10:52.000000000 +0100
152 #include "mapwrite.h"
155 +#ifdef SVEN_OLA_UNBLOAT
157 +#define OLSR_PRINTF(...)
158 +#endif /* SVEN_OLA_UNBLOAT */
160 /* config parameters */
161 static char my_hosts_file[MAX_FILE + 1];
162 static char my_sighup_pid_file[MAX_FILE + 1];
164 static char my_suffix[MAX_SUFFIX];
165 static int my_interval = EMISSION_INTERVAL;
166 static double my_timeout = NAME_VALID_TIME;
167 +#ifndef SVEN_OLA_UNBLOAT
168 static char my_resolv_file[MAX_FILE + 1];
169 +#endif /* SVEN_OLA_UNBLOAT */
170 static char my_services_file[MAX_FILE + 1];
171 static char my_macs_file[MAX_FILE + 1];
172 +#ifndef SVEN_OLA_UNBLOAT
173 static char my_name_change_script[MAX_FILE + 1];
174 static char my_services_change_script[MAX_FILE + 1];
175 static char my_macs_change_script[MAX_FILE + 1];
177 static char latlon_in_file[MAX_FILE + 1];
178 static char my_latlon_file[MAX_FILE + 1];
179 float my_lat = 0.0, my_lon = 0.0;
181 static struct name_entry *my_macs = NULL;
182 static olsr_bool mac_table_changed = OLSR_TRUE;
184 +#ifndef SVEN_OLA_UNBLOAT
185 static struct list_node forwarder_list[HASHSIZE];
186 static struct name_entry *my_forwarders = NULL;
187 static olsr_bool forwarder_table_changed = OLSR_TRUE;
188 +#endif /* SVEN_OLA_UNBLOAT */
190 struct list_node latlon_list[HASHSIZE];
191 static olsr_bool latlon_table_changed = OLSR_TRUE;
193 GetWindowsDirectory(my_hosts_file, MAX_FILE - 12);
194 GetWindowsDirectory(my_services_file, MAX_FILE - 12);
195 GetWindowsDirectory(my_macs_file, MAX_FILE - 12);
196 +#ifndef SVEN_OLA_UNBLOAT
197 GetWindowsDirectory(my_resolv_file, MAX_FILE - 12);
198 +#endif /* SVEN_OLA_UNBLOAT */
200 len = strlen(my_hosts_file);
201 if (my_hosts_file[len - 1] != '\\')
202 @@ -155,15 +168,19 @@
203 strscat(my_macs_file, "\\", sizeof(my_macs_file));
204 strscat(my_macs_file, "macs_olsr", sizeof(my_macs_file));
206 +#ifndef SVEN_OLA_UNBLOAT
207 len = strlen(my_resolv_file);
208 if (my_resolv_file[len - 1] != '\\')
209 strscat(my_resolv_file, "\\", sizeof(my_resolv_file));
210 strscat(my_resolv_file, "resolvconf_olsr", sizeof(my_resolv_file));
211 +#endif /* SVEN_OLA_UNBLOAT */
213 strscpy(my_hosts_file, "/var/run/hosts_olsr", sizeof(my_hosts_file));
214 strscpy(my_services_file, "/var/run/services_olsr", sizeof(my_services_file));
215 strscpy(my_macs_file, "/var/run/macs_olsr", sizeof(my_macs_file));
216 +#ifndef SVEN_OLA_UNBLOAT
217 strscpy(my_resolv_file, "/var/run/resolvconf_olsr", sizeof(my_resolv_file));
218 +#endif /* SVEN_OLA_UNBLOAT */
219 *my_sighup_pid_file = 0;
222 @@ -171,14 +188,18 @@
223 my_add_hosts[0] = '\0';
224 my_latlon_file[0] = '\0';
225 latlon_in_file[0] = '\0';
226 +#ifndef SVEN_OLA_UNBLOAT
227 my_name_change_script[0] = '\0';
228 my_services_change_script[0] = '\0';
229 my_macs_change_script[0] = '\0';
230 +#endif /* SVEN_OLA_UNBLOAT */
232 /* init the lists heads */
233 for (i = 0; i < HASHSIZE; i++) {
234 list_head_init(&name_list[i]);
235 +#ifndef SVEN_OLA_UNBLOAT
236 list_head_init(&forwarder_list[i]);
237 +#endif /* SVEN_OLA_UNBLOAT */
238 list_head_init(&service_list[i]);
239 list_head_init(&mac_list[i]);
240 list_head_init(&latlon_list[i]);
245 +#ifndef SVEN_OLA_UNBLOAT
247 set_nameservice_server(const char *value, void *data, set_plugin_parameter_addon addon)
253 +#endif /* SVEN_OLA_UNBLOAT */
256 set_nameservice_name(const char *value, void *data, set_plugin_parameter_addon addon)
257 @@ -253,10 +276,12 @@
258 { .name = "timeout", .set_plugin_parameter = &set_nameservice_float, .data = &my_timeout },
259 { .name = "sighup-pid-file", .set_plugin_parameter = &set_plugin_string, .data = &my_sighup_pid_file, .addon = {sizeof(my_sighup_pid_file)} },
260 { .name = "hosts-file", .set_plugin_parameter = &set_plugin_string, .data = &my_hosts_file, .addon = {sizeof(my_hosts_file)} },
261 +#ifndef SVEN_OLA_UNBLOAT
262 { .name = "name-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_name_change_script, .addon = {sizeof(my_name_change_script)} },
263 { .name = "services-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_services_change_script, .addon = {sizeof(my_services_change_script)} },
264 { .name = "macs-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_macs_change_script, .addon = {sizeof(my_macs_change_script)} },
265 { .name = "resolv-file", .set_plugin_parameter = &set_plugin_string, .data = &my_resolv_file, .addon = {sizeof(my_resolv_file)} },
266 +#endif /* SVEN_OLA_UNBLOAT */
267 { .name = "suffix", .set_plugin_parameter = &set_plugin_string, .data = &my_suffix, .addon = {sizeof(my_suffix)} },
268 { .name = "add-hosts", .set_plugin_parameter = &set_plugin_string, .data = &my_add_hosts, .addon = {sizeof(my_add_hosts)} },
269 { .name = "services-file", .set_plugin_parameter = &set_plugin_string, .data = &my_services_file, .addon = {sizeof(my_services_file)} },
271 { .name = "lon", .set_plugin_parameter = &set_nameservice_float, .data = &my_lon },
272 { .name = "latlon-file", .set_plugin_parameter = &set_plugin_string, .data = &my_latlon_file, .addon = {sizeof(my_latlon_file)} },
273 { .name = "latlon-infile", .set_plugin_parameter = &set_plugin_string, .data = &latlon_in_file, .addon = {sizeof(latlon_in_file)} },
274 +#ifndef SVEN_OLA_UNBLOAT
275 { .name = "dns-server", .set_plugin_parameter = &set_nameservice_server, .data = &my_forwarders, .addon = {NAME_FORWARDER} },
276 +#endif /* SVEN_OLA_UNBLOAT */
277 { .name = "name", .set_plugin_parameter = &set_nameservice_name, .data = &my_names, .addon = {NAME_HOST} },
278 { .name = "service", .set_plugin_parameter = &set_nameservice_name, .data = &my_services, .addon = {NAME_SERVICE} },
279 { .name = "mac", .set_plugin_parameter = &set_nameservice_name, .data = &my_macs, .addon = {NAME_MACADDR} },
280 @@ -381,16 +408,20 @@
281 name->ip = olsr_cnf->main_addr;
284 +#ifndef SVEN_OLA_UNBLOAT
285 for (name = my_forwarders; name != NULL; name = name->next) {
286 if (name->ip.v4.s_addr == 0) {
287 OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name);
288 name->ip = olsr_cnf->main_addr;
291 +#endif /* SVEN_OLA_UNBLOAT */
293 //check if entries I want to announce myself are valid and allowed
294 my_names = remove_nonvalid_names_from_list(my_names, NAME_HOST);
295 +#ifndef SVEN_OLA_UNBLOAT
296 my_forwarders = remove_nonvalid_names_from_list(my_forwarders, NAME_FORWARDER);
297 +#endif /* SVEN_OLA_UNBLOAT */
298 my_services = remove_nonvalid_names_from_list(my_services, NAME_SERVICE);
299 my_macs = remove_nonvalid_names_from_list(my_macs, NAME_MACADDR);
301 @@ -463,12 +494,16 @@
302 free_name_entry_list(&my_names);
303 free_name_entry_list(&my_services);
304 free_name_entry_list(&my_macs);
305 +#ifndef SVEN_OLA_UNBLOAT
306 free_name_entry_list(&my_forwarders);
307 +#endif /* SVEN_OLA_UNBLOAT */
309 free_all_list_entries(name_list);
310 free_all_list_entries(service_list);
311 free_all_list_entries(mac_list);
312 +#ifndef SVEN_OLA_UNBLOAT
313 free_all_list_entries(forwarder_list);
314 +#endif /* SVEN_OLA_UNBLOAT */
315 free_all_list_entries(latlon_list);
317 olsr_stop_timer(write_file_timer);
320 write_file_timer = NULL;
322 +#ifndef SVEN_OLA_UNBLOAT
323 write_resolv_file(); /* if forwarder_table_changed */
324 +#endif /* SVEN_OLA_UNBLOAT */
325 write_hosts_file(); /* if name_table_changed */
326 write_services_file(OLSR_FALSE); /* if service_table_changed */
327 write_services_file(OLSR_TRUE); /* if mac_table_changed */
328 @@ -693,11 +730,13 @@
329 pos = create_packet((struct name *)pos, my_name);
332 +#ifndef SVEN_OLA_UNBLOAT
334 for (my_name = my_forwarders; my_name != NULL; my_name = my_name->next) {
335 pos = create_packet((struct name *)pos, my_name);
338 +#endif /* SVEN_OLA_UNBLOAT */
340 for (my_name = my_services; my_name != NULL; my_name = my_name->next) {
341 pos = create_packet((struct name *)pos, my_name);
344 insert_new_name_in_list(originator, name_list, from_packet, &name_table_changed, vtime);
346 +#ifndef SVEN_OLA_UNBLOAT
348 insert_new_name_in_list(originator, forwarder_list, from_packet, &forwarder_table_changed, vtime);
350 +#endif /* SVEN_OLA_UNBLOAT */
352 insert_new_name_in_list(originator, service_list, from_packet, &service_table_changed, vtime);
355 pos += sizeof(struct name);
356 pos += 1 + ((ntohs(from_packet->len) - 1) | 3);
360 OLSR_PRINTF(4, "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n", i,
361 olsr_ip_to_string(&strbuf, originator));
366 @@ -1120,6 +1163,7 @@
368 name_table_changed = OLSR_FALSE;
370 +#ifndef SVEN_OLA_UNBLOAT
371 // Executes my_name_change_script after writing the hosts file
372 if (my_name_change_script[0] != '\0') {
373 if (system(my_name_change_script) != -1) {
374 @@ -1128,6 +1172,7 @@
375 OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on hosts change\n", my_name_change_script);
378 +#endif /* SVEN_OLA_UNBLOAT */
382 @@ -1193,6 +1238,7 @@
386 +#ifndef SVEN_OLA_UNBLOAT
387 // Executes my_macs_change_script after writing the macs file
388 if (my_macs_change_script[0] != '\0') {
389 if (system(my_macs_change_script) != -1) {
390 @@ -1201,9 +1247,11 @@
391 OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on mac change\n", my_macs_change_script);
394 +#endif /* SVEN_OLA_UNBLOAT */
395 mac_table_changed = OLSR_FALSE;
398 +#ifndef SVEN_OLA_UNBLOAT
399 // Executes my_services_change_script after writing the services file
400 if (my_services_change_script[0] != '\0') {
401 if (system(my_services_change_script) != -1) {
402 @@ -1212,6 +1260,7 @@
403 OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on service change\n", my_services_change_script);
406 +#endif /* SVEN_OLA_UNBLOAT */
407 service_table_changed = OLSR_FALSE;
410 @@ -1222,6 +1271,7 @@
411 * fresh entries are at the beginning of the array and
412 * the best entry is at the end of the array.
414 +#ifndef SVEN_OLA_UNBLOAT
416 select_best_nameserver(struct rt_entry **rt)
418 @@ -1253,11 +1303,13 @@
422 +#endif /* SVEN_OLA_UNBLOAT */
425 * write the 3 best upstream DNS servers to resolv.conf file
426 * best means the 3 with the best etx value in routing table
428 +#ifndef SVEN_OLA_UNBLOAT
430 write_resolv_file(void)
432 @@ -1341,6 +1393,7 @@
434 forwarder_table_changed = OLSR_FALSE;
436 +#endif /* SVEN_OLA_UNBLOAT */
439 * completely free a list of name_entries
440 @@ -1359,9 +1412,11 @@
442 name_table_changed = OLSR_TRUE;
444 +#ifndef SVEN_OLA_UNBLOAT
446 forwarder_table_changed = OLSR_TRUE;
448 +#endif /* SVEN_OLA_UNBLOAT */
450 service_table_changed = OLSR_TRUE;
452 @@ -1459,8 +1514,14 @@
453 * these are then used by allowed_hostname_or_ip_in_service
454 * see regexec(3) for more infos */
455 if (!is_service_wellformed(service_line)) {
456 +#ifdef SVEN_OLA_UNBLOAT
457 + olsr_printf(1, "NAME PLUGIN: %s: Not 'x://y:z/|tcp|Text'\n", service_line);
458 +#endif /* SVEN_OLA_UNBLOAT */
460 } else if (!allowed_hostname_or_ip_in_service(service_line, &(regmatch_t_service[1]))) {
461 +#ifdef SVEN_OLA_UNBLOAT
462 + olsr_printf(1, "NAME PLUGIN: %s: IP/Addr not yours and not HNA\n", service_line);
463 +#endif /* SVEN_OLA_UNBLOAT */
467 diff -Nur olsrd-0.5.6-r3.orig/Makefile.inc olsrd-0.5.6-r3/Makefile.inc
468 --- olsrd-0.5.6-r3.orig/Makefile.inc 2008-12-02 11:50:01.000000000 +0100
469 +++ olsrd-0.5.6-r3/Makefile.inc 2008-12-03 10:01:07.000000000 +0100
471 $(warning Use CPPFLAGS instead of DEFINES for -D)
474 +ifeq ($(SVEN_OLA_UNBLOAT),1)
475 +CPPFLAGS += -DSVEN_OLA_UNBLOAT -DNODEBUG
481 diff -Nur olsrd-0.5.6-r3.orig/src/apm.h olsrd-0.5.6-r3/src/apm.h
482 --- olsrd-0.5.6-r3.orig/src/apm.h 2008-12-02 11:50:01.000000000 +0100
483 +++ olsrd-0.5.6-r3/src/apm.h 2008-12-03 10:01:07.000000000 +0100
488 +#ifndef SVEN_OLA_UNBLOAT
491 * Interface to OS dependent power management information
493 int apm_read(struct olsr_apm_info *);
496 +#endif /* SVEN_OLA_UNBLOAT */
500 diff -Nur olsrd-0.5.6-r3.orig/src/cfgparser/local.mk olsrd-0.5.6-r3/src/cfgparser/local.mk
501 --- olsrd-0.5.6-r3.orig/src/cfgparser/local.mk 2008-12-02 11:50:01.000000000 +0100
502 +++ olsrd-0.5.6-r3/src/cfgparser/local.mk 2008-12-03 10:01:07.000000000 +0100
504 C=$(if $(CFGDIR),$(CFGDIR)/)
506 # add the variables as we may have others already there
507 +ifeq ($(SVEN_OLA_UNBLOAT),1)
508 +SRCS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).c)
509 +OBJS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).o)
511 SRCS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).c)
512 OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o)
514 HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
516 $(C)oscan.c: $(C)oscan.lex $(C)Makefile
517 diff -Nur olsrd-0.5.6-r3.orig/src/cfgparser/olsrd_conf.c olsrd-0.5.6-r3/src/cfgparser/olsrd_conf.c
518 --- olsrd-0.5.6-r3.orig/src/cfgparser/olsrd_conf.c 2008-12-02 11:50:01.000000000 +0100
519 +++ olsrd-0.5.6-r3/src/cfgparser/olsrd_conf.c 2008-12-03 10:01:07.000000000 +0100
523 if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) {
524 +#ifndef SVEN_OLA_UNBLOAT
525 if ((argc > 2) && (!strcmp(argv[2], "-print"))) {
526 olsrd_print_cnf(cnf);
527 olsrd_write_cnf(cnf, "./out.conf");
529 printf("Use -print to view parsed values\n");
530 +#endif /* SVEN_OLA_UNBLOAT */
531 printf("Configfile parsed OK\n");
533 printf("Failed parsing \"%s\"\n", argv[1]);
535 /* set various stuff */
536 in->configured = OLSR_FALSE;
538 +#ifndef SVEN_OLA_UNBLOAT
539 in->host_emul = OLSR_FALSE;
540 +#endif /* SVEN_OLA_UNBLOAT */
546 cnf->debug_level = DEF_DEBUGLVL;
547 cnf->no_fork = OLSR_FALSE;
548 +#ifndef SVEN_OLA_UNBLOAT
549 cnf->host_emul = OLSR_FALSE;
550 +#endif /* SVEN_OLA_UNBLOAT */
551 cnf->ip_version = AF_INET;
552 cnf->ipsize = sizeof(struct in_addr);
556 cnf->rttable_default = 0;
557 cnf->willingness_auto = DEF_WILL_AUTO;
558 +#ifndef SVEN_OLA_UNBLOAT
559 cnf->ipc_connections = DEF_IPC_CONNECTIONS;
560 +#endif /* SVEN_OLA_UNBLOAT */
561 cnf->fib_metric = DEF_FIB_METRIC;
563 cnf->use_hysteresis = DEF_USE_HYST;
568 +#ifndef SVEN_OLA_UNBLOAT
570 olsrd_print_cnf(struct olsrd_config *cnf)
576 +#endif /* SVEN_OLA_UNBLOAT */
580 diff -Nur olsrd-0.5.6-r3.orig/src/cfgparser/oparse.y olsrd-0.5.6-r3/src/cfgparser/oparse.y
581 --- olsrd-0.5.6-r3.orig/src/cfgparser/oparse.y 2008-12-02 11:50:01.000000000 +0100
582 +++ olsrd-0.5.6-r3/src/cfgparser/oparse.y 2008-12-03 10:01:07.000000000 +0100
585 %token TOK_RTTABLE_DEFAULT
586 %token TOK_WILLINGNESS
597 %token TOK_IP4BROADCAST
598 %token TOK_IP6ADDRTYPE
601 block: TOK_HNA4 hna4body
603 - | TOK_IPCCON ipcbody
611 -ipcbody: TOK_OPEN ipcstmts TOK_CLOSE
614 -ipcstmts: | ipcstmts ipcstmt
623 ifblock: ifstart ifnicks
630 -imaxipc: TOK_MAXIPC TOK_INTEGER
632 - olsr_cnf->ipc_connections = $2->integer;
637 -ipchost: TOK_HOSTLABEL TOK_IP4_ADDR
639 - union olsr_ip_addr ipaddr;
640 - PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string);
642 - if (inet_aton($2->string, &ipaddr.v4) == 0) {
643 - fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string);
647 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen);
654 -ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR
656 - union olsr_ip_addr ipaddr, netmask;
658 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
660 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
661 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
665 - if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) {
666 - fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string);
670 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask));
677 - | TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER
679 - union olsr_ip_addr ipaddr;
681 - PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
683 - if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
684 - fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
688 - if ($4->integer > olsr_cnf->maxplen) {
689 - fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen);
693 - ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer);
701 iifweight: TOK_IFWEIGHT TOK_INTEGER
703 int ifcnt = ifs_in_curr_cfg;
704 diff -Nur olsrd-0.5.6-r3.orig/src/cfgparser/oscan.lex olsrd-0.5.6-r3/src/cfgparser/oscan.lex
705 --- olsrd-0.5.6-r3.orig/src/cfgparser/oscan.lex 2008-12-02 11:50:01.000000000 +0100
706 +++ olsrd-0.5.6-r3/src/cfgparser/oscan.lex 2008-12-03 10:01:07.000000000 +0100
718 return TOK_DEBUGLEVEL;
720 return TOK_WILLINGNESS;
730 return TOK_FIBMETRIC;
731 diff -Nur olsrd-0.5.6-r3.orig/src/defs.h olsrd-0.5.6-r3/src/defs.h
732 --- olsrd-0.5.6-r3.orig/src/defs.h 2008-12-02 11:50:01.000000000 +0100
733 +++ olsrd-0.5.6-r3/src/defs.h 2008-12-03 10:01:07.000000000 +0100
736 unsigned long olsr_times(void);
738 +#ifndef SVEN_OLA_UNBLOAT
742 *These are moved to a plugin soon
744 int ipc_output(struct olsr *);
747 +#endif /* SVEN_OLA_UNBLOAT */
751 diff -Nur olsrd-0.5.6-r3.orig/src/duplicate_set.c olsrd-0.5.6-r3/src/duplicate_set.c
752 --- olsrd-0.5.6-r3.orig/src/duplicate_set.c 2008-12-02 11:50:01.000000000 +0100
753 +++ olsrd-0.5.6-r3/src/duplicate_set.c 2008-12-03 10:01:07.000000000 +0100
755 return OLSR_FALSE; /* no duplicate */
758 +#ifndef SVEN_OLA_UNBLOAT
760 olsr_print_duplicate_table(void)
763 } OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
766 +#endif /* SVEN_OLA_UNBLOAT */
770 diff -Nur olsrd-0.5.6-r3.orig/src/hna_set.c olsrd-0.5.6-r3/src/hna_set.c
771 --- olsrd-0.5.6-r3.orig/src/hna_set.c 2008-12-02 11:50:01.000000000 +0100
772 +++ olsrd-0.5.6-r3/src/hna_set.c 2008-12-03 10:01:07.000000000 +0100
777 +#ifndef SVEN_OLA_UNBLOAT
779 olsr_print_hna_set(void)
785 +#endif /* SVEN_OLA_UNBLOAT */
788 *Process incoming HNA message.
789 diff -Nur olsrd-0.5.6-r3.orig/src/interfaces.c olsrd-0.5.6-r3/src/interfaces.c
790 --- olsrd-0.5.6-r3.orig/src/interfaces.c 2008-12-02 11:50:01.000000000 +0100
791 +++ olsrd-0.5.6-r3/src/interfaces.c 2008-12-03 10:01:07.000000000 +0100
793 OLSR_PRINTF(1, "\n ---- Interface configuration ---- \n\n");
794 /* Run trough all interfaces immedeatly */
795 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
796 +#ifndef SVEN_OLA_UNBLOAT
797 if (!tmp_if->host_emul) {
798 if (!olsr_cnf->host_emul) /* XXX: TEMPORARY! */
799 +#endif /* SVEN_OLA_UNBLOAT */
800 chk_if_up(tmp_if, 1);
801 +#ifndef SVEN_OLA_UNBLOAT
805 +#endif /* SVEN_OLA_UNBLOAT */
808 /* Kick a periodic timer for the network interface update function */
813 +#ifdef SVEN_OLA_UNBLOAT
814 +queue_if(const char *name)
815 +#else /* SVEN_OLA_UNBLOAT */
816 queue_if(const char *name, int hemu)
817 +#endif /* SVEN_OLA_UNBLOAT */
819 struct olsr_if *interf_n = olsr_cnf->interfaces;
822 interf_n->interf = NULL;
823 interf_n->configured = 0;
825 +#ifndef SVEN_OLA_UNBLOAT
826 interf_n->host_emul = hemu ? OLSR_TRUE : OLSR_FALSE;
827 +#endif /* SVEN_OLA_UNBLOAT */
829 strscpy(interf_n->name, name, name_size);
830 interf_n->next = olsr_cnf->interfaces;
831 diff -Nur olsrd-0.5.6-r3.orig/src/interfaces.h olsrd-0.5.6-r3/src/interfaces.h
832 --- olsrd-0.5.6-r3.orig/src/interfaces.h 2008-12-02 11:50:01.000000000 +0100
833 +++ olsrd-0.5.6-r3/src/interfaces.h 2008-12-03 10:01:07.000000000 +0100
836 struct interface *if_ifwithindex(const int if_index);
838 -struct olsr_if *queue_if(const char *, int);
840 +#ifdef SVEN_OLA_UNBLOAT
841 + queue_if(const char *);
842 +#else /* SVEN_OLA_UNBLOAT */
843 + queue_if(const char *, int);
844 +#endif /* SVEN_OLA_UNBLOAT */
846 int add_ifchgf(int (*f) (struct interface *, int));
848 diff -Nur olsrd-0.5.6-r3.orig/src/ipcalc.c olsrd-0.5.6-r3/src/ipcalc.c
849 --- olsrd-0.5.6-r3.orig/src/ipcalc.c 2008-12-02 11:50:01.000000000 +0100
850 +++ olsrd-0.5.6-r3/src/ipcalc.c 2008-12-03 10:01:07.000000000 +0100
855 +#ifndef SVEN_OLA_UNBLOAT
857 olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
863 +#endif /* SVEN_OLA_UNBLOAT */
865 /* see if the ipaddr is in the net. That is equivalent to the fact that the net part
866 * of both are equal. So we must compare the first <prefixlen> bits.
867 diff -Nur olsrd-0.5.6-r3.orig/src/ipcalc.h olsrd-0.5.6-r3/src/ipcalc.h
868 --- olsrd-0.5.6-r3.orig/src/ipcalc.h 2008-12-02 11:50:01.000000000 +0100
869 +++ olsrd-0.5.6-r3/src/ipcalc.h 2008-12-03 10:01:07.000000000 +0100
871 return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
874 +#ifndef SVEN_OLA_UNBLOAT
875 const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
876 +#endif /* SVEN_OLA_UNBLOAT */
878 static INLINE const char *
879 sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr)
880 diff -Nur olsrd-0.5.6-r3.orig/src/ipc_frontend.c olsrd-0.5.6-r3/src/ipc_frontend.c
881 --- olsrd-0.5.6-r3.orig/src/ipc_frontend.c 2008-12-02 11:50:01.000000000 +0100
882 +++ olsrd-0.5.6-r3/src/ipc_frontend.c 2008-12-03 10:01:07.000000000 +0100
887 +#ifndef SVEN_OLA_UNBLOAT
888 #include "ipc_frontend.h"
889 #include "link_set.h"
895 +#endif /* SVEN_OLA_UNBLOAT */
899 diff -Nur olsrd-0.5.6-r3.orig/src/ipc_frontend.h olsrd-0.5.6-r3/src/ipc_frontend.h
900 --- olsrd-0.5.6-r3.orig/src/ipc_frontend.h 2008-12-02 11:50:01.000000000 +0100
901 +++ olsrd-0.5.6-r3/src/ipc_frontend.h 2008-12-03 10:01:07.000000000 +0100
906 +#ifndef SVEN_OLA_UNBLOAT
908 #include <sys/types.h>
909 #include <netinet/in.h>
911 int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *);
914 +#endif /* SVEN_OLA_UNBLOAT */
918 diff -Nur olsrd-0.5.6-r3.orig/src/link_set.c olsrd-0.5.6-r3/src/link_set.c
919 --- olsrd-0.5.6-r3.orig/src/link_set.c 2008-12-02 11:50:01.000000000 +0100
920 +++ olsrd-0.5.6-r3/src/link_set.c 2008-12-03 10:01:07.000000000 +0100
925 +#ifndef SVEN_OLA_UNBLOAT
927 olsr_print_link_set(void)
930 } OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
933 +#endif /* SVEN_OLA_UNBLOAT */
936 * called for every LQ HELLO message.
937 diff -Nur olsrd-0.5.6-r3.orig/src/linux/apm.c olsrd-0.5.6-r3/src/linux/apm.c
938 --- olsrd-0.5.6-r3.orig/src/linux/apm.c 2008-12-02 11:50:01.000000000 +0100
939 +++ olsrd-0.5.6-r3/src/linux/apm.c 2008-12-03 10:01:07.000000000 +0100
941 * Acpi-Power Enlightenment epplet
944 +#ifndef SVEN_OLA_UNBLOAT
949 /* No battery found */
952 +#endif /* SVEN_OLA_UNBLOAT */
956 diff -Nur olsrd-0.5.6-r3.orig/src/linux/kernel_routes.c olsrd-0.5.6-r3/src/linux/kernel_routes.c
957 --- olsrd-0.5.6-r3.orig/src/linux/kernel_routes.c 2008-12-02 11:50:01.000000000 +0100
958 +++ olsrd-0.5.6-r3/src/linux/kernel_routes.c 2008-12-03 10:01:07.000000000 +0100
959 @@ -144,10 +144,12 @@
960 h = NLMSG_NEXT(h, ret);
963 +#ifndef SVEN_OLA_UNBLOAT
964 if (0 <= ret && olsr_cnf->ipc_connections > 0) {
965 ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd,
966 if_ifwithindex_name(nexthop->iif_index));
968 +#endif /* SVEN_OLA_UNBLOAT */
972 diff -Nur olsrd-0.5.6-r3.orig/src/linux/net.c olsrd-0.5.6-r3/src/linux/net.c
973 --- olsrd-0.5.6-r3.orig/src/linux/net.c 2008-12-02 11:50:01.000000000 +0100
974 +++ olsrd-0.5.6-r3/src/linux/net.c 2008-12-03 10:01:07.000000000 +0100
976 #define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
978 /* The original state of the IP forwarding proc entry */
979 +#ifndef SVEN_OLA_UNBLOAT
980 static char orig_fwd_state;
981 static char orig_global_redirect_state;
982 +#endif /* SVEN_OLA_UNBLOAT */
985 *Bind a socket to a device
987 return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1);
990 +#ifndef SVEN_OLA_UNBLOAT
993 *Enable IP forwarding.
994 *Just writing "1" to the /proc/sys/net/ipv4/ip_forward
996 const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
998 if ((proc_fwd = fopen(procfile, "r")) == NULL) {
999 +#ifdef SVEN_OLA_UNBLOAT_OLD
1003 if (version == AF_INET)
1013 @@ -131,9 +139,13 @@
1014 OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
1016 if ((proc_fwd = fopen(procfile, "w")) == NULL) {
1017 +#ifdef SVEN_OLA_UNBLOAT_OLD
1020 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1021 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP forwarding is enabeled!\n\n");
1026 syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile);
1027 @@ -154,11 +166,15 @@
1030 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1031 +#ifdef SVEN_OLA_UNBLOAT_OLD
1035 "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",
1042 orig_global_redirect_state = fgetc(proc_redirect);
1043 @@ -168,9 +184,13 @@
1046 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1047 +#ifdef SVEN_OLA_UNBLOAT_OLD
1050 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1051 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1056 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1057 @@ -196,19 +216,27 @@
1058 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name);
1060 if ((proc_redirect = fopen(procfile, "r")) == NULL) {
1061 +#ifdef SVEN_OLA_UNBLOAT_OLD
1065 "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",
1071 iface->nic_state.redirect = fgetc(proc_redirect);
1072 fclose(proc_redirect);
1074 if ((proc_redirect = fopen(procfile, "w")) == NULL) {
1075 +#ifdef SVEN_OLA_UNBLOAT_OLD
1078 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1079 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
1084 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1085 @@ -234,20 +262,28 @@
1086 sprintf(procfile, SPOOF_PROC, if_name);
1088 if ((proc_spoof = fopen(procfile, "r")) == NULL) {
1089 +#ifdef SVEN_OLA_UNBLOAT_OLD
1093 "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",
1100 iface->nic_state.spoof = fgetc(proc_spoof);
1103 if ((proc_spoof = fopen(procfile, "w")) == NULL) {
1104 +#ifdef SVEN_OLA_UNBLOAT_OLD
1107 fprintf(stderr, "Could not open %s for writing!\n", procfile);
1108 fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabeled!\n\n");
1113 syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
1114 @@ -272,7 +308,11 @@
1117 if ((proc_fd = fopen(procfile, "w")) == NULL) {
1118 +#ifdef SVEN_OLA_UNBLOAT_OLD
1121 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1124 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state);
1125 fputc(orig_fwd_state, proc_fd);
1126 @@ -287,7 +327,11 @@
1129 if ((proc_fd = fopen(procfile, "w")) == NULL) {
1130 +#ifdef SVEN_OLA_UNBLOAT_OLD
1133 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1136 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state);
1137 fputc(orig_global_redirect_state, proc_fd);
1138 @@ -311,7 +355,11 @@
1139 snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name);
1141 if ((proc_fd = fopen(procfile, "w")) == NULL)
1142 +#ifdef SVEN_OLA_UNBLOAT_OLD
1145 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1148 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect);
1150 @@ -324,7 +372,11 @@
1151 /* Generate the procfile name */
1152 sprintf(procfile, SPOOF_PROC, ifs->int_name);
1153 if ((proc_fd = fopen(procfile, "w")) == NULL)
1154 +#ifdef SVEN_OLA_UNBLOAT_OLD
1157 fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
1160 syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof);
1166 +#endif /* SVEN_OLA_UNBLOAT */
1169 *Creates a nonblocking broadcast socket.
1170 *@param sa sockaddr struct. Used for bind(2).
1171 diff -Nur olsrd-0.5.6-r3.orig/src/lq_plugin.c olsrd-0.5.6-r3/src/lq_plugin.c
1172 --- olsrd-0.5.6-r3.orig/src/lq_plugin.c 2008-12-02 11:50:01.000000000 +0100
1173 +++ olsrd-0.5.6-r3/src/lq_plugin.c 2008-12-03 10:01:07.000000000 +0100
1175 init_lq_handler_tree(void)
1177 avl_init(&lq_handler_tree, &avl_strcasecmp);
1178 +#ifndef SVEN_OLA_UNBLOAT
1179 register_lq_handler(&lq_etx_float_handler, LQ_ALGORITHM_ETX_FLOAT_NAME);
1180 register_lq_handler(&lq_etx_fpm_handler, LQ_ALGORITHM_ETX_FPM_NAME);
1181 +#endif /* SVEN_OLA_UNBLOAT */
1182 register_lq_handler(&lq_etx_ff_handler, LQ_ALGORITHM_ETX_FF_NAME);
1183 +#ifndef SVEN_OLA_UNBLOAT
1184 if (activate_lq_handler(olsr_cnf->lq_algorithm)) {
1185 activate_lq_handler(LQ_ALGORITHM_ETX_FPM_NAME);
1187 +#else /* SVEN_OLA_UNBLOAT */
1188 + activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME);
1189 +#endif /* SVEN_OLA_UNBLOAT */
1193 @@ -417,7 +423,11 @@
1194 * @return pointer to hello_neighbor
1196 struct hello_neighbor *
1197 +#ifndef SVEN_OLA_UNBLOAT
1198 olsr_malloc_hello_neighbor(const char *id)
1199 +#else /* SVEN_OLA_UNBLOAT */
1200 +olsr_malloc_hello_neighbor(const char *id __attribute__ ((unused)))
1201 +#endif /* SVEN_OLA_UNBLOAT */
1203 struct hello_neighbor *h;
1205 @@ -439,7 +449,11 @@
1206 * @return pointer to tc_mpr_addr
1208 struct tc_mpr_addr *
1209 +#ifndef SVEN_OLA_UNBLOAT
1210 olsr_malloc_tc_mpr_addr(const char *id)
1211 +#else /* SVEN_OLA_UNBLOAT */
1212 +olsr_malloc_tc_mpr_addr(const char *id __attribute__ ((unused)))
1213 +#endif /* SVEN_OLA_UNBLOAT */
1215 struct tc_mpr_addr *t;
1217 @@ -461,7 +475,11 @@
1218 * @return pointer to lq_hello_neighbor
1220 struct lq_hello_neighbor *
1221 +#ifndef SVEN_OLA_UNBLOAT
1222 olsr_malloc_lq_hello_neighbor(const char *id)
1223 +#else /* SVEN_OLA_UNBLOAT */
1224 +olsr_malloc_lq_hello_neighbor(const char *id __attribute__ ((unused)))
1225 +#endif /* SVEN_OLA_UNBLOAT */
1227 struct lq_hello_neighbor *h;
1229 @@ -483,7 +501,11 @@
1230 * @return pointer to link_entry
1233 +#ifndef SVEN_OLA_UNBLOAT
1234 olsr_malloc_link_entry(const char *id)
1235 +#else /* SVEN_OLA_UNBLOAT */
1236 +olsr_malloc_link_entry(const char *id __attribute__ ((unused)))
1237 +#endif /* SVEN_OLA_UNBLOAT */
1239 struct link_entry *h;
1241 diff -Nur olsrd-0.5.6-r3.orig/src/lq_plugin_default_float.c olsrd-0.5.6-r3/src/lq_plugin_default_float.c
1242 --- olsrd-0.5.6-r3.orig/src/lq_plugin_default_float.c 2008-12-02 11:50:01.000000000 +0100
1243 +++ olsrd-0.5.6-r3/src/lq_plugin_default_float.c 2008-12-03 10:01:07.000000000 +0100
1248 +#ifndef SVEN_OLA_UNBLOAT
1250 #include "link_set.h"
1251 #include "olsr_spf.h"
1256 +#endif /* SVEN_OLA_UNBLOAT */
1260 diff -Nur olsrd-0.5.6-r3.orig/src/lq_plugin_default_float.h olsrd-0.5.6-r3/src/lq_plugin_default_float.h
1261 --- olsrd-0.5.6-r3.orig/src/lq_plugin_default_float.h 2008-12-02 11:50:01.000000000 +0100
1262 +++ olsrd-0.5.6-r3/src/lq_plugin_default_float.h 2008-12-03 10:01:07.000000000 +0100
1267 +#ifndef SVEN_OLA_UNBLOAT
1268 #ifndef LQ_PLUGIN_DEFAULT_H_
1269 #define LQ_PLUGIN_DEFAULT_H_
1272 extern struct lq_handler lq_etx_float_handler;
1274 #endif /*LQ_PLUGIN_DEFAULT_H_ */
1275 +#endif /* SVEN_OLA_UNBLOAT */
1279 diff -Nur olsrd-0.5.6-r3.orig/src/lq_plugin_default_fpm.c olsrd-0.5.6-r3/src/lq_plugin_default_fpm.c
1280 --- olsrd-0.5.6-r3.orig/src/lq_plugin_default_fpm.c 2008-12-02 11:50:01.000000000 +0100
1281 +++ olsrd-0.5.6-r3/src/lq_plugin_default_fpm.c 2008-12-03 10:01:07.000000000 +0100
1286 +#ifndef SVEN_OLA_UNBLOAT
1288 #include "link_set.h"
1289 #include "lq_plugin.h"
1291 snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER);
1294 +#endif /* SVEN_OLA_UNBLOAT */
1298 diff -Nur olsrd-0.5.6-r3.orig/src/lq_plugin_default_fpm.h olsrd-0.5.6-r3/src/lq_plugin_default_fpm.h
1299 --- olsrd-0.5.6-r3.orig/src/lq_plugin_default_fpm.h 2008-12-02 11:50:01.000000000 +0100
1300 +++ olsrd-0.5.6-r3/src/lq_plugin_default_fpm.h 2008-12-03 10:01:07.000000000 +0100
1305 +#ifndef SVEN_OLA_UNBLOAT
1310 extern struct lq_handler lq_etx_fpm_handler;
1312 #endif /*LQ_ETX_FPM_ */
1313 +#endif /* SVEN_OLA_UNBLOAT */
1317 diff -Nur olsrd-0.5.6-r3.orig/src/main.c olsrd-0.5.6-r3/src/main.c
1318 --- olsrd-0.5.6-r3.orig/src/main.c 2008-12-02 11:50:01.000000000 +0100
1319 +++ olsrd-0.5.6-r3/src/main.c 2008-12-03 10:01:07.000000000 +0100
1320 @@ -243,13 +243,17 @@
1322 * Print configuration
1324 +#ifndef SVEN_OLA_UNBLOAT
1325 if (olsr_cnf->debug_level > 1) {
1326 olsrd_print_cnf(olsr_cnf);
1328 +#endif /* SVEN_OLA_UNBLOAT */
1330 +#ifndef SVEN_OLA_UNBLOAT
1331 /* Disable redirects globally */
1332 disable_redirects_global(olsr_cnf->ip_version);
1334 +#endif /* SVEN_OLA_UNBLOAT */
1337 * socket for ioctl calls
1340 *enable ip forwarding on host
1342 +#ifndef SVEN_OLA_UNBLOAT
1343 enable_ip_forwarding(olsr_cnf->ip_version);
1344 +#endif /* SVEN_OLA_UNBLOAT */
1346 /* Initialize parser */
1349 *Set up willingness/APM
1351 if (olsr_cnf->willingness_auto) {
1352 +#ifndef SVEN_OLA_UNBLOAT
1353 if (apm_init() < 0) {
1354 OLSR_PRINTF(1, "Could not read APM info - setting default willingness(%d)\n", WILL_DEFAULT);
1356 @@ -311,10 +318,13 @@
1357 olsr_cnf->willingness_auto = 0;
1358 olsr_cnf->willingness = WILL_DEFAULT;
1360 +#endif /* SVEN_OLA_UNBLOAT */
1361 olsr_cnf->willingness = olsr_calculate_willingness();
1363 OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int);
1364 +#ifndef SVEN_OLA_UNBLOAT
1366 +#endif /* SVEN_OLA_UNBLOAT */
1369 /* Initialize net */
1370 @@ -342,9 +352,11 @@
1372 /* Initialize the IPC socket */
1374 +#ifndef SVEN_OLA_UNBLOAT
1375 if (olsr_cnf->ipc_connections > 0) {
1378 +#endif /* SVEN_OLA_UNBLOAT */
1379 /* Initialisation of different tables to be used. */
1382 @@ -450,9 +462,11 @@
1383 OLSR_PRINTF(1, "Closing sockets...\n");
1385 /* front-end IPC socket */
1386 +#ifndef SVEN_OLA_UNBLOAT
1387 if (olsr_cnf->ipc_connections > 0) {
1390 +#endif /* SVEN_OLA_UNBLOAT */
1393 for (ifn = ifnet; ifn; ifn = ifn->int_next)
1395 olsr_close_plugins();
1397 /* Reset network settings */
1398 +#ifndef SVEN_OLA_UNBLOAT
1399 restore_settings(olsr_cnf->ip_version);
1400 +#endif /* SVEN_OLA_UNBLOAT */
1403 close(olsr_cnf->ioctl_s);
1404 @@ -498,7 +514,11 @@
1405 "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n"
1406 " [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n"
1407 " [-lql <LQ level>] [-lqw <LQ winsize>] [-lqnt <nat threshold>]\n"
1408 +#ifdef SVEN_OLA_UNBLOAT
1409 + " [-bcast <broadcastaddr>] [-delgw] (Note: no -ipc,-dispin,-dispout)\n"
1410 +#else /* SVEN_OLA_UNBLOAT */
1411 " [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n"
1412 +#endif /* SVEN_OLA_UNBLOAT */
1413 " [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n"
1414 " [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n"
1415 " [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n" " [-lql <LQ level>] [-lqa <LQ aging factor>]\n");
1416 @@ -662,12 +682,20 @@
1417 olsr_exit(__func__, EXIT_FAILURE);
1419 printf("Queuing if %s\n", *argv);
1420 +#ifdef SVEN_OLA_UNBLOAT
1422 +#else /* SVEN_OLA_UNBLOAT */
1423 queue_if(*argv, OLSR_FALSE);
1424 +#endif /* SVEN_OLA_UNBLOAT */
1426 while ((argc - 1) && (argv[1][0] != '-')) {
1428 printf("Queuing if %s\n", *argv);
1429 +#ifdef SVEN_OLA_UNBLOAT
1431 +#else /* SVEN_OLA_UNBLOAT */
1432 queue_if(*argv, OLSR_FALSE);
1433 +#endif /* SVEN_OLA_UNBLOAT */
1438 sscanf(*argv, "%f", &cnf->pollrate);
1442 +#ifndef SVEN_OLA_UNBLOAT
1444 * Should we display the contents of packages beeing sent?
1447 cnf->ipc_connections = 1;
1450 +#endif /* SVEN_OLA_UNBLOAT */
1453 * IPv6 multicast addr
1459 +#ifndef SVEN_OLA_UNBLOAT
1467 +#endif /* SVEN_OLA_UNBLOAT */
1470 * Delete possible default GWs
1471 diff -Nur olsrd-0.5.6-r3.orig/src/neighbor_table.c olsrd-0.5.6-r3/src/neighbor_table.c
1472 --- olsrd-0.5.6-r3.orig/src/neighbor_table.c 2008-12-02 11:50:01.000000000 +0100
1473 +++ olsrd-0.5.6-r3/src/neighbor_table.c 2008-12-03 10:01:07.000000000 +0100
1478 +#ifndef SVEN_OLA_UNBLOAT
1480 olsr_print_neighbor_table(void)
1486 +#endif /* SVEN_OLA_UNBLOAT */
1490 diff -Nur olsrd-0.5.6-r3.orig/src/net_olsr.c olsrd-0.5.6-r3/src/net_olsr.c
1491 --- olsrd-0.5.6-r3.orig/src/net_olsr.c 2008-12-03 10:01:07.000000000 +0100
1492 +++ olsrd-0.5.6-r3/src/net_olsr.c 2008-12-03 10:01:07.000000000 +0100
1497 +#ifndef SVEN_OLA_UNBLOAT
1498 #include "print_packet.h"
1499 +#endif /* SVEN_OLA_UNBLOAT */
1500 #include "link_set.h"
1501 #include "lq_packet.h"
1503 @@ -385,8 +387,10 @@
1504 *if the -dispout option was given
1505 *we print the content of the packets
1507 +#ifndef SVEN_OLA_UNBLOAT
1509 print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr);
1510 +#endif /* SVEN_OLA_UNBLOAT */
1512 if (olsr_cnf->ip_version == AF_INET) {
1514 @@ -400,12 +404,16 @@
1516 if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
1518 +#ifndef SVEN_OLA_UNBLOAT
1519 struct ipaddr_str buf;
1520 +#endif /* SVEN_OLA_UNBLOAT */
1521 perror("sendto(v6)");
1522 olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
1523 +#ifndef SVEN_OLA_UNBLOAT
1524 fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index);
1525 fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6));
1526 fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending);
1527 +#endif /* SVEN_OLA_UNBLOAT */
1531 diff -Nur olsrd-0.5.6-r3.orig/src/olsr.c olsrd-0.5.6-r3/src/olsr.c
1532 --- olsrd-0.5.6-r3.orig/src/olsr.c 2008-12-02 11:50:01.000000000 +0100
1533 +++ olsrd-0.5.6-r3/src/olsr.c 2008-12-03 10:01:07.000000000 +0100
1537 if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) {
1538 +#ifndef SVEN_OLA_UNBLOAT
1540 +#endif /* SVEN_OLA_UNBLOAT */
1541 printf(" *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host);
1545 if (changes_neighborhood || changes_topology || changes_hna) {
1546 olsr_calculate_routing_table();
1549 +#ifndef SVEN_OLA_UNBLOAT
1550 if (olsr_cnf->debug_level > 0) {
1551 if (olsr_cnf->debug_level > 2) {
1552 olsr_print_mid_set();
1554 olsr_print_tc_table();
1557 +#endif /* SVEN_OLA_UNBLOAT */
1559 for (tmp_pc_list = pcf_list; tmp_pc_list != NULL; tmp_pc_list = tmp_pc_list->next) {
1560 tmp_pc_list->function(changes_neighborhood, changes_topology, changes_hna);
1561 @@ -415,12 +418,15 @@
1563 olsr_calculate_willingness(void)
1565 +#ifndef SVEN_OLA_UNBLOAT
1566 struct olsr_apm_info ainfo;
1567 +#endif /* SVEN_OLA_UNBLOAT */
1569 /* If fixed willingness */
1570 if (!olsr_cnf->willingness_auto)
1571 return olsr_cnf->willingness;
1573 +#ifndef SVEN_OLA_UNBLOAT
1574 if (apm_read(&ainfo) < 1)
1575 return WILL_DEFAULT;
1577 @@ -437,8 +443,12 @@
1578 * 26% > juice will: 1
1580 return (ainfo.battery_percentage / 26);
1581 +#else /* SVEN_OLA_UNBLOAT */
1582 + return WILL_DEFAULT;
1583 +#endif /* SVEN_OLA_UNBLOAT */
1586 +#ifndef SVEN_OLA_UNBLOAT
1588 olsr_msgtype_to_string(olsr_u8_t msgtype)
1591 snprintf(type, sizeof(type), "UNKNOWN(%d)", status);
1594 +#endif /* SVEN_OLA_UNBLOAT */
1597 *Termination function to be called whenever a error occures
1600 * @return a void pointer to the memory allocated
1602 +#ifndef SVEN_OLA_UNBLOAT
1604 olsr_malloc(size_t size, const char *id)
1610 +#endif /* SVEN_OLA_UNBLOAT */
1613 *Wrapper for printf that prints to a specific
1614 diff -Nur olsrd-0.5.6-r3.orig/src/olsr_cfg.h olsrd-0.5.6-r3/src/olsr_cfg.h
1615 --- olsrd-0.5.6-r3.orig/src/olsr_cfg.h 2008-12-02 11:50:01.000000000 +0100
1616 +++ olsrd-0.5.6-r3/src/olsr_cfg.h 2008-12-03 10:01:07.000000000 +0100
1617 @@ -140,8 +140,10 @@
1620 olsr_bool configured;
1621 +#ifndef SVEN_OLA_UNBLOAT
1622 olsr_bool host_emul;
1623 union olsr_ip_addr hemu_ip;
1624 +#endif /* SVEN_OLA_UNBLOAT */
1625 struct interface *interf;
1626 struct if_config_options *cnf;
1627 struct olsr_if *next;
1629 struct olsrd_config {
1632 +#ifndef SVEN_OLA_UNBLOAT
1633 olsr_bool host_emul;
1634 +#endif /* SVEN_OLA_UNBLOAT */
1636 olsr_bool allow_no_interfaces;
1638 @@ -191,13 +195,17 @@
1639 olsr_u8_t rttable_default;
1640 olsr_u8_t willingness;
1641 olsr_bool willingness_auto;
1642 +#ifndef SVEN_OLA_UNBLOAT
1643 int ipc_connections;
1644 +#endif /* SVEN_OLA_UNBLOAT */
1645 olsr_bool use_hysteresis;
1646 olsr_fib_metric_options fib_metric;
1647 struct hyst_param hysteresis_param;
1648 struct plugin_entry *plugins;
1649 struct ip_prefix_list *hna_entries;
1650 +#ifndef SVEN_OLA_UNBLOAT
1651 struct ip_prefix_list *ipc_nets;
1652 +#endif /* SVEN_OLA_UNBLOAT */
1653 struct olsr_if *interfaces;
1655 float nic_chgs_pollrate;
1658 void olsrd_free_cnf(struct olsrd_config *);
1660 +#ifndef SVEN_OLA_UNBLOAT
1661 void olsrd_print_cnf(struct olsrd_config *);
1662 +#endif /* SVEN_OLA_UNBLOAT */
1664 int olsrd_write_cnf(struct olsrd_config *, const char *);
1666 diff -Nur olsrd-0.5.6-r3.orig/src/olsr.h olsrd-0.5.6-r3/src/olsr.h
1667 --- olsrd-0.5.6-r3.orig/src/olsr.h 2008-12-02 11:50:01.000000000 +0100
1668 +++ olsrd-0.5.6-r3/src/olsr.h 2008-12-03 10:01:07.000000000 +0100
1671 olsr_u8_t olsr_calculate_willingness(void);
1673 +#ifndef SVEN_OLA_UNBLOAT
1674 const char *olsr_msgtype_to_string(olsr_u8_t);
1676 const char *olsr_link_to_string(olsr_u8_t);
1678 const char *olsr_status_to_string(olsr_u8_t);
1679 +#endif /* SVEN_OLA_UNBLOAT */
1681 void olsr_exit(const char *, int);
1683 +#ifdef SVEN_OLA_UNBLOAT
1684 +#define olsr_malloc(size, msg) calloc(1, size)
1685 +#else /* SVEN_OLA_UNBLOAT */
1686 void *olsr_malloc(size_t, const char *);
1687 +#endif /* SVEN_OLA_UNBLOAT */
1689 int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
1691 diff -Nur olsrd-0.5.6-r3.orig/src/parser.c olsrd-0.5.6-r3/src/parser.c
1692 --- olsrd-0.5.6-r3.orig/src/parser.c 2008-12-02 11:50:01.000000000 +0100
1693 +++ olsrd-0.5.6-r3/src/parser.c 2008-12-03 10:01:07.000000000 +0100
1695 #include "rebuild_packet.h"
1698 +#ifndef SVEN_OLA_UNBLOAT
1699 #include "print_packet.h"
1700 +#endif /* SVEN_OLA_UNBLOAT */
1701 #include "net_olsr.h"
1704 @@ -280,8 +282,10 @@
1705 //printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr));
1707 /* Display packet */
1708 +#ifndef SVEN_OLA_UNBLOAT
1710 print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr);
1711 +#endif /* SVEN_OLA_UNBLOAT */
1713 if (olsr_cnf->ip_version == AF_INET)
1714 msgsize = ntohs(m->v4.olsr_msgsize);
1715 diff -Nur olsrd-0.5.6-r3.orig/src/print_packet.c olsrd-0.5.6-r3/src/print_packet.c
1716 --- olsrd-0.5.6-r3.orig/src/print_packet.c 2008-12-02 11:50:01.000000000 +0100
1717 +++ olsrd-0.5.6-r3/src/print_packet.c 2008-12-03 10:01:07.000000000 +0100
1722 +#ifndef SVEN_OLA_UNBLOAT
1723 #include "print_packet.h"
1725 #include "mantissa.h"
1727 remsize -= olsr_cnf->ipsize;
1730 +#endif /* SVEN_OLA_UNBLOAT */
1734 diff -Nur olsrd-0.5.6-r3.orig/src/process_routes.c olsrd-0.5.6-r3/src/process_routes.c
1735 --- olsrd-0.5.6-r3.orig/src/process_routes.c 2008-12-02 11:50:01.000000000 +0100
1736 +++ olsrd-0.5.6-r3/src/process_routes.c 2008-12-03 10:01:07.000000000 +0100
1739 olsr_delete_kernel_route(struct rt_entry *rt)
1741 +#ifndef SVEN_OLA_UNBLOAT
1742 if (!olsr_cnf->host_emul) {
1743 olsr_16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1745 @@ -170,6 +171,12 @@
1746 olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
1749 +#else /* SVEN_OLA_UNBLOAT */
1750 + olsr_16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
1752 + olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno));
1754 +#endif /* SVEN_OLA_UNBLOAT */
1759 olsr_add_kernel_route(struct rt_entry *rt)
1762 +#ifndef SVEN_OLA_UNBLOAT
1763 if (!olsr_cnf->host_emul) {
1764 olsr_16_t error = (olsr_cnf->ip_version == AF_INET) ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1766 @@ -199,6 +207,14 @@
1767 rt->rt_metric = rt->rt_best->rtp_metric;
1770 +#else /* SVEN_OLA_UNBLOAT */
1771 + olsr_16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
1773 + olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno));
1775 + rt->rt_nexthop = rt->rt_best->rtp_nexthop;
1777 +#endif /* SVEN_OLA_UNBLOAT */
1782 /* route additions */
1783 olsr_add_kernel_routes(&add_kernel_list);
1787 olsr_print_routing_table(&routingtree);
1790 diff -Nur olsrd-0.5.6-r3.orig/src/rebuild_packet.c olsrd-0.5.6-r3/src/rebuild_packet.c
1791 --- olsrd-0.5.6-r3.orig/src/rebuild_packet.c 2008-12-02 11:50:01.000000000 +0100
1792 +++ olsrd-0.5.6-r3/src/rebuild_packet.c 2008-12-03 10:01:07.000000000 +0100
1794 mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m)
1797 +#ifndef SVEN_OLA_UNBLOAT
1798 struct mid_alias *alias, *alias_tmp;
1799 +#else /* SVEN_OLA_UNBLOAT */
1800 + struct mid_alias *alias;
1801 +#endif /* SVEN_OLA_UNBLOAT */
1804 /* Checking if everything is ok */
1809 +#ifndef SVEN_OLA_UNBLOAT
1810 if (olsr_cnf->debug_level > 1) {
1811 struct ipaddr_str buf;
1812 OLSR_PRINTF(3, "Alias list for %s: ", olsr_ip_to_string(&buf, &mmsg->mid_origaddr));
1815 OLSR_PRINTF(3, "\n");
1817 +#endif /* SVEN_OLA_UNBLOAT */
1820 const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr;
1825 +#ifndef SVEN_OLA_UNBLOAT
1826 if (olsr_cnf->debug_level > 1) {
1827 struct ipaddr_str buf;
1828 OLSR_PRINTF(3, "Alias list for %s", ip6_to_string(&buf, &mmsg->mid_origaddr.v6));
1831 OLSR_PRINTF(3, "\n");
1833 +#endif /* SVEN_OLA_UNBLOAT */
1837 diff -Nur olsrd-0.5.6-r3.orig/src/routing_table.c olsrd-0.5.6-r3/src/routing_table.c
1838 --- olsrd-0.5.6-r3.orig/src/routing_table.c 2008-12-02 11:50:01.000000000 +0100
1839 +++ olsrd-0.5.6-r3/src/routing_table.c 2008-12-03 10:01:07.000000000 +0100
1842 * format a route entry into a buffer
1844 +#ifndef SVEN_OLA_UNBLOAT
1846 olsr_rt_to_string(const struct rt_entry *rt)
1848 @@ -654,11 +655,13 @@
1852 +#endif /* SVEN_OLA_UNBLOAT */
1855 * Print the routingtree to STDOUT
1858 +#ifndef SVEN_OLA_UNBLOAT
1860 olsr_print_routing_table(struct avl_tree *tree)
1864 tree = NULL; /* squelch compiler warnings */
1866 +#endif /* SVEN_OLA_UNBLOAT */
1870 diff -Nur olsrd-0.5.6-r3.orig/src/routing_table.h olsrd-0.5.6-r3/src/routing_table.h
1871 --- olsrd-0.5.6-r3.orig/src/routing_table.h 2008-12-02 11:50:01.000000000 +0100
1872 +++ olsrd-0.5.6-r3/src/routing_table.h 2008-12-03 10:01:07.000000000 +0100
1873 @@ -210,9 +210,11 @@
1874 olsr_bool olsr_cmp_rt(const struct rt_entry *, const struct rt_entry *);
1875 olsr_u8_t olsr_fib_metric(const struct rt_metric *);
1877 +#ifndef SVEN_OLA_UNBLOAT
1878 char *olsr_rt_to_string(const struct rt_entry *);
1879 char *olsr_rtp_to_string(const struct rt_path *);
1880 void olsr_print_routing_table(struct avl_tree *);
1881 +#endif /* SVEN_OLA_UNBLOAT */
1883 const struct rt_nexthop *olsr_get_nh(const struct rt_entry *);
1885 diff -Nur olsrd-0.5.6-r3.orig/src/tc_set.c olsrd-0.5.6-r3/src/tc_set.c
1886 --- olsrd-0.5.6-r3.orig/src/tc_set.c 2008-12-02 11:50:01.000000000 +0100
1887 +++ olsrd-0.5.6-r3/src/tc_set.c 2008-12-03 10:01:07.000000000 +0100
1890 * Format tc_edge contents into a buffer.
1892 +#ifndef SVEN_OLA_UNBLOAT
1894 olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
1900 +#endif /* SVEN_OLA_UNBLOAT */
1903 * Wrapper for the timer callback.
1906 * Print the topology table to stdout
1908 +#ifndef SVEN_OLA_UNBLOAT
1910 olsr_print_tc_table(void)
1913 } OLSR_FOR_ALL_TC_ENTRIES_END(tc);
1916 +#endif /* SVEN_OLA_UNBLOAT */
1919 * calculate the border IPs of a tc edge set according to the border flags
1920 diff -Nur olsrd-0.5.6-r3.orig/src/tc_set.h olsrd-0.5.6-r3/src/tc_set.h
1921 --- olsrd-0.5.6-r3.orig/src/tc_set.h 2008-12-02 11:50:01.000000000 +0100
1922 +++ olsrd-0.5.6-r3/src/tc_set.h 2008-12-03 10:01:07.000000000 +0100
1925 /* tc_edge_entry manipulation */
1926 olsr_bool olsr_delete_outdated_tc_edges(struct tc_entry *);
1927 +#ifndef SVEN_OLA_UNBLOAT
1928 char *olsr_tc_edge_to_string(struct tc_edge_entry *);
1929 +#endif /* SVEN_OLA_UNBLOAT */
1930 struct tc_edge_entry *olsr_lookup_tc_edge(struct tc_entry *, union olsr_ip_addr *);
1931 struct tc_edge_entry *olsr_add_tc_edge_entry(struct tc_entry *, union olsr_ip_addr *, olsr_u16_t);
1932 void olsr_delete_tc_entry(struct tc_entry *);
1933 diff -Nur olsrd-0.5.6-r3.orig/src/two_hop_neighbor_table.c olsrd-0.5.6-r3/src/two_hop_neighbor_table.c
1934 --- olsrd-0.5.6-r3.orig/src/two_hop_neighbor_table.c 2008-12-02 11:50:01.000000000 +0100
1935 +++ olsrd-0.5.6-r3/src/two_hop_neighbor_table.c 2008-12-03 10:01:07.000000000 +0100
1940 +#ifndef SVEN_OLA_UNBLOAT
1943 *Print the two hop neighbor table to STDOUT.
1949 +#endif /* SVEN_OLA_UNBLOAT */
1953 diff -Nur olsrd-0.5.6-r3.orig/src/unix/ifnet.c olsrd-0.5.6-r3/src/unix/ifnet.c
1954 --- olsrd-0.5.6-r3.orig/src/unix/ifnet.c 2008-12-02 11:50:01.000000000 +0100
1955 +++ olsrd-0.5.6-r3/src/unix/ifnet.c 2008-12-03 10:01:07.000000000 +0100
1958 #define BUFSPACE (127*1024) /* max. input buffer size to request */
1960 +#ifndef SVEN_OLA_UNBLOAT
1963 set_flag(char *ifname, short flag __attribute__ ((unused)))
1969 +#endif /* SVEN_OLA_UNBLOAT */
1972 check_interface_updates(void *foo __attribute__ ((unused)))
1974 @@ -110,11 +114,13 @@
1977 for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
1978 +#ifndef SVEN_OLA_UNBLOAT
1979 if (tmp_if->host_emul)
1982 if (olsr_cnf->host_emul) /* XXX: TEMPORARY! */
1984 +#endif /* SVEN_OLA_UNBLOAT */
1986 if (!tmp_if->cnf->autodetect_chg) {
1988 @@ -154,8 +160,10 @@
1989 OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name);
1992 +#ifndef SVEN_OLA_UNBLOAT
1993 if (iface->host_emul)
1995 +#endif /* SVEN_OLA_UNBLOAT */
1997 ifp = iface->interf;
2003 +#ifndef SVEN_OLA_UNBLOAT
2004 struct ipaddr_str buf;
2005 +#endif /* SVEN_OLA_UNBLOAT */
2006 /* Check interface address (IPv4) */
2007 if (ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) {
2008 OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n");
2011 if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) {
2012 OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2013 +#ifndef SVEN_OLA_UNBLOAT
2014 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
2015 +#endif /* SVEN_OLA_UNBLOAT */
2016 memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize);
2022 OLSR_PRINTF(1, "Removing interface %s\n", iface->name);
2023 +#ifndef SVEN_OLA_UNBLOAT
2024 olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
2025 +#endif /* SVEN_OLA_UNBLOAT */
2027 olsr_delete_link_entry_by_ip(&ifp->ip_addr);
2029 @@ -393,10 +407,14 @@
2030 memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
2031 OLSR_PRINTF(1, "No more interfaces...\n");
2033 +#if !defined(SVEN_OLA_UNBLOAT)
2034 struct ipaddr_str buf;
2035 +#endif /* SVEN_OLA_UNBLOAT */
2036 olsr_cnf->main_addr = ifnet->ip_addr;
2037 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2038 +#ifndef SVEN_OLA_UNBLOAT
2039 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2040 +#endif /* SVEN_OLA_UNBLOAT */
2046 if ((ifnet == NULL) && (!olsr_cnf->allow_no_interfaces)) {
2047 OLSR_PRINTF(1, "No more active interfaces - exiting.\n");
2048 +#ifndef SVEN_OLA_UNBLOAT
2049 olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n");
2050 +#endif /* SVEN_OLA_UNBLOAT */
2051 olsr_cnf->exit_value = EXIT_FAILURE;
2052 kill(getpid(), SIGINT);
2058 +#ifndef SVEN_OLA_UNBLOAT
2061 * Initializes the special interface used in
2062 * host-client emulation
2067 +#endif /* SVEN_OLA_UNBLOAT */
2069 static char basenamestr[32];
2070 static const char *if_basename(const char *name);
2071 @@ -613,8 +636,10 @@
2072 int tos_bits = IPTOS_TOS(olsr_cnf->tos);
2075 +#ifndef SVEN_OLA_UNBLOAT
2076 if (iface->host_emul)
2078 +#endif /* SVEN_OLA_UNBLOAT */
2080 memset(&ifr, 0, sizeof(struct ifreq));
2081 memset(&ifs, 0, sizeof(struct interface));
2082 @@ -721,11 +746,13 @@
2083 ifs.int_broadaddr = *(struct sockaddr_in *)&ifr.ifr_broadaddr;
2086 +#ifndef SVEN_OLA_UNBLOAT
2087 /* Deactivate IP spoof filter */
2088 deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2090 /* Disable ICMP redirects */
2091 disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
2092 +#endif /* SVEN_OLA_UNBLOAT */
2098 OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu);
2100 +#ifndef SVEN_OLA_UNBLOAT
2101 olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name);
2102 +#endif /* SVEN_OLA_UNBLOAT */
2103 OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index);
2105 if (olsr_cnf->ip_version == AF_INET) {
2106 @@ -860,10 +889,14 @@
2108 memset(&null_addr, 0, olsr_cnf->ipsize);
2109 if (ipequal(&null_addr, &olsr_cnf->main_addr)) {
2110 +#ifndef SVEN_OLA_UNBLOAT
2111 struct ipaddr_str buf;
2113 olsr_cnf->main_addr = ifp->ip_addr;
2114 OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2115 +#ifndef SVEN_OLA_UNBLOAT
2116 olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
2117 +#endif /* SVEN_OLA_UNBLOAT */
2121 diff -Nur olsrd-0.5.6-r3.orig/src/unix/misc.c olsrd-0.5.6-r3/src/unix/misc.c
2122 --- olsrd-0.5.6-r3.orig/src/unix/misc.c 2008-12-02 11:50:01.000000000 +0100
2123 +++ olsrd-0.5.6-r3/src/unix/misc.c 2008-12-03 10:01:07.000000000 +0100
2126 #include "olsr_types.h"
2128 +#ifndef SVEN_OLA_UNBLOAT
2136 +#endif /* SVEN_OLA_UNBLOAT */