2009-05-24 09:54:11 -05:00
|
|
|
#ifndef _Vlan_H
|
|
|
|
#define _Vlan_H
|
|
|
|
|
|
|
|
#include "abstractprotocol.h"
|
|
|
|
|
|
|
|
#include "vlan.pb.h"
|
|
|
|
#include "ui_vlan.h"
|
|
|
|
|
|
|
|
class VlanConfigForm : public QWidget, public Ui::Vlan
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
VlanConfigForm(QWidget *parent = 0);
|
|
|
|
};
|
|
|
|
|
|
|
|
class VlanProtocol : public AbstractProtocol
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
OstProto::Vlan data;
|
2009-08-02 09:52:34 -05:00
|
|
|
VlanConfigForm *configForm;
|
2009-05-24 09:54:11 -05:00
|
|
|
enum Vlanfield
|
|
|
|
{
|
|
|
|
vlan_tpid,
|
|
|
|
vlan_prio,
|
|
|
|
vlan_cfiDei,
|
|
|
|
vlan_vlanId,
|
|
|
|
|
|
|
|
// meta-fields
|
|
|
|
vlan_isOverrideTpid,
|
|
|
|
|
|
|
|
vlan_fieldCount
|
|
|
|
};
|
|
|
|
|
|
|
|
public:
|
2009-08-02 09:52:34 -05:00
|
|
|
VlanProtocol(StreamBase *stream);
|
2009-05-24 09:54:11 -05:00
|
|
|
virtual ~VlanProtocol();
|
|
|
|
|
2009-08-02 09:52:34 -05:00
|
|
|
static AbstractProtocol* createInstance(StreamBase *stream);
|
|
|
|
virtual quint32 protocolNumber() const;
|
2009-05-24 09:54:11 -05:00
|
|
|
|
2009-08-02 09:52:34 -05:00
|
|
|
virtual void protoDataCopyInto(OstProto::Protocol &protocol) const;
|
|
|
|
virtual void protoDataCopyFrom(const OstProto::Protocol &protocol);
|
2009-05-24 09:54:11 -05:00
|
|
|
|
|
|
|
virtual QString name() const;
|
|
|
|
virtual QString shortName() const;
|
|
|
|
|
|
|
|
virtual int fieldCount() const;
|
|
|
|
|
|
|
|
virtual AbstractProtocol::FieldFlags fieldFlags(int index) const;
|
|
|
|
virtual QVariant fieldData(int index, FieldAttrib attrib,
|
|
|
|
int streamIndex = 0) const;
|
|
|
|
virtual bool setFieldData(int index, const QVariant &value,
|
|
|
|
FieldAttrib attrib = FieldValue);
|
|
|
|
|
|
|
|
virtual QWidget* configWidget();
|
|
|
|
virtual void loadConfigWidget();
|
|
|
|
virtual void storeConfigWidget();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|