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