mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-25 04:37:22 +01:00
* procurveInterfaces.cpp (procurveInterfaces::parseVlan): fixed #1683
class procurveInterfaces interprets interface "DEFAULT_VLAN" as vlan interface with vlan id 1.
This commit is contained in:
parent
42e3e6f445
commit
6f4a986273
@ -1,5 +1,14 @@
|
||||
2010-08-17 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* procurveInterfaces.cpp (procurveInterfaces::parseVlan): fixed #1683
|
||||
class procurveInterfaces interprets interface "DEFAULT_VLAN" as
|
||||
vlan interface with vlan id 1.
|
||||
|
||||
* newFirewallDialog.cpp (newFirewallDialog::finishClicked):
|
||||
fixed #1683 When user creates new firewall using snmp scan,
|
||||
fwbuilder will now guess and assign the type to interfaces that
|
||||
look like vlans for the given platform and host OS.
|
||||
|
||||
* safety_net_acl: fixed #1687 "temporary access list commands
|
||||
syntax is incorrect". Temporary ACL generated for the Procurve
|
||||
platform was incorrect.
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#include "interfaceProperties.h"
|
||||
#include "linux24Interfaces.h"
|
||||
#include "iosInterfaces.h"
|
||||
#include "procurveInterfaces.h"
|
||||
#include "bsdInterfaces.h"
|
||||
#include "pixInterfaces.h"
|
||||
#include "procurveInterfaces.h"
|
||||
|
||||
@ -58,7 +58,15 @@ bool procurveInterfaces::basicValidateInterfaceName(Interface*,
|
||||
bool procurveInterfaces::parseVlan(
|
||||
const QString &name, QString *base_name, int *vlan_id)
|
||||
{
|
||||
QRegExp vlan_name_pattern("(vlan|Vlan|VLAN) (\\d{1,})");
|
||||
if (name == "DEFAULT_VLAN")
|
||||
{
|
||||
if (base_name!=NULL) *base_name = "vlan";
|
||||
if (vlan_id!=NULL) *vlan_id = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Procurve SNMP reports vlan interface names without space
|
||||
QRegExp vlan_name_pattern("(vlan|Vlan|VLAN) *(\\d{1,})");
|
||||
if (vlan_name_pattern.indexIn(name) != -1)
|
||||
{
|
||||
if (base_name!=NULL) *base_name = vlan_name_pattern.cap(1);
|
||||
|
||||
@ -2090,12 +2090,12 @@ FWObject* DiscoveryDruid::addInterface(FWObject *parent, InterfaceData *in,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
QString obj_name = in->name.c_str();
|
||||
Interface *itf = NULL;
|
||||
itf = Interface::cast(
|
||||
mw->createObject(parent,
|
||||
QString(Interface::TYPENAME),
|
||||
QString(in->name.c_str())));
|
||||
|
||||
QString(Interface::TYPENAME), obj_name));
|
||||
|
||||
QString iname = om->getStandardName(itf, physAddress::TYPENAME, "mac");
|
||||
iname = om->makeNameUnique(itf, iname, physAddress::TYPENAME);
|
||||
|
||||
@ -2107,11 +2107,28 @@ FWObject* DiscoveryDruid::addInterface(FWObject *parent, InterfaceData *in,
|
||||
itf->setLabel(in->label);
|
||||
itf->setSecurityLevel(in->securityLevel);
|
||||
|
||||
if (fwbdebug)
|
||||
qDebug() << "Interface=" << obj_name
|
||||
<< "type=" << in->interface_type.c_str();
|
||||
|
||||
if (!in->interface_type.empty())
|
||||
{
|
||||
itf->getOptionsObject()->setStr("type", in->interface_type);
|
||||
if (in->interface_type == "8021q")
|
||||
itf->getOptionsObject()->setInt("vlan_id", in->vlan_id);
|
||||
} else
|
||||
{
|
||||
std::auto_ptr<interfaceProperties> int_prop(
|
||||
interfacePropertiesObjectFactory::getInterfacePropertiesObject(parent));
|
||||
if (int_prop->looksLikeVlanInterface(obj_name))
|
||||
{
|
||||
QString base_name;
|
||||
int vlan_id;
|
||||
int_prop->parseVlan(obj_name, &base_name, &vlan_id);
|
||||
|
||||
itf->getOptionsObject()->setStr("type", "8021q");
|
||||
itf->getOptionsObject()->setInt("vlan_id", vlan_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (in->addr_mask.size()==0 ||
|
||||
|
||||
@ -39,6 +39,9 @@
|
||||
#include "FWBApplication.h"
|
||||
#include "QDesktopWidget"
|
||||
|
||||
#include "interfaceProperties.h"
|
||||
#include "interfacePropertiesObjectFactory.h"
|
||||
|
||||
#include "fwbuilder/Library.h"
|
||||
#include "fwbuilder/Firewall.h"
|
||||
#include "fwbuilder/Resources.h"
|
||||
@ -983,6 +986,19 @@ void newFirewallDialog::finishClicked()
|
||||
qDebug("Adding interface %s: security_level=%d",
|
||||
oi->getName().c_str(), sl);
|
||||
|
||||
std::auto_ptr<interfaceProperties> int_prop(
|
||||
interfacePropertiesObjectFactory::getInterfacePropertiesObject(nfw));
|
||||
if (int_prop->looksLikeVlanInterface(name))
|
||||
{
|
||||
QString base_name;
|
||||
int vlan_id;
|
||||
int_prop->parseVlan(name, &base_name, &vlan_id);
|
||||
|
||||
oi->getOptionsObject()->setStr("type", "8021q");
|
||||
oi->getOptionsObject()->setInt("vlan_id", vlan_id);
|
||||
}
|
||||
|
||||
|
||||
if (iface.type == 0)
|
||||
{
|
||||
foreach(AddressInfo address, iface.addresses)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user