uint32_t mtu;
uint32_t min_mtu;
uint32_t max_mtu;
+
+ // Flags
+ unsigned int flags;
};
int nw_link_create(nw_link** link, nw_daemon* daemon, int ifindex) {
return 0;
}
+static int nw_link_update_flags(nw_link* link, sd_netlink_message* message) {
+ unsigned int flags = 0;
+ int r;
+
+ // Fetch flags
+ r = sd_rtnl_message_link_get_flags(message, &flags);
+ if (r < 0) {
+ return DEBUG("Could not read link flags: %m\n");
+ return 1;
+ }
+
+ // End here if there have been no changes
+ if (link->flags == flags)
+ return 0;
+
+ // XXX We should log any changes here
+
+ // Store the new flags
+ link->flags = flags;
+
+ return 0;
+}
+
/*
This function is called whenever anything changes, so that we can
update our internal link object.
if (r)
return r;
+ // Update flags
+ r = nw_link_update_flags(link, message);
+ if (r)
+ return r;
+
return 0;
}