summaryrefslogtreecommitdiffstats
path: root/src/libudev/libudev-device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libudev/libudev-device.c')
-rw-r--r--src/libudev/libudev-device.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index d3a3c53969..91dc910773 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -23,6 +23,7 @@
#include "device-private.h"
#include "device-util.h"
#include "libudev-device-internal.h"
+#include "libudev-list-internal.h"
#include "parse-util.h"
#include "time-util.h"
@@ -37,6 +38,36 @@
*/
/**
+ * udev_device:
+ *
+ * Opaque object representing one kernel sys device.
+ */
+struct udev_device {
+ struct udev *udev;
+
+ /* real device object */
+ sd_device *device;
+
+ /* legacy */
+ unsigned n_ref;
+
+ struct udev_device *parent;
+ bool parent_set;
+
+ struct udev_list *properties;
+ uint64_t properties_generation;
+ struct udev_list *tags;
+ uint64_t tags_generation;
+ struct udev_list *devlinks;
+ uint64_t devlinks_generation;
+ bool properties_read:1;
+ bool tags_read:1;
+ bool devlinks_read:1;
+ struct udev_list *sysattrs;
+ bool sysattrs_read;
+};
+
+/**
* udev_device_get_seqnum:
* @udev_device: udev device
*
@@ -834,3 +865,9 @@ _public_ int udev_device_has_tag(struct udev_device *udev_device, const char *ta
return sd_device_has_tag(udev_device->device, tag) > 0;
}
+
+sd_device *udev_device_get_sd_device(struct udev_device *udev_device) {
+ assert(udev_device);
+
+ return udev_device->device;
+}