blob: e111c32a4671abed162420d464479bba9b36ae36 [file] [log] [blame] [edit]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library zx;
// TODO(scottmg): (1 << 4) notation or something else for bits would be nice.
type Rights = strict bits : uint32 {
// TODO(scottmg): "bits members must be powers of two"
// NONE = 0x00000000;
DUPLICATE = 0x00000001;
TRANSFER = 0x00000002;
READ = 0x00000004;
WRITE = 0x00000008;
EXECUTE = 0x00000010;
MAP = 0x00000020;
GET_PROPERTY = 0x00000040;
SET_PROPERTY = 0x00000080;
ENUMERATE = 0x00000100;
DESTROY = 0x00000200;
SET_POLICY = 0x00000400;
GET_POLICY = 0x00000800;
SIGNAL = 0x00001000;
SIGNAL_PEER = 0x00002000;
WAIT = 0x00004000;
INSPECT = 0x00008000;
MANAGE_JOB = 0x00010000;
MANAGE_PROCESS = 0x00020000;
MANAGE_THREAD = 0x00040000;
APPLY_PROFILE = 0x00080000;
MANAGE_SOCKET = 0x00100000;
OP_CHILDREN = 0x00200000;
RESIZE = 0x00400000;
ATTACH_VMO = 0x00800000;
MANAGE_VMO = 0x01000000;
SAME_RIGHTS = 0x80000000;
};
const RIGHTS_BASIC Rights = Rights.TRANSFER | Rights.DUPLICATE | Rights.WAIT | Rights.INSPECT;
const RIGHTS_IO Rights = Rights.READ | Rights.WRITE;
const RIGHTS_PROPERTY Rights = Rights.GET_PROPERTY | Rights.SET_PROPERTY;
const RIGHTS_POLICY Rights = Rights.GET_POLICY | Rights.SET_POLICY;
const DEFAULT_CHANNEL_RIGHTS Rights
= Rights.TRANSFER | Rights.WAIT | Rights.INSPECT | RIGHTS_IO | Rights.SIGNAL | Rights.SIGNAL_PEER;
const DEFAULT_EVENT_RIGHTS Rights = RIGHTS_BASIC | Rights.SIGNAL;