summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
Commit message (Collapse)AuthorAgeFilesLines
* batman-adv: Convert BATADV_PRINT_VID macro to functionSven Eckelmann2017-03-161-2/+14
| | | | | | | | The BATADV_PRINT_VID is not free of of possible side-effects. This can be avoided when the the macro is converted to a simple inline function. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Start new development cycleSimon Wunderlich2017-03-161-1/+1
| | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: update copyright years for 2017Sven Eckelmann2017-01-261-1/+1
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Start new development cycleSimon Wunderlich2017-01-011-1/+1
| | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Use own timer for multicast TT and TVLV updatesLinus Lüssing2016-10-301-0/+1
| | | | | | | | | | | | | | | | | | | Instead of latching onto the OGM period, this patch introduces a worker dedicated to multicast TT and TVLV updates. The reasoning is, that upon roaming especially the translation table should be updated timely to minimize connectivity issues. With BATMAN V, the idea is to greatly increase the OGM interval to reduce overhead. Unfortunately, right now this could lead to a bad user experience if multicast traffic is involved. Therefore this patch introduces a fixed 500ms update interval for multicast TT entries and the multicast TVLV. Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Avoid precedence issues in macrosSven Eckelmann2016-10-191-2/+2
| | | | | | | | | It must be avoided that arguments to a macro are evaluated ungrouped (which enforces normal operator precendence). Otherwise the result of the macro is not well defined. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Move batadv_sum_counter to soft-interface.cSven Eckelmann2016-10-171-21/+0
| | | | | | | | The function batadv_sum_counter is only used in soft-interface.c and has no special relevance for main.h. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Start new development cycleSimon Wunderlich2016-10-171-1/+1
| | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Start new development cycleSimon Wunderlich2016-08-091-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: throughput meter implementationAntonio Quartulli2016-07-041-0/+8
| | | | | | | | | | | | | | | | | | | | The throughput meter module is a simple, kernel-space replacement for throughtput measurements tool like iperf and netperf. It is intended to approximate TCP behaviour. It is invoked through batctl: the protocol is connection oriented, with cumulative acknowledgment and a dynamic-size sliding window. The test *can* be interrupted by batctl. A receiver side timeout avoids unlimited waitings for sender packets: after one second of inactivity, the receiver abort the ongoing test. Based on a prototype from Edo Monticelli <montik@autistici.org> Signed-off-by: Antonio Quartulli <antonio.quartulli@open-mesh.com> Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Consolidate logging related functionsSven Eckelmann2016-06-301-67/+2
| | | | | | | | | | | There are several places in batman-adv which provide logging related functions. These should be grouped together in the log.* files to make them easier to find. Reported-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: move bat_algo functions into a separate fileSven Eckelmann2016-06-301-4/+0
| | | | | | | | | | | | The bat_algo functionality in main.c is mostly unrelated to the rest of the content. It still takes up a large portion of this source file (~15%, 103 lines). Moving it to a separate file makes it better visible as a main component of the batman-adv implementation and hides it less in the other helper functions in main.c. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: split tvlv into a separate fileMarkus Pargmann2016-06-301-34/+0
| | | | | | | | | | | | | | | The tvlv functionality in main.c is mostly unrelated to the rest of the content. It still takes up a large portion of this source file (~45%, 588 lines). Moving it to a separate file makes it better visible as a main component of the batman-adv implementation and hides it less in the other helper functions in main.c Signed-off-by: Markus Pargmann <mpa@pengutronix.de> [sven@narfation.org: fix conflicts with current version, fix includes, rewrote commit message] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Keep includes ordered by filenameSven Eckelmann2016-06-301-3/+3
| | | | | | | | | | | It is easier to detect if a include is already there for a used functionality when the includes are ordered. Using an alphabetic order together with the grouping in commit 1e2c2a4fe4a5 ("batman-adv: Add required includes to all files") makes includes better manageable. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Adding logging of mcast flag changesLinus Lüssing2016-06-301-1/+3
| | | | | | | | | | | With this patch changes relevant to a node's own multicast flags are printed to the 'mcast' log level. Tested-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Start new development cycleSimon Wunderlich2016-06-301-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* batman-adv: Use bool as return type for boolean functionsSven Eckelmann2016-05-101-1/+1
| | | | | | | | | | | | It is easier to understand that the returned value of a specific function doesn't have to be 0 when the functions was successful when the actual return type is bool. This is especially true when all surrounding functions with return type int use negative values to return the error code. Reported-by: Nicholas Krause <xerofoify@gmail.com> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: add detection for complex bridge loopsSimon Wunderlich2016-05-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are network setups where the current bridge loop avoidance can't detect bridge loops. The minimal setup affected would consist of two LANs and two separate meshes, connected in a ring like that: A...(mesh1)...B | | (LAN1) (LAN2) | | C...(mesh2)...D Since both the meshes and backbones are separate, the bridge loop avoidance has not enough information to detect and avoid the loop in this case. Even if these scenarios can't be fixed easily, these kind of loops can be detected. This patch implements a periodic check (running every 60 seconds for now) which sends a broadcast frame with a random MAC address on each backbone VLAN. If a broadcast frame with the same MAC address is received shortly after on the mesh, we know that there must be a loop and report that incident as well as throw an uevent to let others handle that problem. Signed-off-by: Simon Wunderlich <simon.wunderlich@open-mesh.com> [sven@narfation.org: fix conflicts with current version] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: fix wrong names in kerneldocAntonio Quartulli2016-05-041-1/+2
| | | | | | | Signed-off-by: Antonio Quartulli <a@unstable.cc> [sven@narfation.org: Fix additional names] Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Start new development cycleSimon Wunderlich2016-05-041-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: Start new development cycleSimon Wunderlich2016-02-291-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: ELP - send unicast ELP packets for throughput samplingAntonio Quartulli2016-02-291-0/+3
| | | | | | | | | | | | | | In case of an unused wireless link, the mac80211 throughput estimation won't get updated further. Consequently, the reported throughput metric will become obsolete. With this patch unicast sampling is introduced by periodically sending unicast ELP packets to each neighbor on idle WiFi links. These sampling packets will fill an entire frame, so that the measurement is as reliable as possible Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: ELP - compute the metric based on the estimated throughputAntonio Quartulli2016-02-291-0/+1
| | | | | | | | | | | | | | | | | | | | In case of wireless interface retrieve the throughput by querying cfg80211. To perform this call a separate work must be scheduled because the function may sleep and this is not allowed within an RCU protected context (RCU in this case is used to iterate over all the neighbours). Use ethtool to retrieve information about an Ethernet link like HALF/FULL_DUPLEX and advertised bandwidth (e.g. 100/10Mbps). The metric is updated each time a new ELP packet is sent, this way it is possible to timely react to a metric variation which can imply (for example) a neighbour disconnection. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: OGMv2 - implement originators logicAntonio Quartulli2016-02-291-0/+2
| | | | | | | | Add the support for recognising new originators in the network and rebroadcast their OGMs. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: OGMv2 - add basic infrastructureAntonio Quartulli2016-02-291-0/+1
| | | | | | | | | | | | | | | | | | | This is the initial implementation of the new OGM protocol (version 2). It has been designed to work on top of the newly added ELP. In the previous version the OGM protocol was used to both measure link qualities and flood the network with the metric information. In this version the protocol is in charge of the latter task only, leaving the former to ELP. This means being able to decouple the interval used by the neighbor discovery from the OGM broadcasting, which revealed to be costly in dense networks and needed to be relaxed so leading to a less responsive routing protocol. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: ELP - creating neighbor structuresLinus Luessing2016-02-291-0/+3
| | | | | | | | | Initially developed by Linus during a 6 months trainee study period in Ascom (Switzerland) AG. Signed-off-by: Linus Luessing <linus.luessing@web.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
* batman-adv: remove unused BATADV_BONDING_TQ_THRESHOLD constantAntonio Quartulli2016-02-231-5/+0
| | | | | | | | | | | | | BATADV_BONDING_TQ_THRESHOLD is not used anymore since the implementation of the bat_neigh_is_similar_or_better() API function. Such function uses the more generic BATADV_TQ_SIMILARITY_THRESHOLD constant. Therefore, remove definition of the unused BATADV_BONDING_TQ_THRESHOLD constant. Signed-off-by: Antonio Quartulli <a@unstable.cc> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: add seqno maximum age and protection start flag parametersSimon Wunderlich2016-02-101-0/+3
| | | | | | | | | | | | | To allow future use of the window protected function with different maximum sequence numbers, add a parameter to set this value which was previously hardcoded. Another parameter added for future use is a flag to return whether the protection window has started. While at it, also fix the kerneldoc. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: update copyright years for 2016Sven Eckelmann2016-02-021-1/+1
| | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: Fix kerneldoc of main functionsSven Eckelmann2016-02-021-0/+4
| | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: Fix kerneldoc parsing of return descriptionSven Eckelmann2016-02-021-3/+10
| | | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: increase BLA wait periods to 6Simon Wunderlich2016-01-091-1/+1
| | | | | | | | | | | | If networks take a long time to come up, e.g. due to lossy links, then the bridge loop avoidance wait time to suppress broadcasts may not wait long enough and detect a backbone before the mesh is brought up. Increasing the wait period further to 60 seconds makes this scenario less likely. Signed-off-by: Simon Wunderlich <simon@open-mesh.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: Start new development cycleSimon Wunderlich2016-01-091-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <a@unstable.cc>
* batman-adv: Start new development cycleSimon Wunderlich2015-08-271-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: Replace C99 int types with kernel typeSven Eckelmann2015-08-251-25/+23
| | | | | | | | | | (s|u)(8|16|32|64) are the preferred types in the kernel. The use of the standard C99 types u?int(8|16|32|64)_t are objected by some people and even checkpatch now warns about using them. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: Clarify calculation precedence for '&' and '?'Sven Eckelmann2015-06-071-1/+1
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Add required includes to all filesSven Eckelmann2015-06-071-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The header files could not be build indepdent from each other. This is happened because headers didn't include the files for things they've used. This was problematic because the success of a build depended on the knowledge about the right order of local includes. Also source files were not including everything they've used explicitly. Instead they required that transitive includes are always stable. This is problematic because some transitive includes are not obvious, depend on config settings and may not be stable in the future. The order for include blocks are: * primary headers (main.h and the *.h file of a *.c file) * global linux headers * required local headers * extra forward declarations for pointers in function/struct declarations The only exceptions are linux/bitops.h and linux/if_ether.h in packet.h. This header file is shared with userspace applications like batctl and must therefore build together with userspace applications. The header linux/bitops.h is not part of the uapi headers and linux/if_ether.h conflicts with the musl implementation of netinet/if_ether.h. The maintainers rejected the use of __KERNEL__ preprocessor checks and thus these two headers are only in main.h. All files using packet.h first have to include main.h to work correctly. Reported-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Use common Jenkins Hash implementationSven Eckelmann2015-06-071-0/+1
| | | | | | | | | | | | | An unoptimized version of the Jenkins one-at-a-time hash function is used and partially copied all over the code wherever an hashtable is used. Instead the optimized version shared between the whole kernel should be used to reduce code duplication and use better optimized code. Only the DAT code must use the old implementation because it is used as distributed hash function which has to be common for all nodes. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: main, batadv_compare_eth return boolMarkus Pargmann2015-06-031-1/+1
| | | | | | | | | | Declare the returntype of batadv_compare_eth as bool. The function called inside this helper function (ether_addr_equal_unaligned) also uses bool as return value, so there is no need to return int. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: main, Convert is_my_mac() to boolMarkus Pargmann2015-06-031-1/+1
| | | | | | | | It is much clearer to see a bool type as return value than 'int' for functions that are supposed to return true or false. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: checkpatch - spaces preferred around that '*'Marek Lindner2015-05-291-1/+1
| | | | Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: update copyright years for 2015Sven Eckelmann2015-05-291-1/+1
| | | | | Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: Start new development cycleSimon Wunderlich2015-05-291-1/+1
| | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
* batman-adv: Start new development cycleSimon Wunderlich2015-01-071-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: checkpatch - No space is necessary after a castAntonio Quartulli2015-01-071-4/+4
| | | | | Signed-off-by: Antonio Quartulli <antonio@meshcoding.com> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
* batman-adv: kernel doc fixes for main.{c, h}Martin Hundebøll2015-01-071-3/+2
| | | | | | Signed-off-by: Martin Hundebøll <martin@hundeboll.net> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: Start new development cycleSimon Wunderlich2014-08-051-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: remove unnecessary logspamAndré Gaul2014-08-051-6/+14
| | | | | | | | | | This patch removes unnecessary logspam which resulted from superfluous calls to net_ratelimit(). With the supplied patch, net_ratelimit() is called after the loglevel has been checked. Signed-off-by: André Gaul <gaul@web-yard.de> Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: Start new development cycleSimon Wunderlich2014-05-181-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
* batman-adv: Start new development cycleSimon Wunderlich2014-03-221-1/+1
| | | | | Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
OpenPOWER on IntegriCloud