summaryrefslogtreecommitdiff
path: root/cli.c
Commit message (Collapse)AuthorAgeFilesLines
* iron out all extra compiler warningsPetr Štetiar2019-12-161-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | clang-9 on x86/64 has reported following warnings/errors: libubus-acl.c:123:2: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] libubus-io.c:108:18: error: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] libubus-io.c:395:56: error: comparison of integers of different signs: 'ssize_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] libubus-req.c:441:4: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] ubusd_acl.c:119:18: error: comparison of integers of different signs: 'int' and 'unsigned long' [-Werror,-Wsign-compare] ubusd_acl.c:152:5: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] ubusd_acl.c:348:3: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] ubusd_acl.c:352:3: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] ubusd_acl.c:357:3: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] ubusd_acl.c:362:3: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] ubusd_acl.c:367:3: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] ubusd_acl.c:447:16: error: comparison of integers of different signs: 'int' and '__size_t' (aka 'unsigned long') [-Werror,-Wsign-compare] ubusd_acl.c:502:18: error: comparison of integers of different signs: 'int' and 'unsigned long' [-Werror,-Wsign-compare] ubusd.c:123:13: error: comparison of integers of different signs: 'int' and 'unsigned long' [-Werror,-Wsign-compare] ubusd.c:170:15: error: comparison of integers of different signs: 'int' and 'unsigned long' [-Werror,-Wsign-compare] ubusd.c:262:43: error: comparison of integers of different signs: 'int' and 'unsigned long' [-Werror,-Wsign-compare] ubusd.c:287:30: error: comparison of integers of different signs: 'int' and 'unsigned long' [-Werror,-Wsign-compare] ubusd_event.c:170:18: error: comparison of integers of different signs: 'int' and 'unsigned long' [-Werror,-Wsign-compare] ubusd_obj.c:71:2: error: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Werror,-Wsign-compare] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* cli: fix listen_timeout compile issueHans Dedecker2017-02-201-2/+2
| | | | | | | | Variable listen_timeout is redefined as a function resulting into a compile issue. Define the function as ubus_cli_listen_timeout to fix the compile issue. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
* cli: do not use default timeout for listenFelix Fietkau2017-02-151-1/+4
| | | | | | | Default to listening for events forever unless -t is explicitly specified on the command line Signed-off-by: Felix Fietkau <nbd@nbd.name>
* cli: add support for subscribing to objectsFelix Fietkau2017-02-141-13/+73
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* cli: register event handler first, then do lookupAlexandru Ardelean2016-10-121-2/+5
| | | | | | | | | | | | | | | | | We seem to be getting timeout for ubus wait_for calls every now and then. And it's not reliably reproducible. Looking at the code the only thing that would look like a potetntial reason, is that between the ubus_lookup() and ubus_register_event_handler() calls, there's a very narrow window where the event would get sent out and we would not get it, thus having to timeout. It doesn't look like registering the event handler first is a big problem for the whole wait_check_object() logic. Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* cli: add timeout support for listen commandZhao, Gang2016-02-291-5/+20
| | | | | | | | | | Currently 'ubus listen' command does not respect the timeout parameter, i.e., whether timeout parameter is provided, 'ubus listen' will always run infinitely. This patch let 'ubus listen' command support the timeout parameter. For example, 'ubus listen -t 60' will cause the command to exit after 60 seconds. Signed-off-by: Zhao, Gang <gang.zhao.42@gmail.com>
* cli: static keyword tweakZhao, Gang2016-02-291-3/+3
| | | | | | | | | | | | | Function ubus_cli_listen() is called only once, and function uloop_run() and uloop_done() which need struct ubus_event_handler listener are called within this function, so it's not needed to mark struct ubus_event_handler listener as static. The same as pointer struct ubus_context *ctx in main function. Global struct commands is only used in this file, so it should be marked static. Signed-off-by: Zhao, Gang <gang.zhao.42@gmail.com>
* cli: add monitor supportFelix Fietkau2015-11-191-1/+191
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* cli: flush stdout after printing an eventFelix Fietkau2015-05-121-0/+1
| | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* cli: implement wait_forFelix Fietkau2014-05-061-0/+102
| | | | | | | Allows waiting for one or more objects to appear Returns instantly if objects are already present Signed-off-by: Felix Fietkau <nbd@openwrt.org>
* cli: add array and table types to method signature dumpFelix Fietkau2012-09-281-0/+2
|
* cli: prevent indenting if simple output is requestedFelix Fietkau2012-05-061-1/+1
|
* add -vFelix Fietkau2011-09-051-2/+7
|
* cli: indent call result dataFelix Fietkau2011-07-181-2/+2
|
* add copyright/license informationFelix Fietkau2011-06-171-0/+13
|
* suppress stderr output with -SFelix Fietkau2011-03-271-6/+10
|
* improve output for scriptsFelix Fietkau2011-03-271-2/+13
|
* use int8 as booleanFelix Fietkau2011-03-271-0/+1
|
* add support for timeouts on synchronous requestsFelix Fietkau2011-02-111-2/+6
|
* remove separate catch all list, always require a pattern argument for ↵Felix Fietkau2011-02-111-6/+14
| | | | registering events, even if it is just *
* cli: clean up codeFelix Fietkau2011-02-071-46/+72
|
* cli: use stdout for outputFelix Fietkau2011-02-071-3/+3
|
* add code for sending events and fix the code for receiving eventsFelix Fietkau2011-02-071-6/+18
|
* more const for the signature type tableFelix Fietkau2011-02-071-1/+1
|
* add options to override the ubus socket name for the cli and the example programFelix Fietkau2011-02-061-25/+50
|
* cli: display proper types for the method signaturesFelix Fietkau2011-02-061-1/+23
|
* use the json to blobmsg libraryFelix Fietkau2011-02-061-79/+2
|
* add support for parsing method calls with json argumentsFelix Fietkau2011-02-061-2/+89
|
* implement code for receiving eventsFelix Fietkau2011-02-051-2/+22
|
* cli: wait for incoming events on listenFelix Fietkau2011-02-051-0/+5
|
* add functionality for registering anonymous objects as event listenersFelix Fietkau2011-02-051-1/+27
|
* add some stub functionality for the ubus event switchFelix Fietkau2011-02-051-0/+3
|
* cli: return the ubus ret codeFelix Fietkau2011-02-051-1/+1
|
* libubus: add generic lookup codeFelix Fietkau2011-01-311-51/+14
|
* cli: use ubus_invoke() instead of low level handlingFelix Fietkau2011-01-311-6/+2
|
* add support for data repliesFelix Fietkau2011-01-311-2/+11
|
* remove path based invoke functions, add stub implementation for invoking ↵Felix Fietkau2011-01-311-4/+36
| | | | method calls
* add stubs for invokeFelix Fietkau2011-01-301-4/+13
|
* Initial importFelix Fietkau2011-01-301-0/+73