Expand description
Structs§
- BpfFilters
- Collection of BPF socket filters for kernel events.
- LineBuf
- Line buffer for parsing HWDB on-disk file format.
- Mode
- Linux file-permission mode.
- Syspath
- Represents the file path in the
sys
filesystem. - Trie
Child Entry - Trie child entry in the hardware database.
- Trie
Entry - Represents the full Trie entry in the HWDB.
- Trie
Header - On-disk trie objects
- Trie
Node - Trie node in the hardware database.
- Trie
Value Entry - Trie value entry in the hardware database.
- Udev
- libudev context
- Udev
Device - Represents one kernel
sys
device. - Udev
Entry - UDEV list entry.
- Udev
Enumerate - Represents one device lookup/sort context..
- Udev
Hwdb - Represents the on-disk hardware database.
- Udev
List - Represents a list wrapper around a UdevEntryList.
- Udev
Monitor - Handles device event sources.
- Udev
Monitor Netlink Header - Represents a UDEV Netlink header.
- Udev
Queue - Represents the current event queue in the udev daemon.
- file_
handle - Represents an FFI type from
fcntl.h
for afile_handle
.
Enums§
- Error
- Error types for the
udev
library. - LogPriority
- Udev
Monitor Netlink Group - Represents the netlink group for the UdevMonitor.
- Udev
Socket - Represents socket variants on a Linux system.
Constants§
- BPF_
FILTER_ LEN - Maximum length of BPF socket filters.
- ENVP_
LEN - Maximum number of ENVP entries
- HWDB_
SIG - Hardware database signature.
- HWDB_
SIG_ STR - Hardware database signature (string representation).
- LINE_
MAX - Maximum length for a file line.
- LOG_
ALERT - LOG_
CRIT - LOG_
DEBUG - LOG_
EMERG - LOG_ERR
- LOG_
INFO - LOG_
NOTICE - LOG_
WARNING - MODE_
MASK - Bitmask for Mode.
- RULES_
PATH_ LEN - UDEV_
MONITOR_ MAGIC - UDEV Monitor magic bytes
- UDEV_
ROOT_ RUN - Default filesystem path for the UDEV
run
directory. - UEVENT_
FILE_ LIMIT - Limits the number of characters for a UEVENT file.
Functions§
- child_
entry_ size - Gets the ChildEntry size loaded from the TrieHeader.
- encode_
devnode_ name - Encodes a
devnode
name, removing potentially dangerous characters. - encode_
string - Encodes provided string, removing potentially unsafe characters.
- major
- Gets the major part of the device number.
- minor
- Gets the minor part of the device number.
- murmur_
hash2 - MurmurHash2 was written by Austin Appleby, and is placed in the public domain. The author hereby disclaims copyright to this source code.
- name_
to_ handle_ at - Wrapper around a syscall that returns an opaque handle that corresponds to a specified file.
- node_
size - Gets the Node size loaded from the TrieHeader.
- string_
bloom64 - Gets a bunch of bit numbers out of the hash, and sets the bits into a bitfield.
- string_
hash32 - Compute a MurMurHash over the provided string.
- trie_
string - Parses a string from the HWDB buffer.
- udev_
device_ get_ action - Gets the device action.
- udev_
device_ get_ current_ tags_ list_ entry - Gets the current tags list entry in the UdevDevice.
- udev_
device_ get_ devlinks_ list_ entry - Gets the list of device links for the UdevDevice.
- udev_
device_ get_ devnode - Gets the UdevDevice
devnode
. - udev_
device_ get_ devnum - Gets the device major/minor number.
- udev_
device_ get_ devpath - Gets the UdevDevice device path.
- udev_
device_ get_ driver - Gets the kernel driver name.
- udev_
device_ get_ is_ initialized - Gets whether the UdevDevice is initialized.
- udev_
device_ get_ parent - Gets the next parent UdevDevice.
- udev_
device_ get_ parent_ with_ subsystem_ devtype - Gets the next parent UdevDevice based on
subsystem
anddevtype
. - udev_
device_ get_ property_ value - Gets the value of a given property.
- udev_
device_ get_ seqnum - Gets the device event sequence number.
- udev_
device_ get_ sysattr_ list_ entry - Gets the first entry in the
sysattr
properties list. - udev_
device_ get_ sysattr_ value - Gets the sys attribute file value.
- udev_
device_ get_ sysname - Gets the UdevDevice
sysname
. - udev_
device_ get_ sysnum - Gets the UdevDevice
sysnum
. - udev_
device_ get_ syspath - Gets the UdevDevice
syspath
. - udev_
device_ get_ tags_ list_ entry - Gets the first tags list entry in the UdevDevice.
- udev_
device_ get_ udev - Gets a reference to the Udev context from an UdevDevice.
- udev_
device_ get_ udev_ cloned - Gets a cloned reference to the Udev context from an UdevDevice.
- udev_
device_ get_ usec_ since_ initialized - Gets the number of microseconds since the UdevDevice was initialized.
- udev_
device_ has_ current_ tag - Gets whether the UdevDevice has the provided current
tag
associated. - udev_
device_ has_ tag - Gets whether the UdevDevice has the provided
tag
associated. - udev_
device_ new - Creates a new UdevDevice from the provided Udev context.
- udev_
device_ new_ from_ device_ id - Create new UdevDevice from an ID string.
- udev_
device_ new_ from_ devnum - Creates new UdevDevice.
- udev_
device_ new_ from_ environment - Create new udev device from the environment information.
- udev_
device_ new_ from_ subsystem_ sysname - Creates a new UdevDevice from the subsystem and sysname.
- udev_
device_ new_ from_ syspath - Creates new UdevDevice, and fills in information from the sys device and the udev database entry.
- udev_
device_ read_ db - Reads UdevDevice information from the persistent database file.
- udev_
enumerate_ add_ match_ is_ initialized - Sets whether the match lists are initialized.
- udev_
enumerate_ add_ match_ parent - Sets the parent UdevDevice on a given device tree.
- udev_
enumerate_ add_ match_ property - Adds an entry to the match properties UdevEntry list.
- udev_
enumerate_ add_ match_ subsystem - Adds an entry to the match subsystem UdevEntry list.
- udev_
enumerate_ add_ match_ sysattr - Adds an entry to the match sysattr UdevEntry list.
- udev_
enumerate_ add_ match_ sysname - Adds an entry to the match sysname UdevEntry list.
- udev_
enumerate_ add_ match_ tag - Adds an entry to the match tag UdevEntry list.
- udev_
enumerate_ add_ nomatch_ subsystem - Adds an entry to the no-match subsystem UdevEntry list.
- udev_
enumerate_ add_ nomatch_ sysattr - Adds an entry to the no-match sysattr UdevEntry list.
- udev_
enumerate_ add_ syspath - Adds a devices to the list of devices.
- udev_
enumerate_ new - Creates a new UdevEnumerate.
- udev_
enumerate_ scan_ devices - Scan
/sys
for devices which match the given filters. - udev_
enumerate_ scan_ subsystems - Scans
/sys
for all kernel subsystems. - udev_
get_ log_ priority - Gets the LogPriority for the Udev context.
- udev_
hwdb_ get_ properties_ list_ entry - Looks up a matching device in the hardware database.
- udev_
hwdb_ new - Creates a new UdevHwdb.
- udev_
hwdb_ query - Looks up a matching device modalias in the hardware database and returns the list of properties.
- udev_
hwdb_ query_ one - Looks up a specific matching property name (key) for device modalias
- udev_
list_ entry_ foreach - Helper function that iterates over every UdevEntry in the list, applying the function to each entry.
- udev_
list_ entry_ foreach_ mut - Helper function that iterates over every UdevEntry in the list, applying the function to each entry.
- udev_
list_ entry_ get_ name - Gets the name of the UdevEntry.
- udev_
list_ entry_ get_ next - Gets a reference to the next entry in a UdevList.
- udev_
list_ entry_ get_ next_ mut - Gets a mutable reference to the next entry in a UdevList.
- udev_
list_ entry_ get_ value - Gets the value of the UdevEntry.
- udev_
monitor_ enable_ receiving - Binds the UdevMonitor socket to the event source.
- udev_
monitor_ filter_ add_ match_ subsystem_ devtype - Adds an UdevEntry into the filter subsystem list.
- udev_
monitor_ filter_ add_ match_ tag - Adds an UdevEntry into the filter tag list.
- udev_
monitor_ filter_ remove - Removes all filters from the UdevMonitor.
- udev_
monitor_ filter_ update - Updates the monitor socket filter.
- udev_
monitor_ get_ fd - Gets the UdevMonitor socket file descriptor.
- udev_
monitor_ get_ udev - Gets the Udev context of the UdevMonitor.
- udev_
monitor_ new_ from_ netlink - Creates a new UdevMonitor from the provided parameters.
- udev_
monitor_ receive_ device - Receives data from the UdevMonitor socket.
- udev_
monitor_ set_ receive_ buffer_ size - Sets the size of the kernel socket buffer.
- udev_
new - Creates a new Udev context.
- udev_
queue_ flush - Clears the watched file descriptor for queue changes.
- udev_
queue_ get_ fd - Gets a file descriptor to watch for a queue to become empty.
- udev_
queue_ get_ queue_ is_ empty - Gets whether UdevQueue is currently processing any events.
- udev_
queue_ get_ udev - Gets a reference to the Udev context.
- udev_
queue_ get_ udev_ is_ active - Checks if Udev is active on the system.
- udev_
queue_ new - Creates a new UdevQueue.
- udev_
set_ log_ priority - Sets the LogPriority for the Udev context.
- udev_
util_ encode_ string - Encodes provided string, removing potentially unsafe characters.
- value_
entry_ size - Gets the ValueEntry size loaded from the TrieHeader.
- whitelisted_
char_ for_ devnode - Gets whether the provided character is whitelisted.
Type Aliases§
- Result
- Convenience alias for the
udev
libraryResult
type. - Udev
Entry List - Convenience alias for a LinkedList of UdevEntry.