Google is committed to advancing racial equity for Black communities. See how.

fuchsia.wlan.devmgr

PROTOCOLS

IsolatedDevmgr

Defined in fuchsia.wlan.devmgr/devmgr.fidl

Provides an isolated devfs.

IsolatedDevmgr is a wrapper around a fuchsia.io.Directory node that is provided by an isolated devmgr component instance (//src/lib/isolated_devmgr). If injected into a test components, it represents the devfs (/dev) served by devmgr, in a real environment.

AddInotifyFilter

Adds a new inotify filter for an object relative to this directory object.

  • 'filter` is a mask of different inotify events that need to be watched by the server for a specific file/directory.

  • path may contain multiple segments, separated by "/" characters, and should never be empty; i.e., "" is an invalid path. Paths should not contain a leading "/".

+watch_descriptor is client assigned value to identify a filter. Server shouldn't trust the client-assigned watch_descriptor. They should just send it back to the client in the socket. This value is not used by server, but it is returned back as part of InotifyEvent, to help the client correlate filter with events on this filter.

  • socket is shared between different filter objects i.e every new filter will have a different server end of the socket and there will be a single client end per inotify instance on inotify init.

Request

NameType
path fuchsia.io2/Path
filter fuchsia.io2/InotifyWatchMask
watch_descriptor uint32
socket handle<socket>

Response

NameType

AdvisoryLock

Acquires an advisory lock on the underlying file.

The lock lasts until either this connection is closed or this method is called with |AdvisoryLockType.UNLOCK| to release the lock explicitly.

Advisory locks are purely advisory. They do not prevent actual read or write operations from occurring on the file, either through this connection or through other connections.

This method requires the following rights:

Errors

  • ZX_ERR_BAD_STATE The specified type of lock cannot be acquired. For example, another connection might hold a conflicting lock type.
  • ZX_ERR_NOT_SUPPORTED This file does not support advisory locking.
  • ZX_ERR_ACCESS_DENIED This connection does not have sufficient rights to acquire the given type of lock.

Request

NameType
request fuchsia.io2/AdvisoryLockRequest

Response

NameType
result fuchsia.io2/AdvisoryLocking_AdvisoryLock_Result

Clone

Create another connection to the same remote object.

flags may be any of:

  • OPEN_RIGHT_*
  • OPEN_FLAG_APPEND
  • OPEN_FLAG_NO_REMOTE
  • OPEN_FLAG_DESCRIBE
  • CLONE_FLAG_SAME_RIGHTS

All other flags are ignored.

The OPEN_RIGHT_* bits in flags request corresponding rights over the resulting cloned object. The cloned object must have rights less than or equal to the original object, otherwise returns ZX_ERR_ACCESS_DENIED. Alternatively, pass CLONE_FLAG_SAME_RIGHTS to inherit the rights on the source connection. It is invalid to pass any of the OPEN_RIGHT_* flags together with CLONE_FLAG_SAME_RIGHTS.

Request

NameType
flags uint32
object request<fuchsia.io/Node>

Close

Terminates connection with object.

This method does not require any rights.

Request

NameType

Response

NameType
s zx/status

Describe

Returns extra information about the type of the object. If the Describe operation fails, the connection is closed.

This method does not require any rights.

Request

NameType

Response

NameType
info fuchsia.io/NodeInfo

GetAttr

Acquires information about the node.

This method does not require any rights.

Request

NameType

Response

NameType
s zx/status
attributes fuchsia.io/NodeAttributes

GetToken

Acquires a token to a Directory which can be used to identify access to it at a later point in time.

This method requires following rights: OPEN_RIGHT_WRITABLE, otherwise returns ZX_ERR_BAD_HANDLE.

Request

NameType

Response

NameType
s zx/status
token handle<handle>?

Creates a link to an object named src by the name dst, within a directory represented by token.

src must be a resolved object name. Including "/" in the string will return ZX_ERR_INVALID_ARGS.

dst must be a resolved object name. Including "/" in the string will return ZX_ERR_INVALID_ARGS.

This method requires following rights: OPEN_RIGHT_WRITABLE, otherwise returns ZX_ERR_BAD_HANDLE.

NameType
src string[4096]
dst_parent_token handle<handle>
dst string[4096]
NameType
s zx/status

NodeGetFlags

Acquires the Directory.Open rights and flags used to access this file.

This method does not require any rights. This method has the same functionality as GetFlags for File and is meant as an in-progress replacement.

Request

NameType

Response

NameType
s zx/status
flags uint32

NodeSetFlags

Changes the Directory.Open flags used to access the file. Supported flags which can be turned on / off:

  • OPEN_FLAG_APPEND

This method does not require any rights. This method has the same functionality as SetFlags for File and is meant as an in-progress replacement.

Request

NameType
flags uint32

Response

NameType
s zx/status

OnOpen

An event produced eagerly by a FIDL server if requested by OPEN_FLAG_DESCRIBE.

Indicates the success or failure of the open operation, and optionally describes the object. If the status is ZX_OK, info contains descriptive information about the object (the same as would be returned by Describe).

Response

NameType
s zx/status
info fuchsia.io/NodeInfo?

Open

Opens a new object relative to this directory object.

path may contain multiple segments, separated by "/" characters, and should never be empty; i.e. "" is an invalid path. A trailing slash implies OPEN_FLAG_DIRECTORY. Components must not be empty (i.e. "foo//bar" is invalid). ".." is disallowed anywhere in the path. "." is only allowed if the path is exactly ".", but not otherwise. A leading '/' is allowed (and is treated the same way as if not present, i.e. "/foo/bar' and "foo/bar" are the same).

flags may be any of the OPEN_FLAG_* and OPEN_RIGHT_* values, bitwise ORed together. The OPEN_FLAG_DESCRIBE flag may cause an OnOpen event to be transmitted on the object handle, indicating the type of object opened.

If an unknown value is sent for flags the connection should be closed.

OPEN_RIGHT_* flags provided in flags will restrict access rights on the object channel which will be connected to the opened entity.

Rights are never increased. When you open a nested entity within a directory, you may only request the same rights as what the directory connection already has, or a subset of those. Exceeding those rights causes an access denied error to be transmitted in the OnOpen event if applicable, and the object connection closed.

The caller must specify either one or more of the OPEN_RIGHT_* flags, or the OPEN_FLAG_NODE_REFERENCE flag.

mode is only used if an object is created and indicates the type of object to be created. An unsupported mode will cause the connection to be closed. The mode type, if set, must always be consistent with the OPEN_FLAG_DIRECTORY and OPEN_FLAG_NOT_DIRECTORY flags, even if an object is not being created. If an object is not being created, mode is otherwise ignored. If an object is being created and the mode type is not set, a directory will be created if OPEN_FLAG_DIRECTORY is set (explicitly or implicitly), or otherwise a server chosen object type.

Request

NameType
flags uint32
mode uint32
path string[4096]
object request<fuchsia.io/Node>

ReadDirents

Reads a collection of variably sized dirents into a buffer. The number of dirents in a directory may be very large: akin to calling read multiple times on a file, directories have a seek offset which is updated on subsequent calls to ReadDirents.

These dirents are of the form:

struct dirent {
  // Describes the inode of the entry.
  uint64 ino;
  // Describes the length of the dirent name in bytes.
  uint8 size;
  // Describes the type of the entry. Aligned with the
  // POSIX d_type values. Use `DIRENT_TYPE_*` constants.
  uint8 type;
  // Unterminated name of entry.
  char name[0];
}

This method does not require any rights, since one could always probe for directory contents by triggering name conflicts during file creation.

Request

NameType
max_bytes uint64

Response

NameType
s zx/status
dirents vector<uint8>[8192]

Rename

Renames an object named src to the name dst, in a directory represented by token.

src/dst must be resolved object names. Including "/" in any position other than the end of the string will return ZX_ERR_INVALID_ARGS. Returning "/" at the end of either string implies that it must be a directory, or else ZX_ERR_NOT_DIR should be returned.

This method requires following rights: OPEN_RIGHT_WRITABLE, otherwise returns ZX_ERR_BAD_HANDLE.

Request

NameType
src string[4096]
dst_parent_token handle<handle>
dst string[4096]

Response

NameType
s zx/status

Rename2

Renames a node named src to the name dst, in a directory represented by dst_parent_token.

src and dst must be valid node names. See fuchsia.io2/Name for what constitutes a valid name.

This method requires the following rights on both the current connection, and the connection identified by dst_parent_token:

Request

NameType
src fuchsia.io2/Name
dst_parent_token fuchsia.io2/Token
dst fuchsia.io2/Name

Response

NameType
result fuchsia.io/Directory_Rename2_Result

Rewind

Resets the directory seek offset.

This method does not require any rights, similar to ReadDirents.

Request

NameType

Response

NameType
s zx/status

SetAttr

Updates information about the node. flags may be any of NODE_ATTRIBUTE_FLAG_*.

This method requires following rights: OPEN_RIGHT_WRITABLE, otherwise returns ZX_ERR_BAD_HANDLE.

Request

NameType
flags uint32
attributes fuchsia.io/NodeAttributes

Response

NameType
s zx/status

Sync

Synchronizes updates to the node to the underlying media, if it exists.

This method does not require any rights.

Request

NameType

Response

NameType
s zx/status

Detaches an object from this directory object.

The underlying object may or may not be deleted after this method completes: although the link will be removed from the containing directory, objects with multiple references (such as files which are still open) will not actually be destroyed until all references are removed.

If a directory is unlinked while it still has an open reference, it must become read-only, preventing new entries from being created until all references close and the directory is destroyed.

path identifies the file which should be detached. If path contains multiple segments, separated by "/" characters, then the directory is traversed, one segment at a time, relative to the originally accessed Directory.

Returns: ZX_ERR_ACCESS_DENIED if the connection (or the underlying filesystem) does not allow writable access. ZX_ERR_INVALID_ARGS if path contains ".." segments. ZX_ERR_NOT_EMPTY if path refers to a non-empty directory. ZX_ERR_UNAVAILABLE if path refers to a mount point, containing a remote channel. ZX_ERR_UNAVAILABLE if path is ".".

Other errors may be returned for filesystem-specific reasons.

This method requires following rights: OPEN_RIGHT_WRITABLE, otherwise returns ZX_ERR_BAD_HANDLE.

NameType
path string[4096]
NameType
s zx/status

Unlink2

Removes a child node from the this directory's list of entries.

Note: this does not guarantee that the underlying object is destroyed. Although the link will be removed from the containing directory, objects with multiple references (such as files which are still open) will not actually be destroyed until all references are closed.

  • error ZX_ERR_ACCESS_DENIED if the connection does not have Rights.WRITE_BYTES.
  • error ZX_ERR_NOT_SUPPORTED if the underlying filesystem does not support writing.
  • error ZX_ERR_BAD_PATH if name is invalid.
  • error ZX_ERR_NOT_EMPTY if name refers to a non-empty directory.
  • error ZX_ERR_UNAVAILABLE if name refers to a mount point, containing a remote channel.
  • error ZX_ERR_NOT_DIR if the options requested a directory but something other than a directory was found.

Other errors may be returned for filesystem-specific reasons.

This method requires the following rights:

Request

NameType
name fuchsia.io2/Name
options fuchsia.io2/UnlinkOptions

Response

NameType
result fuchsia.io/Directory_Unlink2_Result

Watch

Watches a directory, receiving events of added messages on the watcher request channel.

The watcher handle will send messages of the form:

struct {
  uint8 event;
  uint8 len;
  char name[];
};

Where names are NOT null-terminated.

This API is unstable; in the future, watcher will be a DirectoryWatcher client.

Mask specifies a bitmask of events to observe. Options must be zero; it is reserved.

This method does not require any rights, similar to ReadDirents.

Request

NameType
mask uint32
options uint32
watcher handle<channel>

Response

NameType
s zx/status

STRUCTS