| // 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; | |
| MulticastForwardingControlMessage mcast_control = 2; | |
| BroadcastForwardingControlMessage bcast_control = 3; | |
| NDProxyControlMessage ndproxy_control = 4; | |
| } | |
| } | |
| message FeedbackMessage { | |
| oneof message_type { | |
| NDProxySignalMessage ndproxy_signal = 1; | |
| } | |
| } | |
| // For both MulticastForwardingControlMessage and | |
| // BroadcastForwardingControlMessage: | |
| // 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 |int_ifname| exists in the message, a creation or deletion event | |
| // occurred for the bridge interface. | |
| // Otherwise, the event is occurred for the physical interface |lan_ifname|. | |
| message MulticastForwardingControlMessage { | |
| enum Direction { | |
| INBOUND_ONLY = 0; | |
| OUTBOUND_ONLY = 1; | |
| TWO_WAYS = 2; | |
| } | |
| // This field corresponds to the shill Device ifname. | |
| required string lan_ifname = 1; | |
| // This field corresponds to the guest interface. | |
| optional string int_ifname = 2; | |
| // Whether this message is for stopping multicast forwarding. | |
| // Value is ignored. | |
| optional bool teardown = 3; | |
| // Direction of multicast forwarding to be started/stopped. | |
| required Direction dir = 4; | |
| } | |
| message BroadcastForwardingControlMessage { | |
| // This field corresponds to the shill Device interface. | |
| required string lan_ifname = 1; | |
| // This field corresponds to the guest interface. | |
| optional string int_ifname = 2; | |
| // Whether this message is for stopping broadcast forwarding. | |
| // Value is ignored. | |
| optional bool teardown = 3; | |
| } | |
| 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. For START_NS_NA_FILTER and | |
| // STOP_NS_NA_FILTER, |if_id_primary| contains the downstream interface to ARC | |
| // that NS and NA forwarding should be paused / resumed. | |
| 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; | |
| START_NS_NA_FILTER = 7; | |
| STOP_NS_NA_FILTER = 8; | |
| } | |
| 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; | |
| } |