| // Copyright 2023 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 fuchsia.starnix.container; |
| |
| using zx; |
| |
| type ConsoleWindowSize = struct { |
| rows uint16; |
| cols uint16; |
| x_pixels uint16; |
| y_pixels uint16; |
| }; |
| |
| @discoverable |
| closed protocol Controller { |
| /// Connects `bridge_socket` to a vsocket at `port` in the container. |
| strict VsockConnect(resource struct { |
| port uint32; |
| bridge_socket zx.Handle:SOCKET; |
| }); |
| |
| strict SpawnConsole(resource table { |
| 1: console_in zx.Handle:SOCKET; |
| 2: console_out zx.Handle:SOCKET; |
| 3: binary_path string:MAX; |
| 4: argv vector<string:MAX>:MAX; |
| 5: environ vector<string:MAX>:MAX; |
| 6: window_size ConsoleWindowSize; |
| }) -> (struct { |
| exit_code uint8; |
| }) error zx.Status; |
| }; |