Merge branch 'master' of D:/srivatsp/projects/ostinato/master into hostdev
This commit is contained in:
commit
34323bb187
@ -157,7 +157,8 @@ QRegion DumpView::visualRegionForSelection(
|
||||
|
||||
//protected slots:
|
||||
void DumpView::dataChanged(const QModelIndex &/*topLeft*/,
|
||||
const QModelIndex &/*bottomRight*/)
|
||||
const QModelIndex &/*bottomRight*/,
|
||||
const QVector<int> &/*roles*/)
|
||||
{
|
||||
// FIXME(HI)
|
||||
update();
|
||||
|
@ -39,7 +39,8 @@ protected:
|
||||
QRegion visualRegionForSelection( const QItemSelection &selection ) const;
|
||||
protected slots:
|
||||
void dataChanged( const QModelIndex &topLeft,
|
||||
const QModelIndex &bottomRight );
|
||||
const QModelIndex &bottomRight,
|
||||
const QVector<int> &roles );
|
||||
void selectionChanged( const QItemSelection &selected,
|
||||
const QItemSelection &deselected );
|
||||
void paintEvent(QPaintEvent *event);
|
||||
|
@ -118,7 +118,7 @@ QVariant PortModel::data(const QModelIndex &index, int role) const
|
||||
if (!parent.isValid())
|
||||
{
|
||||
// Top Level Item - PortGroup
|
||||
if ((role == Qt::DisplayRole))
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
DBG0("Exit PortModel data 1\n");
|
||||
return QString("Port Group %1: %2 [%3]:%4 (%5)").
|
||||
@ -128,7 +128,7 @@ QVariant PortModel::data(const QModelIndex &index, int role) const
|
||||
arg(pgl->mPortGroups.at(index.row())->serverPort()).
|
||||
arg(pgl->mPortGroups.value(index.row())->numPorts());
|
||||
}
|
||||
else if ((role == Qt::DecorationRole))
|
||||
else if (role == Qt::DecorationRole)
|
||||
{
|
||||
DBG0("Exit PortModel data 2\n");
|
||||
switch(pgl->mPortGroups.at(index.row())->state())
|
||||
@ -170,7 +170,7 @@ QVariant PortModel::data(const QModelIndex &index, int role) const
|
||||
Port *port = pgl->mPortGroups.at(parent.row())->mPorts[index.row()];
|
||||
|
||||
// Non Top Level - Port
|
||||
if ((role == Qt::DisplayRole))
|
||||
if (role == Qt::DisplayRole)
|
||||
{
|
||||
QString rsvdBy;
|
||||
|
||||
@ -183,11 +183,11 @@ QVariant PortModel::data(const QModelIndex &index, int role) const
|
||||
.arg(rsvdBy)
|
||||
.arg(port->description());
|
||||
}
|
||||
else if ((role == Qt::DecorationRole))
|
||||
else if (role == Qt::DecorationRole)
|
||||
{
|
||||
return portIconFactory[port->linkState()][port->hasExclusiveControl()];
|
||||
}
|
||||
else if ((role == Qt::ForegroundRole))
|
||||
else if (role == Qt::ForegroundRole)
|
||||
{
|
||||
return port->isDirty() ? QBrush(Qt::red) : QVariant();
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ QVariant StreamModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
case StreamStatus:
|
||||
{
|
||||
if ((role == Qt::CheckStateRole))
|
||||
if (role == Qt::CheckStateRole)
|
||||
{
|
||||
if (mCurrentPort->streamByIndex(index.row())->isEnabled())
|
||||
return Qt::Checked;
|
||||
|
@ -41,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
static QThreadStorage<QString*> connId;
|
||||
|
||||
RpcConnection::RpcConnection(int socketDescriptor,
|
||||
RpcConnection::RpcConnection(qintptr socketDescriptor,
|
||||
::google::protobuf::Service *service)
|
||||
: socketDescriptor(socketDescriptor),
|
||||
service(service)
|
||||
|
@ -43,7 +43,7 @@ class RpcConnection : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RpcConnection(int socketDescriptor, ::google::protobuf::Service *service);
|
||||
RpcConnection(qintptr socketDescriptor, ::google::protobuf::Service *service);
|
||||
virtual ~RpcConnection();
|
||||
|
||||
static void connIdMsgHandler(QtMsgType type,
|
||||
@ -67,7 +67,7 @@ private slots:
|
||||
void on_clientSock_disconnected();
|
||||
|
||||
private:
|
||||
int socketDescriptor;
|
||||
qintptr socketDescriptor;
|
||||
QTcpSocket *clientSock;
|
||||
|
||||
::google::protobuf::Service *service;
|
||||
|
@ -62,7 +62,7 @@ bool RpcServer::registerService(::google::protobuf::Service *service,
|
||||
return true;
|
||||
}
|
||||
|
||||
void RpcServer::incomingConnection(int socketDescriptor)
|
||||
void RpcServer::incomingConnection(qintptr socketDescriptor)
|
||||
{
|
||||
QThread *thread = new QThreadX; // FIXME:QThreadX pending Qt4.4+
|
||||
RpcConnection *conn = new RpcConnection(socketDescriptor, service);
|
||||
|
@ -47,7 +47,7 @@ signals:
|
||||
void notifyClients(int notifType, SharedProtobufMessage notifData);
|
||||
|
||||
protected:
|
||||
void incomingConnection(int socketDescriptor);
|
||||
void incomingConnection(qintptr socketDescriptor);
|
||||
|
||||
private:
|
||||
::google::protobuf::Service *service;
|
||||
|
@ -28,6 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
const int kBaseHex = 16;
|
||||
const quint64 kBcastMac = 0xffffffffffffULL;
|
||||
const quint16 kEthTypeArp = 0x0806;
|
||||
const quint16 kEthTypeIp4 = 0x0800;
|
||||
const quint16 kEthTypeIp6 = 0x86dd;
|
||||
const int kIp6HdrLen = 40;
|
||||
@ -206,12 +207,12 @@ void Device::resolveNeighbor(PacketBuffer *pktBuf)
|
||||
|
||||
switch(ethType)
|
||||
{
|
||||
case 0x0800: // IPv4
|
||||
case kEthTypeIp4: // IPv4
|
||||
if (hasIp4_)
|
||||
sendArpRequest(pktBuf);
|
||||
break;
|
||||
|
||||
case 0x86dd: // IPv6
|
||||
case kEthTypeIp6: // IPv6
|
||||
if (hasIp6_)
|
||||
sendNeighborSolicit(pktBuf);
|
||||
break;
|
||||
@ -248,7 +249,7 @@ bool Device::isOrigin(const PacketBuffer *pktBuf)
|
||||
|
||||
// We know only about IP packets - adjust for ethType length (2 bytes)
|
||||
// when checking that we have a complete IP header
|
||||
if ((ethType == 0x0800) && hasIp4_) { // IPv4
|
||||
if ((ethType == kEthTypeIp4) && hasIp4_) { // IPv4
|
||||
int ipHdrLen = (pktData[0] & 0x0F) << 2;
|
||||
quint32 srcIp;
|
||||
|
||||
@ -290,7 +291,7 @@ quint64 Device::neighborMac(const PacketBuffer *pktBuf)
|
||||
pktData += 2;
|
||||
|
||||
// We know only about IP packets
|
||||
if ((ethType == 0x0800) && hasIp4_) { // IPv4
|
||||
if ((ethType == kEthTypeIp4) && hasIp4_) { // IPv4
|
||||
int ipHdrLen = (pktData[0] & 0x0F) << 2;
|
||||
quint32 dstIp, tgtIp;
|
||||
|
||||
|
@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
|
||||
#include <QThread>
|
||||
|
||||
class StatsTuple;
|
||||
struct StatsTuple;
|
||||
|
||||
class PcapTxStats : public QThread
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user