2232 lines
69 KiB
Diff
2232 lines
69 KiB
Diff
diff -ur olsrd-0.5.6-r4.orig/Makefile.inc olsrd-0.5.6-r4/Makefile.inc
|
|
--- olsrd-0.5.6-r4.orig/Makefile.inc 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/Makefile.inc 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -204,6 +204,10 @@
|
|
$(warning Use CPPFLAGS instead of DEFINES for -D)
|
|
endif
|
|
|
|
+ifeq ($(SVEN_OLA_UNBLOAT),1)
|
|
+CPPFLAGS += -DSVEN_OLA_UNBLOAT -DNODEBUG
|
|
+endif
|
|
+
|
|
TAGFILE ?= src/TAGS
|
|
|
|
help:
|
|
diff -ur olsrd-0.5.6-r4.orig/lib/bmf/src/NetworkInterfaces.c olsrd-0.5.6-r4/lib/bmf/src/NetworkInterfaces.c
|
|
--- olsrd-0.5.6-r4.orig/lib/bmf/src/NetworkInterfaces.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/lib/bmf/src/NetworkInterfaces.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -544,7 +544,9 @@
|
|
OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: no link found\n", PLUGIN_NAME_SHORT,
|
|
olsr_ip_to_string(&buf, &walker->neighbor_iface_addr));
|
|
} else {
|
|
+#ifndef DEBUG
|
|
struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr);
|
|
+#endif
|
|
|
|
OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %5.2f\n",
|
|
PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), bestIntf->int_name,
|
|
diff -ur olsrd-0.5.6-r4.orig/lib/httpinfo/Makefile olsrd-0.5.6-r4/lib/httpinfo/Makefile
|
|
--- olsrd-0.5.6-r4.orig/lib/httpinfo/Makefile 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/lib/httpinfo/Makefile 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -47,7 +47,11 @@
|
|
CPPFLAGS += -DADMIN_INTERFACE
|
|
endif
|
|
|
|
+ifdef SVEN_OLA_UNBLOAT
|
|
+ CFLAGS += -DSVEN_OLA
|
|
+else
|
|
OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o
|
|
+endif
|
|
|
|
default_target: $(PLUGIN_FULLNAME)
|
|
ifdef ADMIN_INTERFACE
|
|
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
|
|
--- olsrd-0.5.6-r4.orig/lib/httpinfo/src/olsrd_httpinfo.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/lib/httpinfo/src/olsrd_httpinfo.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -67,7 +67,9 @@
|
|
|
|
#include "olsrd_httpinfo.h"
|
|
#include "admin_interface.h"
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "gfx.h"
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
#ifdef OS
|
|
#undef OS
|
|
@@ -181,7 +183,9 @@
|
|
|
|
static int build_about_body(char *, uint32_t);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static int build_cfgfile_body(char *, uint32_t);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
static int check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr);
|
|
|
|
@@ -216,10 +220,13 @@
|
|
{"Admin", "admin", build_admin_body, true},
|
|
#endif
|
|
{"About", "about", build_about_body, true},
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
{"FOO", "cfgfile", build_cfgfile_body, false},
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{NULL, NULL, NULL, false}
|
|
};
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static const struct static_bin_file_entry static_bin_files[] = {
|
|
{"favicon.ico", favicon_ico, sizeof(favicon_ico)}
|
|
,
|
|
@@ -229,6 +236,7 @@
|
|
,
|
|
{NULL, NULL, 0}
|
|
};
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
static const struct static_txt_file_entry static_txt_files[] = {
|
|
{"httpinfo.css", httpinfo_css},
|
|
@@ -407,6 +415,7 @@
|
|
} else if (!strcmp(req_type, "GET")) {
|
|
int i = 0;
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
for (i = 0; static_bin_files[i].filename; i++) {
|
|
if (FILENREQ_MATCH(filename, static_bin_files[i].filename)) {
|
|
break;
|
|
@@ -422,6 +431,7 @@
|
|
}
|
|
|
|
i = 0;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
while (static_txt_files[i].filename) {
|
|
if (FILENREQ_MATCH(filename, static_txt_files[i].filename)) {
|
|
break;
|
|
@@ -461,16 +471,22 @@
|
|
snprintf(&body[size], sizeof(body) - size,
|
|
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<head>\n"
|
|
"<meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n"
|
|
- "<title>olsr.org httpinfo plugin</title>\n" "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
|
|
+ "<title>olsr.org httpinfo plugin</title>\n"
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
+ "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
|
|
"<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n"
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
"<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n" "</head>\n"
|
|
"<body bgcolor=\"#ffffff\" text=\"#000000\">\n"
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%d\">\n"
|
|
"<tbody><tr bgcolor=\"#ffffff\">\n" "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n"
|
|
"<font color=\"black\" face=\"timesroman\" size=\"6\"> <a href=\"http://www.olsr.org/\">olsr.org OLSR daemon</a></font></td>\n"
|
|
"<td height=\"69\" valign=\"middle\" width=\"20%%\">\n"
|
|
"<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n" "</tr>\n"
|
|
- "</tbody>\n" "</table>\n", FRAMEWIDTH);
|
|
+ "</tbody>\n" "</table>\n", FRAMEWIDTH
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
+ );
|
|
|
|
size += build_tabs(&body[size], sizeof(body) - size, i);
|
|
size += build_frame(&body[size], sizeof(body) - size, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb);
|
|
@@ -854,7 +870,7 @@
|
|
size += snprintf(&buf[size], bufsize - size, "<tr><td colspan=\"3\">Status: DOWN</td></tr>\n");
|
|
continue;
|
|
}
|
|
-
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (olsr_cnf->ip_version == AF_INET) {
|
|
struct ipaddr_str addrbuf, maskbuf, bcastbuf;
|
|
size +=
|
|
@@ -867,6 +883,7 @@
|
|
snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n" "<td></td>\n" "</tr>\n",
|
|
ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr));
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
size +=
|
|
snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n" "<td>STATUS: UP</td>\n" "</tr>\n",
|
|
rifs->int_mtu, rifs->is_wireless ? "Yes" : "No");
|
|
@@ -1115,6 +1132,7 @@
|
|
build_host);
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static int
|
|
build_cfgfile_body(char *buf, uint32_t bufsize)
|
|
{
|
|
@@ -1149,6 +1167,7 @@
|
|
#endif
|
|
return size;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
static int
|
|
check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr)
|
|
diff -ur olsrd-0.5.6-r4.orig/lib/nameservice/src/nameservice.c olsrd-0.5.6-r4/lib/nameservice/src/nameservice.c
|
|
--- olsrd-0.5.6-r4.orig/lib/nameservice/src/nameservice.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/lib/nameservice/src/nameservice.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -65,6 +65,11 @@
|
|
#include "mapwrite.h"
|
|
#include "compat.h"
|
|
|
|
+#ifdef SVEN_OLA_UNBLOAT
|
|
+#undef OLSR_PRINTF
|
|
+#define OLSR_PRINTF(...)
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
+
|
|
/* config parameters */
|
|
static char my_hosts_file[MAX_FILE + 1];
|
|
static char my_sighup_pid_file[MAX_FILE + 1];
|
|
@@ -73,12 +78,16 @@
|
|
static char my_suffix[MAX_SUFFIX];
|
|
static int my_interval = EMISSION_INTERVAL;
|
|
static double my_timeout = NAME_VALID_TIME;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static char my_resolv_file[MAX_FILE + 1];
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
static char my_services_file[MAX_FILE + 1];
|
|
static char my_macs_file[MAX_FILE + 1];
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static char my_name_change_script[MAX_FILE + 1];
|
|
static char my_services_change_script[MAX_FILE + 1];
|
|
static char my_macs_change_script[MAX_FILE + 1];
|
|
+#endif
|
|
static char latlon_in_file[MAX_FILE + 1];
|
|
static char my_latlon_file[MAX_FILE + 1];
|
|
float my_lat = 0.0, my_lon = 0.0;
|
|
@@ -102,9 +111,11 @@
|
|
static struct name_entry *my_macs = NULL;
|
|
static bool mac_table_changed = true;
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static struct list_node forwarder_list[HASHSIZE];
|
|
static struct name_entry *my_forwarders = NULL;
|
|
static bool forwarder_table_changed = true;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
struct list_node latlon_list[HASHSIZE];
|
|
static bool latlon_table_changed = true;
|
|
@@ -138,7 +149,9 @@
|
|
GetWindowsDirectory(my_hosts_file, MAX_FILE - 12);
|
|
GetWindowsDirectory(my_services_file, MAX_FILE - 12);
|
|
GetWindowsDirectory(my_macs_file, MAX_FILE - 12);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
GetWindowsDirectory(my_resolv_file, MAX_FILE - 12);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
len = strlen(my_hosts_file);
|
|
if (my_hosts_file[len - 1] != '\\')
|
|
@@ -155,15 +168,19 @@
|
|
strscat(my_macs_file, "\\", sizeof(my_macs_file));
|
|
strscat(my_macs_file, "macs_olsr", sizeof(my_macs_file));
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
len = strlen(my_resolv_file);
|
|
if (my_resolv_file[len - 1] != '\\')
|
|
strscat(my_resolv_file, "\\", sizeof(my_resolv_file));
|
|
strscat(my_resolv_file, "resolvconf_olsr", sizeof(my_resolv_file));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
#else
|
|
strscpy(my_hosts_file, "/var/run/hosts_olsr", sizeof(my_hosts_file));
|
|
strscpy(my_services_file, "/var/run/services_olsr", sizeof(my_services_file));
|
|
strscpy(my_macs_file, "/var/run/macs_olsr", sizeof(my_macs_file));
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
strscpy(my_resolv_file, "/var/run/resolvconf_olsr", sizeof(my_resolv_file));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
*my_sighup_pid_file = 0;
|
|
#endif
|
|
|
|
@@ -171,14 +188,18 @@
|
|
my_add_hosts[0] = '\0';
|
|
my_latlon_file[0] = '\0';
|
|
latlon_in_file[0] = '\0';
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
my_name_change_script[0] = '\0';
|
|
my_services_change_script[0] = '\0';
|
|
my_macs_change_script[0] = '\0';
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* init the lists heads */
|
|
for (i = 0; i < HASHSIZE; i++) {
|
|
list_head_init(&name_list[i]);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
list_head_init(&forwarder_list[i]);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
list_head_init(&service_list[i]);
|
|
list_head_init(&mac_list[i]);
|
|
list_head_init(&latlon_list[i]);
|
|
@@ -186,6 +207,7 @@
|
|
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static int
|
|
set_nameservice_server(const char *value, void *data, set_plugin_parameter_addon addon)
|
|
{
|
|
@@ -204,6 +226,7 @@
|
|
}
|
|
return 1;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
static int
|
|
set_nameservice_name(const char *value, void *data, set_plugin_parameter_addon addon)
|
|
@@ -253,10 +276,12 @@
|
|
{ .name = "timeout", .set_plugin_parameter = &set_nameservice_float, .data = &my_timeout },
|
|
{ .name = "sighup-pid-file", .set_plugin_parameter = &set_plugin_string, .data = &my_sighup_pid_file, .addon = {sizeof(my_sighup_pid_file)} },
|
|
{ .name = "hosts-file", .set_plugin_parameter = &set_plugin_string, .data = &my_hosts_file, .addon = {sizeof(my_hosts_file)} },
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
{ .name = "name-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_name_change_script, .addon = {sizeof(my_name_change_script)} },
|
|
{ .name = "services-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_services_change_script, .addon = {sizeof(my_services_change_script)} },
|
|
{ .name = "macs-change-script", .set_plugin_parameter = &set_plugin_string, .data = &my_macs_change_script, .addon = {sizeof(my_macs_change_script)} },
|
|
{ .name = "resolv-file", .set_plugin_parameter = &set_plugin_string, .data = &my_resolv_file, .addon = {sizeof(my_resolv_file)} },
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{ .name = "suffix", .set_plugin_parameter = &set_plugin_string, .data = &my_suffix, .addon = {sizeof(my_suffix)} },
|
|
{ .name = "add-hosts", .set_plugin_parameter = &set_plugin_string, .data = &my_add_hosts, .addon = {sizeof(my_add_hosts)} },
|
|
{ .name = "services-file", .set_plugin_parameter = &set_plugin_string, .data = &my_services_file, .addon = {sizeof(my_services_file)} },
|
|
@@ -265,7 +290,9 @@
|
|
{ .name = "lon", .set_plugin_parameter = &set_nameservice_float, .data = &my_lon },
|
|
{ .name = "latlon-file", .set_plugin_parameter = &set_plugin_string, .data = &my_latlon_file, .addon = {sizeof(my_latlon_file)} },
|
|
{ .name = "latlon-infile", .set_plugin_parameter = &set_plugin_string, .data = &latlon_in_file, .addon = {sizeof(latlon_in_file)} },
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
{ .name = "dns-server", .set_plugin_parameter = &set_nameservice_server, .data = &my_forwarders, .addon = {NAME_FORWARDER} },
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{ .name = "name", .set_plugin_parameter = &set_nameservice_name, .data = &my_names, .addon = {NAME_HOST} },
|
|
{ .name = "service", .set_plugin_parameter = &set_nameservice_name, .data = &my_services, .addon = {NAME_SERVICE} },
|
|
{ .name = "mac", .set_plugin_parameter = &set_nameservice_name, .data = &my_macs, .addon = {NAME_MACADDR} },
|
|
@@ -381,16 +408,20 @@
|
|
name->ip = olsr_cnf->main_addr;
|
|
}
|
|
}
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
for (name = my_forwarders; name != NULL; name = name->next) {
|
|
if (name->ip.v4.s_addr == 0) {
|
|
OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name);
|
|
name->ip = olsr_cnf->main_addr;
|
|
}
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
//check if entries I want to announce myself are valid and allowed
|
|
my_names = remove_nonvalid_names_from_list(my_names, NAME_HOST);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
my_forwarders = remove_nonvalid_names_from_list(my_forwarders, NAME_FORWARDER);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
my_services = remove_nonvalid_names_from_list(my_services, NAME_SERVICE);
|
|
my_macs = remove_nonvalid_names_from_list(my_macs, NAME_MACADDR);
|
|
|
|
@@ -463,12 +494,16 @@
|
|
free_name_entry_list(&my_names);
|
|
free_name_entry_list(&my_services);
|
|
free_name_entry_list(&my_macs);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
free_name_entry_list(&my_forwarders);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
free_all_list_entries(name_list);
|
|
free_all_list_entries(service_list);
|
|
free_all_list_entries(mac_list);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
free_all_list_entries(forwarder_list);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
free_all_list_entries(latlon_list);
|
|
|
|
olsr_stop_timer(write_file_timer);
|
|
@@ -511,7 +546,9 @@
|
|
{
|
|
write_file_timer = NULL;
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
write_resolv_file(); /* if forwarder_table_changed */
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
write_hosts_file(); /* if name_table_changed */
|
|
write_services_file(false); /* if service_table_changed */
|
|
write_services_file(true); /* if mac_table_changed */
|
|
@@ -693,11 +730,13 @@
|
|
pos = create_packet((struct name *)pos, my_name);
|
|
i++;
|
|
}
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
// forwarders
|
|
for (my_name = my_forwarders; my_name != NULL; my_name = my_name->next) {
|
|
pos = create_packet((struct name *)pos, my_name);
|
|
i++;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
// services
|
|
for (my_name = my_services; my_name != NULL; my_name = my_name->next) {
|
|
pos = create_packet((struct name *)pos, my_name);
|
|
@@ -880,9 +919,11 @@
|
|
case NAME_HOST:
|
|
insert_new_name_in_list(originator, name_list, from_packet, &name_table_changed, vtime);
|
|
break;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
case NAME_FORWARDER:
|
|
insert_new_name_in_list(originator, forwarder_list, from_packet, &forwarder_table_changed, vtime);
|
|
break;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
case NAME_SERVICE:
|
|
insert_new_name_in_list(originator, service_list, from_packet, &service_table_changed, vtime);
|
|
break;
|
|
@@ -901,9 +942,11 @@
|
|
pos += sizeof(struct name);
|
|
pos += 1 + ((ntohs(from_packet->len) - 1) | 3);
|
|
}
|
|
+#ifdef DEBUG
|
|
if (i != 0)
|
|
OLSR_PRINTF(4, "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n", i,
|
|
olsr_ip_to_string(&strbuf, originator));
|
|
+#endif
|
|
}
|
|
|
|
/**
|
|
@@ -1120,6 +1163,7 @@
|
|
#endif
|
|
name_table_changed = false;
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
// Executes my_name_change_script after writing the hosts file
|
|
if (my_name_change_script[0] != '\0') {
|
|
if (system(my_name_change_script) != -1) {
|
|
@@ -1128,6 +1172,7 @@
|
|
OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on hosts change\n", my_name_change_script);
|
|
}
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
/**
|
|
@@ -1193,6 +1238,7 @@
|
|
|
|
fclose(file);
|
|
if (writemacs) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
// Executes my_macs_change_script after writing the macs file
|
|
if (my_macs_change_script[0] != '\0') {
|
|
if (system(my_macs_change_script) != -1) {
|
|
@@ -1201,9 +1247,11 @@
|
|
OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on mac change\n", my_macs_change_script);
|
|
}
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
mac_table_changed = false;
|
|
}
|
|
else {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
// Executes my_services_change_script after writing the services file
|
|
if (my_services_change_script[0] != '\0') {
|
|
if (system(my_services_change_script) != -1) {
|
|
@@ -1212,6 +1260,7 @@
|
|
OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on service change\n", my_services_change_script);
|
|
}
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
service_table_changed = false;
|
|
}
|
|
}
|
|
@@ -1222,6 +1271,7 @@
|
|
* fresh entries are at the beginning of the array and
|
|
* the best entry is at the end of the array.
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static void
|
|
select_best_nameserver(struct rt_entry **rt)
|
|
{
|
|
@@ -1253,11 +1303,13 @@
|
|
}
|
|
}
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
* write the 3 best upstream DNS servers to resolv.conf file
|
|
* best means the 3 with the best etx value in routing table
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
write_resolv_file(void)
|
|
{
|
|
@@ -1341,6 +1393,7 @@
|
|
fclose(resolv);
|
|
forwarder_table_changed = false;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
* completely free a list of name_entries
|
|
@@ -1359,9 +1412,11 @@
|
|
case NAME_HOST:
|
|
name_table_changed = true;
|
|
break;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
case NAME_FORWARDER:
|
|
forwarder_table_changed = true;
|
|
break;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
case NAME_SERVICE:
|
|
service_table_changed = true;
|
|
break;
|
|
diff -ur olsrd-0.5.6-r4.orig/src/apm.h olsrd-0.5.6-r4/src/apm.h
|
|
--- olsrd-0.5.6-r4.orig/src/apm.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/apm.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -41,6 +41,7 @@
|
|
|
|
#ifndef _OLSR_APM
|
|
#define _OLSR_APM
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
|
|
/*
|
|
* Interface to OS dependent power management information
|
|
@@ -69,6 +70,7 @@
|
|
int apm_read(struct olsr_apm_info *);
|
|
|
|
#endif
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/cfgfile_gen.c olsrd-0.5.6-r4/src/cfgparser/cfgfile_gen.c
|
|
--- olsrd-0.5.6-r4.orig/src/cfgparser/cfgfile_gen.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/cfgparser/cfgfile_gen.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -57,7 +57,9 @@
|
|
struct olsr_if *in = cnf->interfaces;
|
|
struct plugin_entry *pe = cnf->plugins;
|
|
struct plugin_param *pp;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct ip_prefix_list *ie = cnf->ipc_nets;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
struct olsr_lq_mult *mult;
|
|
|
|
char ipv6_buf[100]; /* buffer for IPv6 inet_htop */
|
|
@@ -133,6 +135,7 @@
|
|
else
|
|
fprintf(fd, "Willingness\t%d\n\n", cnf->willingness);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
/* IPC */
|
|
fprintf(fd, "# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
|
|
fprintf(fd, "IpcConnect {\n");
|
|
@@ -149,6 +152,7 @@
|
|
}
|
|
|
|
fprintf(fd, "}\n\n");
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* Hysteresis */
|
|
fprintf(fd, "# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
|
|
@@ -367,7 +371,9 @@
|
|
struct olsr_if *in = cnf->interfaces;
|
|
struct plugin_entry *pe = cnf->plugins;
|
|
struct plugin_param *pp;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct ip_prefix_list *ie = cnf->ipc_nets;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
struct olsr_lq_mult *mult;
|
|
|
|
int size = 0;
|
|
@@ -434,6 +440,7 @@
|
|
else
|
|
WRITE_TO_BUF("Willingness\t%d\n\n", cnf->willingness);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
/* IPC */
|
|
WRITE_TO_BUF("# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n");
|
|
WRITE_TO_BUF("IpcConnect {\n");
|
|
@@ -449,6 +456,7 @@
|
|
}
|
|
|
|
WRITE_TO_BUF("}\n\n");
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* Hysteresis */
|
|
WRITE_TO_BUF("# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n");
|
|
diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/local.mk olsrd-0.5.6-r4/src/cfgparser/local.mk
|
|
--- olsrd-0.5.6-r4.orig/src/cfgparser/local.mk 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/cfgparser/local.mk 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -41,8 +41,13 @@
|
|
C=$(if $(CFGDIR),$(CFGDIR)/)
|
|
|
|
# add the variables as we may have others already there
|
|
+ifeq ($(SVEN_OLA_UNBLOAT),1)
|
|
+SRCS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).c)
|
|
+OBJS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).o)
|
|
+else
|
|
SRCS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).c)
|
|
OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o)
|
|
+endif
|
|
HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h)
|
|
|
|
$(C)oscan.c: $(C)oscan.lex $(C)Makefile
|
|
diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/olsrd_conf.c olsrd-0.5.6-r4/src/cfgparser/olsrd_conf.c
|
|
--- olsrd-0.5.6-r4.orig/src/cfgparser/olsrd_conf.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/cfgparser/olsrd_conf.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -81,11 +81,13 @@
|
|
}
|
|
|
|
if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if ((argc > 2) && (!strcmp(argv[2], "-print"))) {
|
|
olsrd_print_cnf(cnf);
|
|
olsrd_write_cnf(cnf, "./out.conf");
|
|
} else
|
|
printf("Use -print to view parsed values\n");
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
printf("Configfile parsed OK\n");
|
|
} else {
|
|
printf("Failed parsing \"%s\"\n", argv[1]);
|
|
@@ -152,7 +154,9 @@
|
|
/* set various stuff */
|
|
in->configured = false;
|
|
in->interf = NULL;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
in->host_emul = false;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
return olsr_cnf;
|
|
}
|
|
@@ -389,7 +393,9 @@
|
|
|
|
cnf->debug_level = DEF_DEBUGLVL;
|
|
cnf->no_fork = false;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
cnf->host_emul = false;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
cnf->ip_version = AF_INET;
|
|
cnf->ipsize = sizeof(struct in_addr);
|
|
cnf->maxplen = 32;
|
|
@@ -400,7 +406,9 @@
|
|
cnf->rtproto = DEF_RTPROTO;
|
|
cnf->rttable_default = 0;
|
|
cnf->willingness_auto = DEF_WILL_AUTO;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
cnf->ipc_connections = DEF_IPC_CONNECTIONS;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
cnf->fib_metric = DEF_FIB_METRIC;
|
|
|
|
cnf->use_hysteresis = DEF_USE_HYST;
|
|
@@ -479,6 +487,7 @@
|
|
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
olsrd_print_cnf(struct olsrd_config *cnf)
|
|
{
|
|
@@ -622,6 +631,7 @@
|
|
}
|
|
}
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
#if defined WIN32
|
|
struct ioinfo {
|
|
diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/oparse.y olsrd-0.5.6-r4/src/cfgparser/oparse.y
|
|
--- olsrd-0.5.6-r4.orig/src/cfgparser/oparse.y 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/cfgparser/oparse.y 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -178,7 +178,6 @@
|
|
%token TOK_RTPROTO
|
|
%token TOK_RTTABLE_DEFAULT
|
|
%token TOK_WILLINGNESS
|
|
-%token TOK_IPCCON
|
|
%token TOK_FIBMETRIC
|
|
%token TOK_USEHYST
|
|
%token TOK_HYSTSCALE
|
|
@@ -201,7 +200,6 @@
|
|
|
|
%token TOK_HOSTLABEL
|
|
%token TOK_NETLABEL
|
|
-%token TOK_MAXIPC
|
|
|
|
%token TOK_IP4BROADCAST
|
|
%token TOK_IFMODE
|
|
@@ -263,7 +261,6 @@
|
|
|
|
block: TOK_HNA4 hna4body
|
|
| TOK_HNA6 hna6body
|
|
- | TOK_IPCCON ipcbody
|
|
| ifblock ifbody
|
|
| plblock plbody
|
|
;
|
|
@@ -288,18 +285,6 @@
|
|
| ihna6entry
|
|
;
|
|
|
|
-ipcbody: TOK_OPEN ipcstmts TOK_CLOSE
|
|
-;
|
|
-
|
|
-ipcstmts: | ipcstmts ipcstmt
|
|
-;
|
|
-
|
|
-ipcstmt: vcomment
|
|
- | imaxipc
|
|
- | ipchost
|
|
- | ipcnet
|
|
-;
|
|
-
|
|
ifblock: ifstart ifnicks
|
|
;
|
|
|
|
@@ -341,77 +326,6 @@
|
|
| vcomment
|
|
;
|
|
|
|
-imaxipc: TOK_MAXIPC TOK_INTEGER
|
|
-{
|
|
- olsr_cnf->ipc_connections = $2->integer;
|
|
- free($2);
|
|
-}
|
|
-;
|
|
-
|
|
-ipchost: TOK_HOSTLABEL TOK_IP4_ADDR
|
|
-{
|
|
- union olsr_ip_addr ipaddr;
|
|
- PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string);
|
|
-
|
|
- if (inet_aton($2->string, &ipaddr.v4) == 0) {
|
|
- fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string);
|
|
- YYABORT;
|
|
- }
|
|
-
|
|
- ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen);
|
|
-
|
|
- free($2->string);
|
|
- free($2);
|
|
-}
|
|
-;
|
|
-
|
|
-ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR
|
|
-{
|
|
- union olsr_ip_addr ipaddr, netmask;
|
|
-
|
|
- PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
|
|
-
|
|
- if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
|
|
- fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
|
|
- YYABORT;
|
|
- }
|
|
-
|
|
- if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) {
|
|
- fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string);
|
|
- YYABORT;
|
|
- }
|
|
-
|
|
- ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask));
|
|
-
|
|
- free($2->string);
|
|
- free($2);
|
|
- free($3->string);
|
|
- free($3);
|
|
-}
|
|
- | TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER
|
|
-{
|
|
- union olsr_ip_addr ipaddr;
|
|
-
|
|
- PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string);
|
|
-
|
|
- if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) {
|
|
- fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string);
|
|
- YYABORT;
|
|
- }
|
|
-
|
|
- if ($4->integer > olsr_cnf->maxplen) {
|
|
- fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen);
|
|
- YYABORT;
|
|
- }
|
|
-
|
|
- ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer);
|
|
-
|
|
- free($2->string);
|
|
- free($2);
|
|
- free($4);
|
|
-}
|
|
-;
|
|
-
|
|
iifweight: TOK_IFWEIGHT TOK_INTEGER
|
|
{
|
|
int ifcnt = ifs_in_curr_cfg;
|
|
diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/oscan.lex olsrd-0.5.6-r4/src/cfgparser/oscan.lex
|
|
--- olsrd-0.5.6-r4.orig/src/cfgparser/oscan.lex 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/cfgparser/oscan.lex 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -253,11 +253,6 @@
|
|
return TOK_NETLABEL;
|
|
}
|
|
|
|
-"MaxConnections" {
|
|
- yylval = NULL;
|
|
- return TOK_MAXIPC;
|
|
-}
|
|
-
|
|
"DebugLevel" {
|
|
yylval = NULL;
|
|
return TOK_DEBUGLEVEL;
|
|
@@ -334,11 +329,6 @@
|
|
return TOK_WILLINGNESS;
|
|
}
|
|
|
|
-"IpcConnect" {
|
|
- yylval = NULL;
|
|
- return TOK_IPCCON;
|
|
-}
|
|
-
|
|
"FIBMetric" {
|
|
yylval = NULL;
|
|
return TOK_FIBMETRIC;
|
|
diff -ur olsrd-0.5.6-r4.orig/src/defs.h olsrd-0.5.6-r4/src/defs.h
|
|
--- olsrd-0.5.6-r4.orig/src/defs.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/defs.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -190,6 +190,8 @@
|
|
*/
|
|
clock_t olsr_times(void);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
+
|
|
/*
|
|
*IPC functions
|
|
*These are moved to a plugin soon
|
|
@@ -207,6 +209,7 @@
|
|
int ipc_output(struct olsr *);
|
|
|
|
#endif
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/duplicate_set.c olsrd-0.5.6-r4/src/duplicate_set.c
|
|
--- olsrd-0.5.6-r4.orig/src/duplicate_set.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/duplicate_set.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -174,6 +174,7 @@
|
|
return false; /* no duplicate */
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
olsr_print_duplicate_table(void)
|
|
{
|
|
@@ -192,6 +193,7 @@
|
|
} OLSR_FOR_ALL_DUP_ENTRIES_END(entry);
|
|
#endif
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/hna_set.c olsrd-0.5.6-r4/src/hna_set.c
|
|
--- olsrd-0.5.6-r4.orig/src/hna_set.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/hna_set.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -279,6 +279,7 @@
|
|
*
|
|
*@return nada
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
olsr_print_hna_set(void)
|
|
{
|
|
@@ -320,6 +321,7 @@
|
|
}
|
|
#endif
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
*Process incoming HNA message.
|
|
diff -ur olsrd-0.5.6-r4.orig/src/interfaces.c olsrd-0.5.6-r4/src/interfaces.c
|
|
--- olsrd-0.5.6-r4.orig/src/interfaces.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/interfaces.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -93,12 +93,16 @@
|
|
OLSR_PRINTF(1, "\n ---- Interface configuration ---- \n\n");
|
|
/* Run trough all interfaces immedeatly */
|
|
for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (!tmp_if->host_emul) {
|
|
if (!olsr_cnf->host_emul) /* XXX: TEMPORARY! */
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
chk_if_up(tmp_if, 1);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
} else {
|
|
add_hemu_if(tmp_if);
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
/* Kick a periodic timer for the network interface update function */
|
|
@@ -244,7 +248,11 @@
|
|
*@return nada
|
|
*/
|
|
struct olsr_if *
|
|
+#ifdef SVEN_OLA_UNBLOAT
|
|
+queue_if(const char *name)
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
queue_if(const char *name, int hemu)
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{
|
|
struct olsr_if *interf_n = olsr_cnf->interfaces;
|
|
size_t name_size;
|
|
@@ -268,7 +276,9 @@
|
|
interf_n->interf = NULL;
|
|
interf_n->configured = 0;
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
interf_n->host_emul = hemu ? true : false;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
strscpy(interf_n->name, name, name_size);
|
|
interf_n->next = olsr_cnf->interfaces;
|
|
diff -ur olsrd-0.5.6-r4.orig/src/interfaces.h olsrd-0.5.6-r4/src/interfaces.h
|
|
--- olsrd-0.5.6-r4.orig/src/interfaces.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/interfaces.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -200,7 +200,12 @@
|
|
|
|
struct interface *if_ifwithindex(const int if_index);
|
|
|
|
-struct olsr_if *queue_if(const char *, int);
|
|
+struct olsr_if *
|
|
+#ifdef SVEN_OLA_UNBLOAT
|
|
+ queue_if(const char *);
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+ queue_if(const char *, int);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
int add_ifchgf(int (*f) (struct interface *, int));
|
|
|
|
diff -ur olsrd-0.5.6-r4.orig/src/ipc_frontend.c olsrd-0.5.6-r4/src/ipc_frontend.c
|
|
--- olsrd-0.5.6-r4.orig/src/ipc_frontend.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/ipc_frontend.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -46,6 +46,7 @@
|
|
*
|
|
*/
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "ipc_frontend.h"
|
|
#include "link_set.h"
|
|
#include "olsr.h"
|
|
@@ -423,6 +424,7 @@
|
|
|
|
return 1;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/ipc_frontend.h olsrd-0.5.6-r4/src/ipc_frontend.h
|
|
--- olsrd-0.5.6-r4.orig/src/ipc_frontend.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/ipc_frontend.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -48,6 +48,7 @@
|
|
|
|
#ifndef _OLSR_IPC
|
|
#define _OLSR_IPC
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
|
|
#include <sys/types.h>
|
|
#include <netinet/in.h>
|
|
@@ -103,6 +104,7 @@
|
|
int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *);
|
|
|
|
#endif
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/ipcalc.c olsrd-0.5.6-r4/src/ipcalc.c
|
|
--- olsrd-0.5.6-r4.orig/src/ipcalc.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/ipcalc.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -121,6 +121,7 @@
|
|
return prefix;
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
const char *
|
|
olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
|
|
{
|
|
@@ -147,6 +148,7 @@
|
|
}
|
|
return rv;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* see if the ipaddr is in the net. That is equivalent to the fact that the net part
|
|
* of both are equal. So we must compare the first <prefixlen> bits.
|
|
diff -ur olsrd-0.5.6-r4.orig/src/ipcalc.h olsrd-0.5.6-r4/src/ipcalc.h
|
|
--- olsrd-0.5.6-r4.orig/src/ipcalc.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/ipcalc.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -146,7 +146,9 @@
|
|
return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf));
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
static INLINE const char *
|
|
sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr)
|
|
diff -ur olsrd-0.5.6-r4.orig/src/link_set.c olsrd-0.5.6-r4/src/link_set.c
|
|
--- olsrd-0.5.6-r4.orig/src/link_set.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/link_set.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -761,6 +761,7 @@
|
|
return ret;
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
olsr_print_link_set(void)
|
|
{
|
|
@@ -782,6 +783,7 @@
|
|
} OLSR_FOR_ALL_LINK_ENTRIES_END(walker);
|
|
#endif
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* called for every LQ HELLO message.
|
|
diff -ur olsrd-0.5.6-r4.orig/src/linux/apm.c olsrd-0.5.6-r4/src/linux/apm.c
|
|
--- olsrd-0.5.6-r4.orig/src/linux/apm.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/linux/apm.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -44,6 +44,7 @@
|
|
* Acpi-Power Enlightenment epplet
|
|
*/
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "apm.h"
|
|
#include "defs.h"
|
|
#include <stdio.h>
|
|
@@ -348,6 +349,7 @@
|
|
/* No battery found */
|
|
return -1;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/linux/kernel_routes.c olsrd-0.5.6-r4/src/linux/kernel_routes.c
|
|
--- olsrd-0.5.6-r4.orig/src/linux/kernel_routes.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/linux/kernel_routes.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -300,11 +300,13 @@
|
|
if (rt_ret > 0) rt_ret = 0; /* successful recovery */
|
|
else rt_ret = -1; /* unrecoverable error */
|
|
}
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
//send ipc update on success
|
|
if ( ( cmd != RTM_NEWRULE ) & ( cmd != RTM_DELRULE ) & (flag = RT_ORIG_REQUEST) & (0 <= rt_ret && olsr_cnf->ipc_connections > 0)) {
|
|
ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd,
|
|
if_ifwithindex_name(nexthop->iif_index));
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
if (rt_ret == -2) olsr_syslog(OLSR_LOG_ERR,"no rtnetlink response! (no system ressources left?, everything may happen now ...)");
|
|
return rt_ret;
|
|
}
|
|
@@ -342,7 +344,9 @@
|
|
int rslt;
|
|
#endif /* LINUX_POLICY_ROUTING */
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
#if !LINUX_POLICY_ROUTING
|
|
memset(&kernel_route, 0, sizeof(struct rtentry));
|
|
@@ -416,7 +420,9 @@
|
|
struct in6_rtmsg kernel_route;
|
|
int rslt;
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
|
|
|
|
@@ -469,7 +475,9 @@
|
|
int rslt;
|
|
#endif /* LINUX_POLICY_ROUTING */
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
#if !LINUX_POLICY_ROUTING
|
|
memset(&kernel_route, 0, sizeof(struct rtentry));
|
|
@@ -536,7 +544,9 @@
|
|
int rslt;
|
|
#endif /* LINUX_POLICY_ROUTING */
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
#if !LINUX_POLICY_ROUTING
|
|
memset(&kernel_route, 0, sizeof(struct in6_rtmsg));
|
|
diff -ur olsrd-0.5.6-r4.orig/src/linux/net.c olsrd-0.5.6-r4/src/linux/net.c
|
|
--- olsrd-0.5.6-r4.orig/src/linux/net.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/linux/net.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -69,8 +69,10 @@
|
|
#define SIOCGIWRATE 0x8B21 /* get default bit rate (bps) */
|
|
|
|
/* The original state of the IP forwarding proc entry */
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
static char orig_fwd_state;
|
|
static char orig_global_redirect_state;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
*Bind a socket to a device
|
|
@@ -91,6 +93,8 @@
|
|
return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1);
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
+
|
|
/**
|
|
*Enable IP forwarding.
|
|
*Just writing "1" to the /proc/sys/net/ipv4/ip_forward
|
|
@@ -110,6 +114,9 @@
|
|
const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding";
|
|
|
|
if ((proc_fwd = fopen(procfile, "r")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
/* IPv4 */
|
|
if (version == AF_INET)
|
|
fprintf(stderr,
|
|
@@ -122,6 +129,7 @@
|
|
procfile);
|
|
|
|
sleep(3);
|
|
+#endif
|
|
return 0;
|
|
}
|
|
|
|
@@ -131,9 +139,13 @@
|
|
OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
|
|
} else {
|
|
if ((proc_fwd = fopen(procfile, "w")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\n", procfile);
|
|
fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP forwarding is enabeled!\n\n");
|
|
sleep(3);
|
|
+#endif
|
|
return 0;
|
|
} else {
|
|
syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile);
|
|
@@ -154,11 +166,15 @@
|
|
return -1;
|
|
|
|
if ((proc_redirect = fopen(procfile, "r")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr,
|
|
"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",
|
|
procfile);
|
|
|
|
sleep(3);
|
|
+#endif
|
|
return -1;
|
|
}
|
|
orig_global_redirect_state = fgetc(proc_redirect);
|
|
@@ -168,9 +184,13 @@
|
|
return 0;
|
|
|
|
if ((proc_redirect = fopen(procfile, "w")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\n", procfile);
|
|
fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
|
|
sleep(3);
|
|
+#endif
|
|
return 0;
|
|
}
|
|
syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
|
|
@@ -196,19 +216,27 @@
|
|
snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name);
|
|
|
|
if ((proc_redirect = fopen(procfile, "r")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr,
|
|
"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",
|
|
procfile);
|
|
sleep(3);
|
|
+#endif
|
|
return 0;
|
|
}
|
|
iface->nic_state.redirect = fgetc(proc_redirect);
|
|
fclose(proc_redirect);
|
|
|
|
if ((proc_redirect = fopen(procfile, "w")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\n", procfile);
|
|
fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n");
|
|
sleep(3);
|
|
+#endif
|
|
return 0;
|
|
}
|
|
syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
|
|
@@ -234,20 +262,28 @@
|
|
sprintf(procfile, SPOOF_PROC, if_name);
|
|
|
|
if ((proc_spoof = fopen(procfile, "r")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr,
|
|
"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",
|
|
procfile);
|
|
|
|
sleep(3);
|
|
+#endif
|
|
return 0;
|
|
}
|
|
iface->nic_state.spoof = fgetc(proc_spoof);
|
|
fclose(proc_spoof);
|
|
|
|
if ((proc_spoof = fopen(procfile, "w")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\n", procfile);
|
|
fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabeled!\n\n");
|
|
sleep(3);
|
|
+#endif
|
|
return 0;
|
|
}
|
|
syslog(LOG_INFO, "Writing \"0\" to %s", procfile);
|
|
@@ -272,7 +308,11 @@
|
|
FILE *proc_fd;
|
|
|
|
if ((proc_fd = fopen(procfile, "w")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
|
|
+#endif
|
|
} else {
|
|
syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state);
|
|
fputc(orig_fwd_state, proc_fd);
|
|
@@ -287,7 +327,11 @@
|
|
FILE *proc_fd;
|
|
|
|
if ((proc_fd = fopen(procfile, "w")) == NULL) {
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
|
|
+#endif
|
|
} else {
|
|
syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state);
|
|
fputc(orig_global_redirect_state, proc_fd);
|
|
@@ -311,7 +355,11 @@
|
|
snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name);
|
|
|
|
if ((proc_fd = fopen(procfile, "w")) == NULL)
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
|
|
+#endif
|
|
else {
|
|
syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect);
|
|
|
|
@@ -324,7 +372,11 @@
|
|
/* Generate the procfile name */
|
|
sprintf(procfile, SPOOF_PROC, ifs->int_name);
|
|
if ((proc_fd = fopen(procfile, "w")) == NULL)
|
|
+#ifdef SVEN_OLA_UNBLOAT_OLD
|
|
+ perror(procfile);
|
|
+#else
|
|
fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile);
|
|
+#endif
|
|
else {
|
|
syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof);
|
|
|
|
@@ -372,6 +424,8 @@
|
|
return sock;
|
|
}
|
|
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
+
|
|
/**
|
|
*Creates a nonblocking broadcast socket.
|
|
*@param sa sockaddr struct. Used for bind(2).
|
|
diff -ur olsrd-0.5.6-r4.orig/src/lq_plugin.c olsrd-0.5.6-r4/src/lq_plugin.c
|
|
--- olsrd-0.5.6-r4.orig/src/lq_plugin.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/lq_plugin.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -67,12 +67,18 @@
|
|
init_lq_handler_tree(void)
|
|
{
|
|
avl_init(&lq_handler_tree, &avl_strcasecmp);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
register_lq_handler(&lq_etx_float_handler, LQ_ALGORITHM_ETX_FLOAT_NAME);
|
|
register_lq_handler(&lq_etx_fpm_handler, LQ_ALGORITHM_ETX_FPM_NAME);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
register_lq_handler(&lq_etx_ff_handler, LQ_ALGORITHM_ETX_FF_NAME);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (activate_lq_handler(olsr_cnf->lq_algorithm)) {
|
|
activate_lq_handler(LQ_ALGORITHM_ETX_FPM_NAME);
|
|
}
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+ activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
/*
|
|
@@ -417,7 +423,11 @@
|
|
* @return pointer to hello_neighbor
|
|
*/
|
|
struct hello_neighbor *
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_malloc_hello_neighbor(const char *id)
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+olsr_malloc_hello_neighbor(const char *id __attribute__ ((unused)))
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{
|
|
struct hello_neighbor *h;
|
|
|
|
@@ -439,7 +449,11 @@
|
|
* @return pointer to tc_mpr_addr
|
|
*/
|
|
struct tc_mpr_addr *
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_malloc_tc_mpr_addr(const char *id)
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+olsr_malloc_tc_mpr_addr(const char *id __attribute__ ((unused)))
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{
|
|
struct tc_mpr_addr *t;
|
|
|
|
@@ -461,7 +475,11 @@
|
|
* @return pointer to lq_hello_neighbor
|
|
*/
|
|
struct lq_hello_neighbor *
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_malloc_lq_hello_neighbor(const char *id)
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+olsr_malloc_lq_hello_neighbor(const char *id __attribute__ ((unused)))
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{
|
|
struct lq_hello_neighbor *h;
|
|
|
|
@@ -483,7 +501,11 @@
|
|
* @return pointer to link_entry
|
|
*/
|
|
struct link_entry *
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_malloc_link_entry(const char *id)
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+olsr_malloc_link_entry(const char *id __attribute__ ((unused)))
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
{
|
|
struct link_entry *h;
|
|
|
|
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
|
|
--- olsrd-0.5.6-r4.orig/src/lq_plugin_default_float.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/lq_plugin_default_float.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -39,6 +39,7 @@
|
|
*
|
|
*/
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "tc_set.h"
|
|
#include "link_set.h"
|
|
#include "olsr_spf.h"
|
|
@@ -223,6 +224,7 @@
|
|
|
|
return buffer->buf;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
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
|
|
--- olsrd-0.5.6-r4.orig/src/lq_plugin_default_float.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/lq_plugin_default_float.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -39,6 +39,7 @@
|
|
*
|
|
*/
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#ifndef LQ_PLUGIN_DEFAULT_H_
|
|
#define LQ_PLUGIN_DEFAULT_H_
|
|
|
|
@@ -77,6 +78,7 @@
|
|
extern struct lq_handler lq_etx_float_handler;
|
|
|
|
#endif /*LQ_PLUGIN_DEFAULT_H_ */
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
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
|
|
--- olsrd-0.5.6-r4.orig/src/lq_plugin_default_fpm.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/lq_plugin_default_fpm.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -39,6 +39,7 @@
|
|
*
|
|
*/
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "tc_set.h"
|
|
#include "link_set.h"
|
|
#include "lq_plugin.h"
|
|
@@ -235,6 +236,7 @@
|
|
snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER);
|
|
return buffer->buf;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
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
|
|
--- olsrd-0.5.6-r4.orig/src/lq_plugin_default_fpm.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/lq_plugin_default_fpm.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -39,6 +39,7 @@
|
|
*
|
|
*/
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#ifndef LQ_ETX_FPM_
|
|
#define LQ_ETX_FPM_
|
|
|
|
@@ -83,6 +84,7 @@
|
|
extern struct lq_handler lq_etx_fpm_handler;
|
|
|
|
#endif /*LQ_ETX_FPM_ */
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/main.c olsrd-0.5.6-r4/src/main.c
|
|
--- olsrd-0.5.6-r4.orig/src/main.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/main.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -256,13 +256,17 @@
|
|
/*
|
|
* Print configuration
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (olsr_cnf->debug_level > 1) {
|
|
olsrd_print_cnf(olsr_cnf);
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
#ifndef WIN32
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
/* Disable redirects globally */
|
|
disable_redirects_global(olsr_cnf->ip_version);
|
|
#endif
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* socket for ioctl calls
|
|
@@ -298,7 +302,9 @@
|
|
/*
|
|
*enable ip forwarding on host
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
enable_ip_forwarding(olsr_cnf->ip_version);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* Initialize parser */
|
|
olsr_init_parser();
|
|
@@ -316,6 +322,7 @@
|
|
*Set up willingness/APM
|
|
*/
|
|
if (olsr_cnf->willingness_auto) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (apm_init() < 0) {
|
|
OLSR_PRINTF(1, "Could not read APM info - setting default willingness(%d)\n", WILL_DEFAULT);
|
|
|
|
@@ -324,10 +331,13 @@
|
|
olsr_cnf->willingness_auto = 0;
|
|
olsr_cnf->willingness = WILL_DEFAULT;
|
|
} else {
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
olsr_cnf->willingness = olsr_calculate_willingness();
|
|
|
|
OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
/* Initialize net */
|
|
@@ -362,9 +372,11 @@
|
|
|
|
/* Initialize the IPC socket */
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (olsr_cnf->ipc_connections > 0) {
|
|
ipc_init();
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
/* Initialisation of different tables to be used. */
|
|
olsr_init_tables();
|
|
|
|
@@ -487,9 +499,11 @@
|
|
OLSR_PRINTF(1, "Closing sockets...\n");
|
|
|
|
/* front-end IPC socket */
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (olsr_cnf->ipc_connections > 0) {
|
|
shutdown_ipc();
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* OLSR sockets */
|
|
for (ifn = ifnet; ifn; ifn = ifn->int_next)
|
|
@@ -499,7 +513,9 @@
|
|
olsr_close_plugins();
|
|
|
|
/* Reset network settings */
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
restore_settings(olsr_cnf->ip_version);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* ioctl socket */
|
|
close(olsr_cnf->ioctl_s);
|
|
@@ -540,7 +556,11 @@
|
|
"usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n"
|
|
" [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n"
|
|
" [-lql <LQ level>] [-lqw <LQ winsize>] [-lqnt <nat threshold>]\n"
|
|
+#ifdef SVEN_OLA_UNBLOAT
|
|
+ " [-bcast <broadcastaddr>] [-delgw] (Note: no -ipc,-dispin,-dispout)\n"
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
" [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n"
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
" [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n"
|
|
" [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n"
|
|
" [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n" " [-lql <LQ level>] [-lqa <LQ aging factor>]\n");
|
|
@@ -704,12 +724,20 @@
|
|
olsr_exit(__func__, EXIT_FAILURE);
|
|
}
|
|
printf("Queuing if %s\n", *argv);
|
|
+#ifdef SVEN_OLA_UNBLOAT
|
|
+ queue_if(*argv);
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
queue_if(*argv, false);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
while ((argc - 1) && (argv[1][0] != '-')) {
|
|
NEXT_ARG;
|
|
printf("Queuing if %s\n", *argv);
|
|
+#ifdef SVEN_OLA_UNBLOAT
|
|
+ queue_if(*argv);
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
queue_if(*argv, false);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
continue;
|
|
@@ -771,7 +799,7 @@
|
|
sscanf(*argv, "%f", &cnf->pollrate);
|
|
continue;
|
|
}
|
|
-
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
/*
|
|
* Should we display the contents of packages beeing sent?
|
|
*/
|
|
@@ -795,6 +823,7 @@
|
|
cnf->ipc_connections = 1;
|
|
continue;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* IPv6 multicast addr
|
|
@@ -812,7 +841,7 @@
|
|
|
|
continue;
|
|
}
|
|
-
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
/*
|
|
* Host emulation
|
|
*/
|
|
@@ -840,6 +869,7 @@
|
|
|
|
continue;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Delete possible default GWs
|
|
diff -ur olsrd-0.5.6-r4.orig/src/neighbor_table.c olsrd-0.5.6-r4/src/neighbor_table.c
|
|
--- olsrd-0.5.6-r4.orig/src/neighbor_table.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/neighbor_table.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -362,6 +362,7 @@
|
|
*
|
|
*@return nada
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
olsr_print_neighbor_table(void)
|
|
{
|
|
@@ -391,6 +392,7 @@
|
|
}
|
|
#endif
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/net_olsr.c olsrd-0.5.6-r4/src/net_olsr.c
|
|
--- olsrd-0.5.6-r4.orig/src/net_olsr.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/net_olsr.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -44,7 +44,9 @@
|
|
#include "log.h"
|
|
#include "olsr.h"
|
|
#include "net_os.h"
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "print_packet.h"
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
#include "link_set.h"
|
|
#include "lq_packet.h"
|
|
|
|
@@ -385,8 +387,10 @@
|
|
*if the -dispout option was given
|
|
*we print the content of the packets
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (disp_pack_out)
|
|
print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
if (olsr_cnf->ip_version == AF_INET) {
|
|
/* IP version 4 */
|
|
@@ -400,12 +404,16 @@
|
|
/* IP version 6 */
|
|
if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6))
|
|
< 0) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct ipaddr_str buf;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
perror("sendto(v6)");
|
|
olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m");
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index);
|
|
fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6));
|
|
fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
retval = -1;
|
|
}
|
|
}
|
|
diff -ur olsrd-0.5.6-r4.orig/src/olsr.c olsrd-0.5.6-r4/src/olsr.c
|
|
--- olsrd-0.5.6-r4.orig/src/olsr.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/olsr.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -149,7 +149,9 @@
|
|
return;
|
|
|
|
if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
clear_console();
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
printf(" *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host);
|
|
}
|
|
|
|
@@ -165,7 +167,7 @@
|
|
if (changes_neighborhood || changes_topology || changes_hna) {
|
|
olsr_calculate_routing_table();
|
|
}
|
|
-
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (olsr_cnf->debug_level > 0) {
|
|
if (olsr_cnf->debug_level > 2) {
|
|
olsr_print_mid_set();
|
|
@@ -184,6 +186,7 @@
|
|
olsr_print_tc_table();
|
|
#endif
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
for (tmp_pc_list = pcf_list; tmp_pc_list != NULL; tmp_pc_list = tmp_pc_list->next) {
|
|
tmp_pc_list->function(changes_neighborhood, changes_topology, changes_hna);
|
|
@@ -420,12 +423,15 @@
|
|
uint8_t
|
|
olsr_calculate_willingness(void)
|
|
{
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct olsr_apm_info ainfo;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/* If fixed willingness */
|
|
if (!olsr_cnf->willingness_auto)
|
|
return olsr_cnf->willingness;
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (apm_read(&ainfo) < 1)
|
|
return WILL_DEFAULT;
|
|
|
|
@@ -442,8 +448,12 @@
|
|
* 26% > juice will: 1
|
|
*/
|
|
return (ainfo.battery_percentage / 26);
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+ return WILL_DEFAULT;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
const char *
|
|
olsr_msgtype_to_string(uint8_t msgtype)
|
|
{
|
|
@@ -513,6 +523,7 @@
|
|
snprintf(type, sizeof(type), "UNKNOWN(%d)", status);
|
|
return type;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
*Termination function to be called whenever a error occures
|
|
@@ -541,6 +552,7 @@
|
|
*
|
|
* @return a void pointer to the memory allocated
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void *
|
|
olsr_malloc(size_t size, const char *id)
|
|
{
|
|
@@ -565,6 +577,7 @@
|
|
|
|
return ptr;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
*Wrapper for printf that prints to a specific
|
|
diff -ur olsrd-0.5.6-r4.orig/src/olsr.h olsrd-0.5.6-r4/src/olsr.h
|
|
--- olsrd-0.5.6-r4.orig/src/olsr.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/olsr.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -72,15 +72,21 @@
|
|
|
|
uint8_t olsr_calculate_willingness(void);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
const char *olsr_msgtype_to_string(uint8_t);
|
|
|
|
const char *olsr_link_to_string(uint8_t);
|
|
|
|
const char *olsr_status_to_string(uint8_t);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
void olsr_exit(const char *, int);
|
|
|
|
+#ifdef SVEN_OLA_UNBLOAT
|
|
+#define olsr_malloc(size, msg) calloc(1, size)
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
void *olsr_malloc(size_t, const char *);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
|
|
|
|
diff -ur olsrd-0.5.6-r4.orig/src/olsr_cfg.h olsrd-0.5.6-r4/src/olsr_cfg.h
|
|
--- olsrd-0.5.6-r4.orig/src/olsr_cfg.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/olsr_cfg.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -148,8 +148,10 @@
|
|
char *name;
|
|
char *config;
|
|
bool configured;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
bool host_emul;
|
|
union olsr_ip_addr hemu_ip;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
struct interface *interf;
|
|
struct if_config_options *cnf;
|
|
struct olsr_if *next;
|
|
@@ -192,7 +194,9 @@
|
|
uint16_t olsrport;
|
|
int debug_level;
|
|
bool no_fork;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
bool host_emul;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
int ip_version;
|
|
bool allow_no_interfaces;
|
|
uint16_t tos;
|
|
@@ -201,13 +205,17 @@
|
|
uint8_t rttable_default;
|
|
uint8_t willingness;
|
|
bool willingness_auto;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
int ipc_connections;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
bool use_hysteresis;
|
|
olsr_fib_metric_options fib_metric;
|
|
struct hyst_param hysteresis_param;
|
|
struct plugin_entry *plugins;
|
|
struct ip_prefix_list *hna_entries;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct ip_prefix_list *ipc_nets;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
struct olsr_if *interfaces;
|
|
float pollrate;
|
|
float nic_chgs_pollrate;
|
|
@@ -267,7 +275,9 @@
|
|
|
|
void olsrd_free_cnf(struct olsrd_config *);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void olsrd_print_cnf(struct olsrd_config *);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
int olsrd_write_cnf(struct olsrd_config *, const char *);
|
|
|
|
diff -ur olsrd-0.5.6-r4.orig/src/parser.c olsrd-0.5.6-r4/src/parser.c
|
|
--- olsrd-0.5.6-r4.orig/src/parser.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/parser.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -51,7 +51,9 @@
|
|
#include "rebuild_packet.h"
|
|
#include "net_os.h"
|
|
#include "log.h"
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "print_packet.h"
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
#include "net_olsr.h"
|
|
|
|
#ifdef WIN32
|
|
@@ -281,8 +283,10 @@
|
|
//printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr));
|
|
|
|
/* Display packet */
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (disp_pack_in)
|
|
print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
if (olsr_cnf->ip_version == AF_INET)
|
|
msgsize = ntohs(m->v4.olsr_msgsize);
|
|
diff -ur olsrd-0.5.6-r4.orig/src/print_packet.c olsrd-0.5.6-r4/src/print_packet.c
|
|
--- olsrd-0.5.6-r4.orig/src/print_packet.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/print_packet.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -39,6 +39,7 @@
|
|
*
|
|
*/
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
#include "print_packet.h"
|
|
#include "ipcalc.h"
|
|
#include "mantissa.h"
|
|
@@ -339,6 +340,7 @@
|
|
remsize -= olsr_cnf->ipsize;
|
|
}
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/process_routes.c olsrd-0.5.6-r4/src/process_routes.c
|
|
--- olsrd-0.5.6-r4.orig/src/process_routes.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/process_routes.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -159,6 +159,7 @@
|
|
static void
|
|
olsr_delete_kernel_route(struct rt_entry *rt)
|
|
{
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (!olsr_cnf->host_emul) {
|
|
int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
|
|
|
|
@@ -170,6 +171,12 @@
|
|
olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg);
|
|
}
|
|
}
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+ int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt);
|
|
+ if (0 > error) {
|
|
+ olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno));
|
|
+ }
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
/**
|
|
@@ -181,6 +188,7 @@
|
|
olsr_add_kernel_route(struct rt_entry *rt)
|
|
{
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (!olsr_cnf->host_emul) {
|
|
int16_t error = (olsr_cnf->ip_version == AF_INET) ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
|
|
|
|
@@ -199,6 +207,14 @@
|
|
rt->rt_metric = rt->rt_best->rtp_metric;
|
|
}
|
|
}
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+ int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt);
|
|
+ if (0 > error) {
|
|
+ olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno));
|
|
+ } else {
|
|
+ rt->rt_nexthop = rt->rt_best->rtp_nexthop;
|
|
+ }
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
/**
|
|
@@ -385,7 +401,7 @@
|
|
/* route additions */
|
|
olsr_add_kernel_routes(&add_kernel_list);
|
|
|
|
-#if DEBUG
|
|
+#ifdef DEBUG
|
|
olsr_print_routing_table(&routingtree);
|
|
#endif
|
|
}
|
|
diff -ur olsrd-0.5.6-r4.orig/src/rebuild_packet.c olsrd-0.5.6-r4/src/rebuild_packet.c
|
|
--- olsrd-0.5.6-r4.orig/src/rebuild_packet.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/rebuild_packet.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -60,7 +60,11 @@
|
|
mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m)
|
|
{
|
|
int i;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct mid_alias *alias, *alias_tmp;
|
|
+#else /* SVEN_OLA_UNBLOAT */
|
|
+ struct mid_alias *alias;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
int no_aliases;
|
|
|
|
/* Checking if everything is ok */
|
|
@@ -100,6 +104,7 @@
|
|
maddr++;
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (olsr_cnf->debug_level > 1) {
|
|
struct ipaddr_str buf;
|
|
OLSR_PRINTF(3, "Alias list for %s: ", olsr_ip_to_string(&buf, &mmsg->mid_origaddr));
|
|
@@ -111,6 +116,7 @@
|
|
}
|
|
OLSR_PRINTF(3, "\n");
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
} else {
|
|
/* IPv6 */
|
|
const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr;
|
|
@@ -144,6 +150,7 @@
|
|
maddr6++;
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (olsr_cnf->debug_level > 1) {
|
|
struct ipaddr_str buf;
|
|
OLSR_PRINTF(3, "Alias list for %s", ip6_to_string(&buf, &mmsg->mid_origaddr.v6));
|
|
@@ -156,6 +163,7 @@
|
|
}
|
|
OLSR_PRINTF(3, "\n");
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
}
|
|
diff -ur olsrd-0.5.6-r4.orig/src/routing_table.c olsrd-0.5.6-r4/src/routing_table.c
|
|
--- olsrd-0.5.6-r4.orig/src/routing_table.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/routing_table.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -628,6 +628,7 @@
|
|
/**
|
|
* format a route entry into a buffer
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
char *
|
|
olsr_rt_to_string(const struct rt_entry *rt)
|
|
{
|
|
@@ -659,11 +660,13 @@
|
|
|
|
return buff;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
* Print the routingtree to STDOUT
|
|
*
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
olsr_print_routing_table(struct avl_tree *tree)
|
|
{
|
|
@@ -697,6 +700,7 @@
|
|
#endif
|
|
tree = NULL; /* squelch compiler warnings */
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/routing_table.h olsrd-0.5.6-r4/src/routing_table.h
|
|
--- olsrd-0.5.6-r4.orig/src/routing_table.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/routing_table.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -210,9 +210,11 @@
|
|
bool olsr_cmp_rt(const struct rt_entry *, const struct rt_entry *);
|
|
uint8_t olsr_fib_metric(const struct rt_metric *);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
char *olsr_rt_to_string(const struct rt_entry *);
|
|
char *olsr_rtp_to_string(const struct rt_path *);
|
|
void olsr_print_routing_table(struct avl_tree *);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
const struct rt_nexthop *olsr_get_nh(const struct rt_entry *);
|
|
|
|
diff -ur olsrd-0.5.6-r4.orig/src/tc_set.c olsrd-0.5.6-r4/src/tc_set.c
|
|
--- olsrd-0.5.6-r4.orig/src/tc_set.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/tc_set.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -336,6 +336,7 @@
|
|
/**
|
|
* Format tc_edge contents into a buffer.
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
char *
|
|
olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge)
|
|
{
|
|
@@ -350,6 +351,7 @@
|
|
|
|
return buf;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/**
|
|
* Wrapper for the timer callback.
|
|
@@ -686,6 +688,7 @@
|
|
/**
|
|
* Print the topology table to stdout
|
|
*/
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
olsr_print_tc_table(void)
|
|
{
|
|
@@ -711,6 +714,7 @@
|
|
} OLSR_FOR_ALL_TC_ENTRIES_END(tc);
|
|
#endif
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* calculate the border IPs of a tc edge set according to the border flags
|
|
diff -ur olsrd-0.5.6-r4.orig/src/tc_set.h olsrd-0.5.6-r4/src/tc_set.h
|
|
--- olsrd-0.5.6-r4.orig/src/tc_set.h 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/tc_set.h 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -157,7 +157,9 @@
|
|
|
|
/* tc_edge_entry manipulation */
|
|
bool olsr_delete_outdated_tc_edges(struct tc_entry *);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
char *olsr_tc_edge_to_string(struct tc_edge_entry *);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
struct tc_edge_entry *olsr_lookup_tc_edge(struct tc_entry *, union olsr_ip_addr *);
|
|
struct tc_edge_entry *olsr_add_tc_edge_entry(struct tc_entry *, union olsr_ip_addr *, uint16_t);
|
|
void olsr_delete_tc_entry(struct tc_entry *);
|
|
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
|
|
--- olsrd-0.5.6-r4.orig/src/two_hop_neighbor_table.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/two_hop_neighbor_table.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -203,6 +203,8 @@
|
|
return NULL;
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
+
|
|
/**
|
|
*Print the two hop neighbor table to STDOUT.
|
|
*
|
|
@@ -240,6 +242,7 @@
|
|
}
|
|
#endif
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|
|
diff -ur olsrd-0.5.6-r4.orig/src/unix/ifnet.c olsrd-0.5.6-r4/src/unix/ifnet.c
|
|
--- olsrd-0.5.6-r4.orig/src/unix/ifnet.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/unix/ifnet.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -70,6 +70,8 @@
|
|
|
|
#define BUFSPACE (127*1024) /* max. input buffer size to request */
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
+
|
|
int
|
|
set_flag(char *ifname, short flag __attribute__ ((unused)))
|
|
{
|
|
@@ -100,6 +102,8 @@
|
|
|
|
}
|
|
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
+
|
|
void
|
|
check_interface_updates(void *foo __attribute__ ((unused)))
|
|
{
|
|
@@ -110,11 +114,13 @@
|
|
#endif
|
|
|
|
for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (tmp_if->host_emul)
|
|
continue;
|
|
|
|
if (olsr_cnf->host_emul) /* XXX: TEMPORARY! */
|
|
continue;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
if (!tmp_if->cnf->autodetect_chg) {
|
|
#ifdef DEBUG
|
|
@@ -154,8 +160,10 @@
|
|
OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name);
|
|
#endif
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (iface->host_emul)
|
|
return -1;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
ifp = iface->interf;
|
|
|
|
@@ -281,7 +289,9 @@
|
|
} else
|
|
/* IP version 4 */
|
|
{
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct ipaddr_str buf;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
/* Check interface address (IPv4) */
|
|
if (ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) {
|
|
OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n");
|
|
@@ -294,17 +304,21 @@
|
|
if (memcmp
|
|
(&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr,
|
|
olsr_cnf->ipsize) != 0) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
/* New address */
|
|
OLSR_PRINTF(1, "IPv4 address changed for %s\n", ifr.ifr_name);
|
|
OLSR_PRINTF(1, "\tOld:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr));
|
|
OLSR_PRINTF(1, "\tNew:%s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
ifp->int_addr = *(struct sockaddr_in *)&ifr.ifr_addr;
|
|
/* deactivated to prevent change of originator IP */
|
|
#if 0
|
|
if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) {
|
|
OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize);
|
|
}
|
|
#endif
|
|
@@ -366,7 +380,9 @@
|
|
|
|
remove_interface:
|
|
OLSR_PRINTF(1, "Removing interface %s\n", iface->name);
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
olsr_delete_link_entry_by_ip(&ifp->ip_addr);
|
|
|
|
@@ -398,10 +414,14 @@
|
|
memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize);
|
|
OLSR_PRINTF(1, "No more interfaces...\n");
|
|
} else {
|
|
+#if !defined(SVEN_OLA_UNBLOAT)
|
|
struct ipaddr_str buf;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
olsr_cnf->main_addr = ifnet->ip_addr;
|
|
OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
}
|
|
#endif
|
|
@@ -425,7 +445,9 @@
|
|
|
|
if ((ifnet == NULL) && (!olsr_cnf->allow_no_interfaces)) {
|
|
OLSR_PRINTF(1, "No more active interfaces - exiting.\n");
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n");
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
olsr_cnf->exit_value = EXIT_FAILURE;
|
|
kill(getpid(), SIGINT);
|
|
}
|
|
@@ -434,6 +456,8 @@
|
|
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
+
|
|
/**
|
|
* Initializes the special interface used in
|
|
* host-client emulation
|
|
@@ -583,6 +607,7 @@
|
|
|
|
return 1;
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
static char basenamestr[32];
|
|
static const char *if_basename(const char *name);
|
|
@@ -618,8 +643,10 @@
|
|
int tos_bits = IPTOS_TOS(olsr_cnf->tos);
|
|
#endif
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
if (iface->host_emul)
|
|
return -1;
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
memset(&ifr, 0, sizeof(struct ifreq));
|
|
memset(&ifs, 0, sizeof(struct interface));
|
|
@@ -726,11 +753,13 @@
|
|
ifs.int_broadaddr = *(struct sockaddr_in *)&ifr.ifr_broadaddr;
|
|
}
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
/* Deactivate IP spoof filter */
|
|
deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
|
|
|
|
/* Disable ICMP redirects */
|
|
disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
}
|
|
|
|
@@ -760,7 +789,9 @@
|
|
|
|
OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu);
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name);
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index);
|
|
|
|
if (olsr_cnf->ip_version == AF_INET) {
|
|
@@ -865,10 +896,14 @@
|
|
*/
|
|
memset(&null_addr, 0, olsr_cnf->ipsize);
|
|
if (ipequal(&null_addr, &olsr_cnf->main_addr)) {
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
struct ipaddr_str buf;
|
|
+#endif
|
|
olsr_cnf->main_addr = ifp->ip_addr;
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
|
|
olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr));
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
}
|
|
|
|
/*
|
|
diff -ur olsrd-0.5.6-r4.orig/src/unix/misc.c olsrd-0.5.6-r4/src/unix/misc.c
|
|
--- olsrd-0.5.6-r4.orig/src/unix/misc.c 2009-03-27 17:32:46.000000000 +0000
|
|
+++ olsrd-0.5.6-r4/src/unix/misc.c 2009-03-27 17:33:00.000000000 +0000
|
|
@@ -44,6 +44,7 @@
|
|
#include "misc.h"
|
|
#include "olsr_types.h"
|
|
|
|
+#ifndef SVEN_OLA_UNBLOAT
|
|
void
|
|
clear_console(void)
|
|
{
|
|
@@ -69,6 +70,7 @@
|
|
|
|
fflush(stdout);
|
|
}
|
|
+#endif /* SVEN_OLA_UNBLOAT */
|
|
|
|
/*
|
|
* Local Variables:
|