57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen#pragma once
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen/***
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen This file is part of systemd.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen Copyright 2014 Tom Gundersen <teg@jklm.no>
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen systemd is free software; you can redistribute it and/or modify it
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen under the terms of the GNU Lesser General Public License as published by
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen the Free Software Foundation; either version 2.1 of the License, or
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen (at your option) any later version.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen systemd is distributed in the hope that it will be useful, but
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen WITHOUT ANY WARRANTY; without even the implied warranty of
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen Lesser General Public License for more details.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen You should have received a copy of the GNU Lesser General Public License
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen along with systemd; If not, see <http://www.gnu.org/licenses/>.
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen***/
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include <inttypes.h>
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include <stdbool.h>
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include <sys/types.h>
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering#include "sd-device.h"
07630cea1f3a845c09309f197ac7c4f11edd3b62Lennart Poettering
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_new_from_strv(sd_device **ret, char **strv);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_id_filename(sd_device *device, const char **ret);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_devlink_priority(sd_device *device, int *priority);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_watch_handle(sd_device *device, int *handle);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_devnode_mode(sd_device *device, mode_t *mode);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_devnode_uid(sd_device *device, uid_t *uid);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_devnode_gid(sd_device *device, gid_t *gid);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_seal(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_set_is_initialized(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_set_watch_handle(sd_device *device, int fd);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_set_db_persist(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_set_devlink_priority(sd_device *device, int priority);
813a71a206f9f8dc7f824299e94404f8bfdafd91Zbigniew Jędrzejewski-Szmekint device_ensure_usec_initialized(sd_device *device, sd_device *device_old);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_add_devlink(sd_device *device, const char *devlink);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_add_property(sd_device *device, const char *property, const char *value);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_add_tag(sd_device *device, const char *tag);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_remove_tag(sd_device *device, const char *tag);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_cleanup_tags(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenvoid device_cleanup_devlinks(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenuint64_t device_get_properties_generation(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenuint64_t device_get_tags_generation(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenuint64_t device_get_devlinks_generation(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_properties_nulstr(sd_device *device, const uint8_t **nulstr, size_t *len);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_get_properties_strv(sd_device *device, char ***strv);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_rename(sd_device *device, const char *name);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_shallow_clone(sd_device *old_device, sd_device **new_device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_clone_with_db(sd_device *old_device, sd_device **new_device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_copy_properties(sd_device *device_dst, sd_device *device_src);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_new_from_synthetic_event(sd_device **new_device, const char *syspath, const char *action);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersen
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_tag_index(sd_device *dev, sd_device *dev_old, bool add);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_update_db(sd_device *device);
57fa1d094cd2c5ac68970526ad0a0754c548e75dTom Gundersenint device_delete_db(sd_device *device);
107f2e2526d476c6cc9b81a690391c111027d641Tom Gundersenint device_read_db_force(sd_device *device);