summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/bat_iv_ogm.c
Commit message (Collapse)AuthorAgeFilesLines
...
* batman-adv: Prefix remaining function like macros with batadv_Sven Eckelmann2012-06-281-1/+1
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Prefix bat_iv_ogm local static functions with batadv_Sven Eckelmann2012-06-251-127/+130
| | | | | | | | 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>
* batman-adv: Prefix main static inline functions with batadv_Sven Eckelmann2012-06-251-99/+107
| | | | | | | | 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>
* batman-adv: Prefix hard-interface static inline functions with batadv_Sven Eckelmann2012-06-241-7/+7
| | | | | | | | 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>
* batman-adv: Prefix bitarray static inline functions with batadv_Sven Eckelmann2012-06-241-6/+7
| | | | | | | | 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>
* batman-adv: Reformat multiline comments to consistent styleSven Eckelmann2012-06-201-33/+42
| | | | | | | | 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>
* batman-adv: Prefix main non-static functions with batadv_Sven Eckelmann2012-06-201-8/+8
| | | | | | | | | | | 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>
* batman-adv: Prefix translation-table non-static functions with batadv_Sven Eckelmann2012-06-201-10/+13
| | | | | | | | | | | 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>
* batman-adv: Prefix send non-static functions with batadv_Sven Eckelmann2012-06-201-4/+5
| | | | | | | | | | | 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>
* batman-adv: Prefix routing non-static functions with batadv_Sven Eckelmann2012-06-201-7/+8
| | | | | | | | | | | 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>
* batman-adv: Prefix ring_buffer non-static functions with batadv_Sven Eckelmann2012-06-201-7/+7
| | | | | | | | | | | 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>
* batman-adv: Prefix originator non-static functions with batadv_Sven Eckelmann2012-06-201-21/+22
| | | | | | | | | | | 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>
* batman-adv: Prefix gateway-client non-static functions with batadv_Sven Eckelmann2012-06-201-3/+3
| | | | | | | | | | | 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>
* batman-adv: Prefix bitarray non-static functions with batadv_Sven Eckelmann2012-06-201-3/+3
| | | | | | | | | | | 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>
* batman-adv: Prefix bat_algo non-static functions with batadv_Sven Eckelmann2012-06-201-1/+1
| | | | | | | | | | | 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>
* batman-adv: turn tt commit code into routing protocol agnostic APIMarek Lindner2012-06-181-5/+9
| | | | | | | | | | | | Prior to this patch the translation table code made assumptions about how the routing protocol works and where its buffers are stored (to directly modify them). Each protocol now calls the tt code with the relevant pointers, thereby abstracting the code. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: don't bother flipping ->tt_crcAl Viro2012-06-181-8/+2Star
| | | | | | | Keep it net-endian Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Return error codes instead of -1 on failuresSven Eckelmann2012-06-181-1/+1
| | | | Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: keep batman_ogm_packet ->seqno net-endian all alongAl Viro2012-06-181-11/+11
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: avoid characters requiring shell escapes in protocol namesMarek Lindner2012-06-181-1/+1
| | | | | | Reported-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Add get_ethtool_stats() supportMartin Hundebøll2012-06-181-1/+9
| | | | | | | | | | | | | | | | | | | Added additional counters in a bat_stats structure, which are exported through the ethtool api. The counters are specific to batman-adv and includes: forwarded packets and bytes management packets and bytes (aggregated OGMs at this point) translation table packets New counters are added by extending "enum bat_counters" in types.h and adding corresponding descriptive string(s) to bat_counters_strings in soft-iface.c. Counters are increased by calling batadv_add_counter() and incremented by one by calling batadv_inc_counter(). Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: convert bat_priv->tt_crc from atomic_t to uint16_tAntonio Quartulli2012-06-181-2/+1Star
| | | | | | | | | | In the code we neever need to atomically check and set the bat_priv->tt_crc field value. It is simply set and read once in different pieces of the code. Therefore this field can be safely be converted from atomic_t to uint16_t. Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: prepare lq_update_lock to be shared among different protocolsMarek Lindner2012-05-131-5/+4Star
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: fix checkpatch string complaintMarek Lindner2012-05-111-2/+2
| | | | | | | Regression introduced by: f76d019194e0a88c57371df169ecc979690a04c2 Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: avoid temporary routing loops by being strict on forwarded OGMsMarek Lindner2012-05-111-29/+31
| | | | | | | | | | | | | | | | | batman-adv would forward OGMs from non-besthops while replacing the the TQ and TTL values with the values from the best hop. In certain corner cases this leads to a temporary routing loop. This patch changes this behavior: Only packets from best next hops are forwarded - TQ and TTL values won't be replaced anymore. However, the protocol needs to rebroadcast OGMs from single hop neighbors regardless of whether or not they are the best hop. To handle this case a new flag is introduced to alert neighboring nodes about the forwarded OGM that is not from my best next hop. It is to be discarded by all nodes except for the one originating the OGM. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Acked-by: Daniele Furlan <daniele.furlan@gmail.com> Tested-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
* batman-adv: refactoring API: find generalized name for bat_ogm_update_mac ↵Marek Lindner2012-05-111-9/+9
| | | | | | | callback Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: ignore protocol packets if the interface did not enable this ↵Marek Lindner2012-05-111-0/+7
| | | | | | | | protocol Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: split neigh_new function into generic and batman iv specific partsMarek Lindner2012-05-111-6/+34
| | | | | | 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>
* batman-adv: rename last_valid to last_seenMarek Lindner2012-05-111-4/+4
| | | | | | 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>
* batman-adv: register batman ogm receive function during protocol initMarek Lindner2012-05-111-4/+27
| | | | | | | | | | | The B.A.T.M.A.N. IV OGM receive function still was hard-coded although it is a routing protocol specific function. This patch takes advantage of the dynamic packet handler registration to remove the hard-coded function calls. 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>
* batman-adv: introduce is_single_hop_neigh variable to increase readabilityMarek Lindner2012-05-111-7/+9
| | | | | | 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>
* batman-adv: skip the window protection test when the originator has no ↵Antonio Quartulli2012-04-181-1/+2
| | | | | | | | | | | | | | | neighbours When we receive an OGM from from a node for the first time, the last_real_seqno field of the orig_node structure has not been initialised yet. The value of this field is used to compute the current ogm-seqno window and therefore the protection mechanism will probably drop the packet due to an out-of-window error. To avoid this situation this patch adds a check to skip the window protection mechanism if no neighbour nodes have already been added. When the first neighbour node is added, the last_real_seqno field is initialised too. Reported-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: print OGM seq numbers as unsigned intAntonio Quartulli2012-04-181-4/+4
| | | | | | | OGM sequence numbers are declared as uint32_t and so they have to printed using %u instead of %d in order to avoid wrong representations. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: use ETH_HLEN instead of sizeof(struct ethhdr)Antonio Quartulli2012-04-181-4/+3Star
| | | | | | | | 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>
* batman-adv: mark existing ogm variables as batman ivMarek Lindner2012-04-181-2/+2
| | | | | | | | 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>
* batman-adv: rename BATMAN_OGM_LEN to BATMAN_OGM_HLENMarek Lindner2012-04-181-6/+6
| | | | | | | | | Using BATMAN_OGM_LEN leaves one with the impression that this is the full packet size which is not the case. Therefore the variable is renamed. Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: refactoring API: find generalized name for bat_ogm_init_primary ↵Marek Lindner2012-04-181-2/+2
| | | | | | | callback Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: handle routing code initialization properlyMarek Lindner2012-04-181-1/+10
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: add iface_disable() callback to routing APIMarek Lindner2012-04-181-0/+7
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: randomize initial seqno to avoid collisionMarek Lindner2012-04-181-0/+5
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: refactoring API: find generalized name for bat_ogm_init callbackMarek Lindner2012-04-181-2/+2
| | | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: Replace bitarray operations with bitmapSven Eckelmann2012-04-111-7/+8
| | | | | | | | | bitarray.c consists mostly of functionality that is already available as part of the standard kernel API. batman-adv could use architecture optimized code and reduce the binary size by switching to the standard functions. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Antonio Quartulli <ordex@autistici.org>
* batman-adv: Don't begin block comments with only a /* lineSven Eckelmann2012-03-101-2/+1Star
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: Ignore 80-chars per line limits for stringsSven Eckelmann2012-03-101-32/+22Star
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: Update copyright yearsSven Eckelmann2012-02-161-1/+1
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: convert batman iv algorithm to use dynamic infrastructureMarek Lindner2012-02-161-85/+94
| | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: add infrastructure to change routing algorithm at runtimeMarek Lindner2012-02-161-0/+10
| | | | Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: simplify bat_ogm_receive API callMarek Lindner2012-02-161-4/+7
| | | | | | | | Most of the values in that call are derived from the skb, so we can hand over the skb instead. Reported-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
* batman-adv: Explicitly mark the common header structureSven Eckelmann2012-02-161-23/+24
| | | | | | | | | | | | | | 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>
* batman-adv: agglomerate all batman iv ogm sending functions in the batman iv ↵Marek Lindner2011-09-081-4/+498
| | | | | | | | | | 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>