ostinato/common/emulproto.proto

86 lines
2.1 KiB
Protocol Buffer
Raw Normal View History

/*
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;
// ======
// VLAN
// ======
message VlanEmulation {
message Vlan {
optional uint32 tpid = 1 [default = 0x8100];
// includes prio, cfi and vlanid
optional uint32 vlan_tag = 2 [default = 100];
optional uint32 count = 10 [default = 1];
optional uint32 step = 11 [default = 1];
}
repeated Vlan stack = 1; // outer to inner
}
extend OstProto.DeviceGroup {
optional VlanEmulation vlan = 200;
}
// ========
// Device
// ========
message MacEmulation {
optional uint64 address = 1; // FIXME: default value
optional uint64 step = 10 [default = 1];
}
message Ip4Emulation {
optional uint32 address = 1;
optional uint32 prefix_length = 2;
optional uint32 default_gateway = 3;
optional uint64 step = 10 [default = 1];
// FIXME: step for gateway?
}
message Ip6Emulation {
optional uint64 address_hi = 1;
optional uint64 address_lo = 2;
optional uint32 prefix_length = 3;
optional uint64 default_gateway_hi = 4;
optional uint64 default_gateway_lo = 5;
optional uint64 step_hi = 10 [default = 0];
optional uint64 step_lo = 11 [default = 1];
// FIXME: step for gateway?
}
message Device {
optional MacEmulation mac = 1;
optional Ip4Emulation ip4 = 2;
optional Ip6Emulation ip6 = 3;
optional uint32 count = 10 [default = 1];
}
extend OstProto.DeviceGroup {
optional Device device = 201;
}