network: re-design request queue

This makes Request object takes hash, compare, free, and process functions.

With this change, the logic in networkd-queue.c can be mostly
independent of the type of the request or the object (e.g. Address) assigned
to the request, and it becomes simpler.
This commit is contained in:
Yu Watanabe
2022-03-11 14:20:31 +09:00
parent 4c8b81caa5
commit 09d09207de
38 changed files with 285 additions and 554 deletions
-3
View File
@@ -109,7 +109,6 @@ typedef enum NetDevCreateType {
typedef struct Manager Manager;
typedef struct Condition Condition;
typedef struct Request Request;
typedef struct NetDev {
Manager *manager;
@@ -209,8 +208,6 @@ int netdev_set_ifindex(NetDev *netdev, sd_netlink_message *newlink);
int netdev_generate_hw_addr(NetDev *netdev, Link *link, const char *name,
const struct hw_addr_data *hw_addr, struct hw_addr_data *ret);
int independent_netdev_process_request(Request *req, Link *link, void *userdata);
int stacked_netdev_process_request(Request *req, Link *link, void *userdata);
int link_request_stacked_netdev(Link *link, NetDev *netdev);
const char *netdev_kind_to_string(NetDevKind d) _const_;