• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2019 The Chromium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5syntax = "proto2";
6
7package mach_fuzzer;
8
9// Specifies a type of Mach port right to create.
10enum MachPortType {
11  // Create a receive right and move it to the peer, while holding
12  // a send right.
13  RECEIVE = 0;
14  // Create a receive right and make a send right during mach_msg.
15  SEND = 1;
16  // Create a receive right and vend a send-once right during mach_msg.
17  SEND_ONCE = 2;
18  // Create a dead name right and give a send right to it to the peer.
19  DEAD_NAME = 3;
20  // Create a receive right with no senders and move the receive right
21  // to the peer.
22  RECEIVE_NO_SENDERS = 4;
23}
24
25// Data to send in an out-of-line memory region in Mach message descriptor.
26message OutOfLineMemory {
27  required bytes data = 1;
28}
29
30// Models a mach_msg_descriptor_t.
31message Descriptor {
32  oneof descriptor_oneof {
33    MachPortType port = 1;
34    OutOfLineMemory ool = 2;
35  }
36}
37
38// Models a Mach message structure including the header, optional body,
39// and inline data.
40message MachMessage {
41  // Creates an optional port to put in msgh_local_port. If this is a receive
42  // right, it will be dropped.
43  optional MachPortType local_port = 1;
44
45  // The msgh_id field.
46  optional uint32 id = 2;
47
48  // Optional Descriptors to carry in the message.
49  repeated Descriptor descriptors = 3;
50
51  // If no Descriptors are present, whether or not to include a mach_msg_body_t
52  // in the message.
53  required bool include_body_if_not_complex = 4;
54
55  // Raw data bytes to send inline with the message.
56  optional bytes data = 5;
57
58  // Extensions can be used by clients to express structured message data,
59  // which can be converted into bytes and placed in |data|.
60  extensions 100 to 199;
61}
62