Open Session - Drone on Windows now sends actual /Device/NPF_XXXX as port names - client sets up the ifX style alias and uses that all places; this was needed for comparison of port names while opening sessions for Drones running on Windows
This commit is contained in:
parent
8bea5636ab
commit
b6a6b776e1
@ -81,6 +81,10 @@ void Port::updatePortConfig(OstProto::Port *port)
|
||||
|
||||
d.MergeFrom(*port);
|
||||
|
||||
// Setup a user-friendly alias for Win32 ports
|
||||
if (name().startsWith("\\Device\\NPF_"))
|
||||
setAlias(QString("if%1").arg(id()));
|
||||
|
||||
if (recalc)
|
||||
recalculateAverageRates();
|
||||
}
|
||||
|
@ -79,7 +79,8 @@ public:
|
||||
~Port();
|
||||
|
||||
quint32 portGroupId() const { return mPortGroupId; }
|
||||
const QString& userAlias() const { return mUserAlias; }
|
||||
const QString userAlias() const
|
||||
{ return mUserAlias.isEmpty() ? name() : mUserAlias; }
|
||||
|
||||
quint32 id() const
|
||||
{ return d.port_id().id(); }
|
||||
@ -103,7 +104,7 @@ public:
|
||||
{ return avgBitsPerSec_; }
|
||||
|
||||
//void setAdminEnable(AdminStatus status) { mAdminStatus = status; }
|
||||
void setAlias(QString &alias) { mUserAlias = alias; }
|
||||
void setAlias(QString alias) { mUserAlias = alias; }
|
||||
//void setExclusive(bool flag);
|
||||
|
||||
int numStreams() { return mStreams.size(); }
|
||||
|
@ -425,7 +425,6 @@ void PortGroup::processPortConfigList(PbRpcController *controller)
|
||||
{
|
||||
Port *port = mPorts[j];
|
||||
|
||||
// FIXME: How to handle the generated ifX Win32 port names
|
||||
if (port->name() == pc->port_config().name().c_str())
|
||||
{
|
||||
if (!port->userName().isEmpty() // rsvd?
|
||||
@ -436,7 +435,7 @@ void PortGroup::processPortConfigList(PbRpcController *controller)
|
||||
"Port will not be reconfigured.")
|
||||
.arg(serverFullName())
|
||||
.arg(j)
|
||||
.arg(port->name())
|
||||
.arg(port->userAlias())
|
||||
.arg(port->userName());
|
||||
QMessageBox::warning(NULL, tr("Open Session"), warning);
|
||||
qWarning(qPrintable(warning));
|
||||
|
@ -179,7 +179,7 @@ QVariant PortModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
return QString("Port %1: %2 %3(%4)")
|
||||
.arg(port->id())
|
||||
.arg(port->name())
|
||||
.arg(port->userAlias())
|
||||
.arg(rsvdBy)
|
||||
.arg(port->description());
|
||||
}
|
||||
|
@ -101,12 +101,8 @@ PcapPort::PcapPort(int id, const char *device)
|
||||
{
|
||||
if (strcmp(device, dev->name) == 0)
|
||||
{
|
||||
#ifdef Q_OS_WIN32
|
||||
data_.set_name(QString("if%1").arg(id).toStdString());
|
||||
#else
|
||||
if (dev->name)
|
||||
data_.set_name(dev->name);
|
||||
#endif
|
||||
if (dev->description)
|
||||
data_.set_description(dev->description);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user