Commit Graph

30 Commits

Author SHA1 Message Date
Adrian Schmutzler 31df0a3779 packages/fff: remove whitespace from package TITLE
Some packages contain a whitespace at the start of TITLE, some
don't. This is completely irrelevant since Make strips leading
and trailing spaces anyway. Nevertheless, make it consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2020-12-13 14:40:53 +01:00
Adrian Schmutzler 91808ad710 nodewatcher: Use Makefile version for nodewatcher data
So far, nodewatcher version has to be specified twice, once in the
Makefile and again in the nodewatcher script.

With this patch, a version file is created during build than can
be read in nodewatcher script, so version only has to be specified
once anymore. The file name mimics the version files already present
for OpenWrt and our firmware.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 498c6ad963 fff-nodewatcher: Consolidate code in nodewatcher.d/10-systemdata.sh
This consolidates the code in nodewatcher.d/10-systemdata.sh by:

- Slightly reordering data retrieval
- Moving XML node assembly to corresponding data retrieval, making
  the whole file easier to read
- Changing some if statements to shorter binary condition shortcuts
- Reduce the number of variables by merging some code into the XML
  node assembly

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Adrian Schmutzler 1c3243dd18 fff-nodewatcher: Tidy up uci-defaults script
This solves the following issues with the uci-defaults script in
fff-nodewatcher:

- Remove /bin/sh in non-executable file
- Only commit to changed config
- Use "-1" for uci node indexing, as this will be the node just
  created

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Tim Niemeyer b6c7acd704 nodewatcher: split into nodewatcher.d scripts for individual task
This splits up the data extraction/assembly of the nodewatcher
script into several parts and distributes them across packages, so
that each nodewatcher.d subscript is located in the package providing
the relevant functionality. This allows to extend the nodewatcher data
by enabling/disabling packages.
This scheme is not perfectly fulfilled for fff-network vs. fff-wireless,
as data cannot uniquely assigned there and the XML syntax does not allow
separation anyway.

In general, this moves code without applying code improvements, yielding
at an easy comparison of moved fragments. However, the following changes
were done to improve experience:

- The function writing debug output has been renamed from "err" to "debug"
- Since we catch the stdout of the nodewatcher.d functions anyway,
  those scripts were adjusted to echo output directly instead of first
  writing it into a variable and then outputting it at the end.
- The uci config has been kept, but initialization for the network part
  has been moved to the fff-network package.
- Space indent has been changed to tab, which is more common in the
  firmware and requires less space.
- Remove support for nodewatcher run without uci config. Script-based
  nodewatcher on other platforms will have altered code anyway, and
  splitting it up will prevent effective use as a blueprint for those
  cases. After this change, nodewatcher in firmware is supposed to be
  used only for this firmware.

Note that since the nodewatcher.d scripts are evaluated by using their
echo output, having a function created uncaught output to stdout there
will corrupt the XML.

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
[rebase and adjustments for current master, use simpler mechanism to
call nodewatcher.d scripts, use tab indent, remove debug() definition
where not needed, do not remove uci config, add commit message, use
echo -n]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
[remove 'local' modifier for variable not inside a function, fix typo]
Signed-off-by: Fabian Bläse <fabian@blaese.de>
2020-04-19 15:44:08 +02:00
Fabian Bläse cac9b55aa2 nodewatcher: Send babeld version
Signed-off-by: Fabian Bläse <fabian@blaese.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-10-07 14:44:10 +02:00
Adrian Schmutzler 004b386d55 nodewatcher: Remove leftover use of batman-adv sysfs
In d9ec8edb15 ("batman-adv: Move from DEBUGFS to batctl") we
switched from deprecated DEBUGFS to batctl.

Despite debugfs, batctl seems to also have deprecated sysfs
(https://www.open-mesh.org/news/90).

This patch thus replaces a reference to iface_status by the
corresponding batctl command.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-08-21 18:16:09 +02:00
Robert Langhammer 5a119dcda8 fff-nodewatcher: remove l2tp
Signed-off-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[Bump PKG_RELEASE and SCRIPT_VERSION]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2019-07-06 13:58:57 +02:00
Adrian Schmutzler d9ec8edb15 batman-adv: Move from DEBUGFS to batctl
The debug filesystem will be deprecated and disabled by default
in newer versions of B.A.T.M.A.N.

This patch switches our code to the batctl, as recommended.

Since batctl can suppress headers, this actually makes our life
easier ...

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
2019-03-27 18:24:29 +01:00
Adrian Schmutzler fa2ead9306 packages/fff: Use tabs in Makefiles
Currently, Makefile use a mixture of tabs and spaces with various
indents. This harmonizes all Makefiles to use tab indentation only.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2019-02-05 14:29:31 +01:00
Adrian Schmutzler ef00054916 configurehood/nodewatcher: Also process hood ID in addition to name
So far, the Monitoring evaluates hoods based on their names.

This introduces several problems, most prominently a hood
re-creation if it is renamed at the KeyXchange.

Since we have unique hood IDs in the KeyXchange and the
Monitoring retrieves those via hoods.php, it is logical use this
information instead of relying on string comparison.

This requires the hood files to contain an additional field "id".
While this has not been implemented, the changes in this patch
will still work and just write empty data to the uci field and
alfred data.

For local hoods, the "id" in the hood file will remain unset.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-11-27 23:20:13 +01:00
Adrian Schmutzler a37dedda26 Always send hood to Monitoring
Since the MacNocker was introduced, the hood information in
UCI is DELETED if the hood is lost.

If the router still successfully sends alfred data in this state,
the Monitoring will treat it as a V1 device. This is annoying,
especially since it looks like a loop.

An easy solution is to send an empty <hood> field in those cases,
as V2 routers are detected by them knowing their hood.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-11-21 15:31:15 +01:00
Adrian Schmutzler e1b9280f12 nodewatcher: Prevent multiple instances at the same time
This is based on the configurehood-Patch from Tim Niemeyer.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Robert Langhammer <rlanghammer@web.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-11-07 15:29:00 +01:00
Adrian Schmutzler 348cdbe8d3 nodewatcher: Change mechanism for client device detection
This is simpler than the previous approach and does not rely
on parsing.

This fixes:
- Interfaces being accounted for multiple times for certain
  devices
- Errors when output of bridge function changes (as with the
  current OpenWrt master)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-07-26 09:22:32 +02:00
Adrian Schmutzler 686da98770 nodewatcher: Provide data to calculate airtime
The actual calculation is done in the Monitoring.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2018-01-28 12:36:14 +01:00
Adrian Schmutzler 145e057a77 fff-nodewatcher: Add detailed clients data
This adds data about the clients per interface

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2018-01-21 14:55:19 +01:00
Adrian Schmutzler bef333c43b nodewatcher: Fix bugs in gateway list creation
Changes:
- Remove first line (headline) previously parsed as gateway
- Delete leading whitespaces for netif correctly (regex
  "\\[" changed to "\\[ *")
- Remove netif whitespaces first, so they are not changed to
  "false"
- Include trailing whitespace in regex for selection marker
- Remove useless replacement "  " to " "

This is designed to support BATMAN compatibility version 14 AND 15

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2018-01-20 15:11:34 +01:00
Adrian Schmutzler 12804b8ff6 nodewatcher: Provide additional information about WiFi interfaces
This patch additional information to the nodewatcher XML:
- wlan_channel: Channel of interface (number only)
- wlan_ssid: SSID available through iw dev
- wlan_type: Type of interface (AP, mesh, IBSS)
- wlan_width: Width of frequency band (20 vs. 40 MHz, number only)

The nodewatcher file from this patch can be copied manually to
devices with older firmware.

The patch includes some comment typo fixes.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Fabian Bläse <fabian@blaese.de>
2017-12-31 15:40:59 +01:00
Adrian Schmutzler 39d147da8d Rearrange fff config values into their own config file
This moves the FFF configuration from
/etc/config/system to a new file /etc/config/fff. Thus,
this file can be copied as a whole during upgrade (with
compatibility provided) and then resulting values in
other files are re-set later.

This also fixes the bandwidth settings not being persistent
during upgrade. Other settings may join ...

I tried to go through all the code and update all occurrences
of the relevant system variables (looking for "system" both
in GitHub and my local src folder).

Note that a downgrade will result in loss of configuration!

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
- Rebased
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
2017-11-12 20:28:52 +01:00
Tim Niemeyer 1b7bfb63cd fff-alfred: new package
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
2017-11-12 17:32:23 +01:00
Adrian Schmutzler e7e27c168c Utilize PKG_NAME in Makefiles
Since there is a PKG_NAME variable, there is no need to repeat
the individual package name five times.

This makes editing and particularly copying Makefiles much
easier, as only the PKG_NAME has to be changed.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-10-16 21:20:02 +02:00
Christian Dresel b287daaf06 Add Hoodinformation to Nodewatcher
Fixes: #38
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2017-07-02 17:45:25 +02:00
Steffen Pankratz 03e3104273 Nodewatcher: interpret 'description' and 'position_comment' purely as textual data
Signed-off-by: Steffen Pankratz <kratz00@gmx.de>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
Reviewed-by: Tim Niemeyer <tim@tn-x.org>
2016-10-30 13:07:02 +01:00
Tim Niemeyer 1313359b1b fff-nodewatcher: bump version
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
2016-06-12 16:19:23 +02:00
Tim Niemeyer 92dc0c647d fff-nodewatcher: self-detect client interfaces
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-06-11 14:13:13 +02:00
Tim Niemeyer af80123aa2 fff-nodewatcher: remove busybox httpd
- remove httpd from .config
- remove httpd startup from rc.local
- add crawldata path creation in nodewatcher

Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-04-05 23:27:34 +02:00
Tim Niemeyer 10d138cd2e fff-nodewatcher: add dependency to ip and ip-bridge
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-04-05 23:27:30 +02:00
Tim Niemeyer 6ee643b66b fff-random: move random from fff to own package
Signed-off-by: Tim Niemeyer <tim@tn-x.org>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
Tested-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Christian Dresel <fff@chrisi01.de>
Reviewed-by: Jan Kraus <mayosemmel@gmail.com>
2016-04-05 23:27:27 +02:00
Tim Niemeyer 5940b43765 web/nodewatcher: add description/position_comment
Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
Reviewed-by: Tobias Klaus <tk+ff@meskal.net>
2016-01-26 00:46:00 +01:00
Tim Niemeyer aad3ba8403 nodewatcher: move to separate package
- remove template parameter NETMON_IP (it's always the same)
- add new fff-nodewatcher package
- move nodewatcher, configurator, syncHostname to fff-nodewatcher
- fff-base selects fff-nodewatcher

Signed-off-by: Tim Niemeyer <tim.niemeyer@mastersword.de>
Reviewed-by: Steffen Pankratz <kratz00@gmx.de>
2015-12-30 08:01:32 +01:00