ostinato/client/streamconfigdialog.h
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

114 lines
2.5 KiB
C++

#ifndef _STREAM_CONFIG_DIALOG_H
#define _STREAM_CONFIG_DIALOG_H
#include <QDialog>
#include "ui_streamconfigdialog.h"
#include "port.h"
#include "stream.h"
#include "packetmodel.h"
#include "modeltest.h"
#define MAX_MAC_ITER_COUNT 256
#define MIN_PKT_LEN 64
#define MAX_PKT_LEN 1522
/*
** TODO
** \todo Improve HexStr handling
**
*/
class StreamConfigDialog : public QDialog, public Ui::StreamConfigDialog
{
Q_OBJECT
public:
StreamConfigDialog(Port &port, uint streamIndex, QWidget *parent = 0);
~StreamConfigDialog();
private:
enum ButtonId
{
ButtonIdNone = 0,
ButtonIdOther = -2
};
enum ProtoButtonGroup
{
ProtoMin,
ProtoL1 = 0,
ProtoVlan = 1,
ProtoL2 = 2,
ProtoL3 = 3,
ProtoL4 = 4,
ProtoPayload = 5,
ProtoMax
};
QButtonGroup *bgProto[ProtoMax];
QStringListModel *mpAvailableProtocolsModel;
QStringListModel *mpSelectedProtocolsModel;
Port& mPort;
uint mCurrentStreamIndex;
Stream *mpStream;
ProtocolListIterator *_iter;
bool isUpdateInProgress;
PacketModel *mpPacketModel;
ModelTest *mpPacketModelTester;
// The following static variables are used to track the "selected" tab
// for the various tab widgets so that it can be restored when the dialog
// is opened the next time
static int lastTopLevelTabIndex;
void setupUiExtra();
void updateSelectedProtocols();
void LoadCurrentStream();
void StoreCurrentStream();
private slots:
void on_cmbPktLenMode_currentIndexChanged(QString mode);
void update_NumPacketsAndNumBursts();
void on_twTopLevel_currentChanged(int index);
void on_tbSelectProtocols_currentChanged(int index);
// "Simple" Protocol Selection related
bool skipProtocols(int layer);
void disableProtocols(QButtonGroup *protocolGroup, bool checked);
void forceProtocolNone(bool checked);
void updateProtocol(int newId);
void __updateProtocol(int level, int newId);
void updateSelectProtocolsSimpleWidget();
// "Advanced" Protocol Selection related
void when_lvAllProtocols_selectionChanged(
const QItemSelection &selected, const QItemSelection &deselected);
void when_lvSelectedProtocols_currentChanged(
const QModelIndex &current, const QModelIndex &previous);
void on_tbAdd_clicked();
void on_tbDelete_clicked();
void on_tbUp_clicked();
void on_tbDown_clicked();
void updateSelectProtocolsAdvancedWidget();
void on_pbPrev_clicked();
void on_pbNext_clicked();
void on_pbOk_clicked();
};
#endif