blob: 2b242eca50e87c0a0266286ad24ec74277833398 [file] [log] [blame]
Serge Bazanski8d7843c2018-10-04 10:37:36 +01001syntax = "proto3";
Sergiusz Bazanski5b5b7c32019-07-21 16:07:49 +02002package dc;
3option go_package = "code.hackerspace.pl/hscloud/dc/proto";
Serge Bazanski8d7843c2018-10-04 10:37:36 +01004
5message GetPortsRequest {
6};
7
8message SwitchPort {
9 enum Speed {
10 SPEED_INVALID = 0;
11 SPEED_100M = 1;
12 SPEED_1G = 2;
13 SPEED_10G = 3;
14 };
15 string name = 1;
16 Speed speed = 2;
17 enum LinkState {
18 LINKSTATE_INVALID = 0;
19 LINKSTATE_DOWN = 1;
20 LINKSTATE_UP = 2;
21 };
22 LinkState link_state = 3;
23 enum PortMode {
24 PORTMODE_INVALID = 0;
25 // Interface is bridged to a VLAN, untagged.
26 PORTMODE_SWITCHPORT_UNTAGGED = 1;
27 // Interfaces is bridged to several tagged 802.1q VLANs.
28 PORTMODE_SWITCHPORT_TAGGED = 2;
29 // Interface is in 'generic', both tagged 802.1q and untagged mode.
30 PORTMODE_SWITCHPORT_GENERIC = 3;
31 // Interface is routed, ie routes packets from a separate L3 network
32 // and the Switch is the default gateway for machines in this network.
33 PORTMODE_ROUTED = 4;
34 // Interface is in a configuration state that cannot be clearly stated
35 // in terms of this enum, and should be reconfigured.
36 PORTMODE_MANGLED = 5;
37 };
38 PortMode port_mode = 4;
39 // For PORTMODE_SWITCHPORT_UNTAGGED and PORTMODE_SWITCHPORT_GENERIC, the
40 // VLAN ID that this interface is natively bridged to.
41 int32 vlan_native = 5;
42 // For PORTMODE_SWITCHPORT_TAGGED and PORTMODE_SWITCHPORT_GENERIC, the VLAN
43 // IDs that the interface is bridged to using 802.1q tags.
44 repeated int32 vlan_tagged = 6;
45 // For PORTMODE_ROUTED
46 repeated string prefixes = 7;
47 // Interface MTU
48 int32 mtu = 8;
49 enum SpanningTreeMode {
50 SPANNING_TREE_MODE_INVALID = 0;
51 // Send STP BPDU, on timeout switch to Forwarding.
52 SPANNING_TREE_MODE_AUTO_PORTFAST = 1;
53 // Switch to Forwarding immediately on link up.
54 SPANNING_TREE_MODE_PORTFAST = 2;
55 };
56 SpanningTreeMode spanning_tree_mode = 9;
57};
58
59message GetPortsResponse {
60 repeated SwitchPort ports = 1;
61};
62
63service SwitchControl {
64 rpc GetPorts(GetPortsRequest) returns (GetPortsResponse);
65};