1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-18 09:18:23 +01:00

* platforms.cpp (setInterfaceTypes): see #2224 "FreeBSD - Bridge

interfaces with the name vlan<xx> dont show as Bridge Port
Interfaces". This actually applies to all OS where we support vlan
and bridge interfaces. Fwbuilder GUI should allow the user to set
subinterface type to both "ethernet" and "vlan" when its parent
interface has type "bridge". Setting subinterface type to
"ethernet" makes it bridge port, while setting the type to "vlan"
signals policy compiler that it should generate code to configure
real vlan interface. If the name of the subinterface does not
include the name of the parent, such as "vlan101", or when the
name does not match vlan ID, such as "vlan8101", global
preferences option "Verify interface names and autoconfigure their
parameters..." should turned off. The option is located in the
Preferences dialog, tab "Objects".
This commit is contained in:
Vadim Kurland 2011-04-10 17:12:05 -07:00
parent 3333ea173f
commit 8b0febcb23
18 changed files with 70 additions and 39 deletions

View File

@ -7,7 +7,7 @@ FWB_MICRO_VERSION=0
# build number is like "nano" version number. I am incrementing build
# number during development cycle
#
BUILD_NUM="3522"
BUILD_NUM="3523"
VERSION="$FWB_MAJOR_VERSION.$FWB_MINOR_VERSION.$FWB_MICRO_VERSION.$BUILD_NUM"

View File

@ -1,2 +1,2 @@
#define VERSION "4.2.0.3522"
#define VERSION "4.2.0.3523"
#define GENERATION "4.2"

View File

@ -1,3 +1,20 @@
2011-04-10 vadim <vadim@netcitadel.com>
* platforms.cpp (setInterfaceTypes): see #2224 "FreeBSD - Bridge
interfaces with the name vlan<xx> don't show as Bridge Port
Interfaces". This actually applies to all OS where we support vlan
and bridge interfaces. Fwbuilder GUI should allow the user to set
subinterface type to both "ethernet" and "vlan" when its parent
interface has type "bridge". Setting subinterface type to
"ethernet" makes it bridge port, while setting the type to "vlan"
signals policy compiler that it should generate code to configure
real vlan interface. If the name of the subinterface does not
include the name of the parent, such as "vlan101", or when the
name does not match vlan ID, such as "vlan8101", global
preferences option "Verify interface names and autoconfigure their
parameters..." should turned off. The option is located in the
Preferences dialog, tab "Objects".
2011-04-08 vadim <vadim@netcitadel.com>
* FWBSettings.cpp (init): fixed bug (no #): "Show text

View File

@ -3,7 +3,7 @@
%define name fwbuilder
%define version 4.2.0.3522
%define version 4.2.0.3523
%define release 1
%if "%_vendor" == "MandrakeSoft"

View File

@ -4,6 +4,6 @@ Replaces: fwbuilder (<=4.1.1-1), fwbuilder-common, fwbuilder-bsd, fwbuilder-linu
Priority: extra
Section: checkinstall
Maintainer: vadim@fwbuilder.org
Version: 4.2.0.3522-1
Version: 4.2.0.3523-1
Depends: libqt4-gui (>= 4.3.0), libxml2, libxslt1.1, libsnmp | libsnmp15
Description: Firewall Builder GUI and policy compilers

View File

@ -1,6 +1,6 @@
%define name fwbuilder
%define version 4.2.0.3522
%define version 4.2.0.3523
%define release 1
%if "%_vendor" == "MandrakeSoft"

View File

@ -565,44 +565,47 @@ void setInterfaceTypes(QComboBox *iface_type,
getSubInterfaceTypes(Interface::cast(iface->getParent()), mapping);
else getInterfaceTypes(iface, mapping);
// #335 : if interface name matches naming convention for vlan
// interfaces and vlan type is in the list that came from the
// resource file, then leave only vlan in the list we return.
// Note that if resource file says this subint can not be vlan, we
// dan't return vlan type on the list even if its name looks like
// it could be one.
FWObject *p = iface->getParentHost();
assert(p!=NULL);
QString host_os = p->getStr("host_OS").c_str();
QString obj_name = iface->getName().c_str();
Resources* os_res = Resources::os_res[p->getStr("host_OS")];
string os_family = p->getStr("host_OS");
if (os_res!=NULL)
os_family = os_res->getResourceStr("/FWBuilderResources/Target/family");
std::auto_ptr<interfaceProperties> int_prop(
interfacePropertiesObjectFactory::getInterfacePropertiesObject(
os_family));
if (int_prop->looksLikeVlanInterface(obj_name))
if (st->getBool("Objects/Interface/autoconfigureInterfaces"))
{
QString parent_name = iface->getParent()->getName().c_str();
QString err;
if (int_prop->isValidVlanInterfaceName(obj_name, parent_name, err))
// #335 : if interface name matches naming convention for vlan
// interfaces and vlan type is in the list that came from the
// resource file, then leave only vlan in the list we return.
// Note that if resource file says this subint can not be vlan, we
// dan't return vlan type on the list even if its name looks like
// it could be one.
FWObject *p = iface->getParentHost();
assert(p!=NULL);
QString host_os = p->getStr("host_OS").c_str();
QString obj_name = iface->getName().c_str();
Resources* os_res = Resources::os_res[p->getStr("host_OS")];
string os_family = p->getStr("host_OS");
if (os_res!=NULL)
os_family = os_res->getResourceStr("/FWBuilderResources/Target/family");
std::auto_ptr<interfaceProperties> int_prop(
interfacePropertiesObjectFactory::getInterfacePropertiesObject(
os_family));
if (int_prop->looksLikeVlanInterface(obj_name))
{
// iface can be valid vlan interface. Leave only vlan type
// in the list if it was there to begin with.
for (list<QStringPair>::iterator it=mapping.begin();
it!=mapping.end(); ++it)
QString parent_name = iface->getParent()->getName().c_str();
QString err;
if (int_prop->isValidVlanInterfaceName(obj_name, parent_name, err))
{
QString itype = it->first;
QString rtype = it->second;
if (itype == "8021q")
// iface can be valid vlan interface. Leave only vlan type
// in the list if it was there to begin with.
for (list<QStringPair>::iterator it=mapping.begin();
it!=mapping.end(); ++it)
{
mapping.clear();
mapping.push_back(QStringPair(itype, rtype));
mapping.push_back(QStringPair("unknown", "Unknown"));
break;
QString itype = it->first;
QString rtype = it->second;
if (itype == "8021q")
{
mapping.clear();
mapping.push_back(QStringPair(itype, rtype));
mapping.push_back(QStringPair("unknown", "Unknown"));
break;
}
}
}
}

View File

@ -112,6 +112,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -112,6 +112,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -56,6 +56,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -76,6 +76,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
</subinterfaces>

View File

@ -56,6 +56,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -113,6 +113,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -56,6 +56,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -75,6 +75,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
</subinterfaces>

View File

@ -112,6 +112,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -89,6 +89,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>

View File

@ -54,6 +54,7 @@
</ethernet>
<bridge>
<string>ethernet,Ethernet</string>
<string>8021q,VLAN</string>
<string>unknown,Unknown</string>
</bridge>
<bonding>