Lines Matching defs:device
243 int link_config_get(link_config_ctx *ctx, struct udev_device *device,
248 assert(device);
254 attr_value = udev_device_get_sysattr_value(device, "address");
260 udev_device_get_property_value(device, "ID_PATH"),
261 udev_device_get_driver(udev_device_get_parent(device)),
262 udev_device_get_property_value(device, "ID_NET_DRIVER"),
263 udev_device_get_devtype(device),
264 udev_device_get_sysname(device))) {
268 attr_value = udev_device_get_sysattr_value(device, "name_assign_type");
273 log_warning("Config file %s applies to device based on potentially unpredictable interface name '%s'",
274 link->filename, udev_device_get_sysname(device));
279 log_warning("Config file %s matches device based on renamed interface name '%s', ignoring",
280 link->filename, udev_device_get_sysname(device));
286 log_debug("Config file %s applies to device %s",
287 link->filename, udev_device_get_sysname(device));
300 static bool mac_is_random(struct udev_device *device) {
306 s = udev_device_get_sysattr_value(device, "addr_assign_type");
317 static bool should_rename(struct udev_device *device, bool respect_predictable) {
323 s = udev_device_get_sysattr_value(device, "name_assign_type");
348 static int get_mac(struct udev_device *device, bool want_random,
357 r = net_get_unique_predictable_data(device, &result);
373 struct udev_device *device, const char **name) {
383 assert(device);
386 old_name = udev_device_get_sysname(device);
401 ifindex = udev_device_get_ifindex(device);
417 new_name = udev_device_get_property_value(device, "ID_NET_NAME_FROM_DATABASE");
420 new_name = udev_device_get_property_value(device, "ID_NET_NAME_ONBOARD");
423 new_name = udev_device_get_property_value(device, "ID_NET_NAME_SLOT");
426 new_name = udev_device_get_property_value(device, "ID_NET_NAME_PATH");
429 new_name = udev_device_get_property_value(device, "ID_NET_NAME_MAC");
437 if (should_rename(device, respect_predictable)) {
446 if (mac_is_random(device)) {
447 r = get_mac(device, false, &generated_mac);
457 if (!mac_is_random(device)) {
458 r = get_mac(device, true, &generated_mac);
481 int link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret) {
486 name = udev_device_get_sysname(device);