| // 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; |
| 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; |