| // Copyright 2016 The ChromiumOS Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| syntax = "proto2"; |
| option optimize_for = LITE_RUNTIME; |
| |
| package patchpanel; |
| |
| message SubprocessMessage { |
| oneof message_type { |
| ControlMessage control_message = 1; // Message from Manager to subprocess |
| FeedbackMessage feedback_message = 2; // Message from subprocess to Manager |
| } |
| } |
| |
| message ControlMessage { |
| oneof message_type { |
| GuestMessage guest_message = 1; |
| DeviceMessage device_message = 2; |
| NDProxyControlMessage ndproxy_control = 3; |
| } |
| } |
| |
| message FeedbackMessage { |
| oneof message_type { |
| NDProxySignalMessage ndproxy_signal = 1; |
| } |
| } |
| |
| // Best practice is to use optional fields, but since the client and server |
| // are always in sync, these messages use required fields to save on |
| // validation. |
| |
| // If |br_ifname| exists in the message, a creation or deletion event |
| // occurred for the bridge interface. |
| // Otherwise, the event is occurred for the physical interface |dev_ifname|. |
| message DeviceMessage { |
| required string dev_ifname = 1; |
| optional string br_ifname = 2; |
| optional bool teardown = 3; // value is ignored |
| optional bool force_local_next_hop = 4; |
| } |
| |
| message GuestMessage { |
| enum GuestType { |
| UNKNOWN_GUEST = 0; |
| ARC = 1; // ARC++ Container (P & higher) |
| ARC_VM = 2; // ARC VM |
| TERMINA_VM = 3; // Crostini Termina VM |
| PARALLELS_VM = 4; |
| BRUSCHETTA_VM = 5; |
| BOREALIS_VM = 6; |
| } |
| required GuestType type = 1; |
| |
| enum GuestEvent { |
| UNKNOWN_EVENT = 0; |
| START = 1; |
| STOP = 2; |
| } |
| required GuestEvent event = 2; |
| |
| // The PID of the ARC++ container. |
| optional int32 arc_pid = 3; |
| |
| // The VSOCK CID of the ARCVM. |
| optional uint32 arcvm_vsock_cid = 4; |
| } |
| |
| // Message sent from main process (GuestIPv6Service) to NDProxy daemon process. |
| // For START_NS_NA_RS_RA and START_NS_NA_RS_RA_MODIFYING_ROUTER_ADDRESS, |
| // |if_id_primary| contains the upstream interface id and |if_id_secondary| |
| // contains the downstream. For START_NS_NA and STOP_PROXY, |if_id_primary| and |
| // |if_id_secondary| are exchangeable and contain the ids of the forwarding |
| // interface pair. For START_NEIGHBOR_MONITOR and STOP_NEIGHBOR_MONITOR, |
| // |if_id_primary| contains the downstream interface that neighbor IP is |
| // monitored and |if_id_secondary| is left empty. |
| message NDProxyControlMessage { |
| enum NDProxyRequestType { |
| UNKNOWN = 0; |
| START_NS_NA = 1; |
| START_NS_NA_RS_RA = 2; |
| START_NS_NA_RS_RA_MODIFYING_ROUTER_ADDRESS = 3; |
| STOP_PROXY = 4; |
| START_NEIGHBOR_MONITOR = 5; |
| STOP_NEIGHBOR_MONITOR = 6; |
| } |
| required NDProxyRequestType type = 1; |
| required int32 if_id_primary = 2; |
| optional int32 if_id_secondary = 3; |
| } |
| |
| // Message sent from NDProxy daemon process to main process upon certain packet |
| // events. NeighborDetectedSignal triggered when a non-link local address was |
| // detected on a downstream interface. RouterDetectedSignal trigger when an RA |
| // was received on an upstream interface. |
| message NDProxySignalMessage { |
| oneof event_type { |
| NeighborDetectedSignal neighbor_detected_signal = 1; |
| RouterDetectedSignal router_detected_signal = 2; |
| } |
| } |
| |
| // |if_id| contains the index of interface receiving the packet. |
| // |ip| is a 16 bytes-long network order bytes array containing the detected |
| // IPv6 address of the neighbor. |
| message NeighborDetectedSignal { |
| required int32 if_id = 1; |
| required bytes ip = 2; // 16 bytes-long IPv6 address, network order |
| } |
| |
| // |if_id| contains the index of interface receiving the packet. |
| // |ip| is a 16 bytes-long network order bytes array containing the announced |
| // prefix, and |prefix_len| the length. |
| message RouterDetectedSignal { |
| required int32 if_id = 1; |
| required bytes ip = 2; // 16 bytes-long IPv6 address, network order |
| required int32 prefix_len = 3; |
| } |