summaryrefslogtreecommitdiff
path: root/libs
Commit message (Collapse)AuthorAgeFilesLines
* luci-lib-nixio: Fix add_luci_conffiles adding duplicate files (#6568)Xiang W2023-12-041-3/+14
| | | | | | | | | * luci-lib-nixio: Fix add_luci_conffiles adding duplicate files add_luci_conffiles does not check whether the file already exists when adding the file, which may result in redundant backups in the sysupgrade backup. Signed-off-by: Xiang W <wxjstz@126.com>
* luci-lib-ip: fix creating address instances from integersJo-Philipp Wich2023-11-071-10/+10
| | | | | | | | Ensure that the proper byte order is used when creating IPv4/IPv6/MAC instances from integer values on big endian systems. Fixes: #6678 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-jsonc: improve handling of integral numeric valuesJo-Philipp Wich2023-10-251-3/+5
| | | | | | | | | | | | | | | | | | | | Properly deal with integral numeric values exceeding the int32_t range by replacing the cast logic with more fine grained checks: - Lua numbers which are integers in the first place are directly converted to JSON integers - Finite double Lua numbers which are integral are converted to JSON integer values - All other numeric values are converted to JSON doubles This should bring the handling of large integral value in line with the documented behavior of turning non-fractional Lua numbers into JSON integers. Fixes: #6647 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-rpcc: Remove old broken libHannu Nyman2023-08-065-173/+0
| | | | | | Remove the old library that has been BROKEN since 2015. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
* luci-lib-px5g: refactor to use PKG_BUILD_FLAGS:=no-mips16Andre Heider2023-03-231-1/+1
| | | | | | | See commit 5c545bdb "treewide: replace PKG_USE_MIPS16:=0 with PKG_BUILD_FLAGS:=no-mips16" on the main repository. Signed-off-by: Andre Heider <a.heider@gmail.com>
* Merge pull request #6104 from dhewg/6gJo-Philipp Wich2023-02-072-131/+79
|\ | | | | luci-mod-network: enable configuring wifi ax networks on the 6G band
| * rpcd-mod-luci: bump versionAndre Heider2023-01-231-2/+2
| | | | | | | | Signed-off-by: Andre Heider <a.heider@gmail.com>
| * rpcd-mod-luci: add "hwmodes_text" to the iwinfo info outputAndre Heider2023-01-231-3/+10
| | | | | | | | | | | | This is a preformatted string like "ac/ax/b/g/n" for presentation. Signed-off-by: Andre Heider <a.heider@gmail.com>
| * rpcd-mod-luci: reuse infos provided by libiwinfoAndre Heider2023-01-231-132/+73
| | | | | | | | | | | | | | | | | | | | | | | | Don't hardcode bit/name pairs, instead iterate over what's known to the library and use that instead. This automatically adds the missing ad hwmode and HE80+80 htmode - and any future ones. The only difference in the output is the order of the 'hwmodes' array. Signed-off-by: Andre Heider <a.heider@gmail.com>
* | rpcd-mod-luci: fix reporting network device flagsJo-Philipp Wich2023-02-071-7/+7
| | | | | | | | | | | | | | | | | | Fix reporting of ceertain flag values larger than 255, such as IFF_PROMISC by explicitly casting the bit test expression to a boolean result since the implicit integer truncation to uint8_t will turn the `0x100` result of a set IFF_PROMISC bit into just `0x0`. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* | luci-lib-httpprotoutils: add airplay mime typesSasha Andonov2023-01-241-0/+3
|/ | | | | | | | Airplay of a statically hosted video file from one Apple device to another fails due to unrecognized content-type. Adding Airplay supported mime types fixes the issue. Signed-off-by: Sasha Andonov <s.andonnov@gmail.com>
* treewide: bump PKG_RELEASE for libiwinfo ABI changeChristian Marangi2023-01-231-0/+1
| | | | | | | Bump PKG_RELEASE for libiwinfo ABI change for rpcd-mod-luci and luci-mod-status. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* luci-lib-base: ensure that `luci.http` can be required standaloneJo-Philipp Wich2022-11-041-1/+1
| | | | | | | | | | | | Various existing Lua software is requiring the `luci.http` library for URL encoding/decoding tasks so ensure that it can be loaded in a stand alone manner even if the emulated Lua runtime environment is not available. Fixes: cea2c3578e ("luci-lib-base: forward luci.http.context.request.message to ucode") Ref: https://forum.openwrt.org/t/x/141817 Ref: https://github.com/openwrt/luci/pull/5976#issuecomment-1296220586 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* treewide: add explicit Lua runtime dependencies where neededJo-Philipp Wich2022-10-251-1/+1
| | | | | | | Some packages require Lua libraries but do not ship with a luasrc directory, add explicit dependencies in these cases. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-base: forward luci.http.context.request.message to ucodeJo-Philipp Wich2022-10-251-0/+1
| | | | | | | | | | Some existing LuCI application code accesses the `luci.http.context.request.message.params` HTTP parameter table directly. Forward the `luci.http.context.request.message` object to the ucode `luci.http.message` instance in order to properly support this. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* treewide: separate Lua runtime resourcesJo-Philipp Wich2022-10-252-463/+28
| | | | | | | | | | | Move classes required for Lua runtime support into a new `luci-lua-runtime` package. Also replace the `luci.http` and `luci.util` classes in `luci-lib-base` with stubbed versions interacting with the ucode based runtime environment. Finally merge `luci-base-ucode` into the remainders of `luci-base`. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpc-mod-luci: Add support for ccmp-256/gcmp/gcmp-256 ciphersJoerg Werner2022-08-251-0/+9
| | | | Signed-off-by: Joerg Werner <schreibubi@gmail.com>
* luci-lib-nixio: always build without TLS supportEneas U de Queiroz2022-08-101-39/+1
| | | | | | | | | | | | | | | | | | | The build system fails to set up the chosen TLS provider and always builds the package without TLS. While this could be easily fixed, the package would fail to build with axTLS and cyaSSL without further intervention. The version of axTLS included with the source is outdated, as is the API used with cyaSSL, now wolfSSL. OpenSSL support could be enabled, but the TLS code limits connections to TLS 1.0, deprecated by RFC 8996: "TLS 1.0 MUST NOT be used". Remove the provider configuration from build options, and always build the library without TLS. Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
* rpcd-mod-luci: update filter for rpc_luci_get_network_devicesMarkus Stockhausen2022-06-281-1/+1
| | | | | | | | When kernel bonding module is loaded it will create a special file /sys/class/net/bonding_masters. This is no network device. Filter it out for getNetworkDevices() call. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
* luci-lib-jsonc: stringify int use json_object_new_int64 insteadJustin Klaassen2022-03-201-1/+1
| | | | | Fixes: #3293 Signed-off-by: Justin Klaassen <jck112@users.noreply.github.com>
* rpcd-mod-luci: parse prefix size from DHCPv6 leasesJo-Philipp Wich2021-10-261-7/+30
| | | | | | | | Remember the prefix size when parsing odhcpd lease entries and expose it in the ip6addrs array. Fixes: #4345 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: fix syntax errorJo-Philipp Wich2021-09-221-1/+1
| | | | | Fixes: 45a398e1ed ("rpcd-mod-luci: avoid PTR requests for IPv6 link-local and ULA addrs") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: avoid PTR requests for IPv6 link-local and ULA addrsJo-Philipp Wich2021-09-221-1/+7
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: let IPv4 hostnames take precedence over IPv6 onesJo-Philipp Wich2021-09-221-2/+3
| | | | | | | Do not overwrite IPv4-resolved hostnames with IPv6 ones in case both are available or resolvable. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: bump versionJo-Philipp Wich2021-06-151-1/+1
| | | | | Fixes: a78b74784d ("rpcd-mod-luci: refactor host hint gathering") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: refactor host hint gatheringJo-Philipp Wich2021-06-141-27/+32
| | | | | | | | | | | | | | | - Do not incorrectly put the IP addresses from the rrdns reply into the first hint, instead distribute hostnames to the appropriate hints. - Avoid returning stale lease information from previously parsed records by clearing the static struct before each parse attempt. - Improve existing checks for empty MAC addresses and unspecified IPv6 addresses. Fixes: #5126 Fixes: 87bcf9e923 ("rpcd-mod-luci: Return array of addresses in getHostHints") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: add link details to ubus netdev informationJo-Philipp Wich2021-06-111-0/+24
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Merge pull request #5070 from blocktrron/pr-luci-wifi6David Bauer2021-06-051-0/+15
|\ | | | | luci-mod-network: add 802.11ax HE support
| * rpcd-mod-luci: support parsing 11ax HW / HT modesDavid Bauer2021-06-051-0/+15
| | | | | | | | | | | | | | Add support for parsing 11ax modes returned from UBUS. This is required so the frontend can display information about supported 11ax operation. Signed-off-by: David Bauer <mail@david-bauer.net>
* | rpcd-mod-luci: Return array of addresses in getHostHintsNiels Widger2021-06-031-39/+156
|/ | | | | | | | | | | | | | | | | | | | | | | | | Update luci-rpc's getHostHints method to return two string arrays for each host, `ipaddrs` and `ip6addrs`, each containing the host's IPv4 and IPv6 addresses, respectively. Each array is sorted by a priority derived from the source from which the address was discovered. The current address sources and their priority is as follows (a higher (larger) priority is listed first): - neighbor table entries: 10 - /etc/ethers entries: 50 - DHCP leasefile: 100 - RRDNS queries: 100 - getifaddrs(): 200 - UCI static leases: 200 The existing `ipv4` and `ipv6` string fields for each host in `getHostHints` has been removed. Downstream users of getHostHints still need to be updated. Fixes: #4838 Signed-off-by: Niels Widger <niels@qacafe.com> [squash commits, reformat fixes tag] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: expose devtype and iflink properties in getNetworkDevicesJo-Philipp Wich2021-03-181-0/+32
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: Fix parsing of DUID-LLT's in duid2eaNiels Widger2021-02-251-1/+1
| | | | | | | | | | Fix parsing of DUID-LLT's in duid2ea. Unlike DUID-LL's, DUID-LLT's have a 32-bit time field between the hardware type and link-layer address fields, see RFC 3315 Sections 9.2 and 9.4: https://tools.ietf.org/html/rfc3315#section-9.2 https://tools.ietf.org/html/rfc3315#section-9.4 therefore, the link-layer address starts at offset 16 instead of 8. Signed-off-by: Niels Widger <niels@qacafe.com>
* rpcd-mod-luci: get rid of now unused getDSLStatus ubus rpcAndre Heider2021-01-261-55/+0
| | | | | | | Good riddance. Signed-off-by: Andre Heider <a.heider@gmail.com> Tested-by: Martin Schiller <ms@dev.tdt.de>
* rpcd-mod-luci: allow finding suffixed libwinfo.soJo-Philipp Wich2021-01-081-3/+11
| | | | | | | | | Recent versions ship a version suffixed libiwinfo.so, therefor we cannot rely on a fixed path name anymore. Use globbing to find matching libraries and load the first one we find. Fixes: #4718 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-*: improve postinst scriptKarel Kočí2020-12-073-6/+3
| | | | | | | | | | | | | | | | | Usage of killall is replaced with init script. This is cleaner solution as it does not consider some implementation detail but rather passes that on to init script implementation. IPKG_INSTROOT was added to prevent execution when not running in current root. It is invalid to request reload if install-root is not current root. In this case it can be considered harmless but it is invalid nonetheless. Last change is removal of `exit 0`. This caused skip of default postinst. Execution of default postinst does no harm and is more standard considering possible future expansion of it. Signed-off-by: Karel Kočí <karel.koci@nic.cz>
* rpcd-mod-luci: bump versionJo-Philipp Wich2020-11-071-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: handle lease files from all dnsmasq/odhcpd sectionsJo-Philipp Wich2020-11-071-111/+134
| | | | | Fixes: #911, #4303, #4308 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* Merge pull request #4373 from wjowsa/ubus-connect-argsJo-Philipp Wich2020-10-301-2/+2
|\ | | | | luci-base: Add possiblity to set path and timeout of ubus connection
| * luci-base: Add possiblity to set path and timeout of ubus connectionWojciech Jowsa2020-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | It might happen (e.g. when downloading a large file with low speed connection) that the ubus connection will time out. The ubus_connect function allows to specify ubus socket path and ubus connection timeout so it should allowed to set these arguments from luci. Signed-off-by: Wojciech Jowsa <wojciech.jowsa@gmail.com>
* | luci-lib-ip: fix tolinklocal invalid ipv6 resultSantiago Piccinini2020-09-061-0/+6
| | | | | | | | | | | | Force zeroing uninitialized memory. Signed-off-by: Santiago Piccinini <spiccinini@altermundi.net>
* | treewide: replace `which` with `command -v`Paul Spooren2020-08-201-1/+1
|/ | | | | | | | | | Fix shellcheck SC2230 > which is non-standard. Use builtin 'command -v' instead. Once applied to everything concerning OpenWrt we can disable the busybox feature `which` and save 3.8kB. Signed-off-by: Paul Spooren <mail@aparcar.org>
* luci-base(-libs): move pcdata() and striptags() from util- to xml-classSven Roederer2020-07-192-4/+16
| | | | | | | | To complete the previous commit these functions are defined in the resulting luci-base package but are also used in the new luci-base-libs package. So move them into the new xml-module of the new package. Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
* luci-base: move some generic classes into a separate luci-base-libs packageSven Roederer2020-07-199-2/+2372
| | | | | | | | | | The new package luci-base-libs provides the modules that not strictly relate to the web-interface of luci. By separating these libs they can be used by other packages without having to install the web-components. This change was inspired by providing a shell-only interface for 4MB-flash devices, by keeping as much code common with a full install. Signed-off-by: Sven Roederer <freifunk@it-solutions.geroedel.de>
* move nixio__bin2hex to header and make staticRosen Penev2020-06-213-6/+4
| | | | | | | | | | This fixes compilation under GCC10. There's no reason for this to be in a C file anyway. Also fixed a -Wmissing-prototypes warning with nixio__addr_prefix. Signed-off-by: Rosen Penev <rosenp@gmail.com>
* Merge pull request #3676 from Tarnyko/masterJo-Philipp Wich2020-06-1620-26/+30
|\ | | | | luci-lib-nixio: allow building with Lua5.2/LuaJIT
| * luci-lib-nixio: allow building with Lua5.2/LuaJITManuel BACHMANN2020-02-2420-26/+30
| | | | | | | | | | | | | | | | | | Lua 5.1 defines a "luaL_Reg" alias for deprecated "luaL_reg", but Lua >= 5.2 and LuaJIT do not. Replace by "luaL_Reg", and define a "luaL_reg" alias in case we build with old Lua 5.0. Signed-off-by: Manuel BACHMANN <tarnyko@tarnyko.net>
* | treewide: Remove myself as maintainerDaniel F. Dickinson2020-03-201-1/+0
| | | | | | | | | | | | | | | | | | | | Life changes, I'm no longer avaiable to be an sufficiently active OpenWrt developer. Therefore removing myself from maintainer from all packages I maintained in OpenWrt. All the best for those who keep up the good work! Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
* | rpcd-mod-luci: use correct dlopen() flagsJo-Philipp Wich2020-03-021-1/+1
|/ | | | | Fixes: #3707 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* rpcd-mod-luci: honour dhcp leases without ip address for host hintsJo-Philipp Wich2020-02-131-9/+9
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* luci-lib-ip: explicitly clear scope when allocating new userdataJo-Philipp Wich2020-02-081-0/+4
| | | | | Fixes: #3609 Signed-off-by: Jo-Philipp Wich <jo@mein.io>