.log_level_cmdline = false,
.log_syslog = true,
.default_duid = { 0 },
- .default_duid_len = 0,
+ .default_duid_len = 0,
};
struct sys_conf sys_conf = {
else
error("Invalid %s value configured for interface '%s'",
iface_attrs[IFACE_ATTR_LEASETIME].name, iface->name);
-
}
if ((c = tb[IFACE_ATTR_MAX_PREFERRED_LIFETIME])) {
if(ra_hoplimit > AdvCurHopLimit)
warn("Clamped invalid %s value configured for interface '%s' to %d",
iface_attrs[IFACE_ATTR_RA_HOPLIMIT].name, iface->name, iface->ra_hoplimit);
-
}
iface->if_mtu = odhcpd_get_interface_config(iface->ifname, "mtu");
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- *
*/
#include <time.h>
ubus_bcast_dhcp_event("dhcp.release", req_mac,
(struct in_addr *)&lease->addr,
- lease->hostname, iface->ifname);
- dhcpv4_free_lease(lease);
- lease = NULL;
+ lease->hostname, iface->ifname);
+ dhcpv4_free_lease(lease);
+ lease = NULL;
break;
case DHCPV4_MSG_DECLINE:
if (ntohl(iface->dhcpv4_mask.s_addr) <= 0xffffff00) { /* /24, 150 of 256, [100..249] */
iface->dhcpv4_start_ip.s_addr = start | htonl(100);
iface->dhcpv4_end_ip.s_addr = end | htonl(100 + 150 - 1);
- } else if (ntohl(iface->dhcpv4_mask.s_addr) <= 0xffffff80) { /* /25, 100 of 128, [20..119] */
+ } else if (ntohl(iface->dhcpv4_mask.s_addr) <= 0xffffff80) { /* /25, 100 of 128, [20..119] */
iface->dhcpv4_start_ip.s_addr = start | htonl(20);
iface->dhcpv4_end_ip.s_addr = end | htonl(20 + 100 - 1);
- } else if (ntohl(iface->dhcpv4_mask.s_addr) <= 0xffffffc0) { /* /26, 50 of 64, [10..59] */
+ } else if (ntohl(iface->dhcpv4_mask.s_addr) <= 0xffffffc0) { /* /26, 50 of 64, [10..59] */
iface->dhcpv4_start_ip.s_addr = start | htonl(10);
iface->dhcpv4_end_ip.s_addr = end | htonl(10 + 50 - 1);
- } else if (ntohl(iface->dhcpv4_mask.s_addr) <= 0xffffffe0) { /* /27, 20 of 32, [10..29] */
+ } else if (ntohl(iface->dhcpv4_mask.s_addr) <= 0xffffffe0) { /* /27, 20 of 32, [10..29] */
iface->dhcpv4_start_ip.s_addr = start | htonl(10);
iface->dhcpv4_end_ip.s_addr = end | htonl(10 + 20 - 1);
} else { /* /28, 10 of 16, [3..12] */
/**
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License version 2 for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License version 2 for more details.
*
*/
#define DHCPV4_CLIENT_PORT 68
#define DHCPV4_SERVER_PORT 67
-#define DHCPV4_FLAG_BROADCAST 0x8000
+#define DHCPV4_FLAG_BROADCAST 0x8000
// RFC951, §3; RFC1542, §2.1; RFC2131, §2
#define DHCPV4_MIN_PACKET_SIZE 300
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
.len = htons(1),
.id = DHCPV6_MSG_RENEW,
};
- struct dhcpv6_auth_reconfigure auth = {
+ struct dhcpv6_auth_reconfigure auth = {
.type = htons(DHCPV6_OPT_AUTH),
.len = htons(sizeof(struct dhcpv6_auth_reconfigure)),
.protocol = 3,
}
/* Check iid against reserved IPv6 interface identifiers.
- Refer to:
- http://www.iana.org/assignments/ipv6-interface-ids */
+ * Refer to: http://www.iana.org/assignments/ipv6-interface-ids
+ */
static bool is_reserved_ipv6_iid(uint64_t iid)
{
if (iid == 0x0000000000000000)
if ((iid & 0xFFFFFFFFFF000000) == 0x02005EFFFE000000)
/* Reserved IPv6 Interface Identifiers corresponding
- to the IANA Ethernet Block [RFC4291] */
+ * to the IANA Ethernet Block [RFC4291]
+ */
return true;
if ((iid & 0xFFFFFFFFFFFFFF80) == 0xFDFFFFFFFFFFFF80)
list_for_each_entry_safe(c, d, &iface->ia_assignments, head) {
if (c->clid_len == 0 ||
- !(c->flags & OAF_DHCPV6_PD) ||
+ !(c->flags & OAF_DHCPV6_PD) ||
(!INFINITE_VALID(c->valid_until) && c->valid_until < now))
continue;
/*
* A requesting router can include a desired prefix length for its
- * delegation. The delegating router (us) is not required to honor
+ * delegation. The delegating router (us) is not required to honor
* the hint (RFC3633, section 11.2, we MAY choose to use the
* information in the option; RFC8168, section 3.2 has several SHOULDs
* about desired choices for selecting a prefix to delegate).
*
* If the minimum prefix length is set in this interface's
* configuration, we use it as a floor for the requested (hinted)
- * prefix length. This allows us to conserve prefix space so that
- * any single router can't grab too much of it. Consider if we have
- * an interface with a /56 prefix. A requesting router could ask for
- * a /58 and take 1/4 of our total address space. But if we set a
+ * prefix length. This allows us to conserve prefix space so that
+ * any single router can't grab too much of it. Consider if we have
+ * an interface with a /56 prefix. A requesting router could ask for
+ * a /58 and take 1/4 of our total address space. But if we set a
* minimum of /60, we can limit each requesting router to get only
* 1/16 of our total address space.
*/
if (iface->dhcpv6_pd_min_len && reqlen < iface->dhcpv6_pd_min_len) {
- info("clamping requested PD from %d to %d", reqlen,
- iface->dhcpv6_pd_min_len);
- reqlen = iface->dhcpv6_pd_min_len;
+ info("clamping requested PD from %d to %d", reqlen,
+ iface->dhcpv6_pd_min_len);
+ reqlen = iface->dhcpv6_pd_min_len;
}
} else if (is_na) {
uint8_t *sdata;
/* Does the DUID match? */
if (c->clid_len != clid_len || memcmp(c->clid_data, clid_data, clid_len))
- continue;
+ continue;
/* Does the IAID match? */
if (c->iaid != ia->iaid) {
a->assigned_host_id = lease_cfg ? lease_cfg->hostid : 0;
else
a->assigned_subnet_id = reqhint;
- a->valid_until = now;
- a->preferred_until = now;
+ a->valid_until = now;
+ a->preferred_until = now;
a->iface = iface;
a->flags = (is_pd ? OAF_DHCPV6_PD : OAF_DHCPV6_NA);
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#define _DHCPV6_IA_H_
#define ADDR_ENTRY_VALID_IA_ADDR(iface, i, m, addrs) \
- ((iface)->dhcpv6_assignall || (i) == (m) || \
- (addrs)[(i)].prefix > 64)
+ ((iface)->dhcpv6_assignall || \
+ (i) == (m) || \
+ (addrs)[(i)].prefix > 64)
size_t get_preferred_addr(const struct odhcpd_ipaddr *addrs, const size_t addrlen);
info("IPv6 PxE URLs:\n");
list_for_each_entry(entry, &ipv6_pxe_list, list)
- info(" arch %04d = %s\n", entry->arch, entry->bootfile_url.payload);
+ info("\tarch %04d = %s\n", entry->arch, entry->bootfile_url.payload);
if (ipv6_pxe_default)
- info(" Default = %s\n", ipv6_pxe_default->bootfile_url.payload);
+ info("\tDefault = %s\n", ipv6_pxe_default->bootfile_url.payload);
}
}
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- *
*/
#include <errno.h>
case DHCPV6_OPT_NEW_POSIX_TIMEZONE:
posix_want = true;
posix_tz.type = htons(DHCPV6_OPT_NEW_POSIX_TIMEZONE);
- posix_tz.len = htons(posix_len);
+ posix_tz.len = htons(posix_len);
break;
case DHCPV6_OPT_NEW_TZDB_TIMEZONE:
tzdb_want = true;
tzdb_tz.type = htons(DHCPV6_OPT_NEW_TZDB_TIMEZONE);
- tzdb_tz.len = htons(tzdb_len);
+ tzdb_tz.len = htons(tzdb_len);
break;
case DHCPV6_OPT_DNR:
/**
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2
- * as published by the Free Software Foundation.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License version 2 for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License version 2 for more details.
*
*/
#define DHCPV6_STATUS_NOPREFIXAVAIL 6
// I just remembered I have an old one lying around...
-#define DHCPV6_ENT_NO 30462
+#define DHCPV6_ENT_NO 30462
#define DHCPV6_ENT_TYPE 1
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
}
if (setsockopt(iface->ndp_ping_fd, IPPROTO_RAW, IPV6_CHECKSUM,
- &val, sizeof(val)) < 0) {
+ &val, sizeof(val)) < 0) {
error("setsockopt(IPV6_CHECKSUM): %m");
ret = -1;
goto out;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
static const char hexdigits[] = "0123456789abcdef";
static const int8_t hexvals[] = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -1, -1, -2, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
- -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -1, -1, -2, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1,
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
};
ssize_t odhcpd_unhexlify(uint8_t *dst, size_t len, const char *src)
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#define ADDR_MATCH_PIO_FILTER(_addr, iface) (odhcpd_bmemcmp(&(_addr)->addr, \
&(iface)->pio_filter_addr, \
(iface)->pio_filter_length) != 0 || \
- (_addr)->prefix < (iface)->pio_filter_length)
+ (_addr)->prefix < (iface)->pio_filter_length)
struct interface;
struct nl_sock;
extern struct sys_conf sys_conf;
void __iflog(int lvl, const char *fmt, ...);
-#define debug(fmt, ...) __iflog(LOG_DEBUG, fmt __VA_OPT__(, ) __VA_ARGS__)
-#define info(fmt, ...) __iflog(LOG_INFO, fmt __VA_OPT__(, ) __VA_ARGS__)
-#define notice(fmt, ...) __iflog(LOG_NOTICE, fmt __VA_OPT__(, ) __VA_ARGS__)
-#define warn(fmt, ...) __iflog(LOG_WARNING, fmt __VA_OPT__(, ) __VA_ARGS__)
-#define error(fmt, ...) __iflog(LOG_ERR, fmt __VA_OPT__(, ) __VA_ARGS__)
-#define critical(fmt, ...) __iflog(LOG_CRIT, fmt __VA_OPT__(, ) __VA_ARGS__)
-#define alert(fmt, ...) __iflog(LOG_ALERT, fmt __VA_OPT__(, ) __VA_ARGS__)
+#define debug(fmt, ...) __iflog(LOG_DEBUG, fmt __VA_OPT__(, ) __VA_ARGS__)
+#define info(fmt, ...) __iflog(LOG_INFO, fmt __VA_OPT__(, ) __VA_ARGS__)
+#define notice(fmt, ...) __iflog(LOG_NOTICE, fmt __VA_OPT__(, ) __VA_ARGS__)
+#define warn(fmt, ...) __iflog(LOG_WARNING, fmt __VA_OPT__(, ) __VA_ARGS__)
+#define error(fmt, ...) __iflog(LOG_ERR, fmt __VA_OPT__(, ) __VA_ARGS__)
+#define critical(fmt, ...) __iflog(LOG_CRIT, fmt __VA_OPT__(, ) __VA_ARGS__)
+#define alert(fmt, ...) __iflog(LOG_ALERT, fmt __VA_OPT__(, ) __VA_ARGS__)
#define emergency(fmt, ...) __iflog(LOG_EMERG, fmt __VA_OPT__(, ) __VA_ARGS__)
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
msecs = (labs(msecs) % ((*maxival != minival) ? (*maxival - minival)*1000 : 500)) +
minival*1000;
- /* RFC 2461 6.2.4 For the first MAX_INITIAL_RTR_ADVERTISEMENTS advertisements */
- /* if the timer is bigger than MAX_INITIAL_RTR_ADVERT_INTERVAL it should be */
- /* set to MAX_INITIAL_RTR_ADVERT_INTERVAL */
- /* Off by one as an initial interval timer has already expired */
+ /* RFC 2461 6.2.4 For the first MAX_INITIAL_RTR_ADVERTISEMENTS advertisements
+ * if the timer is bigger than MAX_INITIAL_RTR_ADVERT_INTERVAL it should be
+ * set to MAX_INITIAL_RTR_ADVERT_INTERVAL
+ * Off by one as an initial interval timer has already expired
+ */
if ((iface->ra_sent + 1) < MaxInitialRtAdvs && msecs > MaxInitialRtrAdvInterval*1000)
msecs = MaxInitialRtrAdvInterval*1000;
new_pios = realloc(iface->pios, sizeof(struct ra_pio) * (iface->pio_cnt + 1));
if (!new_pios)
- return;
+ return;
iface->pios = new_pios;
pio = &iface->pios[iface->pio_cnt];
pref64->type = ND_OPT_PREF64;
pref64->len = 2;
pref64->lifetime_plc = htons((0xfff8 & pref64_lifetime) |
- (0x7 & iface->pref64_plc));
+ (0x7 & iface->pref64_plc));
memcpy(pref64->prefix, iface->pref64_prefix, sizeof(pref64->prefix));
}
iov[IOV_RA_PREF64].iov_base = (char *)pref64;
* L-3: An IPv6 CE router MUST advertise itself as a router for the
* delegated prefix(es) (and ULA prefix if configured to provide
* ULA addressing) using the "Route Information Option" specified
- * in Section 2.3 of [RFC4191]. This advertisement is
+ * in Section 2.3 of [RFC4191]. This advertisement is
* independent of having or not having IPv6 connectivity on the
* WAN interface.
*/
if (c->ra_mtu && mtu_opt) {
if (ingress_mtu_val != c->ra_mtu) {
debug("Rewriting RA MTU from %u to %u on %s",
- ingress_mtu_val, c->ra_mtu, c->name);
+ ingress_mtu_val, c->ra_mtu, c->name);
mtu_opt->nd_opt_mtu_mtu = htonl(c->ra_mtu);
}
}
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#define MaxInitialRtrAdvInterval 16
#define MaxInitialRtAdvs 3
/* RFC8319 §4
- This document updates §4.2 and 6.2.1 of [RFC4861] to change
- the following router configuration variables.
-
- In §6.2.1, inside the paragraph that defines
- MaxRtrAdvInterval, change 1800 to 65535 seconds.
-
- In §6.2.1, inside the paragraph that defines
- AdvDefaultLifetime, change 9000 to 65535 seconds.
-*/
+ * This document updates §4.2 and 6.2.1 of [RFC4861] to change
+ * the following router configuration variables.
+ *
+ * In §6.2.1, inside the paragraph that defines
+ * MaxRtrAdvInterval, change 1800 to 65535 seconds.
+ *
+ * In §6.2.1, inside the paragraph that defines
+ * AdvDefaultLifetime, change 9000 to 65535 seconds.
+ */
#define MaxRtrAdvInterval 65535
#define MinRtrAdvInterval 3
#define AdvDefaultLifetime 65535
/* RFC8319 §4
- This document updates §4.2 and 6.2.1 of [RFC4861] to change
- the following router configuration variables.
-
- In §4.2, inside the paragraph that defines Router Lifetime,
- change 9000 to 65535 seconds.
-
- Note: this is 16 bit Router Lifetime field in RA packets
-*/
+ * This document updates §4.2 and 6.2.1 of [RFC4861] to change
+ * the following router configuration variables.
+ *
+ * In §4.2, inside the paragraph that defines Router Lifetime,
+ * change 9000 to 65535 seconds.
+ *
+ * Note: this is 16 bit Router Lifetime field in RA packets
+ */
/* RFC9096 defines recommended option lifetimes configuration values
- ND_PREFERRED_LIMIT 2700
- ND_VALID_LIMIT 5400
-
- RFC9096 §3.4
- CE routers SHOULD set the "Router Lifetime" of Router Advertisement
- (RA) messages to ND_PREFERRED_LIMIT.
-
- Note: while the RFC recommends SHOULD of ND_PREFERRED_LIMIT, this
- define is used to cap values to a sane ceiling, i.e. ND_VALID_LIMIT.
-*/
+ * ND_PREFERRED_LIMIT 2700
+ * ND_VALID_LIMIT 5400
+ *
+ * RFC9096 §3.4
+ * CE routers SHOULD set the "Router Lifetime" of Router Advertisement
+ * (RA) messages to ND_PREFERRED_LIMIT.
+ *
+ * Note: while the RFC recommends SHOULD of ND_PREFERRED_LIMIT, this
+ * define is used to cap values to a sane ceiling, i.e. ND_VALID_LIMIT.
+ */
#define RouterLifetime 5400
/* RFC4861 §6.2.1 : AdvReachableTime :
* MUST be no greater than 3,600,000 msec
*/
#define AdvReachableTime 3600000
/* RFC4861 §6.2.1 : AdvCurHopLimit
- The value should be set to the current
- diameter of the Internet. The value zero means
- unspecified (by this router).
-
- Note: this value is an 8 bit int, so max 255.
-*/
+ * The value should be set to the current
+ * diameter of the Internet. The value zero means
+ * unspecified (by this router).
+ *
+ * Note: this value is an 8 bit int, so max 255.
+ */
#define AdvCurHopLimit 255
/* RFC4861 §10 - constants
- Node constants:
- RETRANS_TIMER 1,000 milliseconds
-*/
+ * Node constants:
+ * RETRANS_TIMER 1,000 milliseconds
+ */
#define RETRANS_TIMER_MAX 60000
/* RFC2460 §5
- IPv6 requires that every link in the internet have an MTU of 1280
- octets or greater.
-*/
+ * IPv6 requires that every link in the internet have an MTU of 1280
+ * octets or greater.
+ */
#define RA_MTU_MIN 1280
#define RA_MTU_MAX 65535
};
static struct ubus_object_type main_object_type =
- UBUS_OBJECT_TYPE("dhcp", main_object_methods);
+ UBUS_OBJECT_TYPE("dhcp", main_object_methods);
static struct ubus_object main_object = {
- .name = "dhcp",
- .type = &main_object_type,
- .methods = main_object_methods,
- .n_methods = ARRAY_SIZE(main_object_methods),
+ .name = "dhcp",
+ .type = &main_object_type,
+ .methods = main_object_methods,
+ .n_methods = ARRAY_SIZE(main_object_methods),
};
ubus_notify(ubus, &main_object, type, b.head, -1);
}
-static void handle_event(_unused struct ubus_context *ctx, _unused struct ubus_event_handler *ev,
- _unused const char *type, struct blob_attr *msg)
+static void handle_event(_unused struct ubus_context *ctx,
+ _unused struct ubus_event_handler *ev,
+ _unused const char *type, struct blob_attr *msg)
{
struct blob_attr *tb[OBJ_ATTR_MAX];
blobmsg_parse(obj_attrs, OBJ_ATTR_MAX, tb, blob_data(msg), blob_len(msg));