Locked History Actions

attachment:UBNT_SDK3.2_with_olsrd-06.patch of UbntStations

Attachment 'UBNT_SDK3.2_with_olsrd-06.patch'

Download

   1 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/CHANGELOG ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/CHANGELOG
   2 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/CHANGELOG	1970-01-01 01:00:00.000000000 +0100
   3 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/CHANGELOG	2008-08-23 08:23:37.000000000 +0200
   4 @@ -0,0 +1,1626 @@
   5 +This file states changes as of version 0.2.4:
   6 +
   7 +0.5.6 ---------------------------------------------------------------------
   8 +
   9 +PATCHES from Hannes Gredler <hannes@gredler.at>:
  10 +- add small valgrind howto
  11 +- remove the per tc_edge timer
  12 +- add some basic infrastructure for cookies
  13 +  cookies are used to track usage of timer and memory resources
  14 +- add a lightweight memory manager to reduce malloc() churn.
  15 +- eliminate data field from avl_node and list_node and
  16 +  replace this via inline recasts
  17 +- add indentation dotfile for future code cleanup
  18 +- refactor the timer implementation, get rid of timeout functions
  19 +  all manipulations done in constant time.
  20 +- use calloc rather than malloc for lazy callers
  21 +- log RIB add/del transactions only if there is an actual route change
  22 +- fix to to always insert a HNA Net when receiving a HNA refresh
  23 +- fix delete all routes if the last IP address is gone
  24 +
  25 +PATCHES and BUGFIXES from Henning Rogge <rogge@fgan.de>
  26 +- Bugfix for fragmented TC sequence numbers
  27 +- eliminate second timer for edge garbage collection (aka border code).
  28 +- fix SPF bug
  29 +- fix for jitter calculation
  30 +- refactor linkset code
  31 +- add netsimpcap, a network simulation device
  32 +- parser refactoring
  33 +- fix for possible overflow in fpm plugin
  34 +
  35 +PATCHES and BUGFIXES from Sven-Ola Tuecke <sven-ola@gmx.de>:
  36 +- add a fixed-point math implementation, which saves
  37 +  a great deal of CPU on embedded devices
  38 +- fix for Link quality dijkstra limit
  39 +
  40 +PATCHES and BUGFIXES from Aaron Kaplan <aaron@lo-res.org>:
  41 +- fix openbsd warnings / compile errors about sprintf strcpy
  42 +
  43 +BUGFIX from Erik Tromp <erik_tromp@hotmail.com>:
  44 +- update in bmf due to new flags field in tc_edge_entry
  45 +
  46 +PATCH from Clemens Hopfer <datacop@inode.at>:
  47 +- dot_draw plugin: close the connection after graph output.
  48 +
  49 +PATCH from Joe Gio <joezgio@gmail.com>:
  50 +- track if AC power is connected/disconnected
  51 +
  52 +PATCH from Hagen Paul Pfeifer <hagen@jauu.net>:
  53 +- import jenkins hash for good hash calculations
  54 +
  55 +PATCH from Andres Ambrois <andresambrois@gmail.com>:
  56 +- nameservice plugin: add parameters for SIGHUPing other daemons, or calling scripts
  57 +
  58 +PATCH from Markus Kittenberger <Markus.Kittenberger@gmx.at>:
  59 +- txtinfo plugin: add more http options
  60 +
  61 +0.5.5 ---------------------------------------------------------------------
  62 +
  63 +BUGFIX from Andreas Jacobs <andjac@kawo1.rwth-aachen.de>:
  64 +- calculate correct sleeptime
  65 +
  66 +BUGFIX from Dario Borriello <dario_bodj@hotmail.com>:
  67 +- do not update LQ if not configured
  68 +
  69 +BUGFIX from Jo-Philipp Wich <freifunk@wwsnet.net:
  70 +- fix olsr_ip_to_string() buffer quirk
  71 +- fix txtinfo format quirks in HNA table
  72 +- name-service plugin - write MID entries to hosts file
  73 +- avoid infinite loop in the message parser
  74 +
  75 +PATCH by John Hay <jhay@meraka.org.za>:
  76 +- compile clean on FreeBSD
  77 +- bugfix: do not account for IP headers when building MID6 messages
  78 +
  79 +PATCHES from Henning Rogge <rogge@fgan.de>:
  80 +- join LQ and non-LQ Hello execution paths
  81 +
  82 +PATCHES from otti <otti@wirdorange.org>:
  83 +- rttable-default: configures a new policy routing table for the default route
  84 +
  85 +BUGFIXES and PATCHES by Sven-Ola Tuecke <mail2news@commando.de>:
  86 +- Windows Vista: add interface metric to SPF computed metric
  87 +- lqtc-seqno: Optimize check for old seqno numbers in LQTC messages
  88 +- lqnatthresh: maintain an advantage for the current (NAT) inet gw
  89 +- fisheye-startup: Changed to MAX_TTL for the first 32 LQTCs
  90 +- Added and removed files necessary for win32 compile
  91 +- Fix for hg: do not remove anything in .hg with 'make uberclean'
  92 +- 104-olsrd-verysmallfix
  93 +- 105-fix-lq-buffer-quirks
  94 +- 106-fix-seqnocheck
  95 +- 110-bmf-v152
  96 +- 121-olsrd-fib-metric-approx
  97 +- 133-fix-lqneigh
  98 +- 136-optimize-invalidip-check
  99 +- 138-optimize-message-generation
 100 +
 101 +BUGFIX from Lorenz Shori <lorenz.schori@gmx.ch>:
 102 +- Mac OSX compile fixes
 103 +
 104 +BUGFIXES and PATCHES by Hannes Gredler <hannes@gredler.at>
 105 +- fix not deleted tc entry.
 106 +- avoid setting routes with an invalid/impossible netmask.
 107 +- refactoring of TC parsing to kill another pile of malloc()/free()s
 108 +  saving (again) code and especially run.time performance.
 109 +- RIB Refactoring, Part 2:
 110 +  - avoid the periodical rib-tree insertion
 111 +  - add a FOR_ALL_HNA_RT_ENTRIES() macro for the snmp folks
 112 +    (or any parties who want to walk HNA entries).
 113 +  - add an olsr_cnf option 'flat_fib_metrics' which defaults to TRUE.
 114 +- fix broken prefix insertion (regression of the RIB refactoring)
 115 +- squelsh compiler warnings on Mac OSX
 116 +
 117 +PATCH by John Hay <jhay@meraka.org.za>:
 118 +- also printout our own HNAs in the dotdraw plugin.
 119 +
 120 +PATCH by Patrick McCarty <mccartyp@gmail.com>:
 121 +- fixed compile errors in the BSD port
 122 +
 123 +PATCHES by Sven-Ola Tuecke <mail2news@commando.de>:
 124 +- 102-olsrd-cvs-fixes.patch: use different buffers in the same printf()
 125 +- 103-olsrd-rt-exportroute-cleanup.patch: avoid a malloc()ed list of functions
 126 +- 132-save-the-fish.patch: really save the fish and avoid to forward invalid
 127 +  messages from older olsrd versions
 128 +- 135-georss-map-for-nameservice.patch: fixes and extensions for the namesaervice plugin
 129 +- 138-olsrd-fixdotdraw.patch: fix the dot_draw plugin
 130 +(all to be found on http://download-master.berlin.freifunk.net/sven-ola/nylon/packages/olsrd/files/)
 131 +- Replaced "which" with a /bin/sh script snippet
 132 +
 133 +PATCHES and CLEANUPS by Bernd Petrovitsch <bernd@firmix.at>
 134 +- Jens Nachtigall <nachtigall@web.de> suggested (and reminded) to use
 135 +  olsrd.conf.default.lq as the default installed one.
 136 +  It makes much more sense as - to the best of my(bernd's) knowledge - all
 137 +  larger networks uses the LQ extensions. And new customers should better
 138 +  be pushed in that direction.
 139 +- with the help of Patrick McCarty <mccartyp@gmail.com>, we got olsr to build
 140 +  on OpenBSD again:
 141 +  * OpenBSD'd `sed` is pretty conservative and doesn't understand 's|re|sub|'.
 142 +    So we fall back to the old 's/re/sub/' and quote all '/' and '.' correctly
 143 +    (which was the main reason to use '|').
 144 +    And while I'm at it: Remove the useless $(CCACHE) from the $(CC) for
 145 +    dependency generation and beautify (read: "$(strip)") $(CPPFLAGS).
 146 +  * OpenBSD needs an explicit "#include <sys/types.h>" before
 147 +    "#include <netinet/in.h>".
 148 +- fixed lib/secure/src/md5.h: This was broken as it had
 149 +  "typedef unsigned long int UINT4;". "unsigned long int" is 8 bytes on x86_64.
 150 +  We are using now the standardized types from <inttypes.h>.
 151 +- fixed warnings and improved lib/secure/src/md5.c:
 152 +  * we are using memcpy() and memset() instead of the open-coded loops as
 153 +    suggested 
 154 +  * const'ified
 155 +  * added function prototypes for static functions
 156 +  * moved static functions to the top so that their declaration is before
 157 +    their use to allow gcc to inline if only used once.
 158 +  It remains ugly - God knows why there are that so many useless
 159 +  type-casts.
 160 +- Some minor and trivial cleanup: Added two functions to calculate the ETX
 161 +  value from a struct tc_edge_entry and a struct link_entry, respectively.
 162 +  And use them everywhere.
 163 +- added http://meshcube.org/nylon/utils/olsr-topology-view.pl into
 164 +  lib/httpinfo/misc as suggested by Jens Nachtigall <nachtigall@web.de>
 165 +- Killed "struct olsrd_config *cnf" in src/cfgparser/olsrd_conf.h and replaced
 166 +  it's usage with "olsr_cnf" from src/defs.h.
 167 +  Serious cleanup: olsrd_get_default_cnf() does no longer initialize the global
 168 +  "cnf" variable" but uses a local one which is returned as before. And
 169 +  olsrd_parse_cnf() does no longer return the global variable it is working on.
 170 +- Merged "struct hna4_entry" and "struct hna6_entry" into
 171 +  "struct local_hna_entry" (as "struct hna_entry" is a different thing)
 172 +  Both have almost the same data (IP address + netmask/prefix) so we use
 173 +  the quite new "struct olsr_ip_prefix" to store it.
 174 +  Also merged the "hna4" and "hna6" pointer in "struct olsr_config" -
 175 +  look at the global "olsr_cnf->ip_version".
 176 +- added a olsr_ip_prefix_to_string() function
 177 +- .h file cleanup: def.h does not longer include net_olsr.h because it 
 178 +  doesn't needs it.
 179 +- more type safety: the macros COPY_IP() and COMP_IP are gone and replaced
 180 +  with "=" or similar "normal" C operations. There are also now the inline
 181 +  functions ip4cmp() and ip4equal() to work on "struct in_addr", ip6cmp()
 182 +  and ip6equal() to work on "struct in6_addr" and ipcmp() and ip6equal()
 183 +  to work on "union olsr_ip_addr".
 184 +  Most (or even more precise: almost all) uses of COPY_IP() and COMP_IP()
 185 +  are in "if (olsr_cnf->ip_version) { ... } else { ... }" anyway to
 186 +  there is no reson to copy an IPv4 address effectively with
 187 +  "memcpy(&dst, &src, 4)" or compare with memcmp(&a, &b, 4)" wher the
 188 +  always "4" is stored in a variable inhibiting compiler optimization.
 189 +  There is also the deprecated function genipcopy() mimicking the old
 190 +  typeless COPY_IP() macro for the last few places where a cleanup is
 191 +  needed anyways.
 192 +  There also lots of old macros left over (commented out of course) until
 193 +  we are confident that everything works. And then I will kill them too.
 194 +- Fixed the misleading definition of "v4" in "struct olsr_ip_addr" fom
 195 +  "olsr_u32_t" (in network-byteorder!) to "struct in_addr". Lots of
 196 +  temporary variables to call inet_ntoa()/inet_ptoa() vanished .....
 197 +- We have now ip4_to_string(), ip6_to_string() and olsr_ip_to_string()
 198 +  to print a "struct in_addr", "struct in6_addr" and "union olsr_ip_addr"
 199 +  into a string buffer.
 200 +- cleanup: olsr_ip_to_string() and similar non-reentrant functions now must
 201 +  get a target buffer. To ease that, there is the "struct ipaddr_str"
 202 +  which is large enough for all of them (read: for an IPv6 address). This
 203 +  also removes the cyclic buffer there.
 204 +  All of these function return a "const char *" which can be directly used
 205 +  for printf(3) and friends.
 206 +- const'ified more functions
 207 +- converted the source to UTF-8.
 208 +- "struct sig_msg" uses an olsr_u8_t for a byte array (and not "char")
 209 +- force the few inline function to always be inlined.
 210 +- #ifdef the body of the olsr_print_hna_set() and olsr_print_neighbor_table()
 211 +  if nothing is done
 212 +- declare "int_addr", "int_netmask" and "int_broadaddr" in "struct interface"
 213 +  as "struct sockaddr_in" since it is that what we actually want there (and
 214 +  it is similar to the IPv6 code).
 215 +- updated the olsrd.conf.default.lq-fisheye to the Debian-deliverd version
 216 +  after recent discussions olsr-dev@olsr.org
 217 +- use "inline_avl_comp_ipv4()" in "avl_comp_ipv4()"
 218 +- clean up the routes on more signals. Basically we want to do this on all
 219 +  signals which terminate the program.
 220 +- killed a superflous global buffer in src/main.c
 221 +- made inline functions from avl_walk_{first,last,next,prev} and created
 222 +  "const" versions of it. inline_avl_comp_ipv4() is now also an inline function
 223 +  (and not a macro)
 224 +- created a typedef's for various function pointers - much easier to read.
 225 +- cleanup: compare tree->comp (adn other pointers)) to NULL (and not 0)
 226 +- killed superflous "return"s at the end of void functions
 227 +- const'ified more parameters in many more functions in the .h and
 228 +  .c files
 229 +- init-functions with constant or ignored return values are "void"
 230 +- created a typedef fro the callback in "struct export_route_entry"
 231 +  and using it!
 232 +- moved the initialization of the {add,chg,del}_kernel_list variables
 233 +  into process_routes.c. So they are now "static" there.
 234 +- olsr_export_{add,del}_route{,6} are now static in process_routes.c
 235 +  since they are not used elsewhere.
 236 +- olsr_addroute_add_function() and olsr_deldroute_add_function() were
 237 +  almost identical - made one function out of it.
 238 +  Same for olsr_addroute_del_function() and olsr_deldroute_del_function().
 239 +- fixed the sort order in avl_comp_ipv4_prefix(): We compare now the IPv4
 240 +  values in host byte order (and not network byte order). So the route
 241 +  list in the e.g. httpinfo plugin is now nicely sorted.
 242 +- fixed and improved the `gcc-warnings` script:
 243 +  * support older gcc's (as on Debian/Sarge) as they have slightly different
 244 +    error messages
 245 +  * removed superflous lines
 246 +  * replaced the call of `sed` with shell built-in features fixing syntax
 247 +    errors on Debian/Sarge
 248 +  * set all locale-relevant variables to "C" (just to be sure)
 249 +- consolidated ip{4,6,}{cmp,equal}: all are nwo inline functions using only
 250 +  the minimal necessary operations. Thanks to Hannes Gredler
 251 +  <hannes@gedler.at> and Sven-Ola Tuecke <mail2news@commando.de> for pointing
 252 +  that out and suggesting the `inline`, respectively.
 253 +  use ip{4,}cmp in lq_avl.[ch] to resue the code. inline_avl_comp_ipv4
 254 +  is superflous now (and replaced by ip4cmp) and use the global MIN and MAX
 255 +  macro instead of AVLMIN and AVLMAX
 256 +- killed netmasks from the IPv4 part of the code and use the prefixlen there
 257 +  (similar to thte IPv6 part). Manymore details on
 258 +  http://lists.olsr.org/pipermail/olsr-dev/2007-November/001464.html
 259 +- removed the superflous "open_ipc" field from the "struct olsrd_config" as
 260 +  it contains only the equivalent of "olsr_cnf->debug_level > 1".
 261 +- inspired by Sven-Ola Tuecke: avoid a bash'ism (i.e. "OPTS="${OPTS//$opt}") in
 262 +  gcc-warnings and ld-warnings. But we do not replace it with `sed` (since it
 263 +  costs a fork(2) and an exec(3)) but also with shell code which doesn't use
 264 +  any external program.
 265 +- added configuration file support for "flat fib metrics".
 266 +
 267 +0.5.4 ---------------------------------------------------------------------
 268 +
 269 +QUAGGA by Immo 'FaUl' Wehrenberg <immo.olsr@do.bundessicherheitsministerium.de>
 270 +- updated to svn version 33
 271 +
 272 +BMF PLUGIN  by Erik Tromp <erik_tromp@hotmail.com>
 273 +- updated to 1.5.1
 274 +- updated to latest plugin interfaces changes and killed warnings (by Bernd
 275 +  Petrovitsch <bernd@firmix.at>)
 276 +
 277 +PATCH by Hannes Gredler <hannes@gredler.at> which rewrites the route handling.
 278 +To quote him:
 279 +----  snip  ----
 280 +change list:
 281 +- get rid of separate routing tables for HNA and per-node routes, everything is
 282 +  now unified in an AVL routing tree (&routingtree)
 283 +
 284 +- introduce walking macros (OLSR_FOR_ALL_RT_ENTRIES()) that hide the internal
 285 +  structure of the RIB for making life of the plugin authors easier.
 286 +
 287 +- get rid of different SPF implementations for LQ and non-LQ code paths. a
 288 +  non-LQ edge is simply substituted with a cost of 1.0
 289 +
 290 +- get rid of host masks - a new data type olsr_prefix is introduced which is
 291 +  basically an ip address plus a prefix length.
 292 +
 293 +  do not install the metric in the kernel FIB - for the kernel its pointless
 294 +  if the route gets installed with a metric of N or M.
 295 +
 296 +  we do not need to update the kernel FIB if we have hop count only changes
 297 +  (for example if there is a reroute action further downstream)
 298 +
 299 +  the only things which triggers a kernel FIB route update is a next hop
 300 +  change (a next hop is neighboring gateway router plus an interface).
 301 +
 302 +  all OLSR routes are installed with a metric of 2
 303 +
 304 +- separate between rt_entry and rt_path - the former is a route installed in the
 305 +  kernel with an next hop. the latter is a candidate for best path selection
 306 +  after SPF calculation has been done. in the rt_entry we keep a pointer to the
 307 +  best_path and also to the next hop that was installed in the kernel FIB.
 308 +
 309 +  we always keep all originator of a route, if a route originator goes away we
 310 +  can easy recompute the best path for the route.
 311 +
 312 +  the next hop in the rt_entry gets only updated upon a successful route_add
 313 +  call - that way we always remember what next hop to delete.
 314 +
 315 +  stray routes should be history now.
 316 +
 317 +- tweak the linked list toolkit to operate on circular lists.
 318 +
 319 +- get rid of malloc calls for building the kernel update list. the list node is
 320 +  now embedded in the rt_entry.
 321 +
 322 +- introduce three queues (add/chg/del) for kernel updates.
 323 +
 324 +- for neighbor route dependency tracking the neighbor routes are queued first or
 325 +  last (depending on which queue you work on)
 326 +
 327 +- rework all the plugins which directly manipulate rt entries.
 328 +
 329 +- rework the plugins that read from the routing table (most notably nameserver,
 330 +  httpinfo and quagga plugin)
 331 +
 332 +- lots of comments that explains the intentions and purpose of this code-piece.
 333 +
 334 +non RT related stuff:
 335 +- use a list rather than a tree for storing the post-SPF results, which further
 336 +  improves the raw-SPF runtime.
 337 +
 338 +- add display of SPF runtime (masked behind #ifdef SPF_PROFILING)
 339 +
 340 +- http://gredler.at/download/olsrd/neighbor_routes3.diff: This updates the own
 341 +  IP address (read: the main address) after changes (e.g. on
 342 +  `ifup wlan0; sleep 1; ifdown wlan0`) and kills the
 343 +  olsr_fill_routing_table_with_neighbors() function.
 344 +----  snip  ----
 345 +And Sven-Ola Tuecke <mail2news@commando.de> fixed an instability issue on interface
 346 +up/down operations (see 102-olsrd-rt-refactoring-fixes.patch below) and a missing
 347 +initialization.
 348 +
 349 +PATCH by Hannes Gredler <hannes@gredler.at> which "consolidates
 350 +the link-state database and the spf-calculation in order
 351 +to calculate routes more efficiently".
 352 +To quote him (more):
 353 +----  snip  ----
 354 +- use the link-state (tc) database for SPF calculations rather than
 355 +  replicating the notion of vertices and edges for a SPF run.
 356 +  this heavily reduces malloc() calls and shrinks the total CPU
 357 +  load of the route calculation path between 60%-80%.
 358 +----  snip  ----
 359 +
 360 +PATCHES by Sven-Ola Tuecke <mail2news@commando.de> to be found on from
 361 +http://download-master.berlin.freifunk.net/sven-ola/nylon/packages/olsrd/files/
 362 +- 102-olsrd-rt-refactoring-fixes.patch
 363 +  Because you changed a lot of basics: It's time to handle a general
 364 +  flaw in the routing system. Plase take a look at chk_if_changed(). This
 365 +  will free() any "struct interface" pointer without warning at any time.
 366 +  This is why it's possile to SEGV olsrd with a simple "ifdown xxx".
 367 +  The patch replaces the (maybe) invalid pointer with an index reference
 368 +  "iif_index". You can always ask the OS for a name. Please note, that I do
 369 +  not have a working BSD toolchain, so I've placed an #error in the IPv6
 370 +  BSD-part where the author/porter has started to hack something funny.
 371 +
 372 +- 110-olsrd-double-wlancard-neigh-hack.patch:
 373 +  This is a hack for Nodes having to wifi cards with the same channel,
 374 +  bssid, IP-Range etc. If two nodes can see each other by means of two
 375 +  possible links (here: two wifi cards with equal config), a bug is  triggered
 376 +  with the Neigh-is-SYM detections. This small little hack prevents this.
 377 +
 378 +- 112-olsrd-nameservice-fixemptyname.patch:
 379 +  This is an addon to my lat/lon stuff which will prevent olsrd from
 380 +  running (oops?) if no hostname is given and the nameservice plugin
 381 +  is loaded.
 382 +
 383 +- 113-olsrd-dyngwplain-pluginvers5.patch:
 384 +  This updates the dyngwplain plugin to the new Plugin Iface
 385 +
 386 +- 140-olsrd-arprefreshed.patch:
 387 +  This is a new one. Opens a packet socket and listen to UDP(698), extract
 388 +  the sender MAC and refreshes the ARP cache whith that. Should speedup
 389 +  especially in cases, if you initially try to use a longer routing path which
 390 +  normally triggers a "ARP-Lookup-Chain".
 391 +- 106-olsrd-nameserviceparams.patch:
 392 +  This patch converts more plugins to the new interface version.
 393 +- 104-olsrd-policy-routing.patch
 394 +  Reworked this one to discard GPL helper functions. Also checked IPv6 and
 395 +  re-included the IPC hookup. The patch adds a "RtTable [number]" for
 396 +  /etc/olsrd.conf which is simply the Linux
 397 +  policy routing table to use. Defaults to 254 (== main).
 398 +  This patch was modified/clenaed up by <bernd@firmix.at> to use "#if"
 399 +  instead of "#ifdef" as it's more robust against typos.
 400 +- 110-olsrd-fixpacketprint.patch, 112-olsrd-nameservice-fixemptyname.patch,
 401 +  113-olsrd-txtinfo-fixhttpget.patch, 114-olsrd-timeoutlimit.patch,
 402 +  115-olsrd-nameserviceparamfix.patch and
 403 +  116-olsrd-fix-pluginparam-addons.patch fixing the compilation warning
 404 +  on 64bit and lots of other improvements.
 405 +- "Save the fish" patch: Avoid forwarding of packets with too low TTL. This
 406 +  kills lots of packet forwarding storms.
 407 +  NB: The oneliner was applied by hand by BP and formatted to look (in BPs O)
 408 +  more readable.
 409 +
 410 +PATCH by Arnd Hannemann <hannemann@i4.informatik.rwth-aachen.de>
 411 +olsr_makefile_make_use_of_exename.patch
 412 +- This patch makes sure that the EXENAME variable of Makefile.inc is used
 413 +  in Makefile.
 414 +
 415 +PATCHES by John Hay <jhay@meraka.org.za>
 416 +- update to new FreeBSD WLAN API
 417 +- do not require /bin/bash, use /bin/sh
 418 +- Fixed alignment so that olsrd runs on FreeBSD/arm
 419 +- allow more interface in an IPv6 subnet on FreeBSD
 420 +- use PREFIX and DESTDIR as all the other Makefile.$OS also for FreeBSD
 421 +- make txtinfo plugin work with IPv6
 422 +
 423 +PATCH by Andreas Jacobs <jacobs@i4.informatik.rwth-aachen.de>
 424 +- fix the loss link quality calculation for "windows size % 4 != 0"
 425 +
 426 +PATCH by Acinonyx <acinonyxs@yahoo.gr>
 427 +- Bug fix: include $(TOPDIR)/Makefile.inc at the begin in the Quagga plugin
 428 +
 429 +PATCH by David Cornejo <dcornejo@gmail.com>
 430 +- fixed an "+=" of an uninitialized variable (detected with/by the
 431 +  scan.coverty.com).
 432 +
 433 +BUG reported by Aaron Kaplan <aaron@lo-res.org>
 434 +- BSD-xargs doesn't know "-r".
 435 +
 436 +PATCHES and CLEANUPS by Bernd Petrovitsch <bernd@firmix.at>
 437 +- Made a function from the ME_TO_DOUBLE() macro (in src/mantissa.h).
 438 +  This saves code throughout the code even on i386 and will even more
 439 +  on architectures without floating point units and "-msoft-float".
 440 +- And the mathemathics in src/mantissa.h is reformulated to minimize
 441 +  floating point operations to save CPU power - especially on embedded
 442 +  devices.
 443 +- I rewrote the half of src/lq_packet.[ch] which deals with incoming
 444 +  packets. This was triggered with performance output of gcc produced
 445 +  by Sven-Ola Tuecke at CCCamp07.
 446 +  This kills *lots* of (more than) superflous malloc()s and the same
 447 +  number of (free()s). And it also kills some code and copying around of
 448 +  data.
 449 +- Make it compile without warning with flex-2.5.33 (to be found on Fedora 7
 450 +  and Gentoo in Sep-2007) again.
 451 +
 452 +- converted the dyn_gw plugin to plugin interface version 5 (which leaves
 453 +  the quagga plugion as the last with the old one).
 454 +- paving the way to activate -Wshadow, much more to do
 455 +- const-ify parameters here and there
 456 +- use NULL for pointers (and not "0")
 457 +- Killed "extern" declarations in (not generated) .c files
 458 +
 459 +- Based on a patch by Gianni Costanzi <gianni.costanzi@gmail.com> (so credits
 460 +  and thanks have to go there):
 461 +  added OS_CFLAG_PTHREAD Makefile variable since gcc (on Linux) requests this
 462 +  in the manual page.
 463 +  Changes/additions:
 464 +  - I added definitions to all OS-specific Makefile.$OS with the value similar
 465 +    to the value in OS_LIB_PTHREAD (either empty or "-pthread").
 466 +  - The variable is added to CPPFLAGS (and not CFLAGS) since CPPFLAGS is used
 467 +    for all cpp and gcc calls (and gcc's man page indicates that it sets
 468 +    variables for both of them).
 469 +
 470 +0.5.3 ---------------------------------------------------------------------
 471 +
 472 +URGENT BUG FIX
 473 +Ignacio García Pérez <iggarpe@terra.es> found a serious bug in the dot-draw
 474 +plugin and identified it's source.
 475 +
 476 +BUG FIX
 477 +The bmf plugin wanted to kill a not-started thread and this causes a segmentation
 478 +violation. This happens if the old plugin interface support is not compiled in
 479 +and one uses - or more asccurate: wants to use - the bmf plugin which uses that
 480 +ATM. Thanks to Cedric Krier <ced@ced.homedns.org> for reporting this.
 481 +
 482 +DEPENDENCIES FIXED
 483 +The dependencies (*.d files) are now properly generated and used. And they also
 484 +dependen on the Makefile in the current directory and the Makefile.inc so that
 485 +changes there also lead to new compilation.
 486 +Remember: We support "ccache" so install it to save lot of meaningless recompiles
 487 +if nothing (as seen by the real C compiler, i.e. after the C preprocessor) has
 488 +changed.
 489 +
 490 +BUILD FIX
 491 +Linux/IA64 and Linux/HPPA also need "-fPIC".
 492 +
 493 +CLEANUPS
 494 +- olsr_switch does no longer generate warnings
 495 +- olsr_switch is also built with "build_all" and cleaned with "uberclean"
 496 +- More "const" all over the place.
 497 +- More "static" for local functions and variables.
 498 +- Killed an unnecessary "static" variable.
 499 +
 500 +0.5.2 ---------------------------------------------------------------------
 501 +
 502 +URGENT BUG FIX
 503 +Sven-Ola Tuecke found a serious bug of the class "show stopper" and sent a patch.
 504 +
 505 +PLUGIN CLEANUP
 506 +Plugins handle parameters quite individually (case-sensitive vs case-insensitive,
 507 +different parsing functions for the same values, etc.). Plugin Interface version 5
 508 +now exports a table of { parameter-name, parsing-function, addr-of-storage } and
 509 +it's size. Common functions should be shared.
 510 +
 511 +0.5.1 ---------------------------------------------------------------------
 512 +
 513 +MISC
 514 +Upgrade to olsr-bmf 1.5 from Erik Tromp <erik_tromp@hotmail.com>
 515 +
 516 +latitude/longitude support is now in the nameservice plugin done by
 517 +Sven-Ola Tuecke <mail2news@commando.de>
 518 +
 519 +added the spf refactoring patch from  Hannes Gredler <hannes@gredler.at> which
 520 +saves a noteworthy amount of CPU time. To quote him:
 521 +----  snip  ----
 522 +1. use of an AVL tree as a min-heap implementation
 523 +
 524 +   as a means for efficient sorting.
 525 +   (the etx metric is used as the key in the candidate tree)
 526 +
 527 +2. next-hop propagation
 528 +
 529 +   rather than tracking the previous node in olsr_relax()
 530 +   i have changed that model and pre-populate all one-hop neighbors
 531 +   with their own IP adress as 'next-hop' and pull that
 532 +   pointer up once new paths are explored.
 533 +
 534 +   as a result no walker for counting hops and extracting next-hops
 535 +   is required - it turns out at this is slighly more efficient
 536 +   than the existing behaviour (even with the cache applied).
 537 +----  snip  ----
 538 +
 539 +CLEANUPS
 540 +* moved a only locally needed hack from "union olsr_ip_addr" into the only place
 541 +  where it is needed in hashing.c
 542 +
 543 +0.5.0 ---------------------------------------------------------------------
 544 +
 545 +APPLIED PATCHES FROM FREIFUNK-FIRMWARE
 546 +libsmake, dyngwplain, nameservices+services, tzxtinfo, quagga, quagga-routehandler,
 547 +optimize, fixes from Eric Tromp and Sven-Ola Tuecke, CPU-optimize, secure key, HNA-IP
 548 +
 549 +CLEANUPS
 550 +removed hardcoded limit on the number of interfaces (at least in the Unix part)
 551 +made Makefile targets much more consistent
 552 +
 553 +MISC
 554 +put Bmf-1.3 plugin into it
 555 +
 556 +FreeBSD IPv6 SUPPORT
 557 +
 558 +Patch from John Hay applied.
 559 +
 560 +BUGFIXES
 561 +
 562 +0.4.10 --------------------------------------------------------------------
 563 +
 564 +OLSR NETWORK SIMULATOR
 565 +
 566 +An application called olsr_switch(sorry for the nameclash with the win32
 567 +GUI) has been added. If olsrd is ran using the -hint option it can now
 568 +connect to olsr_switch and be part of a virtual network. This means
 569 +that multiple instances can be ran at the same host! The olsr_switch
 570 +application allows the user to define link variables on all viritual
 571 +links in the network, creating all possible topologies. Read more in
 572 +the readme file.
 573 +
 574 +EXPERIMENTAL FISH EYE ALGORITHM
 575 +
 576 +An experimental algorithm for TTL settings on TC messages has
 577 +been added. Read more in the corresponding README file.
 578 +
 579 +OPENBSD SUPPORT
 580 +
 581 +olsrd now also compiles on OpenBSD systems. Thanks a lot to Holger
 582 +Mauermann for the patches!
 583 +
 584 +BUILDSYSTEM REWRITE
 585 +
 586 +Bruno has rewritten the make system. OS detection is now done
 587 +automagically and the general design is much improved.
 588 +
 589 +IP ADDRESS VALIDATION
 590 +
 591 +Olsrd now maintains a set of IP addresses that is considered
 592 +invalid. Checks against this set is done on all received
 593 +OLSR packets announced originator addresses. The dataset can
 594 +be updated dynamically.
 595 +
 596 +PLUGIN INTERFACE
 597 +
 598 +Updated interface version to 3 and added more noticeable warning
 599 +for version missmatch.
 600 +
 601 +MATH LIB DEPENDENCY
 602 +
 603 +The dependency on the math lib came from the use of pow(3) in the
 604 +mantissa/exponent calculation. The calls to pow in this long forgotten
 605 +code, was very unnessecarry. The pow calls are replaced with bitwise
 606 +shifts and -lm is no longer needed.
 607 +
 608 +ICMP REDIRECTS ON LINUX
 609 +
 610 +On Linux systems "0" is now also written to the all/send_redirects
 611 +procfile and not only the pr. interface ones. Hopefully this resolves
 612 +problems reported with systems still sending ICMP redirects.
 613 +
 614 +BUGFIXES
 615 +
 616 +- Fixed init of IPv6 addrtype variable. It used to be uninitialized,
 617 +  causing it to default to site-local and have some weird side-effects.
 618 +- Fixed crash when changing IPv6 address at run-time
 619 +- Fixed a bug that prevented setting willingness 0 in the configfile
 620 +- Fixed bad handling of missing command line arguments
 621 +- Did various updates to prevent assertion when a neighbor
 622 +  has changed IP and sends HELLO before its olsrd precess has detected
 623 +  the change.
 624 +- Fixed return value check on times(2) calls in the scheduler
 625 +- Fixed bug(s) that could cause crash when an interface was brought
 626 +  down while olsrd was running.
 627 +- Removed the silent (read: unchecked) hard limit of 16 interfaces.
 628 +- Compiles now cleanly on 64bit (e.g. x86_64).
 629 +
 630 +0.4.9 ---------------------------------------------------------------------
 631 +
 632 +OPTIMIZATIONS
 633 +
 634 +The MID database is now also indexed by alias addresses. this makes
 635 +look-ups of main addresses based on alias addresses _much_ faster.
 636 +The mid_lookup_main_addr function alone has gone from >30% of the
 637 +total CPU time used by olsrd to <1%.
 638 +PLUGIN DEVELOPERS: datatypes for MID entries has been changed.
 639 +
 640 +Routing table calculation in the LQ case now uses balanced binary
 641 +trees instead of linked lists, which makes look-ups much faster.
 642 +
 643 +The debug output function olsr_printf() is not used by olsrd
 644 +internals any more. Instead the macro OLSR_PRINTF is to be used.
 645 +This macro does debug level testing _before_ doing any function
 646 +calls(both printf itself and parameters to printf). This is a much
 647 +more optimized way of doing debug output. In addition olsrd can
 648 +be built without any debug output code if doing 'make NODEBUG=1'.
 649 +
 650 +TIMEOUT OF DATASETS
 651 +
 652 +Validity times for dataset entries are now set using the clock_t type
 653 +(used to be struct timeval). This data is now fetched from the times(2)
 654 +function instead of gettimeofday(2). This prevents possible problems
 655 +if the system time is changed.
 656 +PLUGIN DEVELOPERS: Note that datatypes for close to all dataset entries
 657 +(link, neighbor, mid, hna, tc etc.) has been changed!!
 658 +
 659 +CONFIGURATION FILE
 660 +
 661 +Multiple interfaces can now use the same interface configuration block.
 662 +Example:
 663 +Interface "if0" "if1" "if2"
 664 +{
 665 +	.....
 666 +}
 667 +
 668 +Interface configurations now also support the "Weight" directive. When
 669 +olsrd finds multiple links to a neighbor it will choose the link
 670 +going via the interface with the lowest weight. Olsrd normally
 671 +sets this weight dynamically based on interface characteristics,
 672 +but if the user wishes to set a fixed weight in a interface(or
 673 +a group of interfaces), this directive is now available.
 674 +
 675 +Moreover, interface configurations now support the "LinkQualityMult"
 676 +directive. It takes an IP address and a multiplier as arguments.
 677 +
 678 +Example:
 679 +
 680 +Interface "if0"
 681 +{
 682 +  [...]
 683 +
 684 +  LinkQualityMult 192.168.0.1 0.7
 685 +  LinkQualityMult default 0.5
 686 +
 687 +  [...]
 688 +}
 689 +
 690 +The idea is to make certain links via the configured interface
 691 +artificially worse or better than they really are. The first parameter
 692 +specifies the IP address of a neighbour interface. The second
 693 +parameter is the multiplier to be applied to the link to the specified
 694 +neighbour interface.
 695 +
 696 +After we have derived the link quality from the packet loss among the
 697 +packets received from the specified neighbour interface, we multiply
 698 +the link quality by the given multiplier. So, the multiplier changes
 699 +the LQ value that we use when determining the ETX, which is 1 / (LQ *
 700 +NLQ).
 701 +
 702 +If "default" is given as the IP address then the multiplier applies to
 703 +all links via the configured interface. Note, however, that olsrd only
 704 +assigns one multiplier to each link. It does so in the following way.
 705 +
 706 +* If there is a "LinkQualityMult" line that matches the IP address of
 707 +  the link's neighbour interface, then use the multiplier in this
 708 +  line.
 709 +
 710 +* If there isn't any matching line, then look for a "default" line. If
 711 +  there is a "default" line, then use the multiplier in this "default"
 712 +  line.
 713 +
 714 +* Otherwise use 1.0, i.e. do not modify the LQ value at all.
 715 +
 716 +Hence, a line with an IP address has priority over a "default" line.
 717 +
 718 +In the above example, the LQ value of the link between the local
 719 +interface if0 and the neighbour interface 192.168.0.1 would be
 720 +multiplied by 0.7. All other links between the local interface if0 and
 721 +a neighbour interface would be multiplied by 0.5.
 722 +
 723 +IPV6 SOCKETS
 724 +
 725 +The socket option IPV6_V6ONLY is now set on IPv6 sockets in linux.
 726 +This means that olsrd will no longer receive IPv4 traffic when
 727 +running in IPv6 mode.
 728 +This should enable users to actually run one olsrd instance using
 729 +IPv6 and one using IPv4 at the same time :)
 730 +
 731 +PLUGINS
 732 +
 733 +The httpinfo, dyn_gw and dot_draw plugins now all include olsrd
 734 +headerfiles directly. A plugin should define OLSR_PLUGIN before
 735 +including olsrd headers. Doing things this way removed the
 736 +redundant datatype definitions that has so often caused trouble
 737 +when things has been updated in olsrd.
 738 +
 739 +NETBSD SUPPORT
 740 +
 741 +olsrd now also compiles on NetBSD systems. Use 'make OS=nbsd' to
 742 +build. This port is not very well tested and feedback is greatly
 743 +appreciated.
 744 +
 745 +EXPERIMENTAL MULTI-INTERFACE CODE FOR FREEBSD
 746 +
 747 +Experimental code using libnet can be compiled in allowing multiple
 748 +interfaces to be used in FreeBSD.  You enable this by compiling using
 749 +OS=fbsd-ll.  You must have libnet-devel installed for this to work
 750 +(/usr/ports/net/libnet-devel).
 751 +
 752 +OTHER UPDATES
 753 +
 754 +- WLAN devices are now detected in FreeBSD
 755 +- First specified interfaces IP is used as main address.
 756 +- Broadcastflag is not checked on interface if fixed broadcast is
 757 +  set in config.
 758 +- Removed Linux link layer code as this was not really in use.
 759 +- Added -nofork command line option
 760 +
 761 +BUGFIXES
 762 +
 763 +- Link sensing now works according to announced vtime from
 764 +  neighbors. Previously links going symmetric->asymmetric
 765 +  were not necessarily detected until the holding time expired.
 766 +- A bug in route addition/removal that could lead to routes
 767 +  using GWs being added before the actual route to the GW
 768 +  was set up, has been fixed.
 769 +- A bug in the interface selection in route calculation has been
 770 +  fixed. New routes are no longer added prior to deleting old ones,
 771 +  since this caused trouble.
 772 +- A bug in the IPv6 multicast address configuration has been fixed.
 773 +  This caused olsrd not to work with global IPv6 addresses.
 774 +- A bug in the IPv6 prefix-from IPaddr function has been fixed. This
 775 +  bug caused HNA prefixes to always be calculated to 0.
 776 +- If a 2-hop neighbor is also a 1-hop neighbor, a bug made olsrd
 777 +  prefer a bad direct link to a better link via an MPR.
 778 +- If a link or interface lookup failed, olsrd crashed.
 779 +- Fixed a crash in the LQ packet generation code based on a
 780 +  signed/unsigned integer comparison.
 781 +
 782 +
 783 +0.4.8 ---------------------------------------------------------------------
 784 +
 785 +LICENSE CHANGE
 786 +
 787 +Olsrd is now distributed under a BSD style license. We believe olsrd will
 788 +be better off using this license as it opens up for commercial players
 789 +to use olsrd freely in their products. In the end this will lead to
 790 +this kind of users doing serious testing and bug fixing of olsrd.
 791 +
 792 +ETX-LIKE LINK QUALITY DETECTION
 793 +
 794 +We can now determine the packet loss on a link by looking at the serial
 795 +numbers of the OLSR messages received from a neighbor. This tells us how
 796 +many packets get through from our neighbor to us. We use a new extended
 797 +kind of HELLO messages (LQ_HELLO messages, LQ = link quality) to broadcast
 798 +the link quality that we have determined on our end of the link to our
 799 +neighbors. So do our neighbors, and we as well as they end up with an
 800 +idea of how good the link is in both directions. From the LQ_HELLOs we
 801 +also learn the link quality between our neighbors and our two-hop neigh-
 802 +bors. In this way we can select those neighbors as MPRs that have the
 803 +best links to our two-hop neighbors. To distribute the link quality
 804 +throughout the network, we use a new extended version of TC messages
 805 +(LQ_TC messages). They contain the qualities at both ends of each of our
 806 +links. Nodes can then run Dijkstra's algorithm to find a path between
 807 +themselves and other nodes that minimizes the packet loss.
 808 +
 809 +If the newly introduced "LinkQualityLevel" is set to zero in the
 810 +configuration file, link quality is not used and the daemon behaves as
 811 +before, i.e. as specified by the OLSR RFC. If this parameter is set
 812 +to 1, LQ_HELLOs and LQ_TCs are used instead of HELLOs and TCs, link
 813 +quality is measured and MPRs are selected based on the link qualities.
 814 +If this parameter is set to 2, the routing table is additionally
 815 +calculated based on the link qualities.
 816 +
 817 +Setting "LinkQualityLevel" to a non-zero value BREAKS COMPATIBILITY. You
 818 +will then not be able to participate in RFC-conformant OLSR networks
 819 +any longer. This is because we use LQ_HELLOs and LQ_TCs instead of HELLOs
 820 +and TCs in this case.
 821 +
 822 +It's best practice to set "LinkQualityLevel" to the same value on all
 823 +nodes in a network.
 824 +
 825 +When determining the quality of a link olsrd only considers a given
 826 +number of most recent OLSR packets received from its neighbors. By
 827 +default, olsrd looks at the 10 most recent OLSR packets. This can be
 828 +changed via the "LinkQualityWinSize" configuration option. Values
 829 +between 3 and 128 are legal.
 830 +
 831 +NEW CONFIGFILE PARSER/FORMAT/SCHEME
 832 +
 833 +A whole new config file syntax and parser is introduced with this
 834 +release. The parser is generated using flex and bison and it is
 835 +designed to be very modular. The parser can be compiled as either
 836 +a standalone binary, a shared library or as part of olsrd. This way
 837 +other applications can parse and generate olsrd configuration files
 838 +only by linking to the dynamic library.
 839 +In the new configfile options can be set pr. interface, plugin
 840 +parameters can be set, more IPC options can be set...and more.
 841 +The syntax is documented in the olsrd.conf(5) manual page found
 842 +in the files/ directory.
 843 +Olsrd internals now uses a single struct, as returned by the config
 844 +parser, for all configuration in runtime. this means that updating
 845 +values in this struct will dynamically update olsrd operation. It
 846 +also means that all configuration is now kept in one place instead
 847 +of spread all across the place.
 848 +
 849 +FREEBSD AND MAC OSX PORT
 850 +
 851 +This version offers an initial port of olsrd to FreeBSD and Mac OS
 852 +X. Like the Windows port it currently does not support IPv6. As this
 853 +is a very first try at supporting FreeBSD and Mac OS X, this port is
 854 +probably not as reliable as the Linux version. We'd greatly appreciate
 855 +feedback and bug reports. To compile you need GNU make. Then simply
 856 +run "gmake OS=fbsd" to build the executable.
 857 +
 858 +NEW MAKEFILE(S)
 859 +
 860 +The makefiles used to build olsrd have been rewritten and now includes
 861 +dependency file generation using makedep.
 862 +
 863 +DEBUG OUTPUT
 864 +
 865 +Tables are now only printed if changes occur, so there are no longer
 866 +any periodical output when using a debuglevel >0. A "heartbeat" is
 867 +now printed to STDOUT(if it is a terminal) in the form of a rotating
 868 +line to show that olsrd is actually operating.
 869 +Adding "ClearScreen yes" to the configuration file clears the screen
 870 +each time before the debug output shows updated information. This
 871 +makes the debug output easier to read in many cases. "ClearScreen no"
 872 +is the default, if no "ClearScreen" directive is given in the
 873 +configuration file.
 874 +
 875 +PLUGIN INTERFACE
 876 +
 877 +There are some changes in the plugin interface. It is now at
 878 +version 2. Plugin specific parameters from the configfile
 879 +using the PlParam option, will now be passed on to plugins.
 880 +To receive such parameters a plugin must implement a function:
 881 +int
 882 +register_olsr_param(char *key, char *value)
 883 +to which parameter pairs will be passed.
 884 +
 885 +NO MORE THREADS
 886 +
 887 +Olsrd no longer uses any thread library on its operation. Everything
 888 +now happens in the main thread allowing for use of olsrd on platforms
 889 +with no thread library.
 890 +
 891 +ACPI SUPPORT IN WILLINGNESS CALCULATION(LINUX)
 892 +
 893 +The willingness calculation for Linux, now also supports the more
 894 +modern ACPI proc interface in addition to APM. This is not well
 895 +tested and feedback is appreciated!
 896 +
 897 +IPC OPTIONS
 898 +
 899 +Various options regarding IPC connections can now be set in the
 900 +configfile. The options are max connections, allowed unicast
 901 +hosts and allowed net-ranges.
 902 +
 903 +CODE REWRITES
 904 +
 905 +Much of the message generation and net output code is rewritten.
 906 +Sending of partial messages should now work 100%. Also TC, MID
 907 +and HNA messages are now cached for a random amount of time
 908 +before transmitted - this often leads to the situation where these
 909 +messages are sent together with an HELLO message, which is highly
 910 +desirable since it saves network resources.
 911 +PLUGIN DEVELOPERS must note that the buffers and size variables
 912 +used in net output is no longer directly accessible!
 913 +
 914 +NET OUTPUT CODE REWRITTEN
 915 +
 916 +Every interface now has one outputbuffer registered. This allows
 917 +messages to be "cached" as explained above, so that multiple
 918 +messages are stacked together.
 919 +Also the outputbuffer and size are no longer accessible directly,
 920 +an API is available to plugins(and olsr code).
 921 +
 922 +OS DEPENDENT NETWORK INTERFACE
 923 +
 924 +The OS dependent network functions are now defined in net_os.h
 925 +instead of being mixed up with internal network functions
 926 +in net.h.
 927 +
 928 +BUGFIXES
 929 +
 930 +A bug that caused the announced ANSN sequence number to never stop
 931 +being increased when a change in the MPR selector set was detected
 932 +has been fixed. Another TC related bug that caused timed out TC
 933 +entries not to be deleted from the routing table in certain cases
 934 +has also been fixed. These bugs could cause unstable routes.
 935 +A bug that in many cases caused the wrong routes to be deleted
 936 +when using IPv6 has been fixed.
 937 +
 938 +
 939 +0.4.7 ---------------------------------------------------------------------
 940 +
 941 +NATIVE WINDOWS GUI AND INSTALLER
 942 +
 943 +We now have a native Windows GUI. The GTK+ version is no longer
 944 +supported on Windows. The new native GUI is pretty compact as it does
 945 +not require the GTK+ runtime DLLs. In addition to monitoring olsrds
 946 +state the GUI offers an easy way for novice users to configure
 947 +olsrd. It's pretty self-explanatory. Have a look at README-WIN32.txt
 948 +for details. The Windows version now also comes with an installer
 949 +based on the freely available Nullsoft Scriptable Install System
 950 +(NSIS). Looks like the Windows port is becoming more and more
 951 +Windows-ish. :-)
 952 +
 953 +WIRELESS INTERFACE DETECTION ON WINDOWS
 954 +
 955 +Like the Linux version the Windows port is now able to tell WLAN
 956 +interfaces from wired interfaces. We can now, for example, set
 957 +different HELLO intervals for WLAN interfaces and wired interfaces,
 958 +respectively.
 959 +
 960 +ROUTE UPDATES
 961 +
 962 +The order of updates of calculated routes is swapped. Now new routes
 963 +are added prior to deleting old ones. This could fix issues where
 964 +in some very very few cases one could experiment loss of routes.
 965 +
 966 +BUGFIXES
 967 +
 968 +There were quite some bugs in IPv6 operation in 0.4.6. These are
 969 +the bugs that were fixed:
 970 +- HNA message parsing did not work.
 971 +- Some IPv6 addresses were printed as IPv4 addresses in the
 972 +  debug output.
 973 +- The '-dispin' option now works again.
 974 +- A filedescriptor leak in the IPv6 interface detection caused
 975 +  olsrd to crash.
 976 +
 977 +
 978 +0.4.6 ---------------------------------------------------------------------
 979 +
 980 +WINDOWS PORT!
 981 +
 982 +Read the README-WIN32.txt file!
 983 +
 984 +DYNAMIC NETWORK INTERFACE UPDATES
 985 +
 986 +Network interfaces can now be updated and removed/added at
 987 +runtime. Olsrd will check all interfaces specified in the config
 988 +file or on the command-line, every 5 seconds. If updates
 989 +occur, olsrd will register this and update the necessary data.
 990 +If interfaces are removed or added, olsrd will detect this
 991 +and configure the interfaces. If an interface is removed
 992 +olsrd will continue to check the interface, so if say, a PCMCIA
 993 +card is removed and later on reinserted(and given the same name),
 994 +olsrd will detect this and start running on it again.
 995 +
 996 +Note that olsrd will now run even if no interfaces are detected.
 997 +
 998 +ROUTE CALCULATION UPDATE
 999 +
1000 +All 1 hop neighbor addresses that are not directly reachable trough
1001 +a symmetric link in the link set will now be added with a GW in the
1002 +routing table. this GW will be an interface address from a registered
1003 +symmetric link to the neighbor.
1004 +
1005 +MID UPDATE
1006 +
1007 +Alias addresses are now registered in the link set processing
1008 +if available. This is not to pretty(since the vtime has to
1009 +be a mere guess) but it gives faster initial route updates.
1010 +If a HELLO is received(at initial registration) from an IP
1011 +that is not the same as the one set as main address in the
1012 +received HELLO header, then the IP from which the HELLO was
1013 +received will be registered as an alias of the main address
1014 +set in the HELLO header. The default vtime is set to 15 secs.
1015 +
1016 +CODE RESTRUCTURING
1017 +
1018 +All OS dependent interface configuration code is now located in
1019 +OS/ifnet.c(that would be linux/ifnet.c if using GNU/Linux).
1020 +The functions are available trough the headerfile src/ifnet.h
1021 +
1022 +CODE CLEANUPS
1023 +
1024 +- Some timer issues fixed
1025 +- Got rid of the global socket descriptors
1026 +- Updated indexing of network interfaces
1027 +- Introduced a global socket to use for ioctl calls(ioctl_s)
1028 +- Removed upper limit for interfaces to use
1029 +- Point-to-point interfaces are now allowed
1030 +- The main select(2) loop now uses a timeout
1031 +- A small bugfix in the select fd-set update code
1032 +- Some bugfixes in the configuration file parsing
1033 +- stdout/stderr are now set to not be buffered
1034 +- A bugfix in the MID generation regarding seq. numbering
1035 +
1036 +PLUGIN INTERFCAE
1037 +
1038 +A new set of functions that are called whenever a change in the
1039 +interface configuration(update, addition, removal) is made is
1040 +introduced.
1041 +These functions are added and removed very much like the ptf
1042 +functions. Available trough the functions add_ifchgf and del_ifchgf.
1043 +
1044 +OBS OBS OBS!!! PLUGIN DEVELOPERS READ THIS!!!!
1045 +
1046 +The interface struct(declared in interfaces.h) has changed.
1047 +Plugin developers must update plugins that uses the interface
1048 +struct!
1049 +
1050 +The headerfile olsr_plugin_io.h which contains the plugin interface
1051 +commands now contains a revision list where all changes are
1052 +stated.
1053 +
1054 +
1055 +0.4.5 ---------------------------------------------------------------------
1056 +
1057 +PLUGIN: SECURE OLSR
1058 +
1059 +A plugin that generates and checks message signatures is added.
1060 +Check lib/secure
1061 +
1062 +PLUGIN: TOPOLOGY GRAPH
1063 +
1064 +A plugin that generates output of the topology in the dot format
1065 +is added. See lib/dot_draw
1066 +
1067 +OPTIMIZATIONS
1068 +
1069 +Some optimizations done that should cause fewer route recalculations.
1070 +
1071 +BUGFIXES
1072 +
1073 +Some bugs reported by Takafumi Tanaka fixed.
1074 +
1075 +RESTORATION OF NETWORK SETTINGS
1076 +
1077 +Network settings like disabling of ICMP redirects and spoof filter, are
1078 +now restored at exit by olsrd.
1079 +
1080 +RFC COMPLIANCE FIX
1081 +
1082 +Nodes would in certain scenarios retransmit messages originating for
1083 +themselves. This was a RFC incompliance. Reported by Ingmar Baumgart.
1084 +
1085 +NON-WLAN TIMERS
1086 +
1087 +No longer setting the HELLO interval of non-wlan interfaces as a multiplier
1088 +of the wlan interval. The interval is set seperatly now.
1089 +Due to this there are some updates in the configfile imperatives.
1090 +
1091 +CODE CLEANUPS
1092 +
1093 +Some new macros introduced for table insertion and removal and IP
1094 +copying and comparison.
1095 +
1096 +FRONT END BUGFIXES
1097 +
1098 +IPv6 bugfixes in the GUI.
1099 +
1100 +
1101 +0.4.4 ---------------------------------------------------------------------
1102 +
1103 +ROUTE CALCULATION
1104 +
1105 +Routes are no longer added via neighbors declaring a willingness
1106 +of WILL_NEVER.
1107 +
1108 +LINK SENSING AND ROUTE CALCULATION
1109 +
1110 +Link sensing and route calculation has been updated to handle
1111 +multiple links between hosts in a sane way.
1112 +
1113 +IP SPOOF FILTERING
1114 +
1115 +IP spoof filtering is disabled on the interfaces which olsrd runs.
1116 +These settings are not restored!
1117 +
1118 +ICMP REDIRECTS
1119 +
1120 +ICMP redirect message generation is disabled on the interfaces
1121 +which olsrd runs.
1122 +These settings are not restored!
1123 +
1124 +CONFIGFILE OPTIONS FOR MID AND HNA ADDED
1125 +
1126 +Options to set the MID and HNA emission intervals and
1127 +validity time in the configfile added.
1128 +
1129 +IPv6 ADDRESS SCOPE
1130 +
1131 +Option to set what IPv6 address type(scope) to use in the
1132 +configfile added. It can be set to either global or site-local.
1133 +
1134 +IPv6 MULTICAST
1135 +
1136 +Options to set site-local and global multicast addresses
1137 +in the configfile added.
1138 +
1139 +EMISSION INTERVAL FUNCTION
1140 +
1141 +Functions to set emission intervals at runtime added.
1142 +
1143 +LINK LAYER NOTIFICATIONS
1144 +
1145 +If started with the -llinfo switch olsrd will collect and display
1146 +link-layer information on neighbors. This is no longer limited to
1147 +one interface. But no action is taken based on this info - and
1148 +there is a upper limit of 8 neighbors from which this info can
1149 +be collected pr. interface. This limitation is inherited from the
1150 +WLAN drivers and is not something imposed by the olsrd code!
1151 +
1152 +IPv6 HNA MESSAGE FORMAT
1153 +
1154 +IPv6 HNA messages now contains 128-bit netmask instead of prefix.
1155 +
1156 +PLUGIN FUNCTIONS
1157 +
1158 +Added "packet transform functions" which allow plugins to alter all
1159 +outgoing OLSR traffic.
1160 +
1161 +RESTRUCTURING
1162 +
1163 +Moved most headers out of OS dependent directories. The tunneling
1164 +and link-layer notification interface is not yet separated from
1165 +the /linux directory.
1166 +
1167 +MANUALPAGE
1168 +
1169 +A manpage(olsrd(8)) describing olsrd has been created. It is installed
1170 +when using 'make install'.
1171 +
1172 +
1173 +0.4.3 ---------------------------------------------------------------------
1174 +
1175 +PLUGIN SUPPORT
1176 +
1177 +Olsrd now supports runtime-loadable plugins! A couple of example plugins
1178 +are located in the lib/ directory. Read the README files in the various
1179 +plugin directories for more info. A directive to load plugins have been
1180 +added to the configfile as well.
1181 +Documentation of the plugin interface can be fount at http://www.olsr.org.
1182 +
1183 +The plugin interface is designed to be extendable. But it should _always_
1184 +be backwards compatible with the interface used in this release!
1185 +
1186 +LINK-LAYER NOTIFICATION
1187 +
1188 +Some preliminary link-layer notification code has been added. Link quality
1189 +can be written to stdout if olsrd is started with the -llinfo switch.
1190 +No action is currently taken based on this info. And info will only
1191 +be retrieved from the interface named "eth1".
1192 +This code is not usable for users as of yet!
1193 +
1194 +MPR UPDATES
1195 +
1196 +Neighbors with willingness set to WILL_ALWAYS is now always added. The
1197 +MPR selection is optimized as described in RFC3626 section 8.3.1
1198 +point 5.
1199 +
1200 +MPR BUGS
1201 +
1202 +There was a couple of bugs in the MPR selection code. All fixed.
1203 +
1204 +LINUX 2.6 BUG
1205 +
1206 +Users could not run olsrd on multiple interfaces using the Linux 2.6 kernel
1207 +series. This is now fixed.
1208 +
1209 +MINOR BUGS
1210 +
1211 +One small bug in link hysteresis initialization and one in HNA route
1212 +deletion.
1213 +
1214 +MESSAGE-SEQUENCENUMBER INCOMPLIANCE
1215 +
1216 +Message-seqnos was implemented on a pr. messagetype and pr. interface
1217 +basis. This is not RFC3626 compliant and has been updates. All messages
1218 +and interfaces now uses a global seuencenumber.
1219 +
1220 +RANDOM SEQUENCENUMBERS
1221 +
1222 +Sequencenumbers are now initialized using a random value.
1223 +
1224 +DAEMON MODE
1225 +
1226 +Fixes for running olsrd in daemon mode(debug 0).
1227 +
1228 +OPTIMIZATIONS
1229 +
1230 +Optimizations based on profiling implemented.
1231 +
1232 +SANITATION
1233 +
1234 +Message size is checked for every message before passing it to the
1235 +appropriate message parsing function. If the size is bigger than the
1236 +remaining size of the olsr packet then the message is discarded.
1237 +
1238 +GUI FRONT-END
1239 +
1240 +Some minor modifications done to the gui.
1241 +
1242 +INTERNAL CHANGES
1243 +
1244 +Lots of changes in handling of registration and unregistration of
1245 +scheduler, socketparser, parser and local hna set.
1246 +Some restructuring and movement of functions.
1247 +
1248 +
1249 +0.4.2 ---------------------------------------------------------------------
1250 +
1251 +No public release
1252 +
1253 +0.4.1 ---------------------------------------------------------------------
1254 +
1255 +No public release
1256 +
1257 +0.4.0 ---------------------------------------------------------------------
1258 +
1259 +LINK HYSTERESIS
1260 +
1261 +Link hysteresis as described in the RFC added.
1262 +
1263 +TC REDUNDANCY
1264 +
1265 +TC redundancy as described in the RFC added
1266 +
1267 +MPR REDUNDANCY
1268 +
1269 +MPR redundancy as described in the RFC added
1270 +
1271 +SCHEDULER REWRITE
1272 +
1273 +The scheduler has been rewritten to register scheduled
1274 +events(function pointers) dynamically.
1275 +
1276 +PARSER REWRITE
1277 +
1278 +The parser has been rewritten to register parse functions
1279 +on a pr. messagetype dynamically
1280 +
1281 +MALLOC WRAPPER
1282 +
1283 +A wrapper for the malloc(3) syscal has been introduced.
1284 +olsr_malloc(size_t, const char *) should ALWAYS be used.
1285 +
1286 +CODE RESTRUCTURING
1287 +
1288 +Lots of restructuring in headerfiles.
1289 +Linux spesific code moved to subdirectory linux/
1290 +FreeBSD code to be put in freebsd/
1291 +LOTS of code restructured due to the rexrite of the scheduler
1292 +and parser.
1293 +
1294 +MPR CALCULATION
1295 +
1296 +Optimizing the MPR set as suggested in the RFC section
1297 +8.3.1 point 5 added.
1298 +
1299 +BUGFIXES
1300 +
1301 +Some bugs in MPR selection fixed.
1302 +
1303 +
1304 +0.3.8 ---------------------------------------------------------------------
1305 +
1306 +CODE REWRITES
1307 +
1308 +HNA code completely rewritten!
1309 +The old code was really bad! Now it is much cleaner implemented and
1310 +should work fine.
1311 +One- and two-hop neighbor list structures rewritten. They now use
1312 +the same hashed double-linked lists as the rest of the information
1313 +sets use.
1314 +
1315 +CODE RESTRUCTURING
1316 +
1317 +Some code restructuring which resulted in the new files: timer.h,
1318 +mantissa.c, mantissa.h, hashing.c, hashing.h, linux/net.c
1319 +linux/net.h, linux/kernel_routes.c, linux/kernel_routes.h and some
1320 +renamed files
1321 +
1322 +BUG FIXES
1323 +
1324 +The bug causing errormessages on exit is fixed.
1325 +The bug that caused initial HNA routes in the GUI to display a hopcount
1326 +of 0 fixed.
1327 +IPv6 HNA netmasks were all added as /128. It's fixed now.
1328 +
1329 +IPv6
1330 +
1331 +Turns out sitelocal address had to be preferred to avoid IPv6 header
1332 +messing up link-sensing. Bug fixed
1333 +
1334 +
1335 +0.3.7 ---------------------------------------------------------------------
1336 +
1337 +CODE REWRITES
1338 +
1339 +The entire TC set and MPR selector set code rewritten. Hashing and
1340 +double linked lists added to the MID code.
1341 +Lots of HNA code has been rewritten as well.
1342 +
1343 +HNA bugfix
1344 +
1345 +When a node lost connectivity to a HNA GW all HNA entries to that gw
1346 +was deleted. This has been fixed - and HNA entries only gets deleted
1347 +on timeout now.
1348 +Other HNA bugs have been fixed as well. But the whole HNA implementation
1349 +needs a rewrite!
1350 +
1351 +Holdingtime BUGfix
1352 +
1353 +There was a bug that caused holdingtime not to be properly recalculated
1354 +when using non-default emission intervals.
1355 +
1356 +Forwarding and symmetric neighbors
1357 +
1358 +Seems I had misread the RFC on what a 1-hop symmetric neighbor is.
1359 +Now the link-set is checked when a check for a symmetric neighbor
1360 +is done. Not the 1 hop neighbor set as it used to be. This way
1361 +the hack when receiving MID messages could be removed.
1362 +
1363 +IPv6
1364 +
1365 +Global addresses are now preferred. Sitelocal addresses are only used
1366 +if no global addresses are found. There have been problems where
1367 +the address set in the IP header of IPv6 packets do not match the
1368 +address chosen by OLSR.
1369 +
1370 +GUI - 0.2.5
1371 +
1372 +The GUI is finally updated! It can now handle piggybacked messages
1373 +and link sensing HELLO message format.
1374 +
1375 +
1376 +0.3.6 ---------------------------------------------------------------------
1377 +
1378 +HNA support using IPv6
1379 +
1380 +HNA now works using IPv6 as well! Just add the network address and
1381 +prefix in the HNA6 section in the configfile. The IPv6 HNA packets differ
1382 +some from the IPv4 as they don't send the netmask but the prefix.
1383 +
1384 +
1385 +NEW FILENAME FOR THE BINARY AND CONFIG FILE
1386 +
1387 +They are now called olsrd and olsrd.conf. I figured I'd use the olsrd
1388 +name before somebody else started using it ;-)
1389 +
1390 +
1391 +Config file
1392 +
1393 +New options: DEBUG, HNA6 and IPC-CONNECT added to config file.
1394 +
1395 +
1396 +Output
1397 +
1398 +A printf-wrapper has been introduced - debug level output handling
1399 +is much more uniform now.
1400 +The daemon should run fine in detached mode now(DEBUG 0)
1401 +
1402 +GUI front-end
1403 +
1404 +The GUI front-end can now connect and disconnect at any time while the
1405 +daemon is running, if started using the -ipc switch or with IPC set to
1406 +'yes' in the configfile.
1407 +
1408 +
1409 +BUGS
1410 +
1411 +A small HNA bug fixed.
1412 +
1413 +
1414 +0.3.5 ---------------------------------------------------------------------
1415 +
1416 +Forwarding jitter
1417 +
1418 +Forwarding jitter added. Messages are piggybacked if they arrive(and are to
1419 +be forwarded) while there is data to be forwarded buffered.
1420 +Added some bugfixes to support parsing of piggybacked messages as well.
1421 +
1422 +Route calculation
1423 +
1424 +Fixed route calculation so that 2 hop neighbors are added. This smooths
1425 +changes from 1 hop to 2 hop neighbor out. The old way one had to wait for
1426 +a TC before the 2 hop neighbors were added.
1427 +
1428 +2 hop neighbor set
1429 +
1430 +All neighbors received in HELLO messages are added to the two hop
1431 +neighborhood. This helps smoothing out the 1-to-2 hop transition as well.
1432 +
1433 +MID calculation
1434 +
1435 +MID calculation had to be updated due to the registering of two hop neighbors
1436 +that are already one hop neighbors. They should not be considered when calculating
1437 +two hop coverage.
1438 +
1439 +Optimizations
1440 +
1441 +Deletion of possible one hop neighbors registered on non main-addresses when
1442 +first registering MID info from a node removed. This can not occur due
1443 +to the fact that registering of neighbor nodes are done on main addresses
1444 +from link-sensing
1445 +Option to not forward messages on wired links on which they arrived removed.
1446 +This is no longer usable to any degree when adding support for piggybacking
1447 +of forwarded messages is to be implemented.
1448 +
1449 +Cleanups
1450 +
1451 +Some unused parameters and commandline options were removed.
1452 +
1453 +
1454 +
1455 +0.3.3 ---------------------------------------------------------------------
1456 +
1457 +TC MESSAGEING
1458 +
1459 +Added sending of empty TC messages if all MPR selectors are removed. Empty
1460 +TC messages are sent for a TC_HOLD_TIME period as described in section
1461 +9.3 in the RFC.
1462 +
1463 +HNA
1464 +
1465 +Fixed HNA route calculations for IPv6. I forgot to upgrade this in 0.3.2
1466 +
1467 +OPTIONS
1468 +
1469 +-hnaint and -midint command line optionas added to set the interval
1470 +of HNA and MID generation.
1471 +
1472 +FORWARDING
1473 +
1474 +As an optimization messages have not been forwarded on the received interface
1475 +if this is registered as a non-WLAN interface. This causes problems for
1476 +people using Ethernet-to-WLAN adapters. This optimization is now turned
1477 +off by default. It can be activated using the -nofwlan option.
1478 +
1479 +BUGS
1480 +
1481 +THERE ARE SOME NASTY BUGS IN 0.3.2!
1482 +Fixed a bug that caused 2 hop neighbors not to time out.
1483 +Fixed a bug that caused a 1 hop neighbor timeout not to recalculate
1484 +the routing table.
1485 +Fixed a small memleak in the MID set
1486 +Fixed some smaller bugs.
1487 +
1488 +IPv6 functioning is not well tested in this release.
1489 +
1490 +0.3.2 ---------------------------------------------------------------------
1491 +
1492 +HNA
1493 +
1494 +Updated HNA to be RFC compliant. This means that all received HNA tuples
1495 +are registered and only the subset of unique entries(net/netmask) with
1496 +the smallest hopcount is inserted into the routing table.
1497 +
1498 +Config file
1499 +
1500 +User can specify configfile name using the -f switch.
1501 +
1502 +Bugs
1503 +
1504 +Fixed a link-sensing bug that caused problems when using MID nodes.
1505 +
1506 +0.3.1 ---------------------------------------------------------------------
1507 +
1508 +MPR calculation
1509 +
1510 +MPR calculation is now based on the willingness announced by nodes.
1511 +
1512 +Neighbor set
1513 +
1514 +The neighbor set does not have timeouts on entries any more. Creation
1515 +and deletion of neighbor entries is done from the link-set as suggested
1516 +in the RFC.
1517 +
1518 +Cleanups
1519 +
1520 +Gotten rid of a lot of code that became more or less obsolete due to
1521 +all the changes introduced in 0.3.0.
1522 +
1523 +Bugs
1524 +
1525 +Fixed a nasty bug concerning the sequence numbering of TC packets.
1526 +Fixed some bugs regarding MPR calculation - and probably introduced
1527 +a whole new species when implementing the willingness-based calculation ;-)
1528 +
1529 +
1530 +0.3.0 ---------------------------------------------------------------------
1531 +
1532 +Due to the extensive amount of updates this release is versioned 0.3.0
1533 +
1534 +Duplicate table and forwarding
1535 +
1536 +The duplicate table functionality is totally rewritten in 100% RFC
1537 +compliance. The forward algorithm specified in the RFC is implemented
1538 +this meant rewriting much of the packet processing code. The daemon
1539 +also forwards unknown packettypes now.
1540 +
1541 +Link sensing and neighbor processing
1542 +
1543 +Link sensing and neighbor processing was done in the same operation in the
1544 +old code. Link sensing is now a mechanism of its own which is 100% RFC
1545 +compliant. Neighbor processing and HELLO generation has been partly
1546 +rewritten to be RFC compliant. Neighbors are now registered as either
1547 +SYN or NOT_SYM. The NOT_NEIGH, SYM_NEIGH and MPR_NEIGH values are only
1548 +used when building HELLO messages. Links are in one of the following states:
1549 +UNSPEC_LINK, ASYM_LINK or SYM_LINK.
1550 +HELLO messages now advertise link status of neighbors on the interface
1551 +the message is transmitted.
1552 +
1553 +Willingness
1554 +
1555 +A node now dynamically calculates willingness based on powersource and
1556 +possibly battery power. If the node is AC powered it announces a willingness
1557 +of 6. If batterypowered the willingness is calculated as:
1558 +P / 26
1559 +Where P is percentage of power left.
1560 +
1561 +Configuration file
1562 +
1563 +The daemon now tries to read its configuration from the file /etc/uolsrd.conf
1564 +A "standard" configuration file is installed when doing 'make install'.
1565 +This file should be edited to fit your needs.
1566 +Command-line options can still be used to override the configuration form
1567 +the file(ore if no config file is present).
1568 +The -f switch can also be used to specify a configuration file.
1569 +
1570 +Willingness
1571 +
1572 +If AdvancedPowerManagemant(APM) is supported on your system the willingness
1573 +of the node is dynamically calculated based upon the powerstatus of the node.
1574 +MPR calculation based upon willingness is not done as of yet.
1575 +
1576 +TC ANSN
1577 +
1578 +A bugs in the TC processing fixed.
1579 +
1580 +HNA
1581 +
1582 +Some serious HNA bugs fixed. These bugs caused a node to always choos the
1583 +gateway with the larges hopcout :) More seriously - a bug caused looping
1584 +of HNA messages in certain scenarios.
1585 +
1586 +Package sequence numbers
1587 +
1588 +These were added. Not much use as of now - but they're there(as specified
1589 +in the RFC).
1590 +
1591 +Broadcast address
1592 +
1593 +Users can now specify the broadcast address to use. Useful if one wishes to
1594 +use the 255.255.255.255 broadcast.
1595 +
1596 +
1597 +
1598 +0.2.5 ---------------------------------------------------------------------
1599 +
1600 +Htime and Vtime
1601 +
1602 +Htime and Vtime processing and handling added. Holding times used to be
1603 +a static value for all nodes. Now every node can signal its vlidity time
1604 +to others.
1605 +To achieve this mantissa/exponent calculation functionality was added.
1606 +Messages now include Vtime(and Htime in HELLO) values in mantissa/exponent
1607 +format instead of just zero. These values are as stated above, used as holding
1608 +time for nodes.
1609 +the GUI should be upgraded as well...
1610 +
1611 +Jitter
1612 +
1613 +The use of jitter in message generation intervals vere fixed.
1614 +
1615 +
1616 +0.2.4 ---------------------------------------------------------------------
1617 +
1618 +Seqno bugs
1619 +
1620 +Some bugs concerning sequence numbers in HELLO and MID message handling
1621 +was fixed. Newly registered nodes in the neighbor and MID sets were
1622 +initialized with a seqno of 0. When using a "wraparound" sequencenumber
1623 +check(as defined in olsr_protocol.h) this can produce errors if a new
1624 +node joins a network where existing nodes has seqnos >0x00FF.
1625 +
1626 +IPv6 related bugs
1627 +
1628 +Some checks and copying of node addresses where done using sizeof(u_olsr32_t)
1629 +which is 32 bits. This caused only the 32 firs bits of IPv6 addresses to
1630 +be copied and checked.
1631 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/LICENCE ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/LICENCE
1632 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/LICENCE	1970-01-01 01:00:00.000000000 +0100
1633 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/LICENCE	2008-08-23 08:23:37.000000000 +0200
1634 @@ -0,0 +1,674 @@
1635 +                    GNU GENERAL PUBLIC LICENSE
1636 +                       Version 3, 29 June 2007
1637 +
1638 + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
1639 + Everyone is permitted to copy and distribute verbatim copies
1640 + of this license document, but changing it is not allowed.
1641 +
1642 +                            Preamble
1643 +
1644 +  The GNU General Public License is a free, copyleft license for
1645 +software and other kinds of works.
1646 +
1647 +  The licenses for most software and other practical works are designed
1648 +to take away your freedom to share and change the works.  By contrast,
1649 +the GNU General Public License is intended to guarantee your freedom to
1650 +share and change all versions of a program--to make sure it remains free
1651 +software for all its users.  We, the Free Software Foundation, use the
1652 +GNU General Public License for most of our software; it applies also to
1653 +any other work released this way by its authors.  You can apply it to
1654 +your programs, too.
1655 +
1656 +  When we speak of free software, we are referring to freedom, not
1657 +price.  Our General Public Licenses are designed to make sure that you
1658 +have the freedom to distribute copies of free software (and charge for
1659 +them if you wish), that you receive source code or can get it if you
1660 +want it, that you can change the software or use pieces of it in new
1661 +free programs, and that you know you can do these things.
1662 +
1663 +  To protect your rights, we need to prevent others from denying you
1664 +these rights or asking you to surrender the rights.  Therefore, you have
1665 +certain responsibilities if you distribute copies of the software, or if
1666 +you modify it: responsibilities to respect the freedom of others.
1667 +
1668 +  For example, if you distribute copies of such a program, whether
1669 +gratis or for a fee, you must pass on to the recipients the same
1670 +freedoms that you received.  You must make sure that they, too, receive
1671 +or can get the source code.  And you must show them these terms so they
1672 +know their rights.
1673 +
1674 +  Developers that use the GNU GPL protect your rights with two steps:
1675 +(1) assert copyright on the software, and (2) offer you this License
1676 +giving you legal permission to copy, distribute and/or modify it.
1677 +
1678 +  For the developers' and authors' protection, the GPL clearly explains
1679 +that there is no warranty for this free software.  For both users' and
1680 +authors' sake, the GPL requires that modified versions be marked as
1681 +changed, so that their problems will not be attributed erroneously to
1682 +authors of previous versions.
1683 +
1684 +  Some devices are designed to deny users access to install or run
1685 +modified versions of the software inside them, although the manufacturer
1686 +can do so.  This is fundamentally incompatible with the aim of
1687 +protecting users' freedom to change the software.  The systematic
1688 +pattern of such abuse occurs in the area of products for individuals to
1689 +use, which is precisely where it is most unacceptable.  Therefore, we
1690 +have designed this version of the GPL to prohibit the practice for those
1691 +products.  If such problems arise substantially in other domains, we
1692 +stand ready to extend this provision to those domains in future versions
1693 +of the GPL, as needed to protect the freedom of users.
1694 +
1695 +  Finally, every program is threatened constantly by software patents.
1696 +States should not allow patents to restrict development and use of
1697 +software on general-purpose computers, but in those that do, we wish to
1698 +avoid the special danger that patents applied to a free program could
1699 +make it effectively proprietary.  To prevent this, the GPL assures that
1700 +patents cannot be used to render the program non-free.
1701 +
1702 +  The precise terms and conditions for copying, distribution and
1703 +modification follow.
1704 +
1705 +                       TERMS AND CONDITIONS
1706 +
1707 +  0. Definitions.
1708 +
1709 +  "This License" refers to version 3 of the GNU General Public License.
1710 +
1711 +  "Copyright" also means copyright-like laws that apply to other kinds of
1712 +works, such as semiconductor masks.
1713 +
1714 +  "The Program" refers to any copyrightable work licensed under this
1715 +License.  Each licensee is addressed as "you".  "Licensees" and
1716 +"recipients" may be individuals or organizations.
1717 +
1718 +  To "modify" a work means to copy from or adapt all or part of the work
1719 +in a fashion requiring copyright permission, other than the making of an
1720 +exact copy.  The resulting work is called a "modified version" of the
1721 +earlier work or a work "based on" the earlier work.
1722 +
1723 +  A "covered work" means either the unmodified Program or a work based
1724 +on the Program.
1725 +
1726 +  To "propagate" a work means to do anything with it that, without
1727 +permission, would make you directly or secondarily liable for
1728 +infringement under applicable copyright law, except executing it on a
1729 +computer or modifying a private copy.  Propagation includes copying,
1730 +distribution (with or without modification), making available to the
1731 +public, and in some countries other activities as well.
1732 +
1733 +  To "convey" a work means any kind of propagation that enables other
1734 +parties to make or receive copies.  Mere interaction with a user through
1735 +a computer network, with no transfer of a copy, is not conveying.
1736 +
1737 +  An interactive user interface displays "Appropriate Legal Notices"
1738 +to the extent that it includes a convenient and prominently visible
1739 +feature that (1) displays an appropriate copyright notice, and (2)
1740 +tells the user that there is no warranty for the work (except to the
1741 +extent that warranties are provided), that licensees may convey the
1742 +work under this License, and how to view a copy of this License.  If
1743 +the interface presents a list of user commands or options, such as a
1744 +menu, a prominent item in the list meets this criterion.
1745 +
1746 +  1. Source Code.
1747 +
1748 +  The "source code" for a work means the preferred form of the work
1749 +for making modifications to it.  "Object code" means any non-source
1750 +form of a work.
1751 +
1752 +  A "Standard Interface" means an interface that either is an official
1753 +standard defined by a recognized standards body, or, in the case of
1754 +interfaces specified for a particular programming language, one that
1755 +is widely used among developers working in that language.
1756 +
1757 +  The "System Libraries" of an executable work include anything, other
1758 +than the work as a whole, that (a) is included in the normal form of
1759 +packaging a Major Component, but which is not part of that Major
1760 +Component, and (b) serves only to enable use of the work with that
1761 +Major Component, or to implement a Standard Interface for which an
1762 +implementation is available to the public in source code form.  A
1763 +"Major Component", in this context, means a major essential component
1764 +(kernel, window system, and so on) of the specific operating system
1765 +(if any) on which the executable work runs, or a compiler used to
1766 +produce the work, or an object code interpreter used to run it.
1767 +
1768 +  The "Corresponding Source" for a work in object code form means all
1769 +the source code needed to generate, install, and (for an executable
1770 +work) run the object code and to modify the work, including scripts to
1771 +control those activities.  However, it does not include the work's
1772 +System Libraries, or general-purpose tools or generally available free
1773 +programs which are used unmodified in performing those activities but
1774 +which are not part of the work.  For example, Corresponding Source
1775 +includes interface definition files associated with source files for
1776 +the work, and the source code for shared libraries and dynamically
1777 +linked subprograms that the work is specifically designed to require,
1778 +such as by intimate data communication or control flow between those
1779 +subprograms and other parts of the work.
1780 +
1781 +  The Corresponding Source need not include anything that users
1782 +can regenerate automatically from other parts of the Corresponding
1783 +Source.
1784 +
1785 +  The Corresponding Source for a work in source code form is that
1786 +same work.
1787 +
1788 +  2. Basic Permissions.
1789 +
1790 +  All rights granted under this License are granted for the term of
1791 +copyright on the Program, and are irrevocable provided the stated
1792 +conditions are met.  This License explicitly affirms your unlimited
1793 +permission to run the unmodified Program.  The output from running a
1794 +covered work is covered by this License only if the output, given its
1795 +content, constitutes a covered work.  This License acknowledges your
1796 +rights of fair use or other equivalent, as provided by copyright law.
1797 +
1798 +  You may make, run and propagate covered works that you do not
1799 +convey, without conditions so long as your license otherwise remains
1800 +in force.  You may convey covered works to others for the sole purpose
1801 +of having them make modifications exclusively for you, or provide you
1802 +with facilities for running those works, provided that you comply with
1803 +the terms of this License in conveying all material for which you do
1804 +not control copyright.  Those thus making or running the covered works
1805 +for you must do so exclusively on your behalf, under your direction
1806 +and control, on terms that prohibit them from making any copies of
1807 +your copyrighted material outside their relationship with you.
1808 +
1809 +  Conveying under any other circumstances is permitted solely under
1810 +the conditions stated below.  Sublicensing is not allowed; section 10
1811 +makes it unnecessary.
1812 +
1813 +  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
1814 +
1815 +  No covered work shall be deemed part of an effective technological
1816 +measure under any applicable law fulfilling obligations under article
1817 +11 of the WIPO copyright treaty adopted on 20 December 1996, or
1818 +similar laws prohibiting or restricting circumvention of such
1819 +measures.
1820 +
1821 +  When you convey a covered work, you waive any legal power to forbid
1822 +circumvention of technological measures to the extent such circumvention
1823 +is effected by exercising rights under this License with respect to
1824 +the covered work, and you disclaim any intention to limit operation or
1825 +modification of the work as a means of enforcing, against the work's
1826 +users, your or third parties' legal rights to forbid circumvention of
1827 +technological measures.
1828 +
1829 +  4. Conveying Verbatim Copies.
1830 +
1831 +  You may convey verbatim copies of the Program's source code as you
1832 +receive it, in any medium, provided that you conspicuously and
1833 +appropriately publish on each copy an appropriate copyright notice;
1834 +keep intact all notices stating that this License and any
1835 +non-permissive terms added in accord with section 7 apply to the code;
1836 +keep intact all notices of the absence of any warranty; and give all
1837 +recipients a copy of this License along with the Program.
1838 +
1839 +  You may charge any price or no price for each copy that you convey,
1840 +and you may offer support or warranty protection for a fee.
1841 +
1842 +  5. Conveying Modified Source Versions.
1843 +
1844 +  You may convey a work based on the Program, or the modifications to
1845 +produce it from the Program, in the form of source code under the
1846 +terms of section 4, provided that you also meet all of these conditions:
1847 +
1848 +    a) The work must carry prominent notices stating that you modified
1849 +    it, and giving a relevant date.
1850 +
1851 +    b) The work must carry prominent notices stating that it is
1852 +    released under this License and any conditions added under section
1853 +    7.  This requirement modifies the requirement in section 4 to
1854 +    "keep intact all notices".
1855 +
1856 +    c) You must license the entire work, as a whole, under this
1857 +    License to anyone who comes into possession of a copy.  This
1858 +    License will therefore apply, along with any applicable section 7
1859 +    additional terms, to the whole of the work, and all its parts,
1860 +    regardless of how they are packaged.  This License gives no
1861 +    permission to license the work in any other way, but it does not
1862 +    invalidate such permission if you have separately received it.
1863 +
1864 +    d) If the work has interactive user interfaces, each must display
1865 +    Appropriate Legal Notices; however, if the Program has interactive
1866 +    interfaces that do not display Appropriate Legal Notices, your
1867 +    work need not make them do so.
1868 +
1869 +  A compilation of a covered work with other separate and independent
1870 +works, which are not by their nature extensions of the covered work,
1871 +and which are not combined with it such as to form a larger program,
1872 +in or on a volume of a storage or distribution medium, is called an
1873 +"aggregate" if the compilation and its resulting copyright are not
1874 +used to limit the access or legal rights of the compilation's users
1875 +beyond what the individual works permit.  Inclusion of a covered work
1876 +in an aggregate does not cause this License to apply to the other
1877 +parts of the aggregate.
1878 +
1879 +  6. Conveying Non-Source Forms.
1880 +
1881 +  You may convey a covered work in object code form under the terms
1882 +of sections 4 and 5, provided that you also convey the
1883 +machine-readable Corresponding Source under the terms of this License,
1884 +in one of these ways:
1885 +
1886 +    a) Convey the object code in, or embodied in, a physical product
1887 +    (including a physical distribution medium), accompanied by the
1888 +    Corresponding Source fixed on a durable physical medium
1889 +    customarily used for software interchange.
1890 +
1891 +    b) Convey the object code in, or embodied in, a physical product
1892 +    (including a physical distribution medium), accompanied by a
1893 +    written offer, valid for at least three years and valid for as
1894 +    long as you offer spare parts or customer support for that product
1895 +    model, to give anyone who possesses the object code either (1) a
1896 +    copy of the Corresponding Source for all the software in the
1897 +    product that is covered by this License, on a durable physical
1898 +    medium customarily used for software interchange, for a price no
1899 +    more than your reasonable cost of physically performing this
1900 +    conveying of source, or (2) access to copy the
1901 +    Corresponding Source from a network server at no charge.
1902 +
1903 +    c) Convey individual copies of the object code with a copy of the
1904 +    written offer to provide the Corresponding Source.  This
1905 +    alternative is allowed only occasionally and noncommercially, and
1906 +    only if you received the object code with such an offer, in accord
1907 +    with subsection 6b.
1908 +
1909 +    d) Convey the object code by offering access from a designated
1910 +    place (gratis or for a charge), and offer equivalent access to the
1911 +    Corresponding Source in the same way through the same place at no
1912 +    further charge.  You need not require recipients to copy the
1913 +    Corresponding Source along with the object code.  If the place to
1914 +    copy the object code is a network server, the Corresponding Source
1915 +    may be on a different server (operated by you or a third party)
1916 +    that supports equivalent copying facilities, provided you maintain
1917 +    clear directions next to the object code saying where to find the
1918 +    Corresponding Source.  Regardless of what server hosts the
1919 +    Corresponding Source, you remain obligated to ensure that it is
1920 +    available for as long as needed to satisfy these requirements.
1921 +
1922 +    e) Convey the object code using peer-to-peer transmission, provided
1923 +    you inform other peers where the object code and Corresponding
1924 +    Source of the work are being offered to the general public at no
1925 +    charge under subsection 6d.
1926 +
1927 +  A separable portion of the object code, whose source code is excluded
1928 +from the Corresponding Source as a System Library, need not be
1929 +included in conveying the object code work.
1930 +
1931 +  A "User Product" is either (1) a "consumer product", which means any
1932 +tangible personal property which is normally used for personal, family,
1933 +or household purposes, or (2) anything designed or sold for incorporation
1934 +into a dwelling.  In determining whether a product is a consumer product,
1935 +doubtful cases shall be resolved in favor of coverage.  For a particular
1936 +product received by a particular user, "normally used" refers to a
1937 +typical or common use of that class of product, regardless of the status
1938 +of the particular user or of the way in which the particular user
1939 +actually uses, or expects or is expected to use, the product.  A product
1940 +is a consumer product regardless of whether the product has substantial
1941 +commercial, industrial or non-consumer uses, unless such uses represent
1942 +the only significant mode of use of the product.
1943 +
1944 +  "Installation Information" for a User Product means any methods,
1945 +procedures, authorization keys, or other information required to install
1946 +and execute modified versions of a covered work in that User Product from
1947 +a modified version of its Corresponding Source.  The information must
1948 +suffice to ensure that the continued functioning of the modified object
1949 +code is in no case prevented or interfered with solely because
1950 +modification has been made.
1951 +
1952 +  If you convey an object code work under this section in, or with, or
1953 +specifically for use in, a User Product, and the conveying occurs as
1954 +part of a transaction in which the right of possession and use of the
1955 +User Product is transferred to the recipient in perpetuity or for a
1956 +fixed term (regardless of how the transaction is characterized), the
1957 +Corresponding Source conveyed under this section must be accompanied
1958 +by the Installation Information.  But this requirement does not apply
1959 +if neither you nor any third party retains the ability to install
1960 +modified object code on the User Product (for example, the work has
1961 +been installed in ROM).
1962 +
1963 +  The requirement to provide Installation Information does not include a
1964 +requirement to continue to provide support service, warranty, or updates
1965 +for a work that has been modified or installed by the recipient, or for
1966 +the User Product in which it has been modified or installed.  Access to a
1967 +network may be denied when the modification itself materially and
1968 +adversely affects the operation of the network or violates the rules and
1969 +protocols for communication across the network.
1970 +
1971 +  Corresponding Source conveyed, and Installation Information provided,
1972 +in accord with this section must be in a format that is publicly
1973 +documented (and with an implementation available to the public in
1974 +source code form), and must require no special password or key for
1975 +unpacking, reading or copying.
1976 +
1977 +  7. Additional Terms.
1978 +
1979 +  "Additional permissions" are terms that supplement the terms of this
1980 +License by making exceptions from one or more of its conditions.
1981 +Additional permissions that are applicable to the entire Program shall
1982 +be treated as though they were included in this License, to the extent
1983 +that they are valid under applicable law.  If additional permissions
1984 +apply only to part of the Program, that part may be used separately
1985 +under those permissions, but the entire Program remains governed by
1986 +this License without regard to the additional permissions.
1987 +
1988 +  When you convey a copy of a covered work, you may at your option
1989 +remove any additional permissions from that copy, or from any part of
1990 +it.  (Additional permissions may be written to require their own
1991 +removal in certain cases when you modify the work.)  You may place
1992 +additional permissions on material, added by you to a covered work,
1993 +for which you have or can give appropriate copyright permission.
1994 +
1995 +  Notwithstanding any other provision of this License, for material you
1996 +add to a covered work, you may (if authorized by the copyright holders of
1997 +that material) supplement the terms of this License with terms:
1998 +
1999 +    a) Disclaiming warranty or limiting liability differently from the
2000 +    terms of sections 15 and 16 of this License; or
2001 +
2002 +    b) Requiring preservation of specified reasonable legal notices or
2003 +    author attributions in that material or in the Appropriate Legal
2004 +    Notices displayed by works containing it; or
2005 +
2006 +    c) Prohibiting misrepresentation of the origin of that material, or
2007 +    requiring that modified versions of such material be marked in
2008 +    reasonable ways as different from the original version; or
2009 +
2010 +    d) Limiting the use for publicity purposes of names of licensors or
2011 +    authors of the material; or
2012 +
2013 +    e) Declining to grant rights under trademark law for use of some
2014 +    trade names, trademarks, or service marks; or
2015 +
2016 +    f) Requiring indemnification of licensors and authors of that
2017 +    material by anyone who conveys the material (or modified versions of
2018 +    it) with contractual assumptions of liability to the recipient, for
2019 +    any liability that these contractual assumptions directly impose on
2020 +    those licensors and authors.
2021 +
2022 +  All other non-permissive additional terms are considered "further
2023 +restrictions" within the meaning of section 10.  If the Program as you
2024 +received it, or any part of it, contains a notice stating that it is
2025 +governed by this License along with a term that is a further
2026 +restriction, you may remove that term.  If a license document contains
2027 +a further restriction but permits relicensing or conveying under this
2028 +License, you may add to a covered work material governed by the terms
2029 +of that license document, provided that the further restriction does
2030 +not survive such relicensing or conveying.
2031 +
2032 +  If you add terms to a covered work in accord with this section, you
2033 +must place, in the relevant source files, a statement of the
2034 +additional terms that apply to those files, or a notice indicating
2035 +where to find the applicable terms.
2036 +
2037 +  Additional terms, permissive or non-permissive, may be stated in the
2038 +form of a separately written license, or stated as exceptions;
2039 +the above requirements apply either way.
2040 +
2041 +  8. Termination.
2042 +
2043 +  You may not propagate or modify a covered work except as expressly
2044 +provided under this License.  Any attempt otherwise to propagate or
2045 +modify it is void, and will automatically terminate your rights under
2046 +this License (including any patent licenses granted under the third
2047 +paragraph of section 11).
2048 +
2049 +  However, if you cease all violation of this License, then your
2050 +license from a particular copyright holder is reinstated (a)
2051 +provisionally, unless and until the copyright holder explicitly and
2052 +finally terminates your license, and (b) permanently, if the copyright
2053 +holder fails to notify you of the violation by some reasonable means
2054 +prior to 60 days after the cessation.
2055 +
2056 +  Moreover, your license from a particular copyright holder is
2057 +reinstated permanently if the copyright holder notifies you of the
2058 +violation by some reasonable means, this is the first time you have
2059 +received notice of violation of this License (for any work) from that
2060 +copyright holder, and you cure the violation prior to 30 days after
2061 +your receipt of the notice.
2062 +
2063 +  Termination of your rights under this section does not terminate the
2064 +licenses of parties who have received copies or rights from you under
2065 +this License.  If your rights have been terminated and not permanently
2066 +reinstated, you do not qualify to receive new licenses for the same
2067 +material under section 10.
2068 +
2069 +  9. Acceptance Not Required for Having Copies.
2070 +
2071 +  You are not required to accept this License in order to receive or
2072 +run a copy of the Program.  Ancillary propagation of a covered work
2073 +occurring solely as a consequence of using peer-to-peer transmission
2074 +to receive a copy likewise does not require acceptance.  However,
2075 +nothing other than this License grants you permission to propagate or
2076 +modify any covered work.  These actions infringe copyright if you do
2077 +not accept this License.  Therefore, by modifying or propagating a
2078 +covered work, you indicate your acceptance of this License to do so.
2079 +
2080 +  10. Automatic Licensing of Downstream Recipients.
2081 +
2082 +  Each time you convey a covered work, the recipient automatically
2083 +receives a license from the original licensors, to run, modify and
2084 +propagate that work, subject to this License.  You are not responsible
2085 +for enforcing compliance by third parties with this License.
2086 +
2087 +  An "entity transaction" is a transaction transferring control of an
2088 +organization, or substantially all assets of one, or subdividing an
2089 +organization, or merging organizations.  If propagation of a covered
2090 +work results from an entity transaction, each party to that
2091 +transaction who receives a copy of the work also receives whatever
2092 +licenses to the work the party's predecessor in interest had or could
2093 +give under the previous paragraph, plus a right to possession of the
2094 +Corresponding Source of the work from the predecessor in interest, if
2095 +the predecessor has it or can get it with reasonable efforts.
2096 +
2097 +  You may not impose any further restrictions on the exercise of the
2098 +rights granted or affirmed under this License.  For example, you may
2099 +not impose a license fee, royalty, or other charge for exercise of
2100 +rights granted under this License, and you may not initiate litigation
2101 +(including a cross-claim or counterclaim in a lawsuit) alleging that
2102 +any patent claim is infringed by making, using, selling, offering for
2103 +sale, or importing the Program or any portion of it.
2104 +
2105 +  11. Patents.
2106 +
2107 +  A "contributor" is a copyright holder who authorizes use under this
2108 +License of the Program or a work on which the Program is based.  The
2109 +work thus licensed is called the contributor's "contributor version".
2110 +
2111 +  A contributor's "essential patent claims" are all patent claims
2112 +owned or controlled by the contributor, whether already acquired or
2113 +hereafter acquired, that would be infringed by some manner, permitted
2114 +by this License, of making, using, or selling its contributor version,
2115 +but do not include claims that would be infringed only as a
2116 +consequence of further modification of the contributor version.  For
2117 +purposes of this definition, "control" includes the right to grant
2118 +patent sublicenses in a manner consistent with the requirements of
2119 +this License.
2120 +
2121 +  Each contributor grants you a non-exclusive, worldwide, royalty-free
2122 +patent license under the contributor's essential patent claims, to
2123 +make, use, sell, offer for sale, import and otherwise run, modify and
2124 +propagate the contents of its contributor version.
2125 +
2126 +  In the following three paragraphs, a "patent license" is any express
2127 +agreement or commitment, however denominated, not to enforce a patent
2128 +(such as an express permission to practice a patent or covenant not to
2129 +sue for patent infringement).  To "grant" such a patent license to a
2130 +party means to make such an agreement or commitment not to enforce a
2131 +patent against the party.
2132 +
2133 +  If you convey a covered work, knowingly relying on a patent license,
2134 +and the Corresponding Source of the work is not available for anyone
2135 +to copy, free of charge and under the terms of this License, through a
2136 +publicly available network server or other readily accessible means,
2137 +then you must either (1) cause the Corresponding Source to be so
2138 +available, or (2) arrange to deprive yourself of the benefit of the
2139 +patent license for this particular work, or (3) arrange, in a manner
2140 +consistent with the requirements of this License, to extend the patent
2141 +license to downstream recipients.  "Knowingly relying" means you have
2142 +actual knowledge that, but for the patent license, your conveying the
2143 +covered work in a country, or your recipient's use of the covered work
2144 +in a country, would infringe one or more identifiable patents in that
2145 +country that you have reason to believe are valid.
2146 +
2147 +  If, pursuant to or in connection with a single transaction or
2148 +arrangement, you convey, or propagate by procuring conveyance of, a
2149 +covered work, and grant a patent license to some of the parties
2150 +receiving the covered work authorizing them to use, propagate, modify
2151 +or convey a specific copy of the covered work, then the patent license
2152 +you grant is automatically extended to all recipients of the covered
2153 +work and works based on it.
2154 +
2155 +  A patent license is "discriminatory" if it does not include within
2156 +the scope of its coverage, prohibits the exercise of, or is
2157 +conditioned on the non-exercise of one or more of the rights that are
2158 +specifically granted under this License.  You may not convey a covered
2159 +work if you are a party to an arrangement with a third party that is
2160 +in the business of distributing software, under which you make payment
2161 +to the third party based on the extent of your activity of conveying
2162 +the work, and under which the third party grants, to any of the
2163 +parties who would receive the covered work from you, a discriminatory
2164 +patent license (a) in connection with copies of the covered work
2165 +conveyed by you (or copies made from those copies), or (b) primarily
2166 +for and in connection with specific products or compilations that
2167 +contain the covered work, unless you entered into that arrangement,
2168 +or that patent license was granted, prior to 28 March 2007.
2169 +
2170 +  Nothing in this License shall be construed as excluding or limiting
2171 +any implied license or other defenses to infringement that may
2172 +otherwise be available to you under applicable patent law.
2173 +
2174 +  12. No Surrender of Others' Freedom.
2175 +
2176 +  If conditions are imposed on you (whether by court order, agreement or
2177 +otherwise) that contradict the conditions of this License, they do not
2178 +excuse you from the conditions of this License.  If you cannot convey a
2179 +covered work so as to satisfy simultaneously your obligations under this
2180 +License and any other pertinent obligations, then as a consequence you may
2181 +not convey it at all.  For example, if you agree to terms that obligate you
2182 +to collect a royalty for further conveying from those to whom you convey
2183 +the Program, the only way you could satisfy both those terms and this
2184 +License would be to refrain entirely from conveying the Program.
2185 +
2186 +  13. Use with the GNU Affero General Public License.
2187 +
2188 +  Notwithstanding any other provision of this License, you have
2189 +permission to link or combine any covered work with a work licensed
2190 +under version 3 of the GNU Affero General Public License into a single
2191 +combined work, and to convey the resulting work.  The terms of this
2192 +License will continue to apply to the part which is the covered work,
2193 +but the special requirements of the GNU Affero General Public License,
2194 +section 13, concerning interaction through a network will apply to the
2195 +combination as such.
2196 +
2197 +  14. Revised Versions of this License.
2198 +
2199 +  The Free Software Foundation may publish revised and/or new versions of
2200 +the GNU General Public License from time to time.  Such new versions will
2201 +be similar in spirit to the present version, but may differ in detail to
2202 +address new problems or concerns.
2203 +
2204 +  Each version is given a distinguishing version number.  If the
2205 +Program specifies that a certain numbered version of the GNU General
2206 +Public License "or any later version" applies to it, you have the
2207 +option of following the terms and conditions either of that numbered
2208 +version or of any later version published by the Free Software
2209 +Foundation.  If the Program does not specify a version number of the
2210 +GNU General Public License, you may choose any version ever published
2211 +by the Free Software Foundation.
2212 +
2213 +  If the Program specifies that a proxy can decide which future
2214 +versions of the GNU General Public License can be used, that proxy's
2215 +public statement of acceptance of a version permanently authorizes you
2216 +to choose that version for the Program.
2217 +
2218 +  Later license versions may give you additional or different
2219 +permissions.  However, no additional obligations are imposed on any
2220 +author or copyright holder as a result of your choosing to follow a
2221 +later version.
2222 +
2223 +  15. Disclaimer of Warranty.
2224 +
2225 +  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
2226 +APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
2227 +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
2228 +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
2229 +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2230 +PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
2231 +IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
2232 +ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
2233 +
2234 +  16. Limitation of Liability.
2235 +
2236 +  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
2237 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
2238 +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
2239 +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
2240 +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
2241 +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
2242 +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
2243 +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
2244 +SUCH DAMAGES.
2245 +
2246 +  17. Interpretation of Sections 15 and 16.
2247 +
2248 +  If the disclaimer of warranty and limitation of liability provided
2249 +above cannot be given local legal effect according to their terms,
2250 +reviewing courts shall apply local law that most closely approximates
2251 +an absolute waiver of all civil liability in connection with the
2252 +Program, unless a warranty or assumption of liability accompanies a
2253 +copy of the Program in return for a fee.
2254 +
2255 +                     END OF TERMS AND CONDITIONS
2256 +
2257 +            How to Apply These Terms to Your New Programs
2258 +
2259 +  If you develop a new program, and you want it to be of the greatest
2260 +possible use to the public, the best way to achieve this is to make it
2261 +free software which everyone can redistribute and change under these terms.
2262 +
2263 +  To do so, attach the following notices to the program.  It is safest
2264 +to attach them to the start of each source file to most effectively
2265 +state the exclusion of warranty; and each file should have at least
2266 +the "copyright" line and a pointer to where the full notice is found.
2267 +
2268 +    <one line to give the program's name and a brief idea of what it does.>
2269 +    Copyright (C) <year>  <name of author>
2270 +
2271 +    This program is free software: you can redistribute it and/or modify
2272 +    it under the terms of the GNU General Public License as published by
2273 +    the Free Software Foundation, either version 3 of the License, or
2274 +    (at your option) any later version.
2275 +
2276 +    This program is distributed in the hope that it will be useful,
2277 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
2278 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2279 +    GNU General Public License for more details.
2280 +
2281 +    You should have received a copy of the GNU General Public License
2282 +    along with this program.  If not, see <http://www.gnu.org/licenses/>.
2283 +
2284 +Also add information on how to contact you by electronic and paper mail.
2285 +
2286 +  If the program does terminal interaction, make it output a short
2287 +notice like this when it starts in an interactive mode:
2288 +
2289 +    <program>  Copyright (C) <year>  <name of author>
2290 +    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
2291 +    This is free software, and you are welcome to redistribute it
2292 +    under certain conditions; type `show c' for details.
2293 +
2294 +The hypothetical commands `show w' and `show c' should show the appropriate
2295 +parts of the General Public License.  Of course, your program's commands
2296 +might be different; for a GUI interface, you would use an "about box".
2297 +
2298 +  You should also get your employer (if you work as a programmer) or school,
2299 +if any, to sign a "copyright disclaimer" for the program, if necessary.
2300 +For more information on this, and how to apply and follow the GNU GPL, see
2301 +<http://www.gnu.org/licenses/>.
2302 +
2303 +  The GNU General Public License does not permit incorporating your program
2304 +into proprietary programs.  If your program is a subroutine library, you
2305 +may consider it more useful to permit linking proprietary applications with
2306 +the library.  If this is what you want to do, use the GNU Lesser General
2307 +Public License instead of this License.  But first, please read
2308 +<http://www.gnu.org/philosophy/why-not-lgpl.html>.
2309 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/Makefile ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/Makefile
2310 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/Makefile	1970-01-01 01:00:00.000000000 +0100
2311 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/Makefile	2008-08-23 08:23:37.000000000 +0200
2312 @@ -0,0 +1,19 @@
2313 +SRC +=	$(wildcard ./src/*.c)
2314 +
2315 +OBJS = $(SRC:.c=.o)
2316 +
2317 +CC = gcc
2318 +CFLAGS = -c -g -Wall -Werror -I./src
2319 +LFLAGS = -g -Wall 
2320 +BUILDLIBS = -L/usr/lib -lpcap -Wl
2321 +
2322 +.c.o:
2323 +	${CC} ${CFLAGS} -o $@ $^
2324 +
2325 +netsimpcap:	${OBJS}
2326 +	${CC} -o ./bin/$@ ${LFLAGS} ${BUILDLIBS} ${OBJS}
2327 +
2328 +clean:
2329 +	rm -f ${OBJS} ./bin/netsimpcap
2330 +
2331 +all: netsimpcap
2332 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/sampleconf.txt ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/sampleconf.txt
2333 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/sampleconf.txt	1970-01-01 01:00:00.000000000 +0100
2334 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/sampleconf.txt	2008-08-23 08:23:37.000000000 +0200
2335 @@ -0,0 +1,11 @@
2336 +0 1 0.8
2337 +
2338 +1 2 0.9
2339 +
2340 +2 3 0.8
2341 +
2342 +3 4 0.7
2343 +
2344 +4 5 0.9
2345 +
2346 +5 0 0.95
2347 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/config.c ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/config.c
2348 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/config.c	1970-01-01 01:00:00.000000000 +0100
2349 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/config.c	2008-08-23 08:23:37.000000000 +0200
2350 @@ -0,0 +1,107 @@
2351 +/*
2352 + * NetsimPcap - a userspace network bridge with simulated packet loss
2353 + *             Copyright 2008 H. Rogge (rogge@fgan.de)
2354 + * 
2355 + * This program is free software: you can redistribute it and/or modify
2356 + * it under the terms of the GNU General Public License as published by
2357 + * the Free Software Foundation, either version 3 of the License, or
2358 + * (at your option) any later version.
2359 + *
2360 + * This program is distributed in the hope that it will be useful,
2361 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2362 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2363 + * GNU General Public License for more details.
2364 + *
2365 + * You should have received a copy of the GNU General Public License
2366 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
2367 + */
2368 +
2369 +#include <stdio.h>
2370 +#include <stdlib.h>
2371 +#include <string.h>
2372 +
2373 +#include "config.h"
2374 +#include "debug.h"
2375 +
2376 +/*
2377 + * stripString
2378 + * 
2379 + * this function strips leading and trailing whitespaces from a string
2380 + * 
2381 + * @param string to strip
2382 + * @return stripped string
2383 + */
2384 +char *
2385 +stripString (char *str)
2386 +{
2387 +
2388 +  /* strip left whitespaces */
2389 +  while (*str == ' ' || *str == '\t') {
2390 +    str++;
2391 +  }
2392 +	
2393 +  /* strip right whitespaces */
2394 +  int i = strlen(str);
2395 +  while (--i >= 0) {
2396 +    if(str[i]==' ' || str[i]=='\r' || str[i]=='\n' || str[i]=='\t') {
2397 +      str[i] = 0;
2398 +      break;
2399 +    }
2400 +  }
2401 +	
2402 +  return str;
2403 +}
2404 +
2405 +/*
2406 + * readConnectionMatrix
2407 + * 
2408 + * This function reads the network settings and place them in the
2409 + * connection matrix (float array with size "len" x "len".
2410 + * 
2411 + * @param pointer to begin of connection matrix
2412 + * @param pointer to filename
2413 + * @param number of elements in each connection matrix line
2414 + * @return 0 if function was successfull, 1 if an error happened
2415 + */
2416 +int
2417 +readConnectionMatrix (float *connectionMatrix, char *filename, int len)
2418 +{
2419 +  FILE *file = fopen(filename, "r");
2420 +  if (!file) {
2421 +    return 1;
2422 +  }
2423 +	
2424 +  char buffer[1024];
2425 +  while (fgets(buffer, 1024, file)) {
2426 +    int from, to;
2427 +    float propability;
2428 +    
2429 +    char *line = stripString(buffer);
2430 +    DPRINT("%s\n", line);
2431 +		
2432 +    if (line[0] == '#' || line[0] == 0) {
2433 +      continue;
2434 +    }
2435 +		
2436 +    if(sscanf(line, "%d %d %f", &from, &to, &propability) != 3) {
2437 +      continue;
2438 +    }
2439 +		
2440 +    if (from < 0 || from >= len || to < 0 || to >= len || from == to) {
2441 +      continue;
2442 +    }
2443 +		
2444 +    connectionMatrix[GRID(from, to, len)] = propability;
2445 +    if (connectionMatrix[GRID(to, from, len)] == 0) {
2446 +      connectionMatrix[GRID(to, from, len)] = propability;
2447 +    }
2448 +  }
2449 +  fclose(file);
2450 +  return 0;
2451 +}
2452 +
2453 +/*
2454 + * Local Variables:
2455 + * c-basic-offset: 2
2456 + * End:
2457 + */
2458 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/config.h ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/config.h
2459 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/config.h	1970-01-01 01:00:00.000000000 +0100
2460 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/config.h	2008-08-23 08:23:37.000000000 +0200
2461 @@ -0,0 +1,32 @@
2462 +/*
2463 + * NetsimPcap - a userspace network bridge with simulated packet loss
2464 + *             Copyright 2008 H. Rogge (rogge@fgan.de)
2465 + * 
2466 + * This program is free software: you can redistribute it and/or modify
2467 + * it under the terms of the GNU General Public License as published by
2468 + * the Free Software Foundation, either version 3 of the License, or
2469 + * (at your option) any later version.
2470 + *
2471 + * This program is distributed in the hope that it will be useful,
2472 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2473 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2474 + * GNU General Public License for more details.
2475 + *
2476 + * You should have received a copy of the GNU General Public License
2477 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
2478 + */
2479 +
2480 +#ifndef CONFIG_H_
2481 +    
2482 +#define CONFIG_H_
2483 +
2484 +#define GRID(x,y,width) ((x) + (y) * (width))
2485 +
2486 +int readConnectionMatrix(float *connectionMatrix, char *filename, int len);
2487 +#endif /*CONFIG_H_*/
2488 +
2489 +/*
2490 + * Local Variables:
2491 + * c-basic-offset: 2
2492 + * End:
2493 + */
2494 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/debug.h ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/debug.h
2495 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/debug.h	1970-01-01 01:00:00.000000000 +0100
2496 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/debug.h	2008-08-23 08:23:37.000000000 +0200
2497 @@ -0,0 +1,38 @@
2498 +/*
2499 + * NetsimPcap - a userspace network bridge with simulated packet loss
2500 + *             Copyright 2008 H. Rogge (rogge@fgan.de)
2501 + * 
2502 + * This program is free software: you can redistribute it and/or modify
2503 + * it under the terms of the GNU General Public License as published by
2504 + * the Free Software Foundation, either version 3 of the License, or
2505 + * (at your option) any later version.
2506 + *
2507 + * This program is distributed in the hope that it will be useful,
2508 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2509 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2510 + * GNU General Public License for more details.
2511 + *
2512 + * You should have received a copy of the GNU General Public License
2513 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
2514 + */
2515 +
2516 +#ifndef WLAN_DEBUG_H
2517 +#define WLAN_DEBUG_H
2518 +
2519 +#define DPRINT(...)		if(debugMode) { printf(__VA_ARGS__); }
2520 +
2521 +#define DHEXDUMP(purpose, data,length)	if (debugMode) {	\
2522 +		int i;										\
2523 +		printf("Hexdump: %s\n", purpose);						\
2524 +		for (i=0; i<length; i++) {					\
2525 +			if ((i & 31) == 0)	printf("%04x: ", i);\
2526 +			printf("%02x", ((int)data[i])  & 255);	\
2527 +			if ((i & 3) == 3) printf(" ");			\
2528 +			if ((i & 31) == 31) printf("\n");		\
2529 +		}											\
2530 +		printf("\n\n");								\
2531 +	}
2532 +
2533 +extern int debugMode;
2534 +
2535 +#endif
2536 diff -Nur ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/netsimpcap.c ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/netsimpcap.c
2537 --- ubnt-lsX-SDK-v3.2.3743.orig/apps/gpl/olsrd/contrib/netsimpcap/src/netsimpcap.c	1970-01-01 01:00:00.000000000 +0100
2538 +++ ubnt-lsX-SDK-v3.2.3743.diff/apps/gpl/olsrd/contrib/netsimpcap/src/netsimpcap.c	2008-08-23 08:23:37.000000000 +0200
2539 @@ -0,0 +1,397 @@
2540 +/*
2541 + * NetsimPcap - a userspace network bridge with simulated packet loss
2542 + *             Copyright 2008 H. Rogge (rogge@fgan.de)
2543 + * 
2544 + * This program is free software: you can redistribute it and/or modify
2545 + * it under the terms of the GNU General Public License as published by
2546 + * the Free Software Foundation, either version 3 of the License, or
2547 + * (at your option) any later version.
2548 + *
2549 + * This program is distributed in the hope that it will be useful,
2550 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
2551 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2552 + * GNU General Public License for more details.
2553 + *
2554 + * You should have received a copy of the GNU General Public License
2555 + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
2556 + */
2557 +
2558 +#include <errno.h>
2559 +#include <fcntl.h>
2560 +#include <pcap.h>
2561 +#include <pthread.h>
2562 +#include <stddef.h>
2563 +#include <stdio.h>
2564 +#include <string.h>
2565 +#include <stdarg.h>
2566 +#include <stdlib.h>
2567 +#include <signal.h>
2568 +#include <time.h>
2569 +#include <unistd.h>
2570 +#include <arpa/inet.h>
2571 +#include <linux/if_ether.h>
2572 +#include <linux/if_packet.h>
2573 +#include <linux/if_tun.h>
2574 +#include <net/if_arp.h>
2575 +#include <netinet/ip.h>
2576 +#include <netinet/udp.h>
2577 +#include <net/if.h>
2578 +#include <net/route.h>
2579 +#include <sys/ioctl.h>
2580 +#include <sys/time.h>
2581 +#include <sys/types.h>
2582 +
2583 +#include "config.h"
2584 +#include "network_tap.h"
2585 +
2586 +int debugMode = 0;
2587 +
2588 +int running;
2589 +
2590 +pcap_t* devices[128];
2591 +int deviceFD[128];
2592 +int deviceCount;
2593 +
2594 +int tapFD;
2595 +
2596 +u_int32_t *connBC;
2597 +u_int32_t *connUni;
2598 +
2599 +u_int8_t buffer[65536];
2600 +u_int8_t mac_bc[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
2601 +
2602 +/*
2603 + * signalHandler
2604 + * 
2605 + * This handler stops the mainloop when the programm is send a signal
2606 + * to stop
2607 + */
2608 +static void
2609 +signalHandler (int signo __attribute__((unused)))
2610 +{
2611 +  running = 0;
2612 +}
2613 +
2614 +/*
2615 + * calculateConnections
2616 + * 
2617 + * @param pointer to user defined connection matrix
2618 + * @param number of elements in a matrix line
2619 + * @param 1 if matrix contains drop-propabilities
2620 + */
2621 +void
2622 +calculateConnections (float *connMatrix, int socketcount, int drop)
2623 +{
2624 +
2625 +  /* calculating unicast/broadcast matrix */
2626 +  connUni = malloc(sizeof(u_int32_t) * socketcount * socketcount);
2627 +  memset(connUni, 0, sizeof(u_int32_t) * socketcount * socketcount);
2628 +  connBC = malloc(sizeof(u_int32_t) * socketcount * socketcount);
2629 +  memset(connBC, 0, sizeof(u_int32_t) * socketcount * socketcount);
2630 +  
2631 +  float broadcast, unicast;
2632 +  int i, j;
2633 +  for (j=0; j<socketcount; j++) {
2634 +    for (i=0; i<socketcount; i++) {
2635 +      float prop = connMatrix[GRID(i, j, socketcount)];
2636 +      if (drop) {
2637 +        prop = 1.0 - prop;
2638 +      }
2639 +      broadcast = prop;
2640 +      
2641 +      /* IEEE 802.11 do (normally) up to 4 retransmissions for unicast.
2642 +       * A unicast package is only lost if all of this 5 transmissions
2643 +       * are lost.
2644 +       */      
2645 +      prop = 1 - prop;
2646 +      unicast = (1 - prop)*(1 + prop + prop*prop + prop*prop*prop + prop*prop*prop*prop);
2647 +      
2648 +      connBC[GRID(i, j, socketcount)] = (1<<24) * broadcast;
2649 +      connUni[GRID(i, j, socketcount)] = (1<<24) * unicast;
2650 +    }
2651 +  }
2652 +  
2653 +  if (debugMode) {
2654 +    printf("Connection matrix for unicast:\n");
2655 +    for (j=0; j<socketcount; j++) {
2656 +      for (i=0; i<socketcount; i++) {
2657 +        if (i>0) {
2658 +          printf(" ");
2659 +        }
2660 +        
2661 +        printf("%1.2f", (float)connBC[GRID(i,j, socketcount)] / (float)(1<<24));
2662 +      }
2663 +      printf("\n");
2664 +    }
2665 +    printf("\nConnectionmatrix for broadcast:\n");
2666 +    for (j=0; j<socketcount; j++) {
2667 +      for (i=0; i<socketcount; i++) {
2668 +        if (i>0) {
2669 +          printf(" ");
2670 +        }
2671 +        
2672 +        printf("%1.2f", (float)connUni[GRID(i,j, socketcount)] / (float)(1<<24));
2673 +      }
2674 +      printf("\n");
2675 +    }
2676 +  }
2677 +}
2678 +
2679 +/*
2680 + * tap_callback
2681 + * 
2682 + * This function is called every times a package is received through the
2683 + * (optional) tap device. It retransmits the package to all connected devices.
2684 + */
2685 +void
2686 +tap_callback (void)
2687 +{
2688 +  int len, i;
2689 +  
2690 +  len = read(tapFD, buffer, sizeof(buffer));
2691 +  if (len > 0) {
2692 +    for (i=0; i<deviceCount; i++) {
2693 +      pcap_inject(devices[i], buffer, len);
2694 +    }
2695 +  }
2696 +}
2697 +
2698 +/*
2699 + * capture_callback
2700 + * 
2701 + * This function is called for every package received through libpcap on
2702 + * one of the connected devices. It retransmit the package to the other
2703 + * devices (loss propability is defined in connection matrix) and always
2704 + * to the tap device (if active)
2705 + * 
2706 + * See libpcap documentation for parameters
2707 + */
2708 +void
2709 +capture_callback (u_char *args, const struct pcap_pkthdr* hdr, const u_char* packet)
2710 +{
2711 +  int *index = (int *)args;
2712 +  int unicast = memcmp(packet, mac_bc, 6) != 0;
2713 +  
2714 +  int i, len;
2715 +  
2716 +  len = hdr->len;
2717 +  memcpy(buffer, packet, len);
2718 +  
2719 +  if (tapFD != -1) {
2720 +    int send = 0;
2721 +    while (send < len) {
2722 +      int t = write(tapFD, &buffer[send], len - send);
2723 +      if (t == -1) {
2724 +        printf("Error while sending to tap device!\n");
2725 +        break;
2726 +      }
2727 +      send += t;
2728 +    }
2729 +  }
2730 +  
2731 +  for (i=0; i<deviceCount; i++) {
2732 +    u_int32_t prop;
2733 +    if (unicast) {
2734 +      prop = connUni[GRID(*index, i, deviceCount)];
2735 +    } else {
2736 +      prop = connBC[GRID(*index, i, deviceCount)];
2737 +    }
2738 +    
2739 +    if (prop == 0 || prop < (rand() % (1<<24))) {
2740 +      continue;
2741 +    }
2742 +    
2743 +    pcap_inject(devices[i], buffer, len);
2744 +  }
2745 +}
2746 +
2747 +int
2748 +main (int argc, char **argv)
2749 +{
2750 +  int i;
2751 +  int dropPropability = 0;
2752 +  char *connectionFile= NULL;
2753 +  int deviceIndex = -1;
2754 +  int hubMode = 0;
2755 +  
2756 +  MacAddress mac;
2757 +  char *tapname = NULL;
2758 +  
2759 +  if (argc==1 || (argc == 2 && strcmp(argv[1], "--help")==0)) {
2760 +    printf("%s: [-con <connectionfile>] [-hub] [-debug]"
2761 +        " [-tap <devname> <mac>] [-drop] -dev <dev1> <dev2> <dev3>...\n", argv[0]);
2762 +    return 0;
2763 +  }
2764 +  
2765 +  deviceCount = 0;
2766 +  tapFD = -1;
2767 +  
2768 +  for (i=1; i<argc; i++) {
2769 +    if (strcmp(argv[i], "-con")==0 && i < argc-1) {
2770 +      connectionFile = argv[i+1];
2771 +      i++;
2772 +    }
2773 +    if (strcmp(argv[i], "-drop")==0) {
2774 +      dropPropability = 1;
2775 +    }
2776 +    if (strcmp(argv[i], "-dev")==0) {
2777 +      deviceIndex = ++i;
2778 +      while (i < argc && argv[i][0] != '-') {
2779 +        i++;
2780 +        deviceCount++;
2781 +      }
2782 +      i--; /* to cancel the i++ in the for loop */
2783 +    }
2784 +    if (strcmp(argv[i], "-hub")==0) {
2785 +      hubMode = 1;
2786 +    }
2787 +    if (strcmp(argv[i], "-tap")==0 && i < argc-2) {
2788 +      tapname = argv[++i];
2789 +      readMac(argv[++i], &mac);
2790 +    }
2791 +    if (strcmp(argv[i], "-debug")==0) {
2792 +      debugMode = 1;
2793 +    }
2794 +  }
2795 +  
2796 +  if (hubMode == 1 && connectionFile != NULL) {
2797 +    printf("Error, you cannot set matrix file in hub mode.\n");
2798 +    return 1;
2799 +  }
2800 +  
2801 +  if (connectionFile == NULL && hubMode == 0) {
2802 +    printf("Error, netsim needs a matrix file for connections if not running in hub mode.\n");
2803 +    return 1;
2804 +  }
2805 +  
2806 +  if (deviceIndex < 0) {
2807 +    printf("Error, you must specify the devices the programm connects to.\n");
2808 +    return 1;
2809 +  }
2810 +  
2811 +  if (deviceCount < 2) {
2812 +    printf("Error, you need to bind at least two devices to the bridge.\n");
2813 +    return 1;
2814 +  }
2815 +  
2816 +  if (tapname) {
2817 +    tapFD = createTap(tapname, &mac);
2818 +    if (tapFD==-1) {
2819 +      printf("Error, cannot open tap device '%s'\n", tapname);
2820 +      return 1;
2821 +    }
2822 +    
2823 +  }
2824 +  running = 1;
2825 +  
2826 +  float *connMatrix = malloc(sizeof(float) * deviceCount * deviceCount);
2827 +  if (!connMatrix) {
2828 +    printf("Error, not enough memory for mac buffer!");
2829 +    if (tapFD != -1)    closeTap(tapFD);
2830 +    return 1;
2831 +  }
2832 +  
2833 +  if (hubMode) {
2834 +    int x,y;
2835 +
2836 +    /*
2837 +     * In hub mode the any-to-any loss factor is 1.0, which
2838 +     * means we can skip reading a matrix file.
2839 +     */
2840 +    for (y=0; y<deviceCount; y++) {
2841 +      for (x=0; x<deviceCount; x++) {
2842 +        if (x != y) {
2843 +          connMatrix[GRID(x,y,deviceCount)] = 1.0;
2844 +        }
2845 +      }
2846 +    }
2847 +  } else {
2848 +    if (readConnectionMatrix(connMatrix, connectionFile, deviceCount)) {
2849 +      printf("Error while reading matrix file\n");
2850 +      free(connMatrix);
2851 +      if (tapFD != -1)    closeTap(tapFD);
2852 +      return 1;
2853 +    }
2854 +  }
2855 +  calculateConnections(connMatrix, deviceCount, dropPropability);
2856 +  free(connMatrix);
2857 +
2858 +  char errbuf[PCAP_ERRBUF_SIZE];
2859 +  int maxDeviceFD = 0;
2860 +  
2861 +  if (tapFD != -1) {
2862 +    maxDeviceFD = tapFD;
2863 +  }
2864 +  for (i=0; i<deviceCount; i++) {
2865 +    devices[i] = pcap_open_live(argv[i + deviceIndex], BUFSIZ, 0, -1, errbuf);
2866 +    deviceFD[i] = -1;
2867 +    if (devices[i] == NULL) {
2868 +      printf("Error, cannot open pcap for device '%s'.\n", argv[i + deviceIndex]);
2869 +      running = 0;
2870 +    } else {
2871 +      deviceFD[i] = pcap_fileno(devices[i]);
2872 +      if (deviceFD[i] > maxDeviceFD) {
2873 +        maxDeviceFD = deviceFD[i];
2874 +      }
2875 +    }
2876 +  }
2877 +  
2878 +  /* activate signal handling */
2879 +  signal(SIGABRT, &signalHandler);
2880 +  signal(SIGTERM, &signalHandler);
2881 +  signal(SIGQUIT, &signalHandler);
2882 +  signal(SIGINT, &signalHandler);
2883 +  
2884 +  while (running) {