mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-11 07:31:25 +02:00
fixed snmp discovery
This commit is contained in:
+144
-119
@@ -68,6 +68,7 @@
|
|||||||
|
|
||||||
#include "fwbuilder/dns.h"
|
#include "fwbuilder/dns.h"
|
||||||
#include "fwbuilder/snmp.h"
|
#include "fwbuilder/snmp.h"
|
||||||
|
#include "fwbuilder/Logger.h"
|
||||||
|
|
||||||
#include "FWBSettings.h"
|
#include "FWBSettings.h"
|
||||||
#include "ObjectManipulator.h"
|
#include "ObjectManipulator.h"
|
||||||
@@ -98,11 +99,16 @@ DiscoveryDruid::DiscoveryDruid(QWidget *parent, bool start_with_import) :
|
|||||||
dm_method->addButton(m_dialog->dm_usesnmp,2);
|
dm_method->addButton(m_dialog->dm_usesnmp,2);
|
||||||
dm_method->addButton(m_dialog->dm_import_config,3);
|
dm_method->addButton(m_dialog->dm_import_config,3);
|
||||||
|
|
||||||
connect(dm_method, SIGNAL( buttonClicked(int) ), this, SLOT( changedDiscoveryMethod(int) ) );
|
connect(dm_method, SIGNAL( buttonClicked(int) ),
|
||||||
connect(m_dialog->dnsfromlist, SIGNAL( clicked(bool) ), this, SLOT( changedNameServer() ) );
|
this, SLOT( changedDiscoveryMethod(int) ) );
|
||||||
connect(m_dialog->dnscustom, SIGNAL( clicked(bool) ), this, SLOT( changedNameServer() ) );
|
connect(m_dialog->dnsfromlist, SIGNAL( clicked(bool) ),
|
||||||
connect(m_dialog->nameserverlist, SIGNAL( editTextChanged(QString) ), this, SLOT( changedNameServer() ) );
|
this, SLOT( changedNameServer() ) );
|
||||||
connect(m_dialog->nameserverline, SIGNAL( textChanged(QString) ), this, SLOT( changedNameServer() ) );
|
connect(m_dialog->dnscustom, SIGNAL( clicked(bool) ),
|
||||||
|
this, SLOT( changedNameServer() ) );
|
||||||
|
connect(m_dialog->nameserverlist, SIGNAL( editTextChanged(QString) ),
|
||||||
|
this, SLOT( changedNameServer() ) );
|
||||||
|
connect(m_dialog->nameserverline, SIGNAL( textChanged(QString) ),
|
||||||
|
this, SLOT( changedNameServer() ) );
|
||||||
|
|
||||||
thread = NULL;
|
thread = NULL;
|
||||||
|
|
||||||
@@ -251,8 +257,9 @@ void DiscoveryDruid::restore()
|
|||||||
m_dialog->dnstimeout->setValue((i)?i:2);
|
m_dialog->dnstimeout->setValue((i)?i:2);
|
||||||
i=st->getInt(QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_DNSRETRIES);
|
i=st->getInt(QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_DNSRETRIES);
|
||||||
m_dialog->dnsretries->setValue((i)?i:1);
|
m_dialog->dnsretries->setValue((i)?i:1);
|
||||||
//m_dialog->seedhostname->setText(st->getStr(
|
|
||||||
// QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SEEDHOST));
|
m_dialog->seedhostname->setText(st->getStr(
|
||||||
|
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SEEDHOST));
|
||||||
m_dialog->snmpinaddr->setText(st->getStr(
|
m_dialog->snmpinaddr->setText(st->getStr(
|
||||||
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SNMPINADDR));
|
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SNMPINADDR));
|
||||||
m_dialog->snmpinmask->setText(st->getStr(
|
m_dialog->snmpinmask->setText(st->getStr(
|
||||||
@@ -309,9 +316,9 @@ void DiscoveryDruid::save()
|
|||||||
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SNMPDNSTIMEOUT,
|
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SNMPDNSTIMEOUT,
|
||||||
m_dialog->snmpdnstimeout->value());
|
m_dialog->snmpdnstimeout->value());
|
||||||
}
|
}
|
||||||
//st->setStr(
|
st->setStr(
|
||||||
// QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SEEDHOST,
|
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SEEDHOST,
|
||||||
// m_dialog->seedhostname->text());
|
m_dialog->seedhostname->text());
|
||||||
st->setStr(
|
st->setStr(
|
||||||
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SNMPINADDR,
|
QString(DISCOVERY_DRUID_PREFIX) + DISCOVERY_DRUID_SNMPINADDR,
|
||||||
m_dialog->snmpinaddr->text());
|
m_dialog->snmpinaddr->text());
|
||||||
@@ -698,46 +705,6 @@ void DiscoveryDruid::changedDiscoveryMethod(int c)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiscoveryDruid::saveScanLog()
|
|
||||||
{
|
|
||||||
QString dir;
|
|
||||||
dir=st->getWDir();
|
|
||||||
if (dir.isEmpty()) dir=st->getOpenFileDir();
|
|
||||||
if (dir.isEmpty()) dir="~";
|
|
||||||
|
|
||||||
QString s = QFileDialog::getSaveFileName(
|
|
||||||
this,
|
|
||||||
"Choose a file",
|
|
||||||
dir,
|
|
||||||
"Text file (*.txt)");
|
|
||||||
|
|
||||||
|
|
||||||
if (!s.isEmpty())
|
|
||||||
{
|
|
||||||
if (s.endsWith(".txt"))
|
|
||||||
{
|
|
||||||
s+=".txt";
|
|
||||||
}
|
|
||||||
QFile f(s);
|
|
||||||
if (f.open(QIODevice::WriteOnly))
|
|
||||||
{
|
|
||||||
if (fwbdebug)
|
|
||||||
{
|
|
||||||
qDebug("Saving crawler log to file: %d chars",
|
|
||||||
m_dialog->discoverylog->toPlainText().length());
|
|
||||||
qDebug("--------------------------------");
|
|
||||||
}
|
|
||||||
QTextStream strm(&f);
|
|
||||||
QString txt = m_dialog->discoverylog->toPlainText();
|
|
||||||
strm << txt << endl;
|
|
||||||
if (fwbdebug) qDebug("%s",txt.toAscii().constData());
|
|
||||||
if (fwbdebug)
|
|
||||||
qDebug("--------------------------------");
|
|
||||||
f.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void DiscoveryDruid::startHostsScan()
|
void DiscoveryDruid::startHostsScan()
|
||||||
{
|
{
|
||||||
if (thread!=NULL)
|
if (thread!=NULL)
|
||||||
@@ -866,60 +833,6 @@ InetAddr DiscoveryDruid::getSeedHostAddress()
|
|||||||
return seed_host_addr;
|
return seed_host_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiscoveryDruid::startSNMPScan()
|
|
||||||
{
|
|
||||||
#ifdef HAVE_LIBSNMP
|
|
||||||
|
|
||||||
|
|
||||||
bool use_incl=!m_dialog->snmpinaddr->text().isEmpty() && !m_dialog->snmpinmask->text().isEmpty();
|
|
||||||
if (use_incl)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
InetAddrMask in(
|
|
||||||
InetAddr(m_dialog->snmpinaddr->text().toLatin1().constData()),
|
|
||||||
InetAddr(m_dialog->snmpinmask->text().toLatin1().constData())
|
|
||||||
);
|
|
||||||
include_networks.push_back(in);
|
|
||||||
}
|
|
||||||
catch (const FWException &ex)
|
|
||||||
{
|
|
||||||
//TODO: to do something usefull
|
|
||||||
}
|
|
||||||
}
|
|
||||||
libfwbuilder::SNMPCrawler *q=new SNMPCrawler();
|
|
||||||
q->init(getSeedHostAddress(),
|
|
||||||
m_dialog->snmpcommunity->text().toLatin1().constData(),
|
|
||||||
m_dialog->snmprecursive->isChecked(),
|
|
||||||
! m_dialog->snmpincludevirt->isChecked(),
|
|
||||||
false,
|
|
||||||
m_dialog->snmpfollowp2p->isChecked(),
|
|
||||||
0,
|
|
||||||
m_dialog->snmpretries->value(),
|
|
||||||
1000000L*m_dialog->snmptimeout->value(),
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
(use_incl) ? &include_networks : NULL);
|
|
||||||
|
|
||||||
m_dialog->discoveryprogress->setMaximum(0);
|
|
||||||
unBar=m_dialog->discoveryprogress;
|
|
||||||
|
|
||||||
bop=q;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
logger=bop->start_operation();
|
|
||||||
m_dialog->discoverylog->append("Collecting data ...");
|
|
||||||
|
|
||||||
} catch(const FWException &ex)
|
|
||||||
{
|
|
||||||
delete q;
|
|
||||||
q=NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void DiscoveryDruid::changedDomainName()
|
void DiscoveryDruid::changedDomainName()
|
||||||
{
|
{
|
||||||
if (m_dialog->domainname->text().isEmpty())
|
if (m_dialog->domainname->text().isEmpty())
|
||||||
@@ -1387,6 +1300,106 @@ void DiscoveryDruid::loadDataFromImporter()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DiscoveryDruid::saveScanLog()
|
||||||
|
{
|
||||||
|
QString dir;
|
||||||
|
dir=st->getWDir();
|
||||||
|
if (dir.isEmpty()) dir=st->getOpenFileDir();
|
||||||
|
if (dir.isEmpty()) dir="~";
|
||||||
|
|
||||||
|
QString s = QFileDialog::getSaveFileName(
|
||||||
|
this,
|
||||||
|
"Choose a file",
|
||||||
|
dir,
|
||||||
|
"Text file (*.txt)");
|
||||||
|
|
||||||
|
|
||||||
|
if (!s.isEmpty())
|
||||||
|
{
|
||||||
|
if (s.endsWith(".txt"))
|
||||||
|
{
|
||||||
|
s+=".txt";
|
||||||
|
}
|
||||||
|
QFile f(s);
|
||||||
|
if (f.open(QIODevice::WriteOnly))
|
||||||
|
{
|
||||||
|
if (fwbdebug)
|
||||||
|
{
|
||||||
|
qDebug("Saving crawler log to file: %d chars",
|
||||||
|
m_dialog->discoverylog->toPlainText().length());
|
||||||
|
qDebug("--------------------------------");
|
||||||
|
}
|
||||||
|
QTextStream strm(&f);
|
||||||
|
QString txt = m_dialog->discoverylog->toPlainText();
|
||||||
|
strm << txt << endl;
|
||||||
|
if (fwbdebug) qDebug("%s",txt.toAscii().constData());
|
||||||
|
if (fwbdebug)
|
||||||
|
qDebug("--------------------------------");
|
||||||
|
f.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DiscoveryDruid::startSNMPScan()
|
||||||
|
{
|
||||||
|
#ifdef HAVE_LIBSNMP
|
||||||
|
|
||||||
|
|
||||||
|
bool use_incl=!m_dialog->snmpinaddr->text().isEmpty() && !m_dialog->snmpinmask->text().isEmpty();
|
||||||
|
if (use_incl)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
InetAddrMask in(
|
||||||
|
InetAddr(m_dialog->snmpinaddr->text().toLatin1().constData()),
|
||||||
|
InetAddr(m_dialog->snmpinmask->text().toLatin1().constData())
|
||||||
|
);
|
||||||
|
include_networks.push_back(in);
|
||||||
|
}
|
||||||
|
catch (const FWException &ex)
|
||||||
|
{
|
||||||
|
//TODO: to do something usefull
|
||||||
|
}
|
||||||
|
}
|
||||||
|
libfwbuilder::SNMPCrawler *q = new SNMPCrawler();
|
||||||
|
q->init(getSeedHostAddress(),
|
||||||
|
m_dialog->snmpcommunity->text().toLatin1().constData(),
|
||||||
|
m_dialog->snmprecursive->isChecked(),
|
||||||
|
! m_dialog->snmpincludevirt->isChecked(),
|
||||||
|
false,
|
||||||
|
m_dialog->snmpfollowp2p->isChecked(),
|
||||||
|
0,
|
||||||
|
m_dialog->snmpretries->value(),
|
||||||
|
1000000L*m_dialog->snmptimeout->value(),
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
(use_incl) ? &include_networks : NULL);
|
||||||
|
|
||||||
|
m_dialog->discoveryprogress->setMaximum(0);
|
||||||
|
unBar = m_dialog->discoveryprogress;
|
||||||
|
|
||||||
|
bop=q;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
logger = bop->start_operation();
|
||||||
|
if (fwbdebug) logger->copyToStderr();
|
||||||
|
m_dialog->discoverylog->append("Collecting data ...");
|
||||||
|
|
||||||
|
disconnect(timer, SIGNAL(timeout()), 0, 0);
|
||||||
|
connect(timer, SIGNAL(timeout()), this, SLOT(updateLog()));
|
||||||
|
timer->setSingleShot(false);
|
||||||
|
timer->start(100);
|
||||||
|
|
||||||
|
} catch(const FWException &ex)
|
||||||
|
{
|
||||||
|
delete q;
|
||||||
|
q=NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void DiscoveryDruid::loadDataFromCrawler()
|
void DiscoveryDruid::loadDataFromCrawler()
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBSNMP
|
#ifdef HAVE_LIBSNMP
|
||||||
@@ -1615,6 +1628,8 @@ void DiscoveryDruid::customEvent(QEvent *event)
|
|||||||
|
|
||||||
void DiscoveryDruid::updateLog()
|
void DiscoveryDruid::updateLog()
|
||||||
{
|
{
|
||||||
|
if (fwbdebug) qDebug("DiscoveryDruid::updateLog");
|
||||||
|
|
||||||
if (current_task==BT_HOSTS || current_task==BT_IMPORT)
|
if (current_task==BT_HOSTS || current_task==BT_IMPORT)
|
||||||
{
|
{
|
||||||
QString buf;
|
QString buf;
|
||||||
@@ -1981,9 +1996,7 @@ void DiscoveryDruid::createRealObjects()
|
|||||||
m_dialog->lastprogress->setMaximum( Objects.size());
|
m_dialog->lastprogress->setMaximum( Objects.size());
|
||||||
|
|
||||||
QMap<QString,ObjectDescriptor >::iterator i;
|
QMap<QString,ObjectDescriptor >::iterator i;
|
||||||
for(i=Networks.begin();
|
for(i=Networks.begin(); i!=Networks.end(); ++i)
|
||||||
i!=Networks.end();
|
|
||||||
++i)
|
|
||||||
{
|
{
|
||||||
od=i.value();
|
od=i.value();
|
||||||
if (od.isSelected)
|
if (od.isSelected)
|
||||||
@@ -2003,9 +2016,7 @@ void DiscoveryDruid::createRealObjects()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=Objects.begin();
|
for(i=Objects.begin(); i!=Objects.end(); ++i)
|
||||||
i!=Objects.end();
|
|
||||||
++i)
|
|
||||||
{
|
{
|
||||||
od = i.value();
|
od = i.value();
|
||||||
type = od.type;
|
type = od.type;
|
||||||
@@ -2036,16 +2047,30 @@ void DiscoveryDruid::createRealObjects()
|
|||||||
ipv4->setNetmask(InetAddr());
|
ipv4->setNetmask(InetAddr());
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
map<int,Interface>::const_iterator i;
|
map<int,InterfaceData>::const_iterator i;
|
||||||
for (i=od.interfaces.begin(); i!=od.interfaces.end(); ++i)
|
for (i=od.interfaces.begin(); i!=od.interfaces.end(); ++i)
|
||||||
{
|
{
|
||||||
Interface in=i->second;
|
InterfaceData in = i->second;
|
||||||
Interface *itf=
|
if (in.addr_mask.getAddressPtr()->isAny()) continue;
|
||||||
Interface::cast(mw->createObject(
|
|
||||||
o,
|
Interface *itf = Interface::cast(
|
||||||
Interface::TYPENAME,
|
mw->createObject(o,
|
||||||
(i->second).getName().c_str(),
|
QString(Interface::TYPENAME),
|
||||||
&in));
|
QString(i->second.name.c_str())));
|
||||||
|
|
||||||
|
itf->setPhysicalAddress(in.mac_addr);
|
||||||
|
itf->setLabel(in.label);
|
||||||
|
itf->setExt(in.ext);
|
||||||
|
itf->setSecurityLevel(in.securityLevel);
|
||||||
|
|
||||||
|
const InetAddr *addr = in.addr_mask.getAddressPtr();
|
||||||
|
IPv4 *ipv4= IPv4::cast(
|
||||||
|
mw->createObject(itf, IPv4::TYPENAME,
|
||||||
|
addr->toString().c_str())
|
||||||
|
);
|
||||||
|
ipv4->setAddress(*addr);
|
||||||
|
ipv4->setNetmask(*(in.addr_mask.getNetmaskPtr()));
|
||||||
|
|
||||||
mw->autorename(itf, IPv4::TYPENAME, "ip");
|
mw->autorename(itf, IPv4::TYPENAME, "ip");
|
||||||
mw->autorename(itf, physAddress::TYPENAME, "mac");
|
mw->autorename(itf, physAddress::TYPENAME, "mac");
|
||||||
}
|
}
|
||||||
@@ -2108,7 +2133,7 @@ void DiscoveryDruid::autorename(FWObject *obj,
|
|||||||
list<FWObject*> ol = obj->getByType(objtype);
|
list<FWObject*> ol = obj->getByType(objtype);
|
||||||
int sfxn = 1;
|
int sfxn = 1;
|
||||||
|
|
||||||
for (list<FWObject*>::iterator j=ol.begin(); j!=ol.end(); ++j,sfxn++)
|
for (list<FWObject*>::iterator j=ol.begin(); j!=ol.end(); ++j,++sfxn)
|
||||||
{
|
{
|
||||||
QString sfx;
|
QString sfx;
|
||||||
if (ol.size()==1) sfx="";
|
if (ol.size()==1) sfx="";
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <qhostinfo.h>
|
#include <qhostinfo.h>
|
||||||
|
|
||||||
#include "fwbuilder/Interface.h"
|
#include "fwbuilder/Interface.h"
|
||||||
|
#include "fwbuilder/InterfaceData.h"
|
||||||
#include "fwbuilder/dns.h"
|
#include "fwbuilder/dns.h"
|
||||||
#include "fwbuilder/snmp.h"
|
#include "fwbuilder/snmp.h"
|
||||||
#include "fwbuilder/InetAddr.h"
|
#include "fwbuilder/InetAddr.h"
|
||||||
@@ -65,7 +66,7 @@ class ObjectDescriptor
|
|||||||
bool isSelected;
|
bool isSelected;
|
||||||
|
|
||||||
|
|
||||||
map<int, libfwbuilder::Interface> interfaces ;
|
map<int, libfwbuilder::InterfaceData> interfaces ;
|
||||||
|
|
||||||
string MAC_addr ;
|
string MAC_addr ;
|
||||||
libfwbuilder::HostEnt dns_info ;
|
libfwbuilder::HostEnt dns_info ;
|
||||||
@@ -118,7 +119,7 @@ class DoneEvent : public QEvent
|
|||||||
|
|
||||||
typedef enum {BT_NONE,BT_HOSTS,BT_DNS,BT_SNMP,BT_IMPORT} BackgroundTask;
|
typedef enum {BT_NONE,BT_HOSTS,BT_DNS,BT_SNMP,BT_IMPORT} BackgroundTask;
|
||||||
|
|
||||||
class WorkerThread : public QThread, QObject
|
class WorkerThread : public QThread
|
||||||
{
|
{
|
||||||
QWidget *Widget;
|
QWidget *Widget;
|
||||||
|
|
||||||
|
|||||||
@@ -1,214 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Firewall Builder
|
|
||||||
|
|
||||||
Copyright (C) 2001 NetCitadel, LLC
|
|
||||||
|
|
||||||
Author: Vadim Kurland vadim@vk.crocodile.org
|
|
||||||
|
|
||||||
$Id: InterfaceData.cpp,v 1.2 2006/03/06 03:02:57 vkurland Exp $
|
|
||||||
|
|
||||||
|
|
||||||
This program is free software which we release under the GNU General Public
|
|
||||||
License. You may redistribute and/or modify this program under the terms
|
|
||||||
of that license as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
To get a copy of the GNU General Public License, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "fwbuilder_ph.h"
|
|
||||||
|
|
||||||
#include "InterfaceData.h"
|
|
||||||
|
|
||||||
#include "fwbuilder/Resources.h"
|
|
||||||
#include "fwbuilder/InetAddr.h"
|
|
||||||
|
|
||||||
using namespace libfwbuilder;
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
InterfaceData::InterfaceData(const libfwbuilder::Interface &iface)
|
|
||||||
{
|
|
||||||
id = iface.getId();
|
|
||||||
name = iface.getName();
|
|
||||||
|
|
||||||
IPv4 *addr = IPv4::cast(iface.getFirstByType(IPv4::TYPENAME));
|
|
||||||
if (addr)
|
|
||||||
{
|
|
||||||
address = addr->getAddressPtr()->toString();
|
|
||||||
netmask = addr->getNetmaskPtr()->toString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
address = "";
|
|
||||||
netmask = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
securityLevel = iface.getSecurityLevel();
|
|
||||||
isDyn = iface.isDyn();
|
|
||||||
isUnnumbered = iface.isUnnumbered();
|
|
||||||
isBridgePort = iface.isBridgePort();
|
|
||||||
libfwbuilder::physAddress *pa = iface.getPhysicalAddress();
|
|
||||||
if (pa!=NULL)
|
|
||||||
physicalAddress = pa->getPhysAddress();
|
|
||||||
label = iface.getLabel();
|
|
||||||
networkZone = iface.getStr("network_zone");
|
|
||||||
}
|
|
||||||
|
|
||||||
void InterfaceData::guessLabel(const string&)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* some firewalls report fairly regular names for interfaces through
|
|
||||||
* their built-in SNMP agent. We can use this to assign labels
|
|
||||||
* automatically.
|
|
||||||
*
|
|
||||||
* in PIX interfaces have names like "PIX Firewall 'inside' interface"
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
string pat1="PIX Firewall '";
|
|
||||||
string pat2="' interface";
|
|
||||||
string::size_type p2;
|
|
||||||
if ( name.find(pat1)==0 && (p2=name.find(pat2))!=string::npos )
|
|
||||||
label=name.substr( pat1.size() , p2-pat1.size() );
|
|
||||||
|
|
||||||
if (!isDyn &&
|
|
||||||
!isUnnumbered &&
|
|
||||||
!isBridgePort &&
|
|
||||||
address == InetAddr::getLoopbackAddr().toString())
|
|
||||||
label="loopback";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void InterfaceData::guessSecurityLevel(const string&)
|
|
||||||
{
|
|
||||||
InetAddrMask n10(InetAddr("10.0.0.0"), InetAddr("255.0.0.0"));
|
|
||||||
InetAddrMask n172(InetAddr("172.16.0.0"), InetAddr("255.240.0.0"));
|
|
||||||
InetAddrMask n192(InetAddr("192.168.0.0"), InetAddr("255.255.0.0"));
|
|
||||||
|
|
||||||
securityLevel=-1;
|
|
||||||
|
|
||||||
string llbl=label;
|
|
||||||
|
|
||||||
for (string::size_type i=0; i<llbl.length(); i++)
|
|
||||||
llbl[i]= tolower( llbl[i] );
|
|
||||||
|
|
||||||
if ( llbl=="outside" ||
|
|
||||||
llbl=="out" ||
|
|
||||||
llbl=="external" ||
|
|
||||||
llbl=="external net" ||
|
|
||||||
llbl=="ext" ||
|
|
||||||
llbl=="internet" ||
|
|
||||||
llbl=="wan" ||
|
|
||||||
llbl=="dsl" ||
|
|
||||||
llbl=="cable") securityLevel=0;
|
|
||||||
|
|
||||||
if ( llbl=="inside" ||
|
|
||||||
llbl=="lan" ||
|
|
||||||
llbl=="in" ||
|
|
||||||
llbl=="internal" ||
|
|
||||||
llbl=="internal_net" ||
|
|
||||||
llbl=="internal net" ) securityLevel=100;
|
|
||||||
|
|
||||||
if ( address==InetAddr::getLoopbackAddr().toString()) securityLevel=100;
|
|
||||||
if ( name=="Null0" ) securityLevel=100;
|
|
||||||
|
|
||||||
if (securityLevel==-1 && !isDyn && !isUnnumbered && !isBridgePort)
|
|
||||||
{
|
|
||||||
if (n10.belongs( InetAddr( address ) )) securityLevel=100;
|
|
||||||
if (n172.belongs( InetAddr( address ) )) securityLevel=100;
|
|
||||||
if (n192.belongs( InetAddr( address ) )) securityLevel=100;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDyn || isUnnumbered || isBridgePort) securityLevel=0;
|
|
||||||
|
|
||||||
if (securityLevel==-1) securityLevel=50;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class sort_order_func_adaptor
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
explicit sort_order_func_adaptor() {}
|
|
||||||
|
|
||||||
bool operator()(const InterfaceData &a, const InterfaceData &b)
|
|
||||||
{
|
|
||||||
if (a.label=="outside") return true;
|
|
||||||
if (b.label=="inside") return true;
|
|
||||||
return (a.securityLevel<b.securityLevel || a.label<b.label || a.name<b.name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void InterfaceData::guessSecurityLevel(const string &platform,
|
|
||||||
list<InterfaceData> &ifaces)
|
|
||||||
{
|
|
||||||
// first pass - try to find internal and external interfaces and
|
|
||||||
// assign sec. levels and labels
|
|
||||||
|
|
||||||
// bool supports_security_levels=Resources::getTargetCapabilityBool(platform,
|
|
||||||
// "security_levels");
|
|
||||||
|
|
||||||
list<InterfaceData> res;
|
|
||||||
|
|
||||||
if (ifaces.size()==1)
|
|
||||||
{
|
|
||||||
ifaces.front().guessSecurityLevel(platform);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ifaces.size()==2)
|
|
||||||
{
|
|
||||||
if (ifaces.front().address==InetAddr::getLoopbackAddr().toString())
|
|
||||||
{
|
|
||||||
ifaces.front().securityLevel=100;
|
|
||||||
ifaces.back().securityLevel=0;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
if (ifaces.back().address==InetAddr::getLoopbackAddr().toString())
|
|
||||||
{
|
|
||||||
ifaces.front().securityLevel=0;
|
|
||||||
ifaces.back().securityLevel=100;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
ifaces.front().guessSecurityLevel(platform);
|
|
||||||
ifaces.back().guessSecurityLevel(platform);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ifaces.sort(sort_order_func_adaptor());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (list<InterfaceData>::iterator i=ifaces.begin(); i!=ifaces.end(); i++)
|
|
||||||
{
|
|
||||||
i->guessSecurityLevel(platform);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ifaces.sort(sort_order_func_adaptor());
|
|
||||||
|
|
||||||
// second pass - Assign sec. levels evenly if it is pix, or all zeros in all other cases.
|
|
||||||
|
|
||||||
int sec_level_step= 100 / ( ifaces.size() - 1 );
|
|
||||||
int sec_level = 0;
|
|
||||||
|
|
||||||
for (list<InterfaceData>::iterator i=ifaces.begin(); i!=ifaces.end(); i++)
|
|
||||||
{
|
|
||||||
i->securityLevel=sec_level;
|
|
||||||
sec_level += sec_level_step;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
Firewall Builder
|
|
||||||
|
|
||||||
Copyright (C) 2001 NetCitadel, LLC
|
|
||||||
|
|
||||||
Author: Vadim Kurland vadim@vk.crocodile.org
|
|
||||||
|
|
||||||
$Id: InterfaceData.h,v 1.2 2006/03/06 03:02:57 vkurland Exp $
|
|
||||||
|
|
||||||
|
|
||||||
This program is free software which we release under the GNU General Public
|
|
||||||
License. You may redistribute and/or modify this program under the terms
|
|
||||||
of that license as published by the Free Software Foundation; either
|
|
||||||
version 2 of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
To get a copy of the GNU General Public License, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __INTERFACE_DATA_HH_
|
|
||||||
#define __INTERFACE_DATA_HH_
|
|
||||||
|
|
||||||
|
|
||||||
#include "fwbuilder/Interface.h"
|
|
||||||
#include "fwbuilder/physAddress.h"
|
|
||||||
|
|
||||||
struct InterfaceData
|
|
||||||
{
|
|
||||||
std::string id;
|
|
||||||
std::string name;
|
|
||||||
std::string address;
|
|
||||||
std::string netmask;
|
|
||||||
int securityLevel;
|
|
||||||
bool isDyn;
|
|
||||||
bool isUnnumbered;
|
|
||||||
bool isBridgePort;
|
|
||||||
std::string physicalAddress;
|
|
||||||
std::string label;
|
|
||||||
std::string networkZone;
|
|
||||||
|
|
||||||
InterfaceData()
|
|
||||||
{
|
|
||||||
isDyn = false;
|
|
||||||
isUnnumbered = false;
|
|
||||||
isBridgePort = false;
|
|
||||||
securityLevel = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
InterfaceData(const libfwbuilder::Interface &iface);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* this method is a collection of heuristics that allow us to assign
|
|
||||||
* a reasonable label to the interface based on firewall platform,
|
|
||||||
* name of the interface, its label and other parameters.
|
|
||||||
*/
|
|
||||||
void guessLabel(const std::string &platform);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* this method is a collection of heuristics that allow us to make an
|
|
||||||
* educated guess about interface's security level based on the
|
|
||||||
* firewall platform, name of the interface, its label and other
|
|
||||||
* parameters.
|
|
||||||
*/
|
|
||||||
void guessSecurityLevel(const std::string &platform);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This method is a collection of heuristics that allow us to assign
|
|
||||||
* a reasonable security level to many interfaces based on firewall
|
|
||||||
* platform, their names and labels and other parameters. This method
|
|
||||||
* compares parameters of many interfaces and in certain cases can
|
|
||||||
* guess their relative security levels.
|
|
||||||
*/
|
|
||||||
static void guessSecurityLevel(const std::string &platform,
|
|
||||||
std::list<InterfaceData> &interfaces);
|
|
||||||
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
@@ -520,13 +520,15 @@ void ObjectManipulator::updateObjName(FWObject *obj,
|
|||||||
|
|
||||||
itm->setText(0, pom->getTreeLabel( obj ) );
|
itm->setText(0, pom->getTreeLabel( obj ) );
|
||||||
|
|
||||||
if (!Library::isA(obj)) itm->parent()->sortChildren(0, Qt::AscendingOrder);
|
if (!Library::isA(obj))
|
||||||
|
itm->parent()->sortChildren(0, Qt::AscendingOrder);
|
||||||
|
|
||||||
/* need to update name of the firewall in the drop-down list */
|
/* need to update name of the firewall in the drop-down list */
|
||||||
if (Firewall::isA(obj))
|
if (Firewall::isA(obj))
|
||||||
{
|
{
|
||||||
pom->m_project->updateFirewallName(obj,oldName);
|
pom->m_project->updateFirewallName(obj,oldName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RuleSet::cast(obj)!=NULL)
|
if (RuleSet::cast(obj)!=NULL)
|
||||||
{
|
{
|
||||||
pom->m_project->updateFirewallName(obj,oldName);
|
pom->m_project->updateFirewallName(obj,oldName);
|
||||||
@@ -659,13 +661,14 @@ void ObjectManipulator::autorename(FWObject *obj,
|
|||||||
|
|
||||||
(*j)->setName(string(nn.toUtf8()));
|
(*j)->setName(string(nn.toUtf8()));
|
||||||
QTreeWidgetItem *itm1 = pom->allItems[ *j ];
|
QTreeWidgetItem *itm1 = pom->allItems[ *j ];
|
||||||
assert(itm1!=NULL);
|
if (itm1!=NULL)
|
||||||
|
{
|
||||||
itm1->setText(0, getTreeLabel( *j ) );
|
itm1->setText(0, getTreeLabel( *j ) );
|
||||||
itm1->parent()->sortChildren(0, Qt::AscendingOrder);//();
|
itm1->parent()->sortChildren(0, Qt::AscendingOrder);//();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ol.clear();
|
ol.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectManipulator::clearObjects()
|
void ObjectManipulator::clearObjects()
|
||||||
@@ -2468,7 +2471,7 @@ void ObjectManipulator::invalidateDialog()
|
|||||||
|
|
||||||
void ObjectManipulator::libChangedById(int id)
|
void ObjectManipulator::libChangedById(int id)
|
||||||
{
|
{
|
||||||
for (int i = 0 ; i < idxToLibs.size(); i++)
|
for (vector<FWObject*>::size_type i = 0 ; i < idxToLibs.size(); i++)
|
||||||
{
|
{
|
||||||
if (idxToLibs[i]->getId()==id)
|
if (idxToLibs[i]->getId()==id)
|
||||||
{
|
{
|
||||||
@@ -2483,7 +2486,7 @@ void ObjectManipulator::changeFirstNotSystemLib()
|
|||||||
{
|
{
|
||||||
QString sid2 = "syslib000";
|
QString sid2 = "syslib000";
|
||||||
QString sid3 = "syslib001";
|
QString sid3 = "syslib001";
|
||||||
for (int i = 0 ; i < idxToLibs.size(); i++)
|
for (vector<FWObject*>::size_type i = 0 ; i < idxToLibs.size(); i++)
|
||||||
{
|
{
|
||||||
QString sid1 = FWObjectDatabase::getStringId(idxToLibs[i]->getId()).c_str();
|
QString sid1 = FWObjectDatabase::getStringId(idxToLibs[i]->getId()).c_str();
|
||||||
if ( sid1 != sid2)
|
if ( sid1 != sid2)
|
||||||
@@ -2630,15 +2633,17 @@ FWObject* ObjectManipulator::createObject(const QString &objType,
|
|||||||
lib->getName().c_str(),
|
lib->getName().c_str(),
|
||||||
FWObjectDatabase::getStringId(lib->getId()).c_str());
|
FWObjectDatabase::getStringId(lib->getId()).c_str());
|
||||||
qDebug("lib: isReadOnly=%d isLoaded=%d",
|
qDebug("lib: isReadOnly=%d isLoaded=%d",
|
||||||
lib->isReadOnly(), m_project->getAddOnLibs()->isLoaded( lib->getName().c_str() ) );
|
lib->isReadOnly(),
|
||||||
|
m_project->getAddOnLibs()->isLoaded(lib->getName().c_str()));
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
FWObject *parent=m_project->getFWTree()->getStandardSlotForObject(lib, objType);
|
FWObject *parent =
|
||||||
|
m_project->getFWTree()->getStandardSlotForObject(lib, objType);
|
||||||
|
|
||||||
if (parent==NULL)
|
if (parent==NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
QMessageBox::warning(this,"Firewall Builder",
|
QMessageBox::warning(this,"Firewall Builder",
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"Type '%1': new object can not be created because\n"
|
"Type '%1': new object can not be created because\n"
|
||||||
@@ -2647,12 +2652,10 @@ FWObject* ObjectManipulator::createObject(const QString &objType,
|
|||||||
.arg(objType),
|
.arg(objType),
|
||||||
"&Continue", QString::null, QString::null,
|
"&Continue", QString::null, QString::null,
|
||||||
0, 1 );
|
0, 1 );
|
||||||
|
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return actuallyCreateObject(parent,objType,objName,copyFrom);
|
|
||||||
|
|
||||||
|
return actuallyCreateObject(parent,objType,objName,copyFrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
FWObject* ObjectManipulator::createObject(FWObject *parent,
|
FWObject* ObjectManipulator::createObject(FWObject *parent,
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ HEADERS += ../../config.h \
|
|||||||
newGroupDialog.h \
|
newGroupDialog.h \
|
||||||
filePropDialog.h \
|
filePropDialog.h \
|
||||||
DialogData.h \
|
DialogData.h \
|
||||||
InterfaceData.h \
|
|
||||||
execDialog.h \
|
execDialog.h \
|
||||||
SimpleTextEditor.h \
|
SimpleTextEditor.h \
|
||||||
SimpleIntEditor.h \
|
SimpleIntEditor.h \
|
||||||
@@ -149,7 +148,6 @@ SOURCES += ProjectPanel.cpp \
|
|||||||
newGroupDialog.cpp \
|
newGroupDialog.cpp \
|
||||||
filePropDialog.cpp \
|
filePropDialog.cpp \
|
||||||
DialogData.cpp \
|
DialogData.cpp \
|
||||||
InterfaceData.cpp \
|
|
||||||
execDialog.cpp \
|
execDialog.cpp \
|
||||||
SimpleTextEditor.cpp \
|
SimpleTextEditor.cpp \
|
||||||
SimpleIntEditor.cpp \
|
SimpleIntEditor.cpp \
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include "platforms.h"
|
#include "platforms.h"
|
||||||
|
|
||||||
#include "newFirewallDialog.h"
|
#include "newFirewallDialog.h"
|
||||||
#include "InterfaceData.h"
|
|
||||||
#include "FWWindow.h"
|
#include "FWWindow.h"
|
||||||
#include "ObjConflictResolutionDialog.h"
|
#include "ObjConflictResolutionDialog.h"
|
||||||
#include "upgradePredicate.h"
|
#include "upgradePredicate.h"
|
||||||
@@ -230,10 +229,11 @@ void newFirewallDialog::monitor()
|
|||||||
|
|
||||||
timer->stop();
|
timer->stop();
|
||||||
|
|
||||||
const map<int, Interface> &intf = q->getInterfaces();
|
const map<int, InterfaceData> &intf = q->getInterfaces();
|
||||||
for(map<int, Interface>::const_iterator i=intf.begin();i!=intf.end(); ++i)
|
map<int, InterfaceData>::const_iterator i;
|
||||||
|
for(i=intf.begin();i!=intf.end(); ++i)
|
||||||
{
|
{
|
||||||
if ( i->second.isUp() )
|
if ( i->second.ostatus )
|
||||||
{
|
{
|
||||||
InterfaceData idata( i->second );
|
InterfaceData idata( i->second );
|
||||||
|
|
||||||
@@ -247,10 +247,10 @@ void newFirewallDialog::monitor()
|
|||||||
QStringList qsl;
|
QStringList qsl;
|
||||||
qsl << idata.name.c_str()
|
qsl << idata.name.c_str()
|
||||||
<< idata.label.c_str()
|
<< idata.label.c_str()
|
||||||
<< idata.address.c_str()
|
<< idata.addr_mask.getAddressPtr()->toString().c_str()
|
||||||
<< idata.netmask.c_str()
|
<< idata.addr_mask.getNetmaskPtr()->toString().c_str()
|
||||||
<< dn
|
<< dn
|
||||||
<< idata.physicalAddress.c_str();
|
<< idata.mac_addr.c_str();
|
||||||
new QTreeWidgetItem(m_dialog->iface_list, qsl);
|
new QTreeWidgetItem(m_dialog->iface_list, qsl);
|
||||||
|
|
||||||
// cerr << "Added interface " << idata.name << endl;
|
// cerr << "Added interface " << idata.name << endl;
|
||||||
@@ -485,9 +485,10 @@ void newFirewallDialog::fillInterfaceSLList()
|
|||||||
idata.isBridgePort = itm->text(4).indexOf("Bridge")!=-1;
|
idata.isBridgePort = itm->text(4).indexOf("Bridge")!=-1;
|
||||||
|
|
||||||
if (!idata.isDyn && !idata.isUnnumbered && !idata.isBridgePort)
|
if (!idata.isDyn && !idata.isUnnumbered && !idata.isBridgePort)
|
||||||
idata.address = itm->text(2).toLatin1().constData();
|
idata.addr_mask.setAddress(itm->text(2).toLatin1().constData());
|
||||||
else
|
else
|
||||||
idata.address = QObject::tr("dynamic").toLatin1().constData();
|
idata.addr_mask.setAddress(
|
||||||
|
QObject::tr("dynamic").toLatin1().constData());
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -506,7 +507,7 @@ void newFirewallDialog::fillInterfaceSLList()
|
|||||||
QStringList qsl;
|
QStringList qsl;
|
||||||
qsl << idata.name.c_str()
|
qsl << idata.name.c_str()
|
||||||
<< idata.label.c_str()
|
<< idata.label.c_str()
|
||||||
<< idata.address.c_str()
|
<< idata.addr_mask.getAddressPtr()->toString().c_str()
|
||||||
<< QString::number(idata.securityLevel);
|
<< QString::number(idata.securityLevel);
|
||||||
new QTreeWidgetItem(m_dialog->iface_sl_list, qsl);
|
new QTreeWidgetItem(m_dialog->iface_sl_list, qsl);
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#include <ui_newfirewalldialog_q.h>
|
#include <ui_newfirewalldialog_q.h>
|
||||||
|
|
||||||
#include "InterfaceData.h"
|
#include "fwbuilder/InterfaceData.h"
|
||||||
#include "fakeWizard.h"
|
#include "fakeWizard.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "platforms.h"
|
#include "platforms.h"
|
||||||
|
|
||||||
#include "newHostDialog.h"
|
#include "newHostDialog.h"
|
||||||
#include "InterfaceData.h"
|
|
||||||
#include "FWWindow.h"
|
#include "FWWindow.h"
|
||||||
#include "ObjConflictResolutionDialog.h"
|
#include "ObjConflictResolutionDialog.h"
|
||||||
#include "upgradePredicate.h"
|
#include "upgradePredicate.h"
|
||||||
@@ -224,10 +223,11 @@ void newHostDialog::monitor()
|
|||||||
|
|
||||||
timer->stop();
|
timer->stop();
|
||||||
|
|
||||||
const map<int, Interface> &intf = q->getInterfaces();
|
const map<int, InterfaceData> &intf = q->getInterfaces();
|
||||||
for(map<int, Interface>::const_iterator i=intf.begin();i!=intf.end(); ++i)
|
map<int, InterfaceData>::const_iterator i;
|
||||||
|
for(i=intf.begin();i!=intf.end(); ++i)
|
||||||
{
|
{
|
||||||
if ( i->second.isUp() )
|
if ( i->second.ostatus )
|
||||||
{
|
{
|
||||||
InterfaceData idata( i->second );
|
InterfaceData idata( i->second );
|
||||||
|
|
||||||
@@ -240,10 +240,10 @@ void newHostDialog::monitor()
|
|||||||
QStringList qsl;
|
QStringList qsl;
|
||||||
qsl << idata.name.c_str()
|
qsl << idata.name.c_str()
|
||||||
<< idata.label.c_str()
|
<< idata.label.c_str()
|
||||||
<< idata.address.c_str()
|
<< idata.addr_mask.getAddressPtr()->toString().c_str()
|
||||||
<< idata.netmask.c_str()
|
<< idata.addr_mask.getNetmaskPtr()->toString().c_str()
|
||||||
<< dn
|
<< dn
|
||||||
<< idata.physicalAddress.c_str();
|
<< idata.mac_addr.c_str();
|
||||||
new QTreeWidgetItem(m_dialog->iface_list, qsl);
|
new QTreeWidgetItem(m_dialog->iface_list, qsl);
|
||||||
|
|
||||||
// cerr << "Added interface " << idata.name << endl;
|
// cerr << "Added interface " << idata.name << endl;
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#include <ui_newhostdialog_q.h>
|
#include <ui_newhostdialog_q.h>
|
||||||
|
|
||||||
#include "InterfaceData.h"
|
#include "fwbuilder/InterfaceData.h"
|
||||||
#include "fakeWizard.h"
|
#include "fakeWizard.h"
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
|||||||
@@ -88,9 +88,15 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QFrame" name="frame16" >
|
<widget class="QFrame" name="frame16" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Preferred" hsizetype="Fixed" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize" >
|
<property name="minimumSize" >
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>0</width>
|
||||||
<height>50</height>
|
<height>50</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
@@ -121,6 +127,12 @@
|
|||||||
</property>
|
</property>
|
||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<widget class="QFrame" name="frame21" >
|
<widget class="QFrame" name="frame21" >
|
||||||
|
<property name="sizePolicy" >
|
||||||
|
<sizepolicy vsizetype="Preferred" hsizetype="Minimum" >
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="frameShape" >
|
<property name="frameShape" >
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -206,7 +218,7 @@
|
|||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QSplitter" name="objInfoSplitter" >
|
<widget class="QSplitter" name="objInfoSplitter" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
<sizepolicy vsizetype="Expanding" hsizetype="Minimum" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -266,7 +278,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QFrame" name="rightFrame" >
|
<widget class="QFrame" name="rightFrame" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="MinimumExpanding" >
|
<sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
|
|||||||
Reference in New Issue
Block a user