Refresh of kicking algorithm to minimise messages and streamline some code.
Removed decide_function() which made some logic hard to follow.
Removed kick_client() function to streamline code.
Revised kicking algorithm code to give better user messages.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Bug that was preventing kicking working due to mishandling of bandwidth
discovery. Fixed bug in use of get_bandwidth_iwinfo() in AP kicking.
Fix rounding of transmission rate calculations in
get_bandwidth_iwinfo().
Restructure of get_bandwidth...() while finding bug.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Bug that could proably cause ineffciency or confusion in multi-SSID
environments.
Adjusted erroneus match test in ap_array_insert().
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
General revisions to maintain code (no functional changes intended).
Removed unnecessary linked-list length checks.
Fixed some typos on function names / comments.
Changed how test_storage forces SEGV due to new compiler warnings.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Set pointers to NULL after free() to help force out memory handling errors.
Add some extra memory / resource tracking to try and chase out latent
bugs / leaks Fixed a couple of memory traces that were misreporting.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
Provide multi-priority syslog() based logging to improve user and
developer experience. Add dawnlog_* functions and macros to convert
printf() family and perror() logging to syslog() family. Removed
unnecessary sprintf() for building log strings (embed format directly).
Add local config settings for log level. Add command line parameters for
log level and destination. Set default log level to suppress a lot of
previously noisy messages. Restore some previously removed noisy
messages as DEBUG level in case they help in future. Eliminate DAWN_NO_OUTPUT static code checks which are no longer used.
Signed-off-by: Ian Clowes <clowes_ian@hotmail.com>
This adds a few options to use the signal strength as a metric, band
dependent:
- rssi_weight: every db of signal increases the score by this much.
- rssi_center: if the signal is stronger than this, the score becomes
positive; below this, it is negative.
- initial_score: since we are capping negative scores, it may be
beneficial to have a positive base score to offset a possible
negative signal value. This is replacing the 'freq' metric.
To avoid a single-digit RSSI increase resulting in a kick, we add a
global threshold value to act as a buffer:
- kicking_threshold: a candidate AP must have a score larger than that
of the current AP plus the value here.
The kicking_threshold also applies when assembling the list of roaming
neighbors we send with the "wnm_disassoc_imminent" command.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This adds #infndef DAWN_NO_OUTPUT to messages printed to stdout that are
not warnings or errors.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This changes the metrics variables that invove scores to arrays. At the
momemnt, there are two bands implemented, 802_11a and 802_11g.
Internally, they are chosen based on the frequency of the channel being
used. Anything < 2500 MHz is 802_11g, and everything else is 802_11a.
Dawn will issue a warning if it finds a frequency greater or equal to
5925 MHz. The upper limit of the 802.11a band, and the start of the
next band vary by country, so this will have to be reviewed.
The UCI configuration changes. Instead of a single metric config, there
will be a global metric config, and one for each band. The
non-band-specific configuration will only work in the global config.
Any per-band configuration present at the global config will be applied
to all bands. Any configuration present at the specific band will
override any global values.
The following configuration options are split into bands:
- ap_weight
- ht_support
- vht_support
- no_ht_support
- no_vht_support
- rssi
- rssi_val
- low_rssi
- low_rssi_val
- freq
- chan_util
- max_chan_util
- chan_util_val
- max_chan_util_val
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
The wnm_disassoc_imminent procedure takes a list of neighbor reports to
send to the client.
Instead of picking just one AP to be sent, send all that have the same
score.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This changes the op_class, channel, and SSID fields used to send a
beacon request. Op_class and channel were set from the UCI config file,
but they are dependent on the band being used--they define the frequency
used. The values can be taken from the AP's own neighbor report.
The SSID was set with a blank string, which would return beacons from
any SSID. Since we only care about our own SSID, there's no need to
waste resorces with reports from other SSIDs.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
This renames "mode" to "rrm_mode", and its type from int to string.
This way, we can set the correct mode for a probe request from the STA
reported capabilities, along with the preferred order of modes, set by
the "rrm_mode" uci config.
rrm_mode is a string of possible mode letters:
'p' = passive report
'a' = active report
'b' or 't' = beacon table report.
Setting rrm_mode='pat', will try to send passive reports, if available;
if not, it will try an active report, using a beacon table if all else
fails.
If you don't include a letter, the corresponding report type will be
disabled. An empty string will disable beacon reports. Unrecognized
letters are ignored, as well as repeated modes. If the configuration is
not present, a default value of 'pat' will be used.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Currenty, ap_array_get_ap returns an entry by matching just the bssid,
without checking if the SSID matches.
ap_array_find_first_entry does a binary search through the ap set
without cheking the SSID, which is bad, as the list is sorted by SSID
then by bssid_mac.
As a side effect, if you have more than one ssid, the network ap list
grows unbounded over time.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
The datastorage-refactoring changes an already existing entry instead
of inserting and deleting it. However, it was forgotten to adopt
some information from the new probe entry.
The ht_capabilities and vht_capabilities are now synced correctly.
RCPI and RSNI is now correctly synced.
general: fixed whitespace and typos
memory audit: on by default in build
memory audit: enhanced audit info
ubus: refactor denied_req expiry to assist datastorage testing
datastorage: fixed performance bug in handling of linked list entry expiry
datastorage: fixed SEGV in skip list handling
test_storage: added linked list memory allocation stress tests
memory auditing: refined auditing code and use in main code
hearing map: fixed bug causing it not be be built correctly
datastorage: fixed memory leak from linked list handling
datastorage: convert to linked lists and optimise use of pointers
datastorage: AP, client, probe, auth entry and MAC list converted to
linked list
datastorage: functions adjusted to take pointers as parameters
datastorage: optimised sort and search functions added
mac_utils: struct dawn_mac added and comparisons adjusted
general: adjust code to call new datastorage functions
test_storage: large scale 100 AP, 3000 client, 70k probe added
[fix commit]
Signed-off-by: Nick Hainke <vincent@systemli.org>
datastorage (bug fix): deleting expired array item would fail to test next item
test_storage: extended to cover all required datastorage entry points
test_storage: added ability to read script file
test_storage: added new and revised test scripts
TESTING.md: added to describe testing approach
general: added various TODO notes on things to come back to
general: revised #includes to make each "self-compiling"
general: revised #includes to minimise usage across source files
general: moved declarations and defintions to simplify and rationalise code
datastorage: refactor to support scalability testing
datastorage: made independent of time() calls to support testing
datastorage: fixed redundant use of both SORT_NUM and SORT_LENGTH defines
datastorage: fake kicking to test clients move between access points
msghandler: new module to reduce compile time interdependencies
mshhandler: (issue #100?) fixed SEGV memcpy() in dump_client() using strncpy()
ubus: merged uface into ubus
mac_utils: new module for MAC address utilites
test_header: added target to help #include rationalisation
Tested-by: Nick Hainke <vincent@systemli.org>
in luci-app-dawn, if eval_probe_req is not ticked, eval_probe_req would be -1.
however, in c language, !(-1) is false.
Since only zero in if statement is false, non-zero number is true.