| // Copyright 2018 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.overnet; |
| |
| using NodeId = uint64; |
| |
| [Discoverable] |
| interface Overnet { |
| 1: ListPeers() -> (vector<Peer> peers); |
| // TODO(ctiller): remove this, and move to something that looks way more like an explicit registry. |
| 2: RegisterService(string service_name, ServiceProvider provider); |
| 3: ConnectToService(NodeId node, string service_name, handle<channel> chan); |
| }; |
| |
| interface ServiceProvider { |
| 1: ConnectToService(string service_name, handle<channel> chan); |
| }; |
| |
| struct PeerDescription { |
| vector<string> services; |
| }; |
| |
| struct Peer { |
| NodeId id; |
| bool is_self; |
| PeerDescription description; |
| }; |