diff options
author | Santiago Piccinini <spiccinini@altermundi.net> | 2020-12-02 19:07:05 -0300 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2020-12-06 20:44:29 +0100 |
commit | 8f27697b9b82420890cedd429622052c8b67cea1 (patch) | |
tree | fb8ddcb7580e973de1604d8dc995b00977ba0d90 /src/odhcpd.h | |
parent | 694148a87fa5a0c964286fdaac1fa490a2fb530b (diff) |
ubus: add add_lease method
Allows sharing leases between odhcpd instances running
in multiple hosts.
Signed-off-by: Santiago Piccinini <spiccinini@altermundi.net>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/odhcpd.h')
-rw-r--r-- | src/odhcpd.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/odhcpd.h b/src/odhcpd.h index 0108af1..2f7dd25 100644 --- a/src/odhcpd.h +++ b/src/odhcpd.h @@ -159,6 +159,15 @@ struct lease { char *hostname; }; +enum { + LEASE_ATTR_IP, + LEASE_ATTR_MAC, + LEASE_ATTR_DUID, + LEASE_ATTR_HOSTID, + LEASE_ATTR_LEASETIME, + LEASE_ATTR_NAME, + LEASE_ATTR_MAX +}; struct odhcpd_ref_ip; @@ -315,6 +324,7 @@ struct interface { }; extern struct avl_tree interfaces; +extern const struct blobmsg_policy lease_attrs[LEASE_ATTR_MAX]; inline static void free_assignment(struct dhcp_assignment *a) { @@ -375,6 +385,7 @@ struct lease *config_find_lease_by_duid(const uint8_t *duid, const uint16_t len) struct lease *config_find_lease_by_mac(const uint8_t *mac); struct lease *config_find_lease_by_hostid(const uint32_t hostid); struct lease *config_find_lease_by_ipaddr(const uint32_t ipaddr); +int set_lease_from_blobmsg(struct blob_attr *ba); #ifdef WITH_UBUS int ubus_init(void); |