blob: 28c5f0e83725787f8061936f500d78943c369ee7 [file] [log] [blame]
Kevin Cernekee27bcaa62016-12-03 11:16:26 -08001// Copyright 2016 The Chromium OS Authors. All rights reserved.
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";
6option optimize_for = LITE_RUNTIME;
7
Garrick Evans3388a032020-03-24 11:25:55 +09008package patchpanel;
Kevin Cernekee27bcaa62016-12-03 11:16:26 -08009
10// Best practice is to use optional fields, but since the client and server
11// are always in sync, these messages use required fields to save on
12// validation.
13
Jason Jeremy Iman3f062ea2019-11-12 08:37:53 +090014// If |br_ifname| exists in the message, a creation or deletion event
15// occurred for the bridge interface.
16// Otherwise, the event is occurred for the physical interface
17// |dev_ifname|.
Garrick Evans96e03042019-05-28 14:30:52 +090018message DeviceMessage {
Taoyu Lif0370c92019-09-18 15:04:37 +090019 required string dev_ifname = 1;
Jason Jeremy Imand89b5f52019-10-24 10:39:17 +090020 optional string br_ifname = 2;
21 optional bool teardown = 3; // value is ignored
Kevin Cernekee27bcaa62016-12-03 11:16:26 -080022}
Garrick Evans96e03042019-05-28 14:30:52 +090023
24message GuestMessage {
25 enum GuestType {
26 UNKNOWN_GUEST = 0;
Garrick Evans1cce71a2019-06-21 10:43:14 +090027 ARC = 1; // ARC++ Container (P & higher)
Garrick Evansb05a7ff2020-02-18 12:59:55 +090028 ARC_VM = 2; // ARC VM
29 TERMINA_VM = 3; // Crostini Termina VM
30 PLUGIN_VM = 4; // Plugin VM
Garrick Evans96e03042019-05-28 14:30:52 +090031 }
32 required GuestType type = 1;
33
34 enum GuestEvent {
35 UNKNOWN_EVENT = 0;
36 START = 1;
37 STOP = 2;
38 }
39 required GuestEvent event = 2;
40
41 // The PID of the ARC++ container.
42 optional int32 arc_pid = 3;
Garrick Evans1cce71a2019-06-21 10:43:14 +090043
44 // The VSOCK CID of the ARCVM.
45 optional int32 arcvm_vsock_cid = 4;
Garrick Evans96e03042019-05-28 14:30:52 +090046}
47
Taoyu Lia0727dc2020-09-24 19:54:59 +090048// Messages sent by NDProxy daemon process to patchpanel main process
49// notifying ndp events and instructing adding / deleting ip address
50// and routes.
51message NDProxyMessage {
52 enum NDProxyEventType {
53 UNKNOWN = 0;
54 ADD_ROUTE = 1; // guest ifname / guest peer addr (route to be added)
55 ADD_ADDR = 2; // guest ifname / guest if addr (to be added)
56 DEL_ADDR = 3; // guest ifname / guest if addr (to be deleted)
57 }
58 required NDProxyEventType type = 1;
59 required string ifname = 2;
60 optional string ip6addr = 3;
61}
62
Garrick Evans96e03042019-05-28 14:30:52 +090063message IpHelperMessage {
64 oneof message_type {
65 GuestMessage guest_message = 1;
66 DeviceMessage device_message = 2;
Taoyu Lia0727dc2020-09-24 19:54:59 +090067 NDProxyMessage ndproxy_message = 3;
Garrick Evans96e03042019-05-28 14:30:52 +090068 }
69}