libubox: add boolean type support - #43
Conversation
|
Ping @nbd168 @systemcrash @Alphix |
|
Not sure how this interacts with ubus. ubus coerces u8 to bool. So bool is u8. https://github.com/openwrt/ubus/blob/0d4bcb56f5e1386e7dc99f1ec9f3b6c9211c8ab6/cli.c#L466 Does this cause ABI breakage? |
4ba241f to
90705e4
Compare
9b6cb9d to
f7a85e3
Compare
Create a distinguished BLOBMSG_TYPE_BOOL in order to differenciate int8 and boolean types (both still use BLOB_ATTR_INT8 as storage format). Signed-off-by: Bastien BERNARD <bastien.bernard@softathome.com>
f7a85e3 to
4d12437
Compare
With the new distinguished BLOBMSG_TYPE_BOOL (equal to 8), libubox no longer can parse existing binary blobs compiled with BLOBMSG_TYPE_BOOL=BLOBMSG_TYPE_INT8 (equal to 7). To fix that, allow an attribute encoded with BLOBMSG_TYPE_INT8, and whose policy indicates a BLOBMSG_TYPE_BOOL. Signed-off-by: Bastien BERNARD <bastien.bernard@softathome.com>
|
@systemcrash: I indeed saw a regression in ubus, with the "ubus monitor" command. Some attributes like "no_reply" are now displayed as 1 instead of "true": I propose the following pull request to solve this: openwrt/ubus#25 Also, adding a boolean type indeed creates an ABI breakage, making one of the test failed (the test which parses procd-instance-nlbwmon.bin). I have added a second commit, to have backward compatibility with existing binary blobs. |
|
@Alphix @Noltari: do you still plan to merge #28 ? In there a boolean function was added, but I think it would be nice to have a dedicated boolean type as well.
|
Create a distinguished BLOBMSG_TYPE_BOOL in order to differenciate int8 and boolean types (both still use BLOB_ATTR_INT8 as storage format).