summaryrefslogtreecommitdiff
path: root/handler.c
Commit message (Collapse)AuthorAgeFilesLines
* netifd: Fix multiple -Wsign-compare warningsHauke Mehrtens2023-02-191-2/+3
| | | | | | | | | | | | | | | | | | This fixes warnings like this: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare] Mostly this was an int compared to a size_t returned by ARRAY_SIZE(). The easiest fix is to count on the size_t type. The ifindex is sometimes an unsigned int and sometimes a signed int in the kernel interfaces. I think it normally fits into an unsigned 16 bit value, so this should be fine. Do the one comparison where the compiler complains as a long. Casting the result of sizeof() to int should be safe. These values are never out of range of int. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* handler: add mechanism to generate external device handler stubsArne Kappen2021-03-311-0/+114
| | | | | | | | | | | | | | | Parse JSON files in a given directory and pass the information on to a callback function for creation of an external device handler stub. The description contains: - 'name': the name of the device type, - 'ubus_name': the name of the external device handler daemon on ubus, - 'bridge': a flag indicating whether the devices are bridge-like, - optionally 'br_prefix': a prefix for created devices (only for bridge-like, defaults to type name), - 'config': the UCI config options for devices of this type, and - optionally 'info' and 'stats': the format of calls to info() and dump(). Signed-off-by: Arne Kappen <arne.kappen@hhi.fraunhofer.de>
* handler: fix resource leak on error in netifd_init_script_handlers()Hans Dedecker2018-04-121-1/+6
| | | | | | Detected by Coverity in CID 1412486 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* handler: replace is_error() helper with NULL checkAlexandru Ardelean2017-12-101-1/+1
| | | | | | | | | | The `is_error()` is just a macro that checks that object is NULL (which is considered an error in libjson-c terminology). Newer libjson-c versions have deprecated this. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* handler: Fix memory leakHans Dedecker2016-02-011-1/+5
| | | | | | Call globfree to free dynamically allocated storage from a previous glob call Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* make netifd_handler_parse_config honour the luci validation passed from the ↵John Crispin2014-02-171-0/+16
| | | | | | backend scripts Signed-off-by: John Crispin <blogic@openwrt.org>
* Work around warn_unused_result in recent gcc/libcSteven Barth2014-02-161-2/+2
|
* utils: add a function for checking if a process given by pid is still aliveFelix Fietkau2013-10-221-1/+0
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* proto-shell: move more core to handler.cFelix Fietkau2013-10-221-3/+20
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* proto-shell: move script handler config parse code to handler.cFelix Fietkau2013-10-221-0/+57
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* proto-shell: move script handler dump code to handler.cFelix Fietkau2013-10-221-0/+119
Signed-off-by: Felix Fietkau <nbd@openwrt.org>