ostinato/common/protocol.proto
Srivats P. 0094f618d3 Protocol Framework related
--------------------------
	- AbstractProtocol Constructor and Factory function now take an optional (default NULL) "parent" abstract protocol in addition to the stream; this "parent" protocol is non-NULL for protocols which are aggregated in a ComboProtocol
	- All subclasses of AbstractProtocol modified as per the above interface change
	- ProtocolManager also modifed as per the above interface change
	- new data members in AbstractProtocol - prev, next; the AbstractProtocol implementation now uses these members to traverse protocols on the list instead of ProtocolListIterator; this change required for ComboProtocol
	- ProtocolListIterator updates these new members - prev/next on insert/remove/replace
	- ComboProtocol and ProtocolListIterator classes made friends of AbstractProtocol
	- ComboProtocol implemented as a template class (completed)
	- Dot2LLc implemented as a combo of Dot3Raw and LLC
	- Dot2Snap implemented as a combo of Dot2Llc and SNAP
	- VlanStack implemented as a combo of VLAN + VLAN
	- ProtocolManager now uses the ProtocolId enums rather than hardcoded values

Stream Config Dialog
--------------------
	- "None" radio button added to all protocol levels
	- Protocol Level 1 added with 'mac' as the only valid protocol in the "simple" mode widget
	- With Dot2Llc, Dot2Snap and VlanStack implemented as "combo" protocols, the protocol choice radiobuttons in the "simple" mode are now 1:1 with a protocol; this has the following implications/advantages:
		- Updates of the "simple" mode widget from/to stream's protocolList is simpler; this code has now been rewritten to take advantage of 1:1
		- This paves the way for exporting tunneled protocols 4over4, 4over6, 6over4 etc. in the "simple" mode
		- This should also (hopefully) require less changes when adding a new protocol; more work needs to be done to reach this goal

Fixes
-----
	- Dot3Protocol now derives "length" correctly for VLAN tagged packets
	- StreamBase now uses the ProtocolListIterator to append the default protocols in a stream instead of directly manipulating ProtocolList; also in protoDataCopyFrom()

Others (Client/Server)
----------------------
	- Port Packet Capture implemented; "view capture" is pending (hack put in place now for testing)
2009-10-14 15:16:56 +00:00

199 lines
4.2 KiB
Protocol Buffer

// stream.proto
// FIXME: Re-evaluate Tag Values
package OstProto;
message StreamId {
required uint32 id = 1;
}
message StreamCore {
enum FrameLengthMode {
e_fl_fixed = 0;
e_fl_inc = 1;
e_fl_dec = 2;
e_fl_random = 3;
}
// Basics
optional string name = 1;
optional bool is_enabled = 2;
optional uint32 ordinal = 3;
// Frame Length (includes CRC)
optional FrameLengthMode len_mode = 14 [default = e_fl_fixed];
optional uint32 frame_len = 15 [default = 64];
optional uint32 frame_len_min = 16 [default = 64];
optional uint32 frame_len_max = 17 [default = 1518];
// Currently Selected Protocols
//repeated uint32 frame_proto = 20;
}
message StreamControl {
enum SendUnit {
e_su_packets = 0;
e_su_bursts = 1;
}
enum SendMode {
e_sm_fixed = 0;
e_sm_continuous = 1;
}
enum NextWhat {
e_nw_stop = 0;
e_nw_goto_next = 1;
e_nw_goto_id = 2;
}
optional SendUnit unit = 1 [default = e_su_packets];
optional SendMode mode = 2 [default = e_sm_fixed];
optional uint32 num_packets = 3 [default = 1];
optional uint32 num_bursts = 4 [default = 1];
optional uint32 packets_per_burst = 5 [default = 10];
optional NextWhat next = 6 [default = e_nw_goto_next];
optional uint32 packets_per_sec = 7 [default = 1];
optional uint32 bursts_per_sec = 8 [default = 1];
// TODO: Gaps?
}
message ProtocolId {
required uint32 id = 1;
}
message Protocol {
required ProtocolId protocol_id = 1;
extensions 51 to 100; // Reserved for Ostinato Use
extensions 101 to 200; // Available for use by protocols
enum k {
kMacFieldNumber = 51;
kPayloadFieldNumber = 52;
kEth2FieldNumber = 121;
kDot3FieldNumber = 122;
kLlcFieldNumber = 123;
kSnapFieldNumber = 124;
kVlanStackFieldNumber = 125;
kVlanFieldNumber = 126;
kDot2LlcFieldNumber = 127;
kDot2SnapFieldNumber = 128;
kIp4FieldNumber = 130;
kArpFieldNumber = 131;
kTcpFieldNumber = 140;
kUdpFieldNumber = 141;
kIcmpFieldNumber = 142;
kIgmpFieldNumber = 143;
}
}
message Stream {
required StreamId stream_id = 1;
optional StreamCore core = 2;
optional StreamControl control = 3;
repeated Protocol protocol = 4;
}
message Void {
// nothing!
}
message Ack {
// TODO
}
message PortId {
required uint32 id = 1;
}
message PortIdList {
repeated PortId port_id = 1;
}
message StreamIdList {
required PortId port_id = 1;
repeated StreamId stream_id = 2;
}
message Port {
required PortId port_id = 1;
optional string name = 2;
optional string description = 3;
optional bool is_enabled = 4;
optional bool is_oper_up = 5;
optional bool is_exclusive_control = 6;
}
message PortConfigList {
repeated Port port = 1;
}
message StreamConfigList {
required PortId port_id = 1;
repeated Stream stream = 2;
}
message CaptureBuffer {
// TODO
}
message CaptureBufferList {
repeated CaptureBuffer list = 1;
}
message PortStats {
required PortId port_id = 1;
optional uint64 rx_pkts = 11;
optional uint64 rx_bytes = 12;
optional uint64 rx_pkts_nic = 13;
optional uint64 rx_bytes_nic = 14;
optional uint64 rx_pps = 15;
optional uint64 rx_bps = 16;
optional uint64 tx_pkts = 21;
optional uint64 tx_bytes = 22;
optional uint64 tx_pkts_nic = 23;
optional uint64 tx_bytes_nic = 24;
optional uint64 tx_pps = 25;
optional uint64 tx_bps = 26;
}
message PortStatsList {
repeated PortStats port_stats = 1;
}
service OstService {
rpc getPortIdList(Void) returns (PortIdList);
rpc getPortConfig(PortIdList) returns (PortConfigList);
rpc getStreamIdList(PortId) returns (StreamIdList);
rpc getStreamConfig(StreamIdList) returns (StreamConfigList);
rpc addStream(StreamIdList) returns (Ack);
rpc deleteStream(StreamIdList) returns (Ack);
rpc modifyStream(StreamConfigList) returns (Ack);
rpc startTx(PortIdList) returns (Ack);
rpc stopTx(PortIdList) returns (Ack);
rpc startCapture(PortIdList) returns (Ack);
rpc stopCapture(PortIdList) returns (Ack);
rpc getCaptureBuffer(PortIdList) returns (CaptureBufferList);
rpc getStats(PortIdList) returns (PortStatsList);
rpc clearStats(PortIdList) returns (Ack);
}