root/luci/branches/luci-0.8/contrib/package/olsrd-luci/patches/140-olsrd-optimize-size.patch @ 4379

Revision 4379, 68.6 KB (checked in by jow, 4 years ago)

Merge r4373, r4374, r4378

  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/Makefile.inc olsrd-0.5.6-r4/Makefile.inc
    old new  
    204204$(warning Use CPPFLAGS instead of DEFINES for -D) 
    205205endif 
    206206 
     207ifeq ($(SVEN_OLA_UNBLOAT),1) 
     208CPPFLAGS += -DSVEN_OLA_UNBLOAT -DNODEBUG 
     209endif 
     210 
    207211TAGFILE ?=  src/TAGS 
    208212 
    209213help: 
  • lib/bmf/src/NetworkInterfaces.c

    diff -ur olsrd-0.5.6-r4.orig/lib/bmf/src/NetworkInterfaces.c olsrd-0.5.6-r4/lib/bmf/src/NetworkInterfaces.c
    old new  
    544544          OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: no link found\n", PLUGIN_NAME_SHORT, 
    545545                      olsr_ip_to_string(&buf, &walker->neighbor_iface_addr)); 
    546546        } else { 
     547#ifndef DEBUG 
    547548          struct interface *bestIntf = if_ifwithaddr(&bestLinkToNeighbor->local_iface_addr); 
     549#endif 
    548550 
    549551          OLSR_PRINTF(9, "%s: ----> Not forwarding to %s: \"%s\" gives a better link to this neighbor, costing %5.2f\n", 
    550552                      PLUGIN_NAME_SHORT, olsr_ip_to_string(&buf, &walker->neighbor_iface_addr), bestIntf->int_name, 
  • lib/httpinfo/Makefile

    diff -ur olsrd-0.5.6-r4.orig/lib/httpinfo/Makefile olsrd-0.5.6-r4/lib/httpinfo/Makefile
    old new  
    4747CPPFLAGS += -DADMIN_INTERFACE 
    4848endif 
    4949 
     50ifdef SVEN_OLA_UNBLOAT 
     51    CFLAGS += -DSVEN_OLA 
     52else 
    5053OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o 
     54endif 
    5155 
    5256default_target: $(PLUGIN_FULLNAME) 
    5357ifdef ADMIN_INTERFACE 
  • lib/httpinfo/src/olsrd_httpinfo.c

    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
    old new  
    6767 
    6868#include "olsrd_httpinfo.h" 
    6969#include "admin_interface.h" 
     70#ifndef SVEN_OLA_UNBLOAT 
    7071#include "gfx.h" 
     72#endif /* SVEN_OLA_UNBLOAT */ 
    7173 
    7274#ifdef OS 
    7375#undef OS 
     
    181183 
    182184static int build_about_body(char *, uint32_t); 
    183185 
     186#ifndef SVEN_OLA_UNBLOAT 
    184187static int build_cfgfile_body(char *, uint32_t); 
     188#endif /* SVEN_OLA_UNBLOAT */ 
    185189 
    186190static int check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr); 
    187191 
     
    216220  {"Admin", "admin", build_admin_body, true}, 
    217221#endif 
    218222  {"About", "about", build_about_body, true}, 
     223#ifndef SVEN_OLA_UNBLOAT 
    219224  {"FOO", "cfgfile", build_cfgfile_body, false}, 
     225#endif /* SVEN_OLA_UNBLOAT */ 
    220226  {NULL, NULL, NULL, false} 
    221227}; 
    222228 
     229#ifndef SVEN_OLA_UNBLOAT 
    223230static const struct static_bin_file_entry static_bin_files[] = { 
    224231  {"favicon.ico", favicon_ico, sizeof(favicon_ico)} 
    225232  , 
     
    229236  , 
    230237  {NULL, NULL, 0} 
    231238}; 
     239#endif /* SVEN_OLA_UNBLOAT */ 
    232240 
    233241static const struct static_txt_file_entry static_txt_files[] = { 
    234242  {"httpinfo.css", httpinfo_css}, 
     
    407415  } else if (!strcmp(req_type, "GET")) { 
    408416    int i = 0; 
    409417 
     418#ifndef SVEN_OLA_UNBLOAT 
    410419    for (i = 0; static_bin_files[i].filename; i++) { 
    411420      if (FILENREQ_MATCH(filename, static_bin_files[i].filename)) { 
    412421        break; 
     
    422431    } 
    423432 
    424433    i = 0; 
     434#endif /* SVEN_OLA_UNBLOAT */ 
    425435    while (static_txt_files[i].filename) { 
    426436      if (FILENREQ_MATCH(filename, static_txt_files[i].filename)) { 
    427437        break; 
     
    461471        snprintf(&body[size], sizeof(body) - size, 
    462472                 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<head>\n" 
    463473                 "<meta http-equiv=\"Content-type\" content=\"text/html; charset=ISO-8859-1\">\n" 
    464                  "<title>olsr.org httpinfo plugin</title>\n" "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n" 
     474                 "<title>olsr.org httpinfo plugin</title>\n" 
     475#ifndef SVEN_OLA_UNBLOAT 
     476                 "<link rel=\"icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n" 
    465477                 "<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image/x-icon\">\n" 
     478#endif /* SVEN_OLA_UNBLOAT */ 
    466479                 "<link rel=\"stylesheet\" type=\"text/css\" href=\"httpinfo.css\">\n" "</head>\n" 
    467480                 "<body bgcolor=\"#ffffff\" text=\"#000000\">\n" 
     481#ifndef SVEN_OLA_UNBLOAT 
    468482                 "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"%d\">\n" 
    469483                 "<tbody><tr bgcolor=\"#ffffff\">\n" "<td align=\"left\" height=\"69\" valign=\"middle\" width=\"80%%\">\n" 
    470484                 "<font color=\"black\" face=\"timesroman\" size=\"6\">&nbsp;&nbsp;&nbsp;<a href=\"http://www.olsr.org/\">olsr.org OLSR daemon</a></font></td>\n" 
    471485                 "<td height=\"69\" valign=\"middle\" width=\"20%%\">\n" 
    472486                 "<a href=\"http://www.olsr.org/\"><img border=\"0\" src=\"/logo.gif\" alt=\"olsrd logo\"></a></td>\n" "</tr>\n" 
    473                  "</tbody>\n" "</table>\n", FRAMEWIDTH); 
     487                 "</tbody>\n" "</table>\n", FRAMEWIDTH 
     488#endif /* SVEN_OLA_UNBLOAT */ 
     489        ); 
    474490 
    475491      size += build_tabs(&body[size], sizeof(body) - size, i); 
    476492      size += build_frame(&body[size], sizeof(body) - size, "Current Routes", "routes", FRAMEWIDTH, tab_entries[i].build_body_cb); 
     
    854870      size += snprintf(&buf[size], bufsize - size, "<tr><td colspan=\"3\">Status: DOWN</td></tr>\n"); 
    855871      continue; 
    856872    } 
    857  
     873#ifndef SVEN_OLA_UNBLOAT 
    858874    if (olsr_cnf->ip_version == AF_INET) { 
    859875      struct ipaddr_str addrbuf, maskbuf, bcastbuf; 
    860876      size += 
     
    867883        snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>IP: %s</td>\n" "<td>MCAST: %s</td>\n" "<td></td>\n" "</tr>\n", 
    868884                 ip6_to_string(&addrbuf, &rifs->int6_addr.sin6_addr), ip6_to_string(&maskbuf, &rifs->int6_multaddr.sin6_addr)); 
    869885    } 
     886#endif /* SVEN_OLA_UNBLOAT */ 
    870887    size += 
    871888      snprintf(&buf[size], bufsize - size, "<tr>\n" "<td>MTU: %d</td>\n" "<td>WLAN: %s</td>\n" "<td>STATUS: UP</td>\n" "</tr>\n", 
    872889               rifs->int_mtu, rifs->is_wireless ? "Yes" : "No"); 
     
    11151132                  build_host); 
    11161133} 
    11171134 
     1135#ifndef SVEN_OLA_UNBLOAT 
    11181136static int 
    11191137build_cfgfile_body(char *buf, uint32_t bufsize) 
    11201138{ 
     
    11491167#endif 
    11501168  return size; 
    11511169} 
     1170#endif /* SVEN_OLA_UNBLOAT */ 
    11521171 
    11531172static int 
    11541173check_allowed_ip(const struct allowed_net *const allowed_nets, const union olsr_ip_addr *const addr) 
  • lib/nameservice/src/nameservice.c

    diff -ur olsrd-0.5.6-r4.orig/lib/nameservice/src/nameservice.c olsrd-0.5.6-r4/lib/nameservice/src/nameservice.c
    old new  
    6565#include "mapwrite.h" 
    6666#include "compat.h" 
    6767 
     68#ifdef SVEN_OLA_UNBLOAT 
     69#undef OLSR_PRINTF 
     70#define OLSR_PRINTF(...) 
     71#endif /* SVEN_OLA_UNBLOAT */ 
     72 
    6873/* config parameters */ 
    6974static char my_hosts_file[MAX_FILE + 1]; 
    7075static char my_sighup_pid_file[MAX_FILE + 1]; 
     
    7378static char my_suffix[MAX_SUFFIX]; 
    7479static int my_interval = EMISSION_INTERVAL; 
    7580static double my_timeout = NAME_VALID_TIME; 
     81#ifndef SVEN_OLA_UNBLOAT 
    7682static char my_resolv_file[MAX_FILE + 1]; 
     83#endif /* SVEN_OLA_UNBLOAT */ 
    7784static char my_services_file[MAX_FILE + 1]; 
    7885static char my_macs_file[MAX_FILE + 1]; 
     86#ifndef SVEN_OLA_UNBLOAT 
    7987static char my_name_change_script[MAX_FILE + 1]; 
    8088static char my_services_change_script[MAX_FILE + 1]; 
    8189static char my_macs_change_script[MAX_FILE + 1]; 
     90#endif 
    8291static char latlon_in_file[MAX_FILE + 1]; 
    8392static char my_latlon_file[MAX_FILE + 1]; 
    8493float my_lat = 0.0, my_lon = 0.0; 
     
    102111static struct name_entry *my_macs = NULL; 
    103112static bool mac_table_changed = true; 
    104113 
     114#ifndef SVEN_OLA_UNBLOAT 
    105115static struct list_node forwarder_list[HASHSIZE]; 
    106116static struct name_entry *my_forwarders = NULL; 
    107117static bool forwarder_table_changed = true; 
     118#endif /* SVEN_OLA_UNBLOAT */ 
    108119 
    109120struct list_node latlon_list[HASHSIZE]; 
    110121static bool latlon_table_changed = true; 
     
    138149  GetWindowsDirectory(my_hosts_file, MAX_FILE - 12); 
    139150  GetWindowsDirectory(my_services_file, MAX_FILE - 12); 
    140151  GetWindowsDirectory(my_macs_file, MAX_FILE - 12); 
     152#ifndef SVEN_OLA_UNBLOAT 
    141153  GetWindowsDirectory(my_resolv_file, MAX_FILE - 12); 
     154#endif /* SVEN_OLA_UNBLOAT */ 
    142155 
    143156  len = strlen(my_hosts_file); 
    144157  if (my_hosts_file[len - 1] != '\\') 
     
    155168    strscat(my_macs_file, "\\", sizeof(my_macs_file)); 
    156169  strscat(my_macs_file, "macs_olsr", sizeof(my_macs_file)); 
    157170 
     171#ifndef SVEN_OLA_UNBLOAT 
    158172  len = strlen(my_resolv_file); 
    159173  if (my_resolv_file[len - 1] != '\\') 
    160174    strscat(my_resolv_file, "\\", sizeof(my_resolv_file)); 
    161175  strscat(my_resolv_file, "resolvconf_olsr", sizeof(my_resolv_file)); 
     176#endif /* SVEN_OLA_UNBLOAT */ 
    162177#else 
    163178  strscpy(my_hosts_file, "/var/run/hosts_olsr", sizeof(my_hosts_file)); 
    164179  strscpy(my_services_file, "/var/run/services_olsr", sizeof(my_services_file)); 
    165180  strscpy(my_macs_file, "/var/run/macs_olsr", sizeof(my_macs_file)); 
     181#ifndef SVEN_OLA_UNBLOAT 
    166182  strscpy(my_resolv_file, "/var/run/resolvconf_olsr", sizeof(my_resolv_file)); 
     183#endif /* SVEN_OLA_UNBLOAT */ 
    167184  *my_sighup_pid_file = 0; 
    168185#endif 
    169186 
     
    171188  my_add_hosts[0] = '\0'; 
    172189  my_latlon_file[0] = '\0'; 
    173190  latlon_in_file[0] = '\0'; 
     191#ifndef SVEN_OLA_UNBLOAT 
    174192  my_name_change_script[0] = '\0'; 
    175193  my_services_change_script[0] = '\0'; 
    176194  my_macs_change_script[0] = '\0'; 
     195#endif /* SVEN_OLA_UNBLOAT */ 
    177196 
    178197  /* init the lists heads */ 
    179198  for (i = 0; i < HASHSIZE; i++) { 
    180199    list_head_init(&name_list[i]); 
     200#ifndef SVEN_OLA_UNBLOAT 
    181201    list_head_init(&forwarder_list[i]); 
     202#endif /* SVEN_OLA_UNBLOAT */ 
    182203    list_head_init(&service_list[i]); 
    183204    list_head_init(&mac_list[i]); 
    184205    list_head_init(&latlon_list[i]); 
     
    186207 
    187208} 
    188209 
     210#ifndef SVEN_OLA_UNBLOAT 
    189211static int 
    190212set_nameservice_server(const char *value, void *data, set_plugin_parameter_addon addon) 
    191213{ 
     
    204226  } 
    205227  return 1; 
    206228} 
     229#endif /* SVEN_OLA_UNBLOAT */ 
    207230 
    208231static int 
    209232set_nameservice_name(const char *value, void *data, set_plugin_parameter_addon addon) 
     
    253276  { .name = "timeout",                .set_plugin_parameter = &set_nameservice_float,  .data = &my_timeout }, 
    254277  { .name = "sighup-pid-file",        .set_plugin_parameter = &set_plugin_string,      .data = &my_sighup_pid_file,        .addon = {sizeof(my_sighup_pid_file)} }, 
    255278  { .name = "hosts-file",             .set_plugin_parameter = &set_plugin_string,      .data = &my_hosts_file,             .addon = {sizeof(my_hosts_file)} }, 
     279#ifndef SVEN_OLA_UNBLOAT 
    256280  { .name = "name-change-script",     .set_plugin_parameter = &set_plugin_string,      .data = &my_name_change_script,     .addon = {sizeof(my_name_change_script)} }, 
    257281  { .name = "services-change-script", .set_plugin_parameter = &set_plugin_string,      .data = &my_services_change_script, .addon = {sizeof(my_services_change_script)} }, 
    258282  { .name = "macs-change-script",     .set_plugin_parameter = &set_plugin_string,      .data = &my_macs_change_script,     .addon = {sizeof(my_macs_change_script)} }, 
    259283  { .name = "resolv-file",            .set_plugin_parameter = &set_plugin_string,      .data = &my_resolv_file,            .addon = {sizeof(my_resolv_file)} }, 
     284#endif /* SVEN_OLA_UNBLOAT */ 
    260285  { .name = "suffix",                 .set_plugin_parameter = &set_plugin_string,      .data = &my_suffix,                 .addon = {sizeof(my_suffix)} }, 
    261286  { .name = "add-hosts",              .set_plugin_parameter = &set_plugin_string,      .data = &my_add_hosts,              .addon = {sizeof(my_add_hosts)} }, 
    262287  { .name = "services-file",          .set_plugin_parameter = &set_plugin_string,      .data = &my_services_file,          .addon = {sizeof(my_services_file)} }, 
     
    265290  { .name = "lon",                    .set_plugin_parameter = &set_nameservice_float,  .data = &my_lon }, 
    266291  { .name = "latlon-file",            .set_plugin_parameter = &set_plugin_string,      .data = &my_latlon_file,            .addon = {sizeof(my_latlon_file)} }, 
    267292  { .name = "latlon-infile",          .set_plugin_parameter = &set_plugin_string,      .data = &latlon_in_file,            .addon = {sizeof(latlon_in_file)} }, 
     293#ifndef SVEN_OLA_UNBLOAT 
    268294  { .name = "dns-server",             .set_plugin_parameter = &set_nameservice_server, .data = &my_forwarders,             .addon = {NAME_FORWARDER} }, 
     295#endif /* SVEN_OLA_UNBLOAT */ 
    269296  { .name = "name",                   .set_plugin_parameter = &set_nameservice_name,   .data = &my_names,                  .addon = {NAME_HOST} }, 
    270297  { .name = "service",                .set_plugin_parameter = &set_nameservice_name,   .data = &my_services,               .addon = {NAME_SERVICE} }, 
    271298  { .name = "mac",                    .set_plugin_parameter = &set_nameservice_name,   .data = &my_macs,                   .addon = {NAME_MACADDR} }, 
     
    381408      name->ip = olsr_cnf->main_addr; 
    382409    } 
    383410  } 
     411#ifndef SVEN_OLA_UNBLOAT 
    384412  for (name = my_forwarders; name != NULL; name = name->next) { 
    385413    if (name->ip.v4.s_addr == 0) { 
    386414      OLSR_PRINTF(2, "NAME PLUGIN: insert main addr for name %s \n", name->name); 
    387415      name->ip = olsr_cnf->main_addr; 
    388416    } 
    389417  } 
     418#endif /* SVEN_OLA_UNBLOAT */ 
    390419 
    391420  //check if entries I want to announce myself are valid and allowed 
    392421  my_names = remove_nonvalid_names_from_list(my_names, NAME_HOST); 
     422#ifndef SVEN_OLA_UNBLOAT 
    393423  my_forwarders = remove_nonvalid_names_from_list(my_forwarders, NAME_FORWARDER); 
     424#endif /* SVEN_OLA_UNBLOAT */ 
    394425  my_services = remove_nonvalid_names_from_list(my_services, NAME_SERVICE); 
    395426  my_macs = remove_nonvalid_names_from_list(my_macs, NAME_MACADDR); 
    396427 
     
    463494  free_name_entry_list(&my_names); 
    464495  free_name_entry_list(&my_services); 
    465496  free_name_entry_list(&my_macs); 
     497#ifndef SVEN_OLA_UNBLOAT 
    466498  free_name_entry_list(&my_forwarders); 
     499#endif /* SVEN_OLA_UNBLOAT */ 
    467500 
    468501  free_all_list_entries(name_list); 
    469502  free_all_list_entries(service_list); 
    470503  free_all_list_entries(mac_list); 
     504#ifndef SVEN_OLA_UNBLOAT 
    471505  free_all_list_entries(forwarder_list); 
     506#endif /* SVEN_OLA_UNBLOAT */ 
    472507  free_all_list_entries(latlon_list); 
    473508 
    474509  olsr_stop_timer(write_file_timer); 
     
    511546{ 
    512547  write_file_timer = NULL; 
    513548 
     549#ifndef SVEN_OLA_UNBLOAT 
    514550  write_resolv_file();             /* if forwarder_table_changed */ 
     551#endif /* SVEN_OLA_UNBLOAT */ 
    515552  write_hosts_file();              /* if name_table_changed */ 
    516553  write_services_file(false); /* if service_table_changed */ 
    517554  write_services_file(true);  /* if mac_table_changed */ 
     
    693730    pos = create_packet((struct name *)pos, my_name); 
    694731    i++; 
    695732  } 
     733#ifndef SVEN_OLA_UNBLOAT 
    696734  // forwarders 
    697735  for (my_name = my_forwarders; my_name != NULL; my_name = my_name->next) { 
    698736    pos = create_packet((struct name *)pos, my_name); 
    699737    i++; 
    700738  } 
     739#endif /* SVEN_OLA_UNBLOAT */ 
    701740  // services 
    702741  for (my_name = my_services; my_name != NULL; my_name = my_name->next) { 
    703742    pos = create_packet((struct name *)pos, my_name); 
     
    880919    case NAME_HOST: 
    881920      insert_new_name_in_list(originator, name_list, from_packet, &name_table_changed, vtime); 
    882921      break; 
     922#ifndef SVEN_OLA_UNBLOAT 
    883923    case NAME_FORWARDER: 
    884924      insert_new_name_in_list(originator, forwarder_list, from_packet, &forwarder_table_changed, vtime); 
    885925      break; 
     926#endif /* SVEN_OLA_UNBLOAT */ 
    886927    case NAME_SERVICE: 
    887928      insert_new_name_in_list(originator, service_list, from_packet, &service_table_changed, vtime); 
    888929      break; 
     
    901942    pos += sizeof(struct name); 
    902943    pos += 1 + ((ntohs(from_packet->len) - 1) | 3); 
    903944  } 
     945#ifdef DEBUG 
    904946  if (i != 0) 
    905947    OLSR_PRINTF(4, "NAME PLUGIN: Lost %d entries in received packet due to length inconsistency (%s)\n", i, 
    906948                olsr_ip_to_string(&strbuf, originator)); 
     949#endif 
    907950} 
    908951 
    909952/** 
     
    11201163#endif 
    11211164  name_table_changed = false; 
    11221165 
     1166#ifndef SVEN_OLA_UNBLOAT 
    11231167  // Executes my_name_change_script after writing the hosts file 
    11241168  if (my_name_change_script[0] != '\0') { 
    11251169    if (system(my_name_change_script) != -1) { 
     
    11281172      OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on hosts change\n", my_name_change_script); 
    11291173    } 
    11301174  } 
     1175#endif /* SVEN_OLA_UNBLOAT */ 
    11311176} 
    11321177 
    11331178/** 
     
    11931238 
    11941239  fclose(file); 
    11951240  if (writemacs) { 
     1241#ifndef SVEN_OLA_UNBLOAT 
    11961242    // Executes my_macs_change_script after writing the macs file 
    11971243    if (my_macs_change_script[0] != '\0') { 
    11981244      if (system(my_macs_change_script) != -1) { 
     
    12011247        OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on mac change\n", my_macs_change_script); 
    12021248      } 
    12031249    } 
     1250#endif /* SVEN_OLA_UNBLOAT */ 
    12041251    mac_table_changed = false; 
    12051252  } 
    12061253  else { 
     1254#ifndef SVEN_OLA_UNBLOAT 
    12071255    // Executes my_services_change_script after writing the services file 
    12081256    if (my_services_change_script[0] != '\0') { 
    12091257      if (system(my_services_change_script) != -1) { 
     
    12121260        OLSR_PRINTF(2, "NAME PLUGIN: WARNING! Failed to execute %s on service change\n", my_services_change_script); 
    12131261      } 
    12141262    } 
     1263#endif /* SVEN_OLA_UNBLOAT */ 
    12151264    service_table_changed = false; 
    12161265  } 
    12171266} 
     
    12221271 * fresh entries are at the beginning of the array and 
    12231272 * the best entry is at the end of the array. 
    12241273 */ 
     1274#ifndef SVEN_OLA_UNBLOAT 
    12251275static void 
    12261276select_best_nameserver(struct rt_entry **rt) 
    12271277{ 
     
    12531303    } 
    12541304  } 
    12551305} 
     1306#endif /* SVEN_OLA_UNBLOAT */ 
    12561307 
    12571308/** 
    12581309 * write the 3 best upstream DNS servers to resolv.conf file 
    12591310 * best means the 3 with the best etx value in routing table 
    12601311 */ 
     1312#ifndef SVEN_OLA_UNBLOAT 
    12611313void 
    12621314write_resolv_file(void) 
    12631315{ 
     
    13411393  fclose(resolv); 
    13421394  forwarder_table_changed = false; 
    13431395} 
     1396#endif /* SVEN_OLA_UNBLOAT */ 
    13441397 
    13451398/** 
    13461399 * completely free a list of name_entries 
     
    13591412    case NAME_HOST: 
    13601413      name_table_changed = true; 
    13611414      break; 
     1415#ifndef SVEN_OLA_UNBLOAT 
    13621416    case NAME_FORWARDER: 
    13631417      forwarder_table_changed = true; 
    13641418      break; 
     1419#endif /* SVEN_OLA_UNBLOAT */ 
    13651420    case NAME_SERVICE: 
    13661421      service_table_changed = true; 
    13671422      break; 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/apm.h olsrd-0.5.6-r4/src/apm.h
    old new  
    4141 
    4242#ifndef _OLSR_APM 
    4343#define _OLSR_APM 
     44#ifndef SVEN_OLA_UNBLOAT 
    4445 
    4546/* 
    4647 * Interface to OS dependent power management information 
     
    6970int apm_read(struct olsr_apm_info *); 
    7071 
    7172#endif 
     73#endif /* SVEN_OLA_UNBLOAT */ 
    7274 
    7375/* 
    7476 * Local Variables: 
  • src/cfgparser/cfgfile_gen.c

    diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/cfgfile_gen.c olsrd-0.5.6-r4/src/cfgparser/cfgfile_gen.c
    old new  
    5757  struct olsr_if *in = cnf->interfaces; 
    5858  struct plugin_entry *pe = cnf->plugins; 
    5959  struct plugin_param *pp; 
     60#ifndef SVEN_OLA_UNBLOAT 
    6061  struct ip_prefix_list *ie = cnf->ipc_nets; 
     62#endif /* SVEN_OLA_UNBLOAT */ 
    6163  struct olsr_lq_mult *mult; 
    6264 
    6365  char ipv6_buf[100];                  /* buffer for IPv6 inet_htop */ 
     
    133135  else 
    134136    fprintf(fd, "Willingness\t%d\n\n", cnf->willingness); 
    135137 
     138#ifndef SVEN_OLA_UNBLOAT 
    136139  /* IPC */ 
    137140  fprintf(fd, "# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n"); 
    138141  fprintf(fd, "IpcConnect {\n"); 
     
    149152  } 
    150153 
    151154  fprintf(fd, "}\n\n"); 
     155#endif /* SVEN_OLA_UNBLOAT */ 
    152156 
    153157  /* Hysteresis */ 
    154158  fprintf(fd, "# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n"); 
     
    367371  struct olsr_if *in = cnf->interfaces; 
    368372  struct plugin_entry *pe = cnf->plugins; 
    369373  struct plugin_param *pp; 
     374#ifndef SVEN_OLA_UNBLOAT 
    370375  struct ip_prefix_list *ie = cnf->ipc_nets; 
     376#endif /* SVEN_OLA_UNBLOAT */ 
    371377  struct olsr_lq_mult *mult; 
    372378 
    373379  int size = 0; 
     
    434440  else 
    435441    WRITE_TO_BUF("Willingness\t%d\n\n", cnf->willingness); 
    436442 
     443#ifndef SVEN_OLA_UNBLOAT 
    437444  /* IPC */ 
    438445  WRITE_TO_BUF("# Allow processes like the GUI front-end\n# to connect to the daemon.\n\n"); 
    439446  WRITE_TO_BUF("IpcConnect {\n"); 
     
    449456  } 
    450457 
    451458  WRITE_TO_BUF("}\n\n"); 
     459#endif /* SVEN_OLA_UNBLOAT */ 
    452460 
    453461  /* Hysteresis */ 
    454462  WRITE_TO_BUF("# Hysteresis adds more robustness to the\n# link sensing.\n# Used by default. 'yes' or 'no'\n\n"); 
  • src/cfgparser/local.mk

    diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/local.mk olsrd-0.5.6-r4/src/cfgparser/local.mk
    old new  
    4141C=$(if $(CFGDIR),$(CFGDIR)/) 
    4242 
    4343# add the variables as we may have others already there 
     44ifeq ($(SVEN_OLA_UNBLOAT),1) 
     45SRCS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).c) 
     46OBJS += $(foreach file,olsrd_conf oparse oscan,$(C)$(file).o) 
     47else 
    4448SRCS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).c) 
    4549OBJS += $(foreach file,olsrd_conf oparse oscan cfgfile_gen,$(C)$(file).o) 
     50endif 
    4651HDRS += $(foreach file,olsrd_conf oparse,$(C)$(file).h) 
    4752 
    4853$(C)oscan.c: $(C)oscan.lex $(C)Makefile 
  • src/cfgparser/olsrd_conf.c

    diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/olsrd_conf.c olsrd-0.5.6-r4/src/cfgparser/olsrd_conf.c
    old new  
    8181  } 
    8282 
    8383  if ((cnf = olsrd_parse_cnf(argv[1])) != NULL) { 
     84#ifndef SVEN_OLA_UNBLOAT 
    8485    if ((argc > 2) && (!strcmp(argv[2], "-print"))) { 
    8586      olsrd_print_cnf(cnf); 
    8687      olsrd_write_cnf(cnf, "./out.conf"); 
    8788    } else 
    8889      printf("Use -print to view parsed values\n"); 
     90#endif /* SVEN_OLA_UNBLOAT */ 
    8991    printf("Configfile parsed OK\n"); 
    9092  } else { 
    9193    printf("Failed parsing \"%s\"\n", argv[1]); 
     
    152154    /* set various stuff */ 
    153155    in->configured = false; 
    154156    in->interf = NULL; 
     157#ifndef SVEN_OLA_UNBLOAT 
    155158    in->host_emul = false; 
     159#endif /* SVEN_OLA_UNBLOAT */ 
    156160  } 
    157161  return olsr_cnf; 
    158162} 
     
    389393 
    390394  cnf->debug_level = DEF_DEBUGLVL; 
    391395  cnf->no_fork = false; 
     396#ifndef SVEN_OLA_UNBLOAT 
    392397  cnf->host_emul = false; 
     398#endif /* SVEN_OLA_UNBLOAT */ 
    393399  cnf->ip_version = AF_INET; 
    394400  cnf->ipsize = sizeof(struct in_addr); 
    395401  cnf->maxplen = 32; 
     
    400406  cnf->rtproto = DEF_RTPROTO; 
    401407  cnf->rttable_default = 0; 
    402408  cnf->willingness_auto = DEF_WILL_AUTO; 
     409#ifndef SVEN_OLA_UNBLOAT 
    403410  cnf->ipc_connections = DEF_IPC_CONNECTIONS; 
     411#endif /* SVEN_OLA_UNBLOAT */ 
    404412  cnf->fib_metric = DEF_FIB_METRIC; 
    405413 
    406414  cnf->use_hysteresis = DEF_USE_HYST; 
     
    479487 
    480488} 
    481489 
     490#ifndef SVEN_OLA_UNBLOAT 
    482491void 
    483492olsrd_print_cnf(struct olsrd_config *cnf) 
    484493{ 
     
    622631    } 
    623632  } 
    624633} 
     634#endif /* SVEN_OLA_UNBLOAT */ 
    625635 
    626636#if defined WIN32 
    627637struct ioinfo { 
  • src/cfgparser/oparse.y

    diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/oparse.y olsrd-0.5.6-r4/src/cfgparser/oparse.y
    old new  
    178178%token TOK_RTPROTO 
    179179%token TOK_RTTABLE_DEFAULT 
    180180%token TOK_WILLINGNESS 
    181 %token TOK_IPCCON 
    182181%token TOK_FIBMETRIC 
    183182%token TOK_USEHYST 
    184183%token TOK_HYSTSCALE 
     
    201200 
    202201%token TOK_HOSTLABEL 
    203202%token TOK_NETLABEL 
    204 %token TOK_MAXIPC 
    205203 
    206204%token TOK_IP4BROADCAST 
    207205%token TOK_IFMODE 
     
    263261 
    264262block:      TOK_HNA4 hna4body 
    265263          | TOK_HNA6 hna6body 
    266           | TOK_IPCCON ipcbody 
    267264          | ifblock ifbody 
    268265          | plblock plbody 
    269266; 
     
    288285         | ihna6entry 
    289286; 
    290287 
    291 ipcbody:    TOK_OPEN ipcstmts TOK_CLOSE 
    292 ; 
    293  
    294 ipcstmts: | ipcstmts ipcstmt 
    295 ; 
    296  
    297 ipcstmt:  vcomment 
    298           | imaxipc 
    299           | ipchost 
    300           | ipcnet 
    301 ; 
    302  
    303288ifblock:   ifstart ifnicks 
    304289; 
    305290 
     
    341326          | vcomment 
    342327; 
    343328 
    344 imaxipc: TOK_MAXIPC TOK_INTEGER 
    345 { 
    346   olsr_cnf->ipc_connections = $2->integer; 
    347   free($2); 
    348 } 
    349 ; 
    350  
    351 ipchost: TOK_HOSTLABEL TOK_IP4_ADDR 
    352 { 
    353   union olsr_ip_addr ipaddr; 
    354   PARSER_DEBUG_PRINTF("\tIPC host: %s\n", $2->string); 
    355    
    356   if (inet_aton($2->string, &ipaddr.v4) == 0) { 
    357     fprintf(stderr, "Failed converting IP address IPC %s\n", $2->string); 
    358     YYABORT; 
    359   } 
    360  
    361   ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_cnf->maxplen); 
    362  
    363   free($2->string); 
    364   free($2); 
    365 } 
    366 ; 
    367  
    368 ipcnet: TOK_NETLABEL TOK_IP4_ADDR TOK_IP4_ADDR 
    369 { 
    370   union olsr_ip_addr ipaddr, netmask; 
    371  
    372   PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string); 
    373    
    374   if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) { 
    375     fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string); 
    376     YYABORT; 
    377   } 
    378  
    379   if (inet_pton(AF_INET, $3->string, &netmask.v4) == 0) { 
    380     fprintf(stderr, "Failed converting IP mask IPC %s\n", $3->string); 
    381     YYABORT; 
    382   } 
    383  
    384   ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, olsr_netmask_to_prefix(&netmask)); 
    385  
    386   free($2->string); 
    387   free($2); 
    388   free($3->string); 
    389   free($3); 
    390 } 
    391         |       TOK_NETLABEL TOK_IP4_ADDR TOK_SLASH TOK_INTEGER 
    392 { 
    393   union olsr_ip_addr ipaddr; 
    394  
    395   PARSER_DEBUG_PRINTF("\tIPC net: %s/%s\n", $2->string, $3->string); 
    396    
    397   if (inet_pton(AF_INET, $2->string, &ipaddr.v4) == 0) { 
    398     fprintf(stderr, "Failed converting IP net IPC %s\n", $2->string); 
    399     YYABORT; 
    400   } 
    401  
    402   if ($4->integer > olsr_cnf->maxplen) { 
    403     fprintf(stderr, "ipcnet: Prefix len %u > %d is not allowed!\n", $4->integer, olsr_cnf->maxplen); 
    404     YYABORT; 
    405   } 
    406  
    407   ip_prefix_list_add(&olsr_cnf->ipc_nets, &ipaddr, $4->integer); 
    408  
    409   free($2->string); 
    410   free($2); 
    411   free($4); 
    412 } 
    413 ; 
    414  
    415329iifweight:       TOK_IFWEIGHT TOK_INTEGER 
    416330{ 
    417331  int ifcnt = ifs_in_curr_cfg; 
  • src/cfgparser/oscan.lex

    diff -ur olsrd-0.5.6-r4.orig/src/cfgparser/oscan.lex olsrd-0.5.6-r4/src/cfgparser/oscan.lex
    old new  
    253253    return TOK_NETLABEL; 
    254254} 
    255255 
    256 "MaxConnections" { 
    257     yylval = NULL; 
    258     return TOK_MAXIPC; 
    259 } 
    260  
    261256"DebugLevel" { 
    262257    yylval = NULL; 
    263258    return TOK_DEBUGLEVEL; 
     
    334329    return TOK_WILLINGNESS; 
    335330} 
    336331 
    337 "IpcConnect" { 
    338     yylval = NULL; 
    339     return TOK_IPCCON; 
    340 } 
    341  
    342332"FIBMetric" { 
    343333    yylval = NULL; 
    344334    return TOK_FIBMETRIC; 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/defs.h olsrd-0.5.6-r4/src/defs.h
    old new  
    190190 */ 
    191191clock_t olsr_times(void); 
    192192 
     193#ifndef SVEN_OLA_UNBLOAT 
     194 
    193195/* 
    194196 *IPC functions 
    195197 *These are moved to a plugin soon 
     
    207209int ipc_output(struct olsr *); 
    208210 
    209211#endif 
     212#endif /* SVEN_OLA_UNBLOAT */ 
    210213 
    211214/* 
    212215 * Local Variables: 
  • src/duplicate_set.c

    diff -ur olsrd-0.5.6-r4.orig/src/duplicate_set.c olsrd-0.5.6-r4/src/duplicate_set.c
    old new  
    174174  return false;                 /* no duplicate */ 
    175175} 
    176176 
     177#ifndef SVEN_OLA_UNBLOAT 
    177178void 
    178179olsr_print_duplicate_table(void) 
    179180{ 
     
    192193  } OLSR_FOR_ALL_DUP_ENTRIES_END(entry); 
    193194#endif 
    194195} 
     196#endif /* SVEN_OLA_UNBLOAT */ 
    195197 
    196198/* 
    197199 * Local Variables: 
  • src/hna_set.c

    diff -ur olsrd-0.5.6-r4.orig/src/hna_set.c olsrd-0.5.6-r4/src/hna_set.c
    old new  
    279279 * 
    280280 *@return nada 
    281281 */ 
     282#ifndef SVEN_OLA_UNBLOAT 
    282283void 
    283284olsr_print_hna_set(void) 
    284285{ 
     
    320321  } 
    321322#endif 
    322323} 
     324#endif /* SVEN_OLA_UNBLOAT */ 
    323325 
    324326/** 
    325327 *Process incoming HNA message. 
  • src/interfaces.c

    diff -ur olsrd-0.5.6-r4.orig/src/interfaces.c olsrd-0.5.6-r4/src/interfaces.c
    old new  
    9393  OLSR_PRINTF(1, "\n ---- Interface configuration ---- \n\n"); 
    9494  /* Run trough all interfaces immedeatly */ 
    9595  for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) { 
     96#ifndef SVEN_OLA_UNBLOAT 
    9697    if (!tmp_if->host_emul) { 
    9798      if (!olsr_cnf->host_emul) /* XXX: TEMPORARY! */ 
     99#endif /* SVEN_OLA_UNBLOAT */ 
    98100        chk_if_up(tmp_if, 1); 
     101#ifndef SVEN_OLA_UNBLOAT 
    99102    } else { 
    100103      add_hemu_if(tmp_if); 
    101104    } 
     105#endif /* SVEN_OLA_UNBLOAT */ 
    102106  } 
    103107 
    104108  /* Kick a periodic timer for the network interface update function */ 
     
    244248 *@return nada 
    245249 */ 
    246250struct olsr_if * 
     251#ifdef SVEN_OLA_UNBLOAT 
     252queue_if(const char *name) 
     253#else                                  /* SVEN_OLA_UNBLOAT */ 
    247254queue_if(const char *name, int hemu) 
     255#endif                                 /* SVEN_OLA_UNBLOAT */ 
    248256{ 
    249257  struct olsr_if *interf_n = olsr_cnf->interfaces; 
    250258  size_t name_size; 
     
    268276  interf_n->interf = NULL; 
    269277  interf_n->configured = 0; 
    270278 
     279#ifndef SVEN_OLA_UNBLOAT 
    271280  interf_n->host_emul = hemu ? true : false; 
     281#endif /* SVEN_OLA_UNBLOAT */ 
    272282 
    273283  strscpy(interf_n->name, name, name_size); 
    274284  interf_n->next = olsr_cnf->interfaces; 
  • src/interfaces.h

    diff -ur olsrd-0.5.6-r4.orig/src/interfaces.h olsrd-0.5.6-r4/src/interfaces.h
    old new  
    200200 
    201201struct interface *if_ifwithindex(const int if_index); 
    202202 
    203 struct olsr_if *queue_if(const char *, int); 
     203struct olsr_if * 
     204#ifdef SVEN_OLA_UNBLOAT 
     205  queue_if(const char *); 
     206#else                                  /* SVEN_OLA_UNBLOAT */ 
     207  queue_if(const char *, int); 
     208#endif /* SVEN_OLA_UNBLOAT */ 
    204209 
    205210int add_ifchgf(int (*f) (struct interface *, int)); 
    206211 
  • src/ipc_frontend.c

    diff -ur olsrd-0.5.6-r4.orig/src/ipc_frontend.c olsrd-0.5.6-r4/src/ipc_frontend.c
    old new  
    4646 * 
    4747 */ 
    4848 
     49#ifndef SVEN_OLA_UNBLOAT 
    4950#include "ipc_frontend.h" 
    5051#include "link_set.h" 
    5152#include "olsr.h" 
     
    423424 
    424425  return 1; 
    425426} 
     427#endif /* SVEN_OLA_UNBLOAT */ 
    426428 
    427429/* 
    428430 * Local Variables: 
  • src/ipc_frontend.h

    diff -ur olsrd-0.5.6-r4.orig/src/ipc_frontend.h olsrd-0.5.6-r4/src/ipc_frontend.h
    old new  
    4848 
    4949#ifndef _OLSR_IPC 
    5050#define _OLSR_IPC 
     51#ifndef SVEN_OLA_UNBLOAT 
    5152 
    5253#include <sys/types.h> 
    5354#include <netinet/in.h> 
     
    103104int ipc_route_send_rtentry(const union olsr_ip_addr *, const union olsr_ip_addr *, int, int, const char *); 
    104105 
    105106#endif 
     107#endif /* SVEN_OLA_UNBLOAT */ 
    106108 
    107109/* 
    108110 * Local Variables: 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/ipcalc.c olsrd-0.5.6-r4/src/ipcalc.c
    old new  
    121121  return prefix; 
    122122} 
    123123 
     124#ifndef SVEN_OLA_UNBLOAT 
    124125const char * 
    125126olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix) 
    126127{ 
     
    147148  } 
    148149  return rv; 
    149150} 
     151#endif /* SVEN_OLA_UNBLOAT */ 
    150152 
    151153/* see if the ipaddr is in the net. That is equivalent to the fact that the net part 
    152154 * of both are equal. So we must compare the first <prefixlen> bits. 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/ipcalc.h olsrd-0.5.6-r4/src/ipcalc.h
    old new  
    146146  return inet_ntop(olsr_cnf->ip_version, addr, buf->buf, sizeof(buf->buf)); 
    147147} 
    148148 
     149#ifndef SVEN_OLA_UNBLOAT 
    149150const char *olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix); 
     151#endif /* SVEN_OLA_UNBLOAT */ 
    150152 
    151153static INLINE const char * 
    152154sockaddr4_to_string(struct ipaddr_str *const buf, const struct sockaddr *const addr) 
  • src/link_set.c

    diff -ur olsrd-0.5.6-r4.orig/src/link_set.c olsrd-0.5.6-r4/src/link_set.c
    old new  
    761761  return ret; 
    762762} 
    763763 
     764#ifndef SVEN_OLA_UNBLOAT 
    764765void 
    765766olsr_print_link_set(void) 
    766767{ 
     
    782783  } OLSR_FOR_ALL_LINK_ENTRIES_END(walker); 
    783784#endif 
    784785} 
     786#endif /* SVEN_OLA_UNBLOAT */ 
    785787 
    786788/* 
    787789 * called for every LQ HELLO message. 
  • src/linux/apm.c

    diff -ur olsrd-0.5.6-r4.orig/src/linux/apm.c olsrd-0.5.6-r4/src/linux/apm.c
    old new  
    4444 * Acpi-Power Enlightenment epplet 
    4545 */ 
    4646 
     47#ifndef SVEN_OLA_UNBLOAT 
    4748#include "apm.h" 
    4849#include "defs.h" 
    4950#include <stdio.h> 
     
    348349  /* No battery found */ 
    349350  return -1; 
    350351} 
     352#endif /* SVEN_OLA_UNBLOAT */ 
    351353 
    352354/* 
    353355 * Local Variables: 
  • src/linux/kernel_routes.c

    diff -ur olsrd-0.5.6-r4.orig/src/linux/kernel_routes.c olsrd-0.5.6-r4/src/linux/kernel_routes.c
    old new  
    300300    if (rt_ret > 0) rt_ret = 0; /* successful recovery */ 
    301301    else rt_ret = -1; /* unrecoverable error */ 
    302302  } 
     303#ifndef SVEN_OLA_UNBLOAT 
    303304  //send ipc update on success 
    304305  if ( ( cmd != RTM_NEWRULE ) & ( cmd != RTM_DELRULE ) & (flag = RT_ORIG_REQUEST) & (0 <= rt_ret && olsr_cnf->ipc_connections > 0)) { 
    305306    ipc_route_send_rtentry(&rt->rt_dst.prefix, &nexthop->gateway, metric, RTM_NEWROUTE == cmd, 
    306307                             if_ifwithindex_name(nexthop->iif_index)); 
    307308  } 
     309#endif /* SVEN_OLA_UNBLOAT */ 
    308310  if (rt_ret == -2) olsr_syslog(OLSR_LOG_ERR,"no rtnetlink response! (no system ressources left?, everything may happen now ...)"); 
    309311  return rt_ret; 
    310312} 
     
    342344  int rslt; 
    343345#endif /* LINUX_POLICY_ROUTING */ 
    344346 
     347#ifndef SVEN_OLA_UNBLOAT 
    345348  OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best)); 
     349#endif /* SVEN_OLA_UNBLOAT */ 
    346350 
    347351#if !LINUX_POLICY_ROUTING 
    348352  memset(&kernel_route, 0, sizeof(struct rtentry)); 
     
    416420  struct in6_rtmsg kernel_route; 
    417421  int rslt; 
    418422 
     423#ifndef SVEN_OLA_UNBLOAT 
    419424  OLSR_PRINTF(2, "KERN: Adding %s\n", olsr_rtp_to_string(rt->rt_best)); 
     425#endif /* SVEN_OLA_UNBLOAT */ 
    420426 
    421427  memset(&kernel_route, 0, sizeof(struct in6_rtmsg)); 
    422428 
     
    469475  int rslt; 
    470476#endif /* LINUX_POLICY_ROUTING */ 
    471477 
     478#ifndef SVEN_OLA_UNBLOAT 
    472479  OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt)); 
     480#endif /* SVEN_OLA_UNBLOAT */ 
    473481 
    474482#if !LINUX_POLICY_ROUTING 
    475483  memset(&kernel_route, 0, sizeof(struct rtentry)); 
     
    536544  int rslt; 
    537545#endif /* LINUX_POLICY_ROUTING */ 
    538546 
     547#ifndef SVEN_OLA_UNBLOAT 
    539548  OLSR_PRINTF(2, "KERN: Deleting %s\n", olsr_rt_to_string(rt)); 
     549#endif /* SVEN_OLA_UNBLOAT */ 
    540550 
    541551#if !LINUX_POLICY_ROUTING 
    542552  memset(&kernel_route, 0, sizeof(struct in6_rtmsg)); 
  • src/linux/net.c

    diff -ur olsrd-0.5.6-r4.orig/src/linux/net.c olsrd-0.5.6-r4/src/linux/net.c
    old new  
    6969#define SIOCGIWRATE 0x8B21  /* get default bit rate (bps) */ 
    7070 
    7171/* The original state of the IP forwarding proc entry */ 
     72#ifndef SVEN_OLA_UNBLOAT 
    7273static char orig_fwd_state; 
    7374static char orig_global_redirect_state; 
     75#endif /* SVEN_OLA_UNBLOAT */ 
    7476 
    7577/** 
    7678 *Bind a socket to a device 
     
    9193  return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name) + 1); 
    9294} 
    9395 
     96#ifndef SVEN_OLA_UNBLOAT 
     97 
    9498/** 
    9599 *Enable IP forwarding. 
    96100 *Just writing "1" to the /proc/sys/net/ipv4/ip_forward 
     
    110114  const char *const procfile = version == AF_INET ? "/proc/sys/net/ipv4/ip_forward" : "/proc/sys/net/ipv6/conf/all/forwarding"; 
    111115 
    112116  if ((proc_fwd = fopen(procfile, "r")) == NULL) { 
     117#ifdef SVEN_OLA_UNBLOAT_OLD 
     118    perror(procfile); 
     119#else 
    113120    /* IPv4 */ 
    114121    if (version == AF_INET) 
    115122      fprintf(stderr, 
     
    122129              procfile); 
    123130 
    124131    sleep(3); 
     132#endif 
    125133    return 0; 
    126134  } 
    127135 
     
    131139    OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n"); 
    132140  } else { 
    133141    if ((proc_fwd = fopen(procfile, "w")) == NULL) { 
     142#ifdef SVEN_OLA_UNBLOAT_OLD 
     143      perror(procfile); 
     144#else 
    134145      fprintf(stderr, "Could not open %s for writing!\n", procfile); 
    135146      fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP forwarding is enabeled!\n\n"); 
    136147      sleep(3); 
     148#endif 
    137149      return 0; 
    138150    } else { 
    139151      syslog(LOG_INFO, "Writing \"1\" to %s\n", procfile); 
     
    154166    return -1; 
    155167 
    156168  if ((proc_redirect = fopen(procfile, "r")) == NULL) { 
     169#ifdef SVEN_OLA_UNBLOAT_OLD 
     170    perror(procfile); 
     171#else 
    157172    fprintf(stderr, 
    158173            "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", 
    159174            procfile); 
    160175 
    161176    sleep(3); 
     177#endif 
    162178    return -1; 
    163179  } 
    164180  orig_global_redirect_state = fgetc(proc_redirect); 
     
    168184    return 0; 
    169185 
    170186  if ((proc_redirect = fopen(procfile, "w")) == NULL) { 
     187#ifdef SVEN_OLA_UNBLOAT_OLD 
     188    perror(procfile); 
     189#else 
    171190    fprintf(stderr, "Could not open %s for writing!\n", procfile); 
    172191    fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n"); 
    173192    sleep(3); 
     193#endif 
    174194    return 0; 
    175195  } 
    176196  syslog(LOG_INFO, "Writing \"0\" to %s", procfile); 
     
    196216  snprintf(procfile, sizeof(procfile), REDIRECT_PROC, if_name); 
    197217 
    198218  if ((proc_redirect = fopen(procfile, "r")) == NULL) { 
     219#ifdef SVEN_OLA_UNBLOAT_OLD 
     220    perror(procfile); 
     221#else 
    199222    fprintf(stderr, 
    200223            "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", 
    201224            procfile); 
    202225    sleep(3); 
     226#endif 
    203227    return 0; 
    204228  } 
    205229  iface->nic_state.redirect = fgetc(proc_redirect); 
    206230  fclose(proc_redirect); 
    207231 
    208232  if ((proc_redirect = fopen(procfile, "w")) == NULL) { 
     233#ifdef SVEN_OLA_UNBLOAT_OLD 
     234    perror(procfile); 
     235#else 
    209236    fprintf(stderr, "Could not open %s for writing!\n", procfile); 
    210237    fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that ICMP redirect is disabeled!\n\n"); 
    211238    sleep(3); 
     239#endif 
    212240    return 0; 
    213241  } 
    214242  syslog(LOG_INFO, "Writing \"0\" to %s", procfile); 
     
    234262  sprintf(procfile, SPOOF_PROC, if_name); 
    235263 
    236264  if ((proc_spoof = fopen(procfile, "r")) == NULL) { 
     265#ifdef SVEN_OLA_UNBLOAT_OLD 
     266    perror(procfile); 
     267#else 
    237268    fprintf(stderr, 
    238269            "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", 
    239270            procfile); 
    240271 
    241272    sleep(3); 
     273#endif 
    242274    return 0; 
    243275  } 
    244276  iface->nic_state.spoof = fgetc(proc_spoof); 
    245277  fclose(proc_spoof); 
    246278 
    247279  if ((proc_spoof = fopen(procfile, "w")) == NULL) { 
     280#ifdef SVEN_OLA_UNBLOAT_OLD 
     281    perror(procfile); 
     282#else 
    248283    fprintf(stderr, "Could not open %s for writing!\n", procfile); 
    249284    fprintf(stderr, "I will continue(in 3 sec) - but you should mannually ensure that IP spoof filtering is disabeled!\n\n"); 
    250285    sleep(3); 
     286#endif 
    251287    return 0; 
    252288  } 
    253289  syslog(LOG_INFO, "Writing \"0\" to %s", procfile); 
     
    272308    FILE *proc_fd; 
    273309 
    274310    if ((proc_fd = fopen(procfile, "w")) == NULL) { 
     311#ifdef SVEN_OLA_UNBLOAT_OLD 
     312      perror(procfile); 
     313#else 
    275314      fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile); 
     315#endif 
    276316    } else { 
    277317      syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_fwd_state); 
    278318      fputc(orig_fwd_state, proc_fd); 
     
    287327      FILE *proc_fd; 
    288328 
    289329      if ((proc_fd = fopen(procfile, "w")) == NULL) { 
     330#ifdef SVEN_OLA_UNBLOAT_OLD 
     331        perror(procfile); 
     332#else 
    290333        fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile); 
     334#endif 
    291335      } else { 
    292336        syslog(LOG_INFO, "Resetting %s to %c\n", procfile, orig_global_redirect_state); 
    293337        fputc(orig_global_redirect_state, proc_fd); 
     
    311355    snprintf(procfile, sizeof(procfile), REDIRECT_PROC, ifs->int_name); 
    312356 
    313357    if ((proc_fd = fopen(procfile, "w")) == NULL) 
     358#ifdef SVEN_OLA_UNBLOAT_OLD 
     359      perror(procfile); 
     360#else 
    314361      fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile); 
     362#endif 
    315363    else { 
    316364      syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.redirect); 
    317365 
     
    324372    /* Generate the procfile name */ 
    325373    sprintf(procfile, SPOOF_PROC, ifs->int_name); 
    326374    if ((proc_fd = fopen(procfile, "w")) == NULL) 
     375#ifdef SVEN_OLA_UNBLOAT_OLD 
     376      perror(procfile); 
     377#else 
    327378      fprintf(stderr, "Could not open %s for writing!\nSettings not restored!\n", procfile); 
     379#endif 
    328380    else { 
    329381      syslog(LOG_INFO, "Resetting %s to %c\n", procfile, ifs->nic_state.spoof); 
    330382 
     
    372424  return sock; 
    373425} 
    374426 
     427#endif /* SVEN_OLA_UNBLOAT */ 
     428 
    375429/** 
    376430 *Creates a nonblocking broadcast socket. 
    377431 *@param sa sockaddr struct. Used for bind(2). 
  • src/lq_plugin.c

    diff -ur olsrd-0.5.6-r4.orig/src/lq_plugin.c olsrd-0.5.6-r4/src/lq_plugin.c
    old new  
    6767init_lq_handler_tree(void) 
    6868{ 
    6969  avl_init(&lq_handler_tree, &avl_strcasecmp); 
     70#ifndef SVEN_OLA_UNBLOAT 
    7071  register_lq_handler(&lq_etx_float_handler, LQ_ALGORITHM_ETX_FLOAT_NAME); 
    7172  register_lq_handler(&lq_etx_fpm_handler, LQ_ALGORITHM_ETX_FPM_NAME); 
     73#endif /* SVEN_OLA_UNBLOAT */ 
    7274  register_lq_handler(&lq_etx_ff_handler, LQ_ALGORITHM_ETX_FF_NAME); 
     75#ifndef SVEN_OLA_UNBLOAT 
    7376  if (activate_lq_handler(olsr_cnf->lq_algorithm)) { 
    7477    activate_lq_handler(LQ_ALGORITHM_ETX_FPM_NAME); 
    7578  } 
     79#else /* SVEN_OLA_UNBLOAT */ 
     80  activate_lq_handler(LQ_ALGORITHM_ETX_FF_NAME); 
     81#endif /* SVEN_OLA_UNBLOAT */ 
    7682} 
    7783 
    7884/* 
     
    417423 * @return pointer to hello_neighbor 
    418424 */ 
    419425struct hello_neighbor * 
     426#ifndef SVEN_OLA_UNBLOAT 
    420427olsr_malloc_hello_neighbor(const char *id) 
     428#else                                  /* SVEN_OLA_UNBLOAT */ 
     429olsr_malloc_hello_neighbor(const char *id __attribute__ ((unused))) 
     430#endif /* SVEN_OLA_UNBLOAT */ 
    421431{ 
    422432  struct hello_neighbor *h; 
    423433 
     
    439449 * @return pointer to tc_mpr_addr 
    440450 */ 
    441451struct tc_mpr_addr * 
     452#ifndef SVEN_OLA_UNBLOAT 
    442453olsr_malloc_tc_mpr_addr(const char *id) 
     454#else                                  /* SVEN_OLA_UNBLOAT */ 
     455olsr_malloc_tc_mpr_addr(const char *id __attribute__ ((unused))) 
     456#endif /* SVEN_OLA_UNBLOAT */ 
    443457{ 
    444458  struct tc_mpr_addr *t; 
    445459 
     
    461475 * @return pointer to lq_hello_neighbor 
    462476 */ 
    463477struct lq_hello_neighbor * 
     478#ifndef SVEN_OLA_UNBLOAT 
    464479olsr_malloc_lq_hello_neighbor(const char *id) 
     480#else                                  /* SVEN_OLA_UNBLOAT */ 
     481olsr_malloc_lq_hello_neighbor(const char *id __attribute__ ((unused))) 
     482#endif /* SVEN_OLA_UNBLOAT */ 
    465483{ 
    466484  struct lq_hello_neighbor *h; 
    467485 
     
    483501 * @return pointer to link_entry 
    484502 */ 
    485503struct link_entry * 
     504#ifndef SVEN_OLA_UNBLOAT 
    486505olsr_malloc_link_entry(const char *id) 
     506#else                                  /* SVEN_OLA_UNBLOAT */ 
     507olsr_malloc_link_entry(const char *id __attribute__ ((unused))) 
     508#endif /* SVEN_OLA_UNBLOAT */ 
    487509{ 
    488510  struct link_entry *h; 
    489511 
  • src/lq_plugin_default_float.c

    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
    old new  
    3939 * 
    4040 */ 
    4141 
     42#ifndef SVEN_OLA_UNBLOAT 
    4243#include "tc_set.h" 
    4344#include "link_set.h" 
    4445#include "olsr_spf.h" 
     
    223224 
    224225  return buffer->buf; 
    225226} 
     227#endif /* SVEN_OLA_UNBLOAT */ 
    226228 
    227229/* 
    228230 * Local Variables: 
  • src/lq_plugin_default_float.h

    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
    old new  
    3939 * 
    4040 */ 
    4141 
     42#ifndef SVEN_OLA_UNBLOAT 
    4243#ifndef LQ_PLUGIN_DEFAULT_H_ 
    4344#define LQ_PLUGIN_DEFAULT_H_ 
    4445 
     
    7778extern struct lq_handler lq_etx_float_handler; 
    7879 
    7980#endif /*LQ_PLUGIN_DEFAULT_H_ */ 
     81#endif /* SVEN_OLA_UNBLOAT */ 
    8082 
    8183/* 
    8284 * Local Variables: 
  • src/lq_plugin_default_fpm.c

    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
    old new  
    3939 * 
    4040 */ 
    4141 
     42#ifndef SVEN_OLA_UNBLOAT 
    4243#include "tc_set.h" 
    4344#include "link_set.h" 
    4445#include "lq_plugin.h" 
     
    235236  snprintf(buffer->buf, sizeof(buffer->buf), "%.3f", (float)(cost) / LQ_FPM_LINKCOST_MULTIPLIER); 
    236237  return buffer->buf; 
    237238} 
     239#endif /* SVEN_OLA_UNBLOAT */ 
    238240 
    239241/* 
    240242 * Local Variables: 
  • src/lq_plugin_default_fpm.h

    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
    old new  
    3939 * 
    4040 */ 
    4141 
     42#ifndef SVEN_OLA_UNBLOAT 
    4243#ifndef LQ_ETX_FPM_ 
    4344#define LQ_ETX_FPM_ 
    4445 
     
    8384extern struct lq_handler lq_etx_fpm_handler; 
    8485 
    8586#endif /*LQ_ETX_FPM_ */ 
     87#endif /* SVEN_OLA_UNBLOAT */ 
    8688 
    8789/* 
    8890 * Local Variables: 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/main.c olsrd-0.5.6-r4/src/main.c
    old new  
    256256  /* 
    257257   * Print configuration 
    258258   */ 
     259#ifndef SVEN_OLA_UNBLOAT 
    259260  if (olsr_cnf->debug_level > 1) { 
    260261    olsrd_print_cnf(olsr_cnf); 
    261262  } 
     263#endif /* SVEN_OLA_UNBLOAT */ 
    262264#ifndef WIN32 
     265#ifndef SVEN_OLA_UNBLOAT 
    263266  /* Disable redirects globally */ 
    264267  disable_redirects_global(olsr_cnf->ip_version); 
    265268#endif 
     269#endif /* SVEN_OLA_UNBLOAT */ 
    266270 
    267271  /* 
    268272   * socket for ioctl calls 
     
    298302  /* 
    299303   *enable ip forwarding on host 
    300304   */ 
     305#ifndef SVEN_OLA_UNBLOAT 
    301306  enable_ip_forwarding(olsr_cnf->ip_version); 
     307#endif /* SVEN_OLA_UNBLOAT */ 
    302308 
    303309  /* Initialize parser */ 
    304310  olsr_init_parser(); 
     
    316322   *Set up willingness/APM 
    317323   */ 
    318324  if (olsr_cnf->willingness_auto) { 
     325#ifndef SVEN_OLA_UNBLOAT 
    319326    if (apm_init() < 0) { 
    320327      OLSR_PRINTF(1, "Could not read APM info - setting default willingness(%d)\n", WILL_DEFAULT); 
    321328 
     
    324331      olsr_cnf->willingness_auto = 0; 
    325332      olsr_cnf->willingness = WILL_DEFAULT; 
    326333    } else { 
     334#endif /* SVEN_OLA_UNBLOAT */ 
    327335      olsr_cnf->willingness = olsr_calculate_willingness(); 
    328336 
    329337      OLSR_PRINTF(1, "Willingness set to %d - next update in %.1f secs\n", olsr_cnf->willingness, olsr_cnf->will_int); 
     338#ifndef SVEN_OLA_UNBLOAT 
    330339    } 
     340#endif /* SVEN_OLA_UNBLOAT */ 
    331341  } 
    332342 
    333343  /* Initialize net */ 
     
    362372 
    363373  /* Initialize the IPC socket */ 
    364374 
     375#ifndef SVEN_OLA_UNBLOAT 
    365376  if (olsr_cnf->ipc_connections > 0) { 
    366377    ipc_init(); 
    367378  } 
     379#endif /* SVEN_OLA_UNBLOAT */ 
    368380  /* Initialisation of different tables to be used. */ 
    369381  olsr_init_tables(); 
    370382 
     
    487499  OLSR_PRINTF(1, "Closing sockets...\n"); 
    488500 
    489501  /* front-end IPC socket */ 
     502#ifndef SVEN_OLA_UNBLOAT 
    490503  if (olsr_cnf->ipc_connections > 0) { 
    491504    shutdown_ipc(); 
    492505  } 
     506#endif /* SVEN_OLA_UNBLOAT */ 
    493507 
    494508  /* OLSR sockets */ 
    495509  for (ifn = ifnet; ifn; ifn = ifn->int_next) 
     
    499513  olsr_close_plugins(); 
    500514 
    501515  /* Reset network settings */ 
     516#ifndef SVEN_OLA_UNBLOAT 
    502517  restore_settings(olsr_cnf->ip_version); 
     518#endif /* SVEN_OLA_UNBLOAT */ 
    503519 
    504520  /* ioctl socket */ 
    505521  close(olsr_cnf->ioctl_s); 
     
    540556          "usage: olsrd [-f <configfile>] [ -i interface1 interface2 ... ]\n" 
    541557          "  [-d <debug_level>] [-ipv6] [-multi <IPv6 multicast address>]\n" 
    542558          "  [-lql <LQ level>] [-lqw <LQ winsize>] [-lqnt <nat threshold>]\n" 
     559#ifdef SVEN_OLA_UNBLOAT 
     560          "  [-bcast <broadcastaddr>] [-delgw] (Note: no -ipc,-dispin,-dispout)\n" 
     561#else /* SVEN_OLA_UNBLOAT */ 
    543562          "  [-bcast <broadcastaddr>] [-ipc] [-dispin] [-dispout] [-delgw]\n" 
     563#endif /* SVEN_OLA_UNBLOAT */ 
    544564          "  [-hint <hello interval (secs)>] [-tcint <tc interval (secs)>]\n" 
    545565          "  [-midint <mid interval (secs)>] [-hnaint <hna interval (secs)>]\n" 
    546566          "  [-T <Polling Rate (secs)>] [-nofork] [-hemu <ip_address>]\n" "  [-lql <LQ level>] [-lqa <LQ aging factor>]\n"); 
     
    704724        olsr_exit(__func__, EXIT_FAILURE); 
    705725      } 
    706726      printf("Queuing if %s\n", *argv); 
     727#ifdef SVEN_OLA_UNBLOAT 
     728      queue_if(*argv); 
     729#else /* SVEN_OLA_UNBLOAT */ 
    707730      queue_if(*argv, false); 
     731#endif /* SVEN_OLA_UNBLOAT */ 
    708732 
    709733      while ((argc - 1) && (argv[1][0] != '-')) { 
    710734        NEXT_ARG; 
    711735        printf("Queuing if %s\n", *argv); 
     736#ifdef SVEN_OLA_UNBLOAT 
     737        queue_if(*argv); 
     738#else /* SVEN_OLA_UNBLOAT */ 
    712739        queue_if(*argv, false); 
     740#endif /* SVEN_OLA_UNBLOAT */ 
    713741      } 
    714742 
    715743      continue; 
     
    771799      sscanf(*argv, "%f", &cnf->pollrate); 
    772800      continue; 
    773801    } 
    774  
     802#ifndef SVEN_OLA_UNBLOAT 
    775803    /* 
    776804     * Should we display the contents of packages beeing sent? 
    777805     */ 
     
    795823      cnf->ipc_connections = 1; 
    796824      continue; 
    797825    } 
     826#endif /* SVEN_OLA_UNBLOAT */ 
    798827 
    799828    /* 
    800829     * IPv6 multicast addr 
     
    812841 
    813842      continue; 
    814843    } 
    815  
     844#ifndef SVEN_OLA_UNBLOAT 
    816845    /* 
    817846     * Host emulation 
    818847     */ 
     
    840869 
    841870      continue; 
    842871    } 
     872#endif /* SVEN_OLA_UNBLOAT */ 
    843873 
    844874    /* 
    845875     * Delete possible default GWs 
  • src/neighbor_table.c

    diff -ur olsrd-0.5.6-r4.orig/src/neighbor_table.c olsrd-0.5.6-r4/src/neighbor_table.c
    old new  
    362362 * 
    363363 *@return nada 
    364364 */ 
     365#ifndef SVEN_OLA_UNBLOAT 
    365366void 
    366367olsr_print_neighbor_table(void) 
    367368{ 
     
    391392  } 
    392393#endif 
    393394} 
     395#endif /* SVEN_OLA_UNBLOAT */ 
    394396 
    395397/* 
    396398 * Local Variables: 
  • src/net_olsr.c

    diff -ur olsrd-0.5.6-r4.orig/src/net_olsr.c olsrd-0.5.6-r4/src/net_olsr.c
    old new  
    4444#include "log.h" 
    4545#include "olsr.h" 
    4646#include "net_os.h" 
     47#ifndef SVEN_OLA_UNBLOAT 
    4748#include "print_packet.h" 
     49#endif /* SVEN_OLA_UNBLOAT */ 
    4850#include "link_set.h" 
    4951#include "lq_packet.h" 
    5052 
     
    385387   *if the -dispout option was given 
    386388   *we print the content of the packets 
    387389   */ 
     390#ifndef SVEN_OLA_UNBLOAT 
    388391  if (disp_pack_out) 
    389392    print_olsr_serialized_packet(stdout, (union olsr_packet *)ifp->netbuf.buff, ifp->netbuf.pending, &ifp->ip_addr); 
     393#endif /* SVEN_OLA_UNBLOAT */ 
    390394 
    391395  if (olsr_cnf->ip_version == AF_INET) { 
    392396    /* IP version 4 */ 
     
    400404    /* IP version 6 */ 
    401405    if (olsr_sendto(ifp->olsr_socket, ifp->netbuf.buff, ifp->netbuf.pending, MSG_DONTROUTE, (struct sockaddr *)sin6, sizeof(*sin6)) 
    402406        < 0) { 
     407#ifndef SVEN_OLA_UNBLOAT 
    403408      struct ipaddr_str buf; 
     409#endif /* SVEN_OLA_UNBLOAT */ 
    404410      perror("sendto(v6)"); 
    405411      olsr_syslog(OLSR_LOG_ERR, "OLSR: sendto IPv6 %m"); 
     412#ifndef SVEN_OLA_UNBLOAT 
    406413      fprintf(stderr, "Socket: %d interface: %d\n", ifp->olsr_socket, ifp->if_index); 
    407414      fprintf(stderr, "To: %s (size: %u)\n", ip6_to_string(&buf, &sin6->sin6_addr), (unsigned int)sizeof(*sin6)); 
    408415      fprintf(stderr, "Outputsize: %d\n", ifp->netbuf.pending); 
     416#endif /* SVEN_OLA_UNBLOAT */ 
    409417      retval = -1; 
    410418    } 
    411419  } 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/olsr.c olsrd-0.5.6-r4/src/olsr.c
    old new  
    149149    return; 
    150150 
    151151  if (olsr_cnf->debug_level > 0 && olsr_cnf->clear_screen && isatty(1)) { 
     152#ifndef SVEN_OLA_UNBLOAT 
    152153    clear_console(); 
     154#endif /* SVEN_OLA_UNBLOAT */ 
    153155    printf("       *** %s (%s on %s) ***\n", olsrd_version, build_date, build_host); 
    154156  } 
    155157 
     
    165167  if (changes_neighborhood || changes_topology || changes_hna) { 
    166168    olsr_calculate_routing_table(); 
    167169  } 
    168  
     170#ifndef SVEN_OLA_UNBLOAT 
    169171  if (olsr_cnf->debug_level > 0) { 
    170172    if (olsr_cnf->debug_level > 2) { 
    171173      olsr_print_mid_set(); 
     
    184186    olsr_print_tc_table(); 
    185187#endif 
    186188  } 
     189#endif /* SVEN_OLA_UNBLOAT */ 
    187190 
    188191  for (tmp_pc_list = pcf_list; tmp_pc_list != NULL; tmp_pc_list = tmp_pc_list->next) { 
    189192    tmp_pc_list->function(changes_neighborhood, changes_topology, changes_hna); 
     
    420423uint8_t 
    421424olsr_calculate_willingness(void) 
    422425{ 
     426#ifndef SVEN_OLA_UNBLOAT 
    423427  struct olsr_apm_info ainfo; 
     428#endif /* SVEN_OLA_UNBLOAT */ 
    424429 
    425430  /* If fixed willingness */ 
    426431  if (!olsr_cnf->willingness_auto) 
    427432    return olsr_cnf->willingness; 
    428433 
     434#ifndef SVEN_OLA_UNBLOAT 
    429435  if (apm_read(&ainfo) < 1) 
    430436    return WILL_DEFAULT; 
    431437 
     
    442448   * 26% > juice will: 1 
    443449   */ 
    444450  return (ainfo.battery_percentage / 26); 
     451#else /* SVEN_OLA_UNBLOAT */ 
     452  return WILL_DEFAULT; 
     453#endif /* SVEN_OLA_UNBLOAT */ 
    445454} 
    446455 
     456#ifndef SVEN_OLA_UNBLOAT 
    447457const char * 
    448458olsr_msgtype_to_string(uint8_t msgtype) 
    449459{ 
     
    513523  snprintf(type, sizeof(type), "UNKNOWN(%d)", status); 
    514524  return type; 
    515525} 
     526#endif /* SVEN_OLA_UNBLOAT */ 
    516527 
    517528/** 
    518529 *Termination function to be called whenever a error occures 
     
    541552 * 
    542553 * @return a void pointer to the memory allocated 
    543554 */ 
     555#ifndef SVEN_OLA_UNBLOAT 
    544556void * 
    545557olsr_malloc(size_t size, const char *id) 
    546558{ 
     
    565577 
    566578  return ptr; 
    567579} 
     580#endif /* SVEN_OLA_UNBLOAT */ 
    568581 
    569582/** 
    570583 *Wrapper for printf that prints to a specific 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/olsr.h olsrd-0.5.6-r4/src/olsr.h
    old new  
    7272 
    7373uint8_t olsr_calculate_willingness(void); 
    7474 
     75#ifndef SVEN_OLA_UNBLOAT 
    7576const char *olsr_msgtype_to_string(uint8_t); 
    7677 
    7778const char *olsr_link_to_string(uint8_t); 
    7879 
    7980const char *olsr_status_to_string(uint8_t); 
     81#endif /* SVEN_OLA_UNBLOAT */ 
    8082 
    8183void olsr_exit(const char *, int); 
    8284 
     85#ifdef SVEN_OLA_UNBLOAT 
     86#define olsr_malloc(size, msg) calloc(1, size) 
     87#else /* SVEN_OLA_UNBLOAT */ 
    8388void *olsr_malloc(size_t, const char *); 
     89#endif /* SVEN_OLA_UNBLOAT */ 
    8490 
    8591int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3))); 
    8692 
  • src/olsr_cfg.h

    diff -ur olsrd-0.5.6-r4.orig/src/olsr_cfg.h olsrd-0.5.6-r4/src/olsr_cfg.h
    old new  
    148148  char *name; 
    149149  char *config; 
    150150  bool configured; 
     151#ifndef SVEN_OLA_UNBLOAT 
    151152  bool host_emul; 
    152153  union olsr_ip_addr hemu_ip; 
     154#endif /* SVEN_OLA_UNBLOAT */ 
    153155  struct interface *interf; 
    154156  struct if_config_options *cnf; 
    155157  struct olsr_if *next; 
     
    192194  uint16_t olsrport; 
    193195  int debug_level; 
    194196  bool no_fork; 
     197#ifndef SVEN_OLA_UNBLOAT 
    195198  bool host_emul; 
     199#endif /* SVEN_OLA_UNBLOAT */ 
    196200  int ip_version; 
    197201  bool allow_no_interfaces; 
    198202  uint16_t tos; 
     
    201205  uint8_t rttable_default; 
    202206  uint8_t willingness; 
    203207  bool willingness_auto; 
     208#ifndef SVEN_OLA_UNBLOAT 
    204209  int ipc_connections; 
     210#endif /* SVEN_OLA_UNBLOAT */ 
    205211  bool use_hysteresis; 
    206212  olsr_fib_metric_options fib_metric; 
    207213  struct hyst_param hysteresis_param; 
    208214  struct plugin_entry *plugins; 
    209215  struct ip_prefix_list *hna_entries; 
     216#ifndef SVEN_OLA_UNBLOAT 
    210217  struct ip_prefix_list *ipc_nets; 
     218#endif /* SVEN_OLA_UNBLOAT */ 
    211219  struct olsr_if *interfaces; 
    212220  float pollrate; 
    213221  float nic_chgs_pollrate; 
     
    267275 
    268276  void olsrd_free_cnf(struct olsrd_config *); 
    269277 
     278#ifndef SVEN_OLA_UNBLOAT 
    270279  void olsrd_print_cnf(struct olsrd_config *); 
     280#endif                                 /* SVEN_OLA_UNBLOAT */ 
    271281 
    272282  int olsrd_write_cnf(struct olsrd_config *, const char *); 
    273283 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/parser.c olsrd-0.5.6-r4/src/parser.c
    old new  
    5151#include "rebuild_packet.h" 
    5252#include "net_os.h" 
    5353#include "log.h" 
     54#ifndef SVEN_OLA_UNBLOAT 
    5455#include "print_packet.h" 
     56#endif /* SVEN_OLA_UNBLOAT */ 
    5557#include "net_olsr.h" 
    5658 
    5759#ifdef WIN32 
     
    281283  //printf("Message from %s\n\n", olsr_ip_to_string(&buf, from_addr)); 
    282284 
    283285  /* Display packet */ 
     286#ifndef SVEN_OLA_UNBLOAT 
    284287  if (disp_pack_in) 
    285288    print_olsr_serialized_packet(stdout, (union olsr_packet *)olsr, size, from_addr); 
     289#endif /* SVEN_OLA_UNBLOAT */ 
    286290 
    287291  if (olsr_cnf->ip_version == AF_INET) 
    288292    msgsize = ntohs(m->v4.olsr_msgsize); 
  • src/print_packet.c

    diff -ur olsrd-0.5.6-r4.orig/src/print_packet.c olsrd-0.5.6-r4/src/print_packet.c
    old new  
    3939 * 
    4040 */ 
    4141 
     42#ifndef SVEN_OLA_UNBLOAT 
    4243#include "print_packet.h" 
    4344#include "ipcalc.h" 
    4445#include "mantissa.h" 
     
    339340    remsize -= olsr_cnf->ipsize; 
    340341  } 
    341342} 
     343#endif /* SVEN_OLA_UNBLOAT */ 
    342344 
    343345/* 
    344346 * Local Variables: 
  • src/process_routes.c

    diff -ur olsrd-0.5.6-r4.orig/src/process_routes.c olsrd-0.5.6-r4/src/process_routes.c
    old new  
    159159static void 
    160160olsr_delete_kernel_route(struct rt_entry *rt) 
    161161{ 
     162#ifndef SVEN_OLA_UNBLOAT 
    162163  if (!olsr_cnf->host_emul) { 
    163164    int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt); 
    164165 
     
    170171      olsr_syslog(OLSR_LOG_ERR, "Delete route %s: %s", routestr, err_msg); 
    171172    } 
    172173  } 
     174#else /* SVEN_OLA_UNBLOAT */ 
     175  int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_delroute_function(rt) : olsr_delroute6_function(rt); 
     176  if (0 > error) { 
     177    olsr_syslog(OLSR_LOG_ERR, "Delete route: %s", strerror(errno)); 
     178  } 
     179#endif /* SVEN_OLA_UNBLOAT */ 
    173180} 
    174181 
    175182/** 
     
    181188olsr_add_kernel_route(struct rt_entry *rt) 
    182189{ 
    183190 
     191#ifndef SVEN_OLA_UNBLOAT 
    184192  if (!olsr_cnf->host_emul) { 
    185193    int16_t error = (olsr_cnf->ip_version == AF_INET) ? olsr_addroute_function(rt) : olsr_addroute6_function(rt); 
    186194 
     
    199207      rt->rt_metric = rt->rt_best->rtp_metric; 
    200208    } 
    201209  } 
     210#else /* SVEN_OLA_UNBLOAT */ 
     211  int16_t error = olsr_cnf->ip_version == AF_INET ? olsr_addroute_function(rt) : olsr_addroute6_function(rt); 
     212  if (0 > error) { 
     213    olsr_syslog(OLSR_LOG_ERR, "Add route: %s", strerror(errno)); 
     214  } else { 
     215    rt->rt_nexthop = rt->rt_best->rtp_nexthop; 
     216  } 
     217#endif /* SVEN_OLA_UNBLOAT */ 
    202218} 
    203219 
    204220/** 
     
    385401  /* route additions */ 
    386402  olsr_add_kernel_routes(&add_kernel_list); 
    387403 
    388 #if DEBUG 
     404#ifdef DEBUG 
    389405  olsr_print_routing_table(&routingtree); 
    390406#endif 
    391407} 
  • src/rebuild_packet.c

    diff -ur olsrd-0.5.6-r4.orig/src/rebuild_packet.c olsrd-0.5.6-r4/src/rebuild_packet.c
    old new  
    6060mid_chgestruct(struct mid_message *mmsg, const union olsr_message *m) 
    6161{ 
    6262  int i; 
     63#ifndef SVEN_OLA_UNBLOAT 
    6364  struct mid_alias *alias, *alias_tmp; 
     65#else /* SVEN_OLA_UNBLOAT */ 
     66  struct mid_alias *alias; 
     67#endif /* SVEN_OLA_UNBLOAT */ 
    6468  int no_aliases; 
    6569 
    6670  /* Checking if everything is ok */ 
     
    100104      maddr++; 
    101105    } 
    102106 
     107#ifndef SVEN_OLA_UNBLOAT 
    103108    if (olsr_cnf->debug_level > 1) { 
    104109      struct ipaddr_str buf; 
    105110      OLSR_PRINTF(3, "Alias list for %s: ", olsr_ip_to_string(&buf, &mmsg->mid_origaddr)); 
     
    111116      } 
    112117      OLSR_PRINTF(3, "\n"); 
    113118    } 
     119#endif /* SVEN_OLA_UNBLOAT */ 
    114120  } else { 
    115121    /* IPv6 */ 
    116122    const struct midaddr6 *maddr6 = m->v6.message.mid.mid_addr; 
     
    144150      maddr6++; 
    145151    } 
    146152 
     153#ifndef SVEN_OLA_UNBLOAT 
    147154    if (olsr_cnf->debug_level > 1) { 
    148155      struct ipaddr_str buf; 
    149156      OLSR_PRINTF(3, "Alias list for %s", ip6_to_string(&buf, &mmsg->mid_origaddr.v6)); 
     
    156163      } 
    157164      OLSR_PRINTF(3, "\n"); 
    158165    } 
     166#endif /* SVEN_OLA_UNBLOAT */ 
    159167  } 
    160168 
    161169} 
  • src/routing_table.c

    diff -ur olsrd-0.5.6-r4.orig/src/routing_table.c olsrd-0.5.6-r4/src/routing_table.c
    old new  
    628628/** 
    629629 * format a route entry into a buffer 
    630630 */ 
     631#ifndef SVEN_OLA_UNBLOAT 
    631632char * 
    632633olsr_rt_to_string(const struct rt_entry *rt) 
    633634{ 
     
    659660 
    660661  return buff; 
    661662} 
     663#endif /* SVEN_OLA_UNBLOAT */ 
    662664 
    663665/** 
    664666 * Print the routingtree to STDOUT 
    665667 * 
    666668 */ 
     669#ifndef SVEN_OLA_UNBLOAT 
    667670void 
    668671olsr_print_routing_table(struct avl_tree *tree) 
    669672{ 
     
    697700#endif 
    698701  tree = NULL;                  /* squelch compiler warnings */ 
    699702} 
     703#endif /* SVEN_OLA_UNBLOAT */ 
    700704 
    701705/* 
    702706 * Local Variables: 
  • src/routing_table.h

    diff -ur olsrd-0.5.6-r4.orig/src/routing_table.h olsrd-0.5.6-r4/src/routing_table.h
    old new  
    210210bool olsr_cmp_rt(const struct rt_entry *, const struct rt_entry *); 
    211211uint8_t olsr_fib_metric(const struct rt_metric *); 
    212212 
     213#ifndef SVEN_OLA_UNBLOAT 
    213214char *olsr_rt_to_string(const struct rt_entry *); 
    214215char *olsr_rtp_to_string(const struct rt_path *); 
    215216void olsr_print_routing_table(struct avl_tree *); 
     217#endif /* SVEN_OLA_UNBLOAT */ 
    216218 
    217219const struct rt_nexthop *olsr_get_nh(const struct rt_entry *); 
    218220 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/tc_set.c olsrd-0.5.6-r4/src/tc_set.c
    old new  
    336336/** 
    337337 * Format tc_edge contents into a buffer. 
    338338 */ 
     339#ifndef SVEN_OLA_UNBLOAT 
    339340char * 
    340341olsr_tc_edge_to_string(struct tc_edge_entry *tc_edge) 
    341342{ 
     
    350351 
    351352  return buf; 
    352353} 
     354#endif /* SVEN_OLA_UNBLOAT */ 
    353355 
    354356/** 
    355357 * Wrapper for the timer callback. 
     
    686688/** 
    687689 * Print the topology table to stdout 
    688690 */ 
     691#ifndef SVEN_OLA_UNBLOAT 
    689692void 
    690693olsr_print_tc_table(void) 
    691694{ 
     
    711714  } OLSR_FOR_ALL_TC_ENTRIES_END(tc); 
    712715#endif 
    713716} 
     717#endif /* SVEN_OLA_UNBLOAT */ 
    714718 
    715719/* 
    716720 * calculate the border IPs of a tc edge set according to the border flags 
  • olsrd-0.5.6-r4

    diff -ur olsrd-0.5.6-r4.orig/src/tc_set.h olsrd-0.5.6-r4/src/tc_set.h
    old new  
    157157 
    158158/* tc_edge_entry manipulation */ 
    159159bool olsr_delete_outdated_tc_edges(struct tc_entry *); 
     160#ifndef SVEN_OLA_UNBLOAT 
    160161char *olsr_tc_edge_to_string(struct tc_edge_entry *); 
     162#endif /* SVEN_OLA_UNBLOAT */ 
    161163struct tc_edge_entry *olsr_lookup_tc_edge(struct tc_entry *, union olsr_ip_addr *); 
    162164struct tc_edge_entry *olsr_add_tc_edge_entry(struct tc_entry *, union olsr_ip_addr *, uint16_t); 
    163165void olsr_delete_tc_entry(struct tc_entry *); 
  • src/two_hop_neighbor_table.c

    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
    old new  
    203203  return NULL; 
    204204} 
    205205 
     206#ifndef SVEN_OLA_UNBLOAT 
     207 
    206208/** 
    207209 *Print the two hop neighbor table to STDOUT. 
    208210 * 
     
    240242  } 
    241243#endif 
    242244} 
     245#endif /* SVEN_OLA_UNBLOAT */ 
    243246 
    244247/* 
    245248 * Local Variables: 
  • src/unix/ifnet.c

    diff -ur olsrd-0.5.6-r4.orig/src/unix/ifnet.c olsrd-0.5.6-r4/src/unix/ifnet.c
    old new  
    7070 
    7171#define BUFSPACE  (127*1024)    /* max. input buffer size to request */ 
    7272 
     73#ifndef SVEN_OLA_UNBLOAT 
     74 
    7375int 
    7476set_flag(char *ifname, short flag __attribute__ ((unused))) 
    7577{ 
     
    100102 
    101103} 
    102104 
     105#endif /* SVEN_OLA_UNBLOAT */ 
     106 
    103107void 
    104108check_interface_updates(void *foo __attribute__ ((unused))) 
    105109{ 
     
    110114#endif 
    111115 
    112116  for (tmp_if = olsr_cnf->interfaces; tmp_if != NULL; tmp_if = tmp_if->next) { 
     117#ifndef SVEN_OLA_UNBLOAT 
    113118    if (tmp_if->host_emul) 
    114119      continue; 
    115120 
    116121    if (olsr_cnf->host_emul)    /* XXX: TEMPORARY! */ 
    117122      continue; 
     123#endif /* SVEN_OLA_UNBLOAT */ 
    118124 
    119125    if (!tmp_if->cnf->autodetect_chg) { 
    120126#ifdef DEBUG 
     
    154160  OLSR_PRINTF(3, "Checking if %s is set down or changed\n", iface->name); 
    155161#endif 
    156162 
     163#ifndef SVEN_OLA_UNBLOAT 
    157164  if (iface->host_emul) 
    158165    return -1; 
     166#endif /* SVEN_OLA_UNBLOAT */ 
    159167 
    160168  ifp = iface->interf; 
    161169 
     
    281289  } else 
    282290    /* IP version 4 */ 
    283291  { 
     292#ifndef SVEN_OLA_UNBLOAT 
    284293    struct ipaddr_str buf; 
     294#endif /* SVEN_OLA_UNBLOAT */ 
    285295    /* Check interface address (IPv4) */ 
    286296    if (ioctl(olsr_cnf->ioctl_s, SIOCGIFADDR, &ifr) < 0) { 
    287297      OLSR_PRINTF(1, "\tCould not get address of interface - removing it\n"); 
     
    294304    if (memcmp 
    295305        (&((struct sockaddr_in *)&ifp->int_addr)->sin_addr.s_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, 
    296306         olsr_cnf->ipsize) != 0) { 
     307#ifndef SVEN_OLA_UNBLOAT 
    297308      /* New address */ 
    298309      OLSR_PRINTF(1, "IPv4 address changed for %s\n", ifr.ifr_name); 
    299310      OLSR_PRINTF(1, "\tOld:%s\n", ip4_to_string(&buf, ifp->int_addr.sin_addr)); 
    300311      OLSR_PRINTF(1, "\tNew:%s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr)); 
     312#endif /* SVEN_OLA_UNBLOAT */ 
    301313 
    302314      ifp->int_addr = *(struct sockaddr_in *)&ifr.ifr_addr; 
    303315      /* deactivated to prevent change of originator IP */ 
    304316#if 0 
    305317      if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) { 
    306318        OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr)); 
     319#ifndef SVEN_OLA_UNBLOAT 
    307320        olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr)); 
     321#endif /* SVEN_OLA_UNBLOAT */ 
    308322        memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize); 
    309323      } 
    310324#endif 
     
    366380 
    367381remove_interface: 
    368382  OLSR_PRINTF(1, "Removing interface %s\n", iface->name); 
     383#ifndef SVEN_OLA_UNBLOAT 
    369384  olsr_syslog(OLSR_LOG_INFO, "Removing interface %s\n", iface->name); 
     385#endif /* SVEN_OLA_UNBLOAT */ 
    370386 
    371387  olsr_delete_link_entry_by_ip(&ifp->ip_addr); 
    372388 
     
    398414      memset(&olsr_cnf->main_addr, 0, olsr_cnf->ipsize); 
    399415      OLSR_PRINTF(1, "No more interfaces...\n"); 
    400416    } else { 
     417#if !defined(SVEN_OLA_UNBLOAT) 
    401418      struct ipaddr_str buf; 
     419#endif /* SVEN_OLA_UNBLOAT */ 
    402420      olsr_cnf->main_addr = ifnet->ip_addr; 
    403421      OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr)); 
     422#ifndef SVEN_OLA_UNBLOAT 
    404423      olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr)); 
     424#endif /* SVEN_OLA_UNBLOAT */ 
    405425    } 
    406426  } 
    407427#endif 
     
    425445 
    426446  if ((ifnet == NULL) && (!olsr_cnf->allow_no_interfaces)) { 
    427447    OLSR_PRINTF(1, "No more active interfaces - exiting.\n"); 
     448#ifndef SVEN_OLA_UNBLOAT 
    428449    olsr_syslog(OLSR_LOG_INFO, "No more active interfaces - exiting.\n"); 
     450#endif /* SVEN_OLA_UNBLOAT */ 
    429451    olsr_cnf->exit_value = EXIT_FAILURE; 
    430452    kill(getpid(), SIGINT); 
    431453  } 
     
    434456 
    435457} 
    436458 
     459#ifndef SVEN_OLA_UNBLOAT 
     460 
    437461/** 
    438462 * Initializes the special interface used in 
    439463 * host-client emulation 
     
    583607 
    584608  return 1; 
    585609} 
     610#endif /* SVEN_OLA_UNBLOAT */ 
    586611 
    587612static char basenamestr[32]; 
    588613static const char *if_basename(const char *name); 
     
    618643  int tos_bits = IPTOS_TOS(olsr_cnf->tos); 
    619644#endif 
    620645 
     646#ifndef SVEN_OLA_UNBLOAT 
    621647  if (iface->host_emul) 
    622648    return -1; 
     649#endif /* SVEN_OLA_UNBLOAT */ 
    623650 
    624651  memset(&ifr, 0, sizeof(struct ifreq)); 
    625652  memset(&ifs, 0, sizeof(struct interface)); 
     
    726753      ifs.int_broadaddr = *(struct sockaddr_in *)&ifr.ifr_broadaddr; 
    727754    } 
    728755 
     756#ifndef SVEN_OLA_UNBLOAT 
    729757    /* Deactivate IP spoof filter */ 
    730758    deactivate_spoof(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version); 
    731759 
    732760    /* Disable ICMP redirects */ 
    733761    disable_redirects(if_basename(ifr.ifr_name), &ifs, olsr_cnf->ip_version); 
     762#endif /* SVEN_OLA_UNBLOAT */ 
    734763 
    735764  } 
    736765 
     
    760789 
    761790  OLSR_PRINTF(1, "\tMTU - IPhdr: %d\n", ifs.int_mtu); 
    762791 
     792#ifndef SVEN_OLA_UNBLOAT 
    763793  olsr_syslog(OLSR_LOG_INFO, "Adding interface %s\n", iface->name); 
     794#endif /* SVEN_OLA_UNBLOAT */ 
    764795  OLSR_PRINTF(1, "\tIndex %d\n", ifs.if_index); 
    765796 
    766797  if (olsr_cnf->ip_version == AF_INET) { 
     
    865896   */ 
    866897  memset(&null_addr, 0, olsr_cnf->ipsize); 
    867898  if (ipequal(&null_addr, &olsr_cnf->main_addr)) { 
     899#ifndef SVEN_OLA_UNBLOAT 
    868900    struct ipaddr_str buf; 
     901#endif 
    869902    olsr_cnf->main_addr = ifp->ip_addr; 
     903#ifndef SVEN_OLA_UNBLOAT 
    870904    OLSR_PRINTF(1, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr)); 
    871905    olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", olsr_ip_to_string(&buf, &olsr_cnf->main_addr)); 
     906#endif /* SVEN_OLA_UNBLOAT */ 
    872907  } 
    873908 
    874909  /* 
  • src/unix/misc.c

    diff -ur olsrd-0.5.6-r4.orig/src/unix/misc.c olsrd-0.5.6-r4/src/unix/misc.c
    old new  
    4444#include "misc.h" 
    4545#include "olsr_types.h" 
    4646 
     47#ifndef SVEN_OLA_UNBLOAT 
    4748void 
    4849clear_console(void) 
    4950{ 
     
    6970 
    7071  fflush(stdout); 
    7172} 
     73#endif /* SVEN_OLA_UNBLOAT */ 
    7274 
    7375/* 
    7476 * Local Variables: 
Note: See TracBrowser for help on using the browser.