package libudev

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Device enumeration and filtering.

type filter =
  1. | Subsystem of string
    (*

    Subsystem subsystem matches devices that are part of subsystem.

    *)
  2. | NoSubsystem of string
    (*

    NoSubsystem subsystem matches devices that are not part of subsystem.

    *)
  3. | Sysattr of string * string
    (*

    Sysattr (attribute, value) matches devices whose attribute has the given value.

    *)
  4. | NoSysattr of string * string
    (*

    Sysattr (attribute, value) matches devices whose attribute doesn't have the given value. Devices that do not have attribute at all are also included.

    *)
  5. | Property of string * string
    (*

    Property (prop, value) matches devices whose prop has the given value.

    *)
  6. | Sysname of string
    (*

    Sysname name matches devices with the given name.

    *)
  7. | Tag of string
    (*

    Tag tag matches devices which have the given tag attached.

    *)
  8. | Parent of Device.t
    (*

    Parent parent matches devices on the subtree of the given parent device.

    *)
  9. | Is_initialized
    (*

    Is_initialized matches devices which are initialized.

    Initialized devices have properly set device node permissions and context, and are (in case of network devices) fully renamed.

    Currently this will not affect devices which do not have device dones and are not network interfaces.

    *)

The devices enumerated using Enumerate.devices and Enumerate.subsystems can be filtered, specifying a list of filter values.

val devices : Context.t -> filter list -> Device.t list

List the devices matching the given filter list.

val subsystems : Context.t -> filter list -> Device.t list

List the subsystems matching the given filter list.

OCaml

Innovation. Community. Security.