The LDI includes libdevinfo(3LIB) interfaces that report a snapshot of device layering information. Device layering occurs when one device in the system is a consumer of another device in the system. Device layering information is reported only if both the consumer and the target are bound to a device node that is contained within the snapshot.
Device layering information is reported by the libdevinfo(3LIB) interfaces as a directed graph. An lnode is an abstraction that represents a vertex in the graph and is bound to a device node. You can use libdevinfo(3LIB) interfaces to access properties of an lnode, such as the name and device number of the node.
The edges in the graph are represented by a link. A link has a source lnode that represents the device consumer. A link also has a target lnode that represents the target device.
Snapshot flag that enables you to capture device layering information.
A directed link between two endpoints. Each endpoint is a di_lnode_t. An opaque structure.
The endpoint of a link. An opaque structure. A di_lnode_t is bound to a di_node_t.
Represents a device node. An opaque structure. A di_node_t is not necessarily bound to a di_lnode_t.
Walk all links in the snapshot.
Walk all lnodes in the snapshot.
Get a handle to the next link where the specified di_node_t node is either the source or the target.
Get a handle to the next link where the specified di_lnode_t lnode is either the source or the target.
Get the lnode that corresponds to the specified endpoint of a di_link_t link.
Get the link spectype. The spectype indicates how the target device is being accessed. The target device is represented by the target lnode.
Get a handle to the next occurrence of the specified di_lnode_t lnode associated with the specified di_node_t device node.
Get the name that is associated with the specified lnode.
Get a handle to the device node that is associated with the specified lnode.
Get the device number of the device node that is associated with the specified lnode.
The device layering information returned by the LDI can be quite complex. Therefore, the LDI provides interfaces to help you traverse the device tree and the device usage graph. These interfaces enable the consumer of a device tree snapshot to associate custom data pointers with different structures within the snapshot. For example, as an application traverses lnodes, the application can update the custom pointer associated with each lnode to mark which lnodes already have been seen.
Associate the specified data with the specified lnode. This association enables you to traverse lnodes in the snapshot.
Retrieve a pointer to data that was associated with an lnode through a call to di_lnode_private_set(3DEVINFO).
Associate the specified data with the specified link. This association enables you to traverse links in the snapshot.
Retrieve a pointer to data that was associated with a link through a call to di_link_private_set(3DEVINFO).