summaryrefslogtreecommitdiffhomepage
path: root/libs
AgeCommit message (Collapse)Author
2015-09-01Fix module lines in several luadoc filesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-08-31luci-lib-jsonc: Fix memory leak in stringify()Jan-Philipp Litza
2015-08-30luci-lib-jsonc: allow encoding empty listsJan-Philipp Litza
To be consistent with the behavior of luci-lib-json, an empty Lua table should be encoded to an empty JSON list, not an empty JSON object. To still allow encoding empty JSON objects, the usage of anything other than a number or a string as a key (for example an empty table or a function) can be used to force encoding as an object: json.stringify({}) -- "[]" json.stringify({[{}] = true}) -- "{}" Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
2015-08-30luci-lib-jsonc: Ignore non-string-or-number keys in tablesJan-Philipp Litza
Previously, the following caused a segmentation fault: json.stringify({[{}] = true}) This was caused by lua_tostring() returning NULL for anything but strings and numbers, letting json_object_object_add crash. This patch makes jsonc ignore all keys which have no string representation altogether. Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
2015-07-30luci-lib-nixio: pass exact sockaddr length to getnameinfo()Jo-Philipp Wich
Musl libc requires the length parameter of getnameinfo() to be exactly `sizeof(struct sockaddr_in)` or `sizeof(struct sockaddr_in6)`, depending on the passed sockaddr family. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-06-04luci-lib-json: ignore null keys to allow encoding empty objectsMatthias Schiffer
There is currently no way to encode an empty object {}, as empty tables are encoded as empty lists []. With this patch, encode() will ignore table fields with the key json.null (which doesn't make sense anyways). This allows adding a field with key json.null to force encoding it as an object. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2015-01-29Move inline documentation into separate files.Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-28luci-lib-jsonc: add api documentationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-28luci-lib-ip: add api documentationJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-28luci-lib-nixio: move CHANGELOG and README into nixio namespaceJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-28luci-lib-ip: add functions to deal with IPv6 mapped IPv6Jo-Philipp Wich
* Add luci.ip.cidr.is6mapped4() to test whether an IPv6 CIDR is a mapped IPv4 one * Add luci.ip.cidr.mapped4() to derive IPv4 from mapped CIDR * Remove mapped IPv4 workaround from constructor as it breaks genuine addrs like ::ffff:0 Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-28luci-lib-ip: multiple fixesJo-Philipp Wich
* Fix broken neighbor filtering by address range due to uninitialized memory * Fix wrong sizeof in _cidr_add_sub when adding/substracing IPv6 addresses * Properly convert numeric values to IPv6 addresses Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-26libs: add luci-lib-jsonc, a Lua binding for JSON-CJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-26luci-lib-ip: accept 2nd netmask argument in new(), IPv4() and IPv6()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-25luci-lib-ip: fix segfault in link() on systems with ip6gre supportJo-Philipp Wich
If an ip6gre interface is queried, the resulting link local address string of 47 byte overflowed the buffer of 32 bytes used to hold the translated address. Increase the address string buffer to 48 byte and check the address length prior to writing it into the buffer to avoid future problems with longs link local addresses. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-24luci-lib-ip: fix netlink receiving in link()Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-23luci-lib-ip: add link() method to get basic iface infoJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-22luci-lib-ip: always return table for dump, even if emptyJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-22luci-lib-ip: support filtering neighbors by mac or dest addrJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-22luci-lib-ip: fix routes() for non-callback invocationsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-22luci-lib-nixio: always assume Linux target (#307)Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-22libs: add luci-lib-ipJo-Philipp Wich
Add new luci.ip library which is an api compatible C reimplementation of ip.lua. It also supports dumping the system routing table and neighbour entry database via netlink. Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-22add params support in optionsYuzo
2015-01-22send Cookie in a single header line, follow browser behaviorYuzo
2015-01-22add sock::readall() to ensure the response body is completeYuzo
2015-01-16Update my email addresses in the license headersJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-16Globally reduce copyright headersJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-15luci-lib-nixio: drop "bit" compatibility classJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-15luci-lib-px5g: disable MIPS16Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-09luci-lib-px5g: add missing src Makefile and fix dependsJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-09luci-lib-luaneightbl: add src Makefile and fix dependencies (#282)Jo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08Remove obsolete .mk filesJo-Philipp Wich
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-08Rework LuCI build systemJo-Philipp Wich
* Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-16httpclient: fix logic error for redirectsManuel Munz
2014-06-11build: remove abandonned sgi librariesJo-Philipp Wich
2014-06-11build: introduce luci-baseJo-Philipp Wich
Merges libs/core, libs/ipkg, libs/web, libs/sys, libs/sgi-cgi, libs/sgi-uhttpd, modules/admin-core, themes/base and protcols/core into modules/base and renames luci-lib-core to luci-base.
2014-06-11Remove unmaintained components: lucid, fastindex, niuJo-Philipp Wich
2014-04-24libs/sys: make sure to always return a table from arptable() when no ↵Jo-Philipp Wich
callback is passed (#671)
2014-03-28libs/sgi-uhttpd: fix binding to properly work with current uhttpd2 ↵Jo-Philipp Wich
implementation Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-03-28libs/sgi-uhttpd: do not assume env.CONTENT_LENGTH to be a numberJo-Philipp Wich
env.CONTENT_LENGTH as passed by uhttpd might be a string, so explicitely convert it using tonumber(). Issue has been reported by Catalin Patulea <cat@vv.carleton.ca> Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-02-05httpclient: fix parsing of IPv6 URLs (#662)Jo-Philipp Wich
2014-02-05build: fix clean targets in Makefiles (#667)Jo-Philipp Wich
2013-12-03libs/core: further network model compatibility fixesJo-Philipp Wich
2013-12-03libs/core: make luci.model.network compatible with new wireless netifd ↵Jo-Philipp Wich
integration
2013-12-03libs/json: add proper support for decoding unicode escapesJo-Philipp Wich
2013-07-07add luaneightbl: this is an arp replacement for ipv6. neightbl.get(wlan0) ↵Patrick Grimm
return ip,mac table this can use in a for loop "for ip,mac in pairs(t) do" Thanx Cyrus
2013-05-23Add support for stateful DHCPv6Steven Barth
2013-04-04libs/web: do not cast to string when using network_netlist widget (#560)Jo-Philipp Wich
2013-04-04libs/core: do not consider alternative routing tables in luci.model.network ↵Jo-Philipp Wich
for now
2013-03-27libs/sys: fix incomplete options table when parsing iptables rulesJo-Philipp Wich