summaryrefslogtreecommitdiffstats
path: root/src/shared/udev-util.h
blob: 651d335b9698611f31a3c696032d64dc3f1d8a4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once

#include "sd-device.h"

#include "hashmap.h"
#include "time-util.h"

int udev_set_max_log_level(char *str);
int udev_parse_config(void);

int device_wait_for_initialization(sd_device *device, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_wait_for_devlink(const char *path, const char *subsystem, usec_t timeout_usec, sd_device **ret);
int device_is_renaming(sd_device *dev);

bool device_for_action(sd_device *dev, sd_device_action_t action);

void log_device_uevent(sd_device *device, const char *str);

size_t udev_replace_whitespace(const char *str, char *to, size_t len);
size_t udev_replace_chars(char *str, const char *allow);

int udev_queue_is_empty(void);

bool udev_available(void);

int device_get_vendor_string(sd_device *device, const char **ret);
int device_get_model_string(sd_device *device, const char **ret);

int device_get_property_value_with_fallback(
                sd_device *device,
                const char *prop,
                Hashmap *extra_props,
                const char **ret);