-static bool match_config(link_config *match, struct udev_device *device) {
- const char *property;
-
- if (match->match_mac) {
- property = udev_device_get_sysattr_value(device, "address");
- if (!property || memcmp(match->match_mac, ether_aton(property), ETH_ALEN)) {
- log_debug("Device MAC address (%s) did not match MACAddress=%s",
- property, ether_ntoa(match->match_mac));
- return 0;
- }
- }
-
- if (match->match_path) {
- property = udev_device_get_property_value(device, "ID_PATH");
- if (!streq_ptr(match->match_path, property)) {
- log_debug("Device's persistent path (%s) did not match Path=%s",
- property, match->match_path);
- return 0;
- }
- }
-
- if (match->match_driver) {
- property = udev_device_get_driver(device);
- if (!streq_ptr(match->match_driver, property)) {
- log_debug("Device driver (%s) did not match Driver=%s",
- property, match->match_driver);
- return 0;
- }
- }
-
- if (match->match_type) {
- property = udev_device_get_devtype(device);
- if (!streq_ptr(match->match_type, property)) {
- log_debug("Device type (%s) did not match Type=%s",
- property, match->match_type);
- return 0;
- }
- }
-
- return 1;
-}
-
-int link_config_get(link_config_ctx *ctx, struct udev_device *device, link_config **ret) {