mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 01:22:25 +00:00
95a7b6d54d5fdcaf835e824a1212c621f748ee1f
The RFC[1] says about Acct-Status-Type:
It MAY be used by the client to mark the start of accounting (for
example, upon booting) by specifying Accounting-On and to mark the
end of accounting (for example, just before a scheduled reboot) by
specifying Accounting-Off.
The RFC errata[2] further specifies that Accounting-On and
Accounting-Off messages apply to the whole NAS.
The RFC also mandates that[3]:
Either NAS-IP-Address or NAS-Identifier MUST be present in a
RADIUS Accounting-Request. It SHOULD contain a NAS-Port or NAS-
Port-Type attribute or both unless the service does not involve a
port or the NAS does not distinguish among its ports.
And[4]:
An Accounting-Request packet MUST have an Acct-Session-Id.
The Acct-Session-Id SHOULD contain UTF-8 encoded 10646 characters.
Finally the freeRADIUS recommendations here[5] suggest that:
1. Acct-Status-Type = Accounting-On should not be used to indicate
sub-system reboot.
2. IANA should allocate two new values for Acct-Status-Type:
Subsystem-On, and Subsystem-Off. These values have meaning similar
to Accounting-On and Accounting-Off, except that they apply to a
subystem of the NAS.
3. NASes should use these new values to indicate subsystem on/off.
4. The Called-Station-Id attribute should contain values unique to each
subsystem.
5. The NAS should signal that the entire system has rebooted by using
the existing Accounting-On and Accounting-Off values, with a value
for Called-Station-Id that is global to the NAS, or to omit it
entirely.
In order to reconcile all this, this commit implements Accounting-On and
Accounting-Off requests as follows:
- When accounting.uc is started, it loops through each uspot interface
and keeps track of the acct_server seen for each interface. Then for
each interface that do not use a previously seen server, it generates
a unique session ID, and sends an Accounting-On request to the
RADIUS server, using this session ID and the configured NAS-ID.
- When accounting.uc stops, it sends an Accounting-Off request for each
uspot interface for which an Accounting-On message was previously sent,
using the same global session ID.
If/when the Subsystem-On/Subsystem-Off values are implemented, this
commit can be revisited to simply lift the restriction on unique servers
and change the acct_type value accordingly.
Finally, it appears that while NAS-ID is provided in the request thus
making NAS-IP unnecessary, libradcli still includes this field in the
request. Likewise, it also insists on sending a NAS-Port attribute.
[1]: https://datatracker.ietf.org/doc/html/rfc2866#section-5.1
[2]: https://www.rfc-editor.org/errata_search.php?rfc=2866
[3]: https://datatracker.ietf.org/doc/html/rfc2866#section-4.1
[4]: https://datatracker.ietf.org/doc/html/rfc2866#section-5.5
[5]: https://freeradius.org/rfc/acct_status_type_subsystem.html
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
OpenWiFi AP NOS
OpenWrt-based access point network operating system (AP NOS) for TIP OpenWiFi. Read more at openwifi.tip.build.
Building
Setting up your build machine
Building requires a recent Linux installation. Older systems without Python 3.7 will have trouble. See this guide for details: https://openwrt.org/docs/guide-developer/toolchain/beginners-build-guide
Install build packages on Debian/Ubuntu (or see above guide for other systems):
sudo apt install build-essential libncurses5-dev gawk git libssl-dev gettext zlib1g-dev swig unzip time rsync python3 python3-setuptools python3-yaml
Doing a native build on Linux
Use ./build.sh <target>, or follow the manual steps below:
- Clone and set up the tree. This will create an
openwrt/directory.
./setup.py --setup # for subsequent builds, use --rebase instead
- Select the profile and base package selection. This setup will install the
feeds and packages and generate the
.configfile.
cd openwrt
./scripts/gen_config.py linksys_ea8300
- Build the tree (replace
-j 8with the number of cores to use).
make -j 8 V=s
Build output
The build results are located in the openwrt/bin/ directory:
| Type | Path |
|---|---|
| Firmware images | openwrt/bin/targets/<target>/<subtarget>/ |
| Kernel modules | openwrt/bin/targets/<target>/<subtarget>/packages/ |
| Package binaries | openwrt/bin/packages/<platform>/<feed>/ |
Developer Notes
Branching model
main- Stable dev branchnext- Integration branchstaging-*- Feature/bug branchesrelease/v#.#.#- Release branches (major.minor.patch)
Repository structure
Build files:
Makefile- Calls Docker environment per targetdock-run.sh- Dockerized build environmentdocker/Dockerfile- Dockerfile for build imagebuild.sh- Build scriptsetup.py- Clone and set up the treeconfig.yml- Specifies OpenWrt version and patches to apply
Directories:
feeds/- OpenWiFi feedspatches/- OpenWiFi patches applied during buildsprofiles/- Per-target kernel configs, packages, and feeds- wifi-ax: Wi-Fi AX packages
- ucentral-ap: uCentral packages
- x64_vm: x86-64 VM image
uCentral packages
AP-NOS packages implementing the uCentral protocol include the following repositories (refer to the ucentral feed for a full list):
- ucentral-client: https://github.com/Telecominfraproject/wlan-ucentral-client
- ucentral-schema: https://github.com/Telecominfraproject/wlan-ucentral-schema
- ucentral-wifi: https://github.com/blogic/ucentral-wifi
Description
Languages
C
85.9%
Shell
5.6%
Makefile
3.3%
Roff
1.8%
UnrealScript
1.6%
Other
1.6%