summaryrefslogtreecommitdiffhomepage
path: root/src/ubus.c
diff options
context:
space:
mode:
authorDainis Jonitis <dainis.jonitis@ubnt.com>2018-11-26 14:36:28 +0200
committerHans Dedecker <dedeckeh@gmail.com>2019-05-02 11:25:51 +0200
commit4a600ce5b1f3f2d877ad68ce0cc199a122d30abd (patch)
treee398fcc86ff08e1094efc5a91a97326045c1f166 /src/ubus.c
parent09e5eca32c1872c1676c25dfd3f240b10bc85d55 (diff)
dhcpv4: add support for Parameter Request List option 55
Add client "reqopts" in ubus "ipv4leases" output. Signed-off-by: Roman Yeryomin <roman.yeryomin@ubnt.com> Signed-off-by: Dainis Jonitis <dainis.jonitis@ubnt.com>
Diffstat (limited to 'src/ubus.c')
-rw-r--r--src/ubus.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ubus.c b/src/ubus.c
index b2e48cf..1bb8237 100644
--- a/src/ubus.c
+++ b/src/ubus.c
@@ -49,6 +49,16 @@ static int handle_dhcpv4_leases(struct ubus_context *ctx, _unused struct ubus_ob
blobmsg_add_string(&b, "hostname", (c->hostname) ? c->hostname : "");
blobmsg_add_u8(&b, "accept-reconf-nonce", c->accept_fr_nonce);
+ if (c->reqopts) {
+ int opt = 0;
+ int chars = 0;
+ buf = blobmsg_alloc_string_buffer(&b, "reqopts", strlen(c->reqopts) * 4 + 1);
+ for(; c->reqopts[opt]; opt++)
+ chars += snprintf(buf + chars, 6, "%u,", (uint8_t)c->reqopts[opt]);
+ buf[chars - 1] = '\0';
+ blobmsg_add_string_buffer(&b);
+ }
+
m = blobmsg_open_array(&b, "flags");
if (c->flags & OAF_BOUND)
blobmsg_add_string(&b, NULL, "bound");