dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

71 Commits

Author SHA1 Message Date
Antonio Quartulli 785ea11441 batman-adv: Distributed ARP Table - create DHT helper functions
Add all the relevant functions in order to manage a Distributed Hash Table over
the B.A.T.M.A.N.-adv network. It will later be used to store several ARP entries
and implement DAT (Distributed ARP Table)

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-11-07 20:00:19 +01:00
Marek Lindner 14511519d4 batman-adv: split hard_iface struct for each routing protocol
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-10-29 09:39:05 +01:00
Sven Eckelmann 807736f6e0 batman-adv: Split batadv_priv in sub-structures for features
The structure batadv_priv grows everytime a new feature is introduced. It gets
hard to find the parts of the struct that belongs to a specific feature. This
becomes even harder by the fact that not every feature uses a prefix in the
member name.

The variables for bridge loop avoidence, gateway handling, translation table
and visualization server are moved into separate structs that are included in
the bat_priv main struct.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-08-23 14:20:13 +02:00
Simon Wunderlich 624463079e batman-adv: check batadv_orig_hash_add_if() return code
If this call fails, some of the orig_nodes spaces may have been
resized for the increased number of interface, and some may not.
If we would just continue with the larger number of interfaces,
this would lead to access to not allocated memory later.

We better check the return code, and don't add the interface if
no memory is available. OTOH, keeping some of the orig_nodes
with too much memory allocated should hurt no one (except for
a few too many bytes allocated).

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-08-23 14:02:46 +02:00
Sven Eckelmann 0aca2369b1 batman-adv: Fix alignment after opened parentheses
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-07-01 22:47:23 +02:00
Sven Eckelmann b706b13b6c batman-adv: Remove bat_ prefix from bat_{debugfs, sysfs}.{c, h}
The "bat_" prefix in the source files implementing the batman-adv sysfs and
debugfs interface doesn't have a special meaning and are only used by these
files and files that implement the actual B.A.T.M.A.N. path finding algorithm.

The prefix is better suited to mark files that are used to implement the main
part of the path finding. All other files should not use it and therefore gets
renamed.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:22 +02:00
Sven Eckelmann 56303d34a3 batman-adv: Prefix types structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:21 +02:00
Sven Eckelmann 9641269011 batman-adv: Prefix packet structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:21 +02:00
Sven Eckelmann e9a4f295eb batman-adv: Prefix hard-interface enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:18 +02:00
Sven Eckelmann 42d0b044b7 batman-adv: Prefix main defines with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-28 08:45:05 +02:00
Sven Eckelmann c11fdfaefa batman-adv: Prefix types defines with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-28 08:45:01 +02:00
Sven Eckelmann 7e071c79a6 batman-adv: Prefix packet defines with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-28 08:45:00 +02:00
Sven Eckelmann 3e34819e0e batman-adv: Prefix remaining function like macros with batadv_
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-28 08:44:48 +02:00
Sven Eckelmann 18a1cb6ee0 batman-adv: Prefix hard-interface local static functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-25 08:21:40 +02:00
Sven Eckelmann 1eda58bfc5 batman-adv: Prefix main static inline functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-25 08:21:30 +02:00
Sven Eckelmann e5d89254bf batman-adv: Prefix hard-interface static inline functions with batadv_
All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-24 18:41:41 +02:00
Sven Eckelmann 9cfc7bd608 batman-adv: Reformat multiline comments to consistent style
batman-adv doesn't follow the style for multiline comments that David S. Miller
prefers. All comments should be reformatted to follow this consistent style to
make the code slightly more readable.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:33 +02:00
Sven Eckelmann 3193e8fdfa batman-adv: Prefix main non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:32 +02:00
Sven Eckelmann 04b482a21a batman-adv: Prefix soft-interface non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:28 +02:00
Sven Eckelmann 9455e34cb2 batman-adv: Prefix send non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:26 +02:00
Sven Eckelmann 7d211efc50 batman-adv: Prefix originator non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:23 +02:00
Sven Eckelmann 9563877ea5 batman-adv: Prefix hard-interface non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:20 +02:00
Sven Eckelmann 08adf15122 batman-adv: Prefix bridge_loop_avoidance non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:17 +02:00
Sven Eckelmann 5853e22c58 batman-adv: Prefix bat_sysfs non-static functions with batadv_
batman-adv can be compiled as part of the kernel instead of an module. In that
case the linker will see all non-static symbols of batman-adv and all other
non-static symbols of the kernel. This could lead to symbol collisions. A
prefix for the batman-adv symbols that defines their private namespace avoids
such a problem.

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-20 22:15:15 +02:00
Sven Eckelmann 5346c35ebf batman-adv: Return error codes instead of -1 on failures
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-06-18 18:01:03 +02:00
Sven Eckelmann 679695813c batman-adv: use shorter pr_warn instead of pr_warning
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-05-13 19:06:41 +02:00
Marek Lindner c32293983d batman-adv: refactoring API: find generalized name for bat_ogm_update_mac callback
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-05-11 13:56:01 +02:00
Marek Lindner ffa995e036 batman-adv: introduce packet type handler array for incoming packets
The packet handler array replaces the growing switch statement, thus
dealing with incoming packets in a more efficient way. It also adds
to possibility to register packet handlers on the fly.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-05-11 10:08:10 +02:00
Antonio Quartulli 0d125074eb batman-adv: use ETH_HLEN instead of sizeof(struct ethhdr)
Instead of using sizeof(struct ethhdr) it is strongly recommended to use the
kernel macro ETH_HLEN. This patch substitute each occurrence of the former
expressione with the latter one.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-18 09:54:01 +02:00
Marek Lindner 1eeb479fda batman-adv: mark existing ogm variables as batman iv
The coming protocol changes also will have a part called "OGM". That
makes it necessary to introduce a distinction in the code base.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-18 09:54:01 +02:00
Marek Lindner cd8b78e7e9 batman-adv: refactoring API: find generalized name for bat_ogm_init_primary callback
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-18 09:54:00 +02:00
Marek Lindner 77af7575c4 batman-adv: handle routing code initialization properly
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-18 09:53:59 +02:00
Marek Lindner 00a50076a3 batman-adv: add iface_disable() callback to routing API
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-18 09:53:59 +02:00
Marek Lindner c2aca02235 batman-adv: refactoring API: find generalized name for bat_ogm_init callback
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-18 09:53:58 +02:00
Marek Lindner 8140625e30 batman-adv: move ogm initialization into the proper function
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-18 09:53:57 +02:00
Simon Wunderlich 23721387c4 batman-adv: add basic bridge loop avoidance code
This second version of the bridge loop avoidance for batman-adv
avoids loops between the mesh and a backbone (usually a LAN).

By connecting multiple batman-adv mesh nodes to the same ethernet
segment a loop can be created when the soft-interface is bridged
into that ethernet segment. A simple visualization of the loop
involving the most common case - a LAN as ethernet segment:

node1  <-- LAN  -->  node2
  |                   |
wifi   <-- mesh -->  wifi

Packets from the LAN (e.g. ARP broadcasts) will circle forever from
node1 or node2 over the mesh back into the LAN.

With this patch, batman recognizes backbone gateways, nodes which are
part of the mesh and backbone/LAN at the same time. Each backbone
gateway "claims" clients from within the mesh to handle them
exclusively. By restricting that only responsible backbone gateways
may handle their claimed clients traffic, loops are effectively
avoided.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-04-11 14:28:58 +02:00
Sven Eckelmann 86ceb36056 batman-adv: Ignore 80-chars per line limits for strings
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-03-11 06:29:44 +08:00
Sven Eckelmann 7c64fd98ce batman-adv: Fix indentation of multiline statements
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-28 19:14:31 +08:00
Sven Eckelmann 567db7b0b7 batman-adv: Update copyright years
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17 02:50:21 +08:00
Marek Lindner 01c4224b51 batman-adv: convert batman iv algorithm to use dynamic infrastructure
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17 02:50:20 +08:00
Marek Lindner 6e242f9037 batman-adv: warn if added interface is part of a bridge
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17 02:50:19 +08:00
Sven Eckelmann 76543d14ae batman-adv: Explicitly mark the common header structure
All batman-adv packets have a common 3 byte header. It can be used to share
some code between different code paths, but it was never explicit stated that
this header has to be always the same for all packets. Therefore, new code
changes always have the problem that they may accidently introduce regressions
by moving some elements around.

A new structure is introduced that contains the common header and makes it
easier visible that these 3 bytes have to be the same for all on-wire packets.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2012-02-17 02:50:19 +08:00
Joe Perches 320f422f62 batman-adv: Remove unnecessary OOM logging messages
Removing unnecessary messages saves code and text.

Site specific OOM messages are duplications of a generic MM
out of memory message and aren't really useful, so just
delete them.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-09-08 17:52:30 +02:00
Marek Lindner b9dacc521f batman-adv: agglomerate all batman iv ogm sending functions in the batman iv file
In the process the batman iv OGM aggregation code could be merged
into the batman iv code base which makes the separate aggregation
files superfluous.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-09-08 17:44:41 +02:00
Marek Lindner d0b9fd89c2 batman-adv: move routing packet initialization into corresponding file
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-09-08 17:39:06 +02:00
Marek Lindner fc95727564 batman-adv: agglomerate all batman iv ogm processing functions in a single file
In preparation of the upcoming improved routing algorithm the code based has
to be re-organized to allow choosing the routing algorithm at compile time.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-09-08 17:39:06 +02:00
Marek Lindner b6da4bf5d7 batman-adv: rename all instances of batman_packet to batman_ogm_packet
The follow-up routing code changes are going to introduce additional
routing packet types which make this distinction necessary.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-09-08 17:37:51 +02:00
Antonio Quartulli bc2790808a batman-adv: detect clients connected through a 802.11 device
Clients connected through a 802.11 device are now marked with the
TT_CLIENT_WIFI flag. This flag is also advertised with the tt
announcement.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-08-22 15:16:20 +02:00
Antonio Quartulli 015758d002 batman-adv: correct several typ0s in the comments
Several typos have been corrected and some sentences have been rephrased

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
2011-08-22 15:16:19 +02:00
David S. Miller eac56465b8 Merge branch 'batman-adv/next' of git://git.open-mesh.org/ecsv/linux-merge 2011-06-20 12:59:37 -07:00