static dbus_bool_t __ni_objectmodel_team_set_address(ni_dbus_object_t *object, const ni_dbus_property_t *property, const ni_dbus_variant_t *argument, DBusError *error) { ni_netdev_t *dev; if (!(dev = ni_objectmodel_unwrap_netif(object, error))) return FALSE; return __ni_objectmodel_set_hwaddr(argument, &dev->link.hwaddr); }
static inline ni_bool_t try_set_mac_address(const ni_dbus_variant_t *var, ni_hwaddr_t *value) { memset(value, 0, sizeof(*value)); if (var == NULL) return TRUE; if (__ni_objectmodel_set_hwaddr(var, value) && value->len == 6) { value->type = NI_IFTYPE_ETHERNET; return TRUE; } return FALSE; }
static dbus_bool_t __ni_objectmodel_gre_set_remote_addr(ni_dbus_object_t *object, const ni_dbus_property_t *property, const ni_dbus_variant_t *argument, DBusError *error) { ni_netdev_t *dev; if (!(dev = ni_objectmodel_unwrap_netif(object, error))) return FALSE; if (__ni_objectmodel_set_hwaddr(argument, &dev->link.hwpeer)) { dev->link.hwpeer.type = ARPHRD_IPGRE; return TRUE; } else { return FALSE; } }