2015-09-14 07:49:52 -05:00
|
|
|
/*
|
|
|
|
Copyright (C) 2015 Srivats P.
|
|
|
|
|
|
|
|
This file is part of "Ostinato"
|
|
|
|
|
|
|
|
This is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
|
|
|
import "protocol.proto";
|
|
|
|
|
|
|
|
package OstEmul;
|
|
|
|
|
2015-11-10 23:22:29 -06:00
|
|
|
// =======
|
|
|
|
// Encap
|
|
|
|
// =======
|
2015-09-14 07:49:52 -05:00
|
|
|
message VlanEmulation {
|
|
|
|
message Vlan {
|
|
|
|
optional uint32 tpid = 1 [default = 0x8100];
|
2015-09-20 07:19:15 -05:00
|
|
|
|
|
|
|
// includes prio, cfi and vlanid
|
|
|
|
optional uint32 vlan_tag = 2 [default = 100];
|
|
|
|
|
|
|
|
optional uint32 count = 10 [default = 1];
|
|
|
|
optional uint32 step = 11 [default = 1];
|
2015-09-14 07:49:52 -05:00
|
|
|
}
|
2015-09-20 07:19:15 -05:00
|
|
|
|
|
|
|
repeated Vlan stack = 1; // outer to inner
|
2015-09-14 07:49:52 -05:00
|
|
|
}
|
|
|
|
|
2015-12-16 09:18:17 -06:00
|
|
|
extend OstProto.EncapEmulation {
|
|
|
|
optional VlanEmulation vlan = 1000;
|
2015-09-14 07:49:52 -05:00
|
|
|
}
|
|
|
|
|
2015-11-10 23:22:29 -06:00
|
|
|
// ===========
|
|
|
|
// Protocols
|
|
|
|
// ===========
|
2015-09-20 07:19:15 -05:00
|
|
|
message MacEmulation {
|
2016-02-29 08:42:02 -06:00
|
|
|
optional uint64 address = 1; // no default - need unique value
|
2015-09-20 07:19:15 -05:00
|
|
|
optional uint64 step = 10 [default = 1];
|
2015-09-14 07:49:52 -05:00
|
|
|
}
|
|
|
|
|
2015-09-20 07:19:15 -05:00
|
|
|
message Ip4Emulation {
|
|
|
|
optional uint32 address = 1;
|
|
|
|
optional uint32 prefix_length = 2;
|
|
|
|
optional uint32 default_gateway = 3;
|
|
|
|
|
2016-02-12 07:40:19 -06:00
|
|
|
optional uint32 step = 10 [default = 1];
|
2015-09-20 07:19:15 -05:00
|
|
|
// FIXME: step for gateway?
|
2015-09-14 07:49:52 -05:00
|
|
|
}
|
|
|
|
|
2015-12-24 07:30:32 -06:00
|
|
|
message Ip6Address {
|
|
|
|
optional uint64 hi = 1;
|
|
|
|
optional uint64 lo = 2;
|
|
|
|
}
|
|
|
|
|
2015-09-14 07:49:52 -05:00
|
|
|
message Ip6Emulation {
|
2015-12-24 07:30:32 -06:00
|
|
|
optional Ip6Address address = 1;
|
|
|
|
optional uint32 prefix_length = 2;
|
|
|
|
optional Ip6Address default_gateway = 3;
|
|
|
|
|
|
|
|
optional Ip6Address step = 10;
|
2015-10-03 09:45:20 -05:00
|
|
|
// FIXME: step for gateway?
|
2015-09-14 07:49:52 -05:00
|
|
|
}
|
|
|
|
|
2015-11-10 23:22:29 -06:00
|
|
|
extend OstProto.DeviceGroup {
|
|
|
|
optional MacEmulation mac = 2001;
|
|
|
|
|
|
|
|
optional Ip4Emulation ip4 = 3000;
|
|
|
|
optional Ip6Emulation ip6 = 3001;
|
|
|
|
}
|
|
|
|
|
2015-09-20 07:19:15 -05:00
|
|
|
message Device {
|
2015-11-10 23:22:29 -06:00
|
|
|
optional uint64 mac = 1;
|
|
|
|
|
|
|
|
repeated uint32 vlan = 2; // includes tpid 'n vlan tag
|
|
|
|
|
2015-11-11 01:35:15 -06:00
|
|
|
optional uint32 ip4 = 10;
|
|
|
|
optional uint32 ip4_prefix_length = 11;
|
|
|
|
optional uint32 ip4_default_gateway = 12;
|
2015-09-20 07:19:15 -05:00
|
|
|
|
2015-12-24 07:30:32 -06:00
|
|
|
optional Ip6Address ip6 = 20;
|
|
|
|
optional uint32 ip6_prefix_length = 21;
|
|
|
|
optional Ip6Address ip6_default_gateway = 22;
|
2015-09-14 07:49:52 -05:00
|
|
|
}
|
|
|
|
|
2015-11-11 01:35:15 -06:00
|
|
|
extend OstProto.PortDeviceList {
|
|
|
|
repeated Device port_device = 100;
|
2015-09-20 07:19:15 -05:00
|
|
|
}
|
2015-11-04 07:20:08 -06:00
|
|
|
|
|
|
|
message ArpEntry {
|
|
|
|
optional uint32 ip4 = 1;
|
|
|
|
optional uint64 mac = 2;
|
|
|
|
}
|
|
|
|
|
2016-01-06 06:40:28 -06:00
|
|
|
message NdpEntry {
|
2015-12-24 07:30:32 -06:00
|
|
|
optional Ip6Address ip6 = 1;
|
|
|
|
optional uint64 mac = 2;
|
2015-11-04 07:20:08 -06:00
|
|
|
}
|
|
|
|
|
2015-11-10 23:22:29 -06:00
|
|
|
message DeviceNeighborList {
|
2015-11-04 07:20:08 -06:00
|
|
|
optional uint32 device_index = 1;
|
|
|
|
repeated ArpEntry arp = 2;
|
2016-01-06 06:40:28 -06:00
|
|
|
repeated NdpEntry ndp = 3;
|
2015-11-04 07:20:08 -06:00
|
|
|
}
|
|
|
|
|
2015-11-10 23:22:29 -06:00
|
|
|
extend OstProto.PortNeighborList {
|
2015-11-11 01:35:15 -06:00
|
|
|
// FIXME: rename to device (singular) to be consistent with naming convention for other repeated fields
|
2015-11-10 23:22:29 -06:00
|
|
|
repeated DeviceNeighborList devices = 100;
|
2015-11-04 07:20:08 -06:00
|
|
|
}
|