Pull Cleanup: Minor changes and cleanup after merging the STP protocol builder contribution - removal of compilation errors, unncessary code, trailing whitespace
This commit is contained in:
parent
c3c1ca84da
commit
9cd92c47ab
@ -38,23 +38,11 @@ extern ProtocolWidgetFactory *OstProtocolWidgetFactory;
|
||||
QSettings *appSettings;
|
||||
QMainWindow *mainWindow;
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
QString kGzipPathDefaultValue;
|
||||
QString kDiffPathDefaultValue;
|
||||
QString kAwkPathDefaultValue;
|
||||
#endif
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
int exitCode;
|
||||
|
||||
#if defined(Q_OS_WIN32)
|
||||
kGzipPathDefaultValue = app.applicationDirPath() + "/gzip.exe";
|
||||
kDiffPathDefaultValue = app.applicationDirPath() + "/diff.exe";
|
||||
kAwkPathDefaultValue = app.applicationDirPath() + "/gawk.exe";
|
||||
#endif
|
||||
|
||||
app.setApplicationName("Ostinato");
|
||||
app.setOrganizationName("Ostinato");
|
||||
app.setProperty("version", version);
|
||||
|
@ -74,11 +74,11 @@ PdmlReader::PdmlReader(OstProto::StreamConfigList *streams)
|
||||
factory_.insert("sdp", PdmlTextProtocol::createInstance);
|
||||
factory_.insert("sip", PdmlTextProtocol::createInstance);
|
||||
factory_.insert("smtp", PdmlTextProtocol::createInstance);
|
||||
factory_.insert("stp", PdmlStpProtocol::createInstance);
|
||||
factory_.insert("tcp", PdmlTcpProtocol::createInstance);
|
||||
factory_.insert("udp", PdmlUdpProtocol::createInstance);
|
||||
factory_.insert("udplite", PdmlUdpProtocol::createInstance);
|
||||
factory_.insert("vlan", PdmlVlanProtocol::createInstance);
|
||||
factory_.insert("stp", PdmlStpProtocol::createInstance);
|
||||
}
|
||||
|
||||
PdmlReader::~PdmlReader()
|
||||
|
@ -140,7 +140,7 @@ message Protocol {
|
||||
kDot2LlcFieldNumber = 206;
|
||||
kDot2SnapFieldNumber = 207;
|
||||
kVlanStackFieldNumber = 208;
|
||||
kStpFieldNumber = 210;
|
||||
kStpFieldNumber = 209;
|
||||
|
||||
kArpFieldNumber = 300;
|
||||
kIp4FieldNumber = 301;
|
||||
|
@ -75,11 +75,6 @@ QString StpProtocol::shortName() const
|
||||
return QString("STP");
|
||||
}
|
||||
|
||||
AbstractProtocol::ProtocolIdType StpProtocol::protocolIdType() const
|
||||
{
|
||||
return ProtocolIdLlc;
|
||||
}
|
||||
|
||||
quint32 StpProtocol::protocolId(ProtocolIdType type) const
|
||||
{
|
||||
switch(type)
|
||||
@ -234,15 +229,15 @@ QVariant StpProtocol::fieldData(int index, FieldAttrib attrib,
|
||||
case FieldName:
|
||||
return QString("Root Identifier");
|
||||
case FieldValue:
|
||||
return (qulonglong) data_.root_id();
|
||||
return (quint64) data_.root_id();
|
||||
case FieldTextValue:
|
||||
{
|
||||
// Root ID contain two value:
|
||||
// Root ID Priority(first 2 bytes)
|
||||
// and Root ID MAC (last 6 bytes). (IEEE802.1D-2008)
|
||||
quint16 priority = (
|
||||
data_.root_id() & 0xFFFF000000000000) >> (BYTES_TO_BITS(6));
|
||||
quint64 mac = data_.root_id() & 0x0000FFFFFFFFFFFF;
|
||||
data_.root_id() & 0xFFFF000000000000ULL) >> (BYTES_TO_BITS(6));
|
||||
quint64 mac = data_.root_id() & 0x0000FFFFFFFFFFFFULL;
|
||||
return QString("Priority: %1 / MAC: %2")
|
||||
.arg(QString::number(priority),
|
||||
uintToMacStr(mac));
|
||||
@ -292,15 +287,15 @@ QVariant StpProtocol::fieldData(int index, FieldAttrib attrib,
|
||||
case FieldName:
|
||||
return QString("Bridge Identifier");
|
||||
case FieldValue:
|
||||
return (qulonglong) data_.bridge_id();
|
||||
return (quint64) data_.bridge_id();
|
||||
case FieldTextValue:
|
||||
{
|
||||
// Bridge ID contain two value:
|
||||
// Bridge ID Priority(first 2 bytes)
|
||||
// and Bridge ID MAC (last 6 bytes). (IEEE802.1D-2008)
|
||||
quint16 priority = (data_.bridge_id() & 0xFFFF000000000000
|
||||
quint16 priority = (data_.bridge_id() & 0xFFFF000000000000ULL
|
||||
) >> (BYTES_TO_BITS(6));
|
||||
quint64 mac = data_.bridge_id() & 0x0000FFFFFFFFFFFF;
|
||||
quint64 mac = data_.bridge_id() & 0x0000FFFFFFFFFFFFULL;
|
||||
return QString("Priority: %1 / MAC: %2").arg(QString::number(priority),
|
||||
uintToMacStr(mac));
|
||||
}
|
||||
|
@ -89,7 +89,6 @@ public:
|
||||
virtual void protoDataCopyInto(OstProto::Protocol &protocol) const;
|
||||
virtual void protoDataCopyFrom(const OstProto::Protocol &protocol);
|
||||
|
||||
virtual ProtocolIdType protocolIdType() const;
|
||||
virtual quint32 protocolId(ProtocolIdType type) const;
|
||||
|
||||
virtual QString name() const;
|
||||
|
@ -107,9 +107,6 @@
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ui_flags_tc_check">
|
||||
<property name="sizePolicy">
|
||||
|
@ -27,7 +27,7 @@ This module is developed by PLVision <developers@plvision.eu>
|
||||
|
||||
#define ONE_BYTE_MAX 255
|
||||
#define TWO_BYTE_MAX 65535
|
||||
#define FOUR_BYTE_MAX 4294967295
|
||||
#define FOUR_BYTE_MAX 4294967295U
|
||||
#define BIT_0 0
|
||||
#define BIT_7 7
|
||||
#define ONE_BIT(pos) ((unsigned int)(1 << (pos)))
|
||||
@ -137,7 +137,7 @@ void StpConfigForm::loadWidget(AbstractProtocol *proto)
|
||||
).toULongLong(&isOk);
|
||||
|
||||
ui_root_id->setText(
|
||||
QString::number(rootId & 0x0000FFFFFFFFFFFF, BASE_HEX));
|
||||
QString::number(rootId & 0x0000FFFFFFFFFFFFULL, BASE_HEX));
|
||||
ui_root_id_priority->setText(QString::number(rootId >> 48));
|
||||
|
||||
ui_root_path_cost->setText(
|
||||
@ -154,7 +154,7 @@ void StpConfigForm::loadWidget(AbstractProtocol *proto)
|
||||
).toULongLong(&isOk);
|
||||
|
||||
ui_bridge_id->setText(
|
||||
QString::number(bridgeId & 0x0000FFFFFFFFFFFF, BASE_HEX));
|
||||
QString::number(bridgeId & 0x0000FFFFFFFFFFFFULL, BASE_HEX));
|
||||
ui_bridge_id_priority->setText(QString::number(bridgeId >> 48));
|
||||
|
||||
// port priority is a first byte of stp_port_id field
|
||||
|
Loading…
Reference in New Issue
Block a user