mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-05-02 23:27:30 +02:00
fixes #437 - got rid of "_()" everywhere (finally)
This commit is contained in:
parent
d4b28ca4ab
commit
e837cdea65
@ -116,5 +116,4 @@ using namespace std;
|
|||||||
# define VSNPRINTF _vsnprintf
|
# define VSNPRINTF _vsnprintf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _(x) x
|
|
||||||
|
|
||||||
|
|||||||
@ -120,18 +120,18 @@ class UpgradePredicate: public XMLTools::UpgradePredicate
|
|||||||
virtual bool operator()(const string&) const
|
virtual bool operator()(const string&) const
|
||||||
{
|
{
|
||||||
bool res=false;
|
bool res=false;
|
||||||
cout << _("Data file has been created in the old version of Firewall Builder.") << endl << flush;
|
cout << "Data file has been created in the old version of Firewall Builder." << endl << flush;
|
||||||
if (autoupgrade_flag)
|
if (autoupgrade_flag)
|
||||||
{
|
{
|
||||||
cout << _("Do you want to convert it? (Y)") << endl;
|
cout << "Do you want to convert it? (Y/n)" << endl;
|
||||||
int a = getchar();
|
int a = getchar();
|
||||||
if (a=='y' || a=='Y' || a=='\n' ) res= true;
|
if (a=='y' || a=='Y' || a=='\n' ) res= true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << _("Use option '-u' to upgrade the file. Alternatively,\nfwbuilder GUI can convert it.") << endl;
|
cout << "Use option '-u' to upgrade the file. Alternatively,\nfwbuilder GUI can convert it." << endl;
|
||||||
}
|
}
|
||||||
if (res) cout << _("Upgrading the file now ...") << endl;
|
if (res) cout << "Upgrading the file now ..." << endl;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -574,7 +574,7 @@ int main(int argc, char * const *argv)
|
|||||||
}
|
}
|
||||||
else if (cmd == UPGRADE)
|
else if (cmd == UPGRADE)
|
||||||
{
|
{
|
||||||
cout << _("File upgraded; current data format version: ")
|
cout << "File upgraded; current data format version: "
|
||||||
<< libfwbuilder::Constants::getDataFormatVersion() << endl;
|
<< libfwbuilder::Constants::getDataFormatVersion() << endl;
|
||||||
}
|
}
|
||||||
else if (cmd == NEWOBJECT)
|
else if (cmd == NEWOBJECT)
|
||||||
@ -615,8 +615,8 @@ int main(int argc, char * const *argv)
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
FWObject *grp = groups.front();
|
FWObject *grp = groups.front();
|
||||||
cout << _("Adding object '") << obj->getName()
|
cout << "Adding object '" << obj->getName()
|
||||||
<< _("' to the group '") << grp->getName()
|
<< "' to the group '" << grp->getName()
|
||||||
<< "'" << endl;
|
<< "'" << endl;
|
||||||
grp->addRef(obj);
|
grp->addRef(obj);
|
||||||
}
|
}
|
||||||
@ -630,8 +630,8 @@ int main(int argc, char * const *argv)
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
FWObject *grp = groups.front();
|
FWObject *grp = groups.front();
|
||||||
cout << _("Removing object '") << obj->getName()
|
cout << "Removing object '" << obj->getName()
|
||||||
<< _("' from the group '") << grp->getName()
|
<< "' from the group '" << grp->getName()
|
||||||
<< "'" << endl;
|
<< "'" << endl;
|
||||||
grp->removeRef(obj);
|
grp->removeRef(obj);
|
||||||
}
|
}
|
||||||
@ -658,7 +658,7 @@ int main(int argc, char * const *argv)
|
|||||||
cerr << ex.what();
|
cerr << ex.what();
|
||||||
exit(1);
|
exit(1);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
cerr << _("Unsupported exception");
|
cerr << "Unsupported exception";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -218,7 +218,7 @@ bool testPlatform(const string &pl, const string &os)
|
|||||||
string str;
|
string str;
|
||||||
if (platforms.empty() || ( platforms.size()==1 && platforms.front()=="unknown" ))
|
if (platforms.empty() || ( platforms.size()==1 && platforms.front()=="unknown" ))
|
||||||
{
|
{
|
||||||
cout << _("Failed to load list of supported platforms") << endl;
|
cout << "Failed to load list of supported platforms" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
for (vector<std::string>::iterator i=platforms.begin();i!=platforms.end();i++)
|
for (vector<std::string>::iterator i=platforms.begin();i!=platforms.end();i++)
|
||||||
@ -331,7 +331,7 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Address: ") << addr1 << endl;
|
cout << "Address: " << addr1 << endl;
|
||||||
if (!addr2.empty()) cout << "Netmask: " << addr2 << endl;
|
if (!addr2.empty()) cout << "Netmask: " << addr2 << endl;
|
||||||
|
|
||||||
Address *o = Address::cast(nobj);
|
Address *o = Address::cast(nobj);
|
||||||
@ -365,8 +365,8 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("DNS Record: ") << dnsrec << endl;
|
cout << "DNS Record: " << dnsrec << endl;
|
||||||
cout << _("Run time: ") << runtime << endl;
|
cout << "Run time: " << runtime << endl;
|
||||||
|
|
||||||
DNSName *o=DNSName::cast(nobj);
|
DNSName *o=DNSName::cast(nobj);
|
||||||
o->setSourceName(dnsrec);
|
o->setSourceName(dnsrec);
|
||||||
@ -384,8 +384,8 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Range start: ") << addr1 << endl
|
cout << "Range start: " << addr1 << endl
|
||||||
<< _("Range end: ") << addr2 << endl;
|
<< "Range end: " << addr2 << endl;
|
||||||
|
|
||||||
AddressRange *o=AddressRange::cast(nobj);
|
AddressRange *o=AddressRange::cast(nobj);
|
||||||
o->setRangeStart(InetAddr(addr1));
|
o->setRangeStart(InetAddr(addr1));
|
||||||
@ -407,8 +407,8 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Address: ") << addr1 << endl
|
cout << "Address: " << addr1 << endl
|
||||||
<< _("Netmask: ") << addr2 << endl;
|
<< "Netmask: " << addr2 << endl;
|
||||||
|
|
||||||
Network *o=Network::cast(nobj);
|
Network *o=Network::cast(nobj);
|
||||||
o->setAddress(InetAddr(addr1));
|
o->setAddress(InetAddr(addr1));
|
||||||
@ -425,8 +425,8 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Address: ") << addr1 << endl
|
cout << "Address: " << addr1 << endl
|
||||||
<< _("Netmask: ") << addr2 << endl;
|
<< "Netmask: " << addr2 << endl;
|
||||||
|
|
||||||
NetworkIPv6 *o=NetworkIPv6::cast(nobj);
|
NetworkIPv6 *o=NetworkIPv6::cast(nobj);
|
||||||
o->setAddress(InetAddr(AF_INET6, addr1));
|
o->setAddress(InetAddr(AF_INET6, addr1));
|
||||||
@ -446,8 +446,8 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Platform: ") << platform << endl
|
cout << "Platform: " << platform << endl
|
||||||
<< _("Host OS: ") << hostOS << endl;
|
<< "Host OS: " << hostOS << endl;
|
||||||
|
|
||||||
if (testPlatform(platform, hostOS))
|
if (testPlatform(platform, hostOS))
|
||||||
{
|
{
|
||||||
@ -481,14 +481,14 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
QDate date;
|
QDate date;
|
||||||
int m,h,d,mn,y,dw;
|
int m,h,d,mn,y,dw;
|
||||||
|
|
||||||
cout << _("Activate a rule on:") << endl
|
cout << "Activate a rule on:" << endl
|
||||||
<< _("Time: ") << time1 << endl
|
<< "Time: " << time1 << endl
|
||||||
<< _("Date: ") << date1 << endl
|
<< "Date: " << date1 << endl
|
||||||
<< _("Day of week:") << day1 << endl
|
<< "Day of week:" << day1 << endl
|
||||||
<< _("Deactivate a rule on:") << endl
|
<< "Deactivate a rule on:" << endl
|
||||||
<< _("Time: ") << time2 << endl
|
<< "Time: " << time2 << endl
|
||||||
<< _("Date: ") << date2 << endl
|
<< "Date: " << date2 << endl
|
||||||
<< _("Day of week:") << day2 << endl;
|
<< "Day of week:" << day2 << endl;
|
||||||
|
|
||||||
Interval *o=Interval::cast(nobj);
|
Interval *o=Interval::cast(nobj);
|
||||||
if (time1 == "")
|
if (time1 == "")
|
||||||
@ -567,13 +567,13 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
|
|
||||||
if (security=="")
|
if (security=="")
|
||||||
{
|
{
|
||||||
cout << _("Security level is mandatory attribute.") << endl;
|
cout << "Security level is mandatory attribute." << endl;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cout << _("Security level: ") << security << endl
|
cout << "Security level: " << security << endl
|
||||||
<< _("Address type: ") << addrtype << endl
|
<< "Address type: " << addrtype << endl
|
||||||
<< _("Management interface: ") << management << endl;
|
<< "Management interface: " << management << endl;
|
||||||
|
|
||||||
Interface *o = Interface::cast(nobj);
|
Interface *o = Interface::cast(nobj);
|
||||||
int sl = atoi(security.c_str());
|
int sl = atoi(security.c_str());
|
||||||
@ -603,15 +603,15 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Source port range:") << endl
|
cout << "Source port range:" << endl
|
||||||
<< _("Start: ") << addr1 << endl
|
<< "Start: " << addr1 << endl
|
||||||
<< _("End: ") << addr2 << endl
|
<< "End: " << addr2 << endl
|
||||||
<< _("Destination port range:") << endl
|
<< "Destination port range:" << endl
|
||||||
<< _("Start: ") << addr3 << endl
|
<< "Start: " << addr3 << endl
|
||||||
<< _("End: ") << addr4 << endl
|
<< "End: " << addr4 << endl
|
||||||
<< _("TCP Flags: ") << endl
|
<< "TCP Flags: " << endl
|
||||||
<< _("Mask: ") << tcpflags_mask << endl
|
<< "Mask: " << tcpflags_mask << endl
|
||||||
<< _("Settings: ") << tcpflags_bits << endl;
|
<< "Settings: " << tcpflags_bits << endl;
|
||||||
|
|
||||||
TCPService *o=TCPService::cast(nobj);
|
TCPService *o=TCPService::cast(nobj);
|
||||||
|
|
||||||
@ -671,12 +671,12 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Source port range:") << endl
|
cout << "Source port range:" << endl
|
||||||
<< _("Start: ") << addr1 << endl
|
<< "Start: " << addr1 << endl
|
||||||
<< _("End: ") << addr2 << endl
|
<< "End: " << addr2 << endl
|
||||||
<< _("Destination port range:") << endl
|
<< "Destination port range:" << endl
|
||||||
<< _("Start: ") << addr3 << endl
|
<< "Start: " << addr3 << endl
|
||||||
<< _("End: ") << addr4 << endl;
|
<< "End: " << addr4 << endl;
|
||||||
|
|
||||||
UDPService *o=UDPService::cast(nobj);
|
UDPService *o=UDPService::cast(nobj);
|
||||||
|
|
||||||
@ -697,8 +697,8 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("ICMP type: ") << ICMPtype << endl
|
cout << "ICMP type: " << ICMPtype << endl
|
||||||
<< _("ICMP code: ") << ICMPcode << endl;
|
<< "ICMP code: " << ICMPcode << endl;
|
||||||
|
|
||||||
ICMPService *o=ICMPService::cast(nobj);
|
ICMPService *o=ICMPService::cast(nobj);
|
||||||
o->setInt("type",atoi(ICMPtype.c_str()));
|
o->setInt("type",atoi(ICMPtype.c_str()));
|
||||||
@ -715,8 +715,8 @@ void _modObject(FWObject *nobj, const string &comment_txt, operands ops)
|
|||||||
notEnoughAttributesError();
|
notEnoughAttributesError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << _("Protocol number: ") << protocol << endl
|
cout << "Protocol number: " << protocol << endl
|
||||||
<< _("Flags: ") << bitmap << endl;
|
<< "Flags: " << bitmap << endl;
|
||||||
|
|
||||||
IPService *o=IPService::cast(nobj);
|
IPService *o=IPService::cast(nobj);
|
||||||
o->setInt("protocol_num",atoi(protocol.c_str()));
|
o->setInt("protocol_num",atoi(protocol.c_str()));
|
||||||
@ -792,8 +792,8 @@ void newObject(FWObjectDatabase *objdb,
|
|||||||
|
|
||||||
cout << "Adding a new object to '"
|
cout << "Adding a new object to '"
|
||||||
<< parent <<"': " << endl
|
<< parent <<"': " << endl
|
||||||
<< _("Type: ") << objtype << endl
|
<< "Type: " << objtype << endl
|
||||||
<< _("Name: ") << name << endl;
|
<< "Name: " << name << endl;
|
||||||
|
|
||||||
FWObject *nobj = createObject(objdb, objtype, parent);
|
FWObject *nobj = createObject(objdb, objtype, parent);
|
||||||
|
|
||||||
@ -870,8 +870,8 @@ void delObject(FWObjectDatabase *objdb, const string &object)
|
|||||||
for (list<FWObject*>::iterator it=objects.begin(); it!=objects.end(); ++it)
|
for (list<FWObject*>::iterator it=objects.begin(); it!=objects.end(); ++it)
|
||||||
{
|
{
|
||||||
FWObject *obj = *it;
|
FWObject *obj = *it;
|
||||||
cout << _("Removing object '") << obj->getName()
|
cout << "Removing object '" << obj->getName()
|
||||||
<< _("' from the tree.") << endl;
|
<< "' from the tree." << endl;
|
||||||
objdb->removeAllInstances(obj);
|
objdb->removeAllInstances(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -65,7 +65,7 @@ void testAndFix(FWObjectDatabase *objdb,
|
|||||||
|
|
||||||
void checkAndRepairTree(FWObjectDatabase *objdb)
|
void checkAndRepairTree(FWObjectDatabase *objdb)
|
||||||
{
|
{
|
||||||
cout << _("Check and repair tree structure:") << endl;
|
cout << "Check and repair tree structure:" << endl;
|
||||||
FWObject *root=objdb;
|
FWObject *root=objdb;
|
||||||
FWObject *nlib;
|
FWObject *nlib;
|
||||||
string lib_name;
|
string lib_name;
|
||||||
|
|||||||
@ -79,16 +79,16 @@ class UpgradePredicate: public XMLTools::UpgradePredicate
|
|||||||
public:
|
public:
|
||||||
virtual bool operator()(const string&) const
|
virtual bool operator()(const string&) const
|
||||||
{
|
{
|
||||||
cout << _("Data file has been created in the old version of Firewall Builder. Use fwbuilder GUI to convert it.") << endl;
|
cout << "Data file has been created in the old version of Firewall Builder. Use fwbuilder GUI to convert it." << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void usage(const char *name)
|
void usage(const char *name)
|
||||||
{
|
{
|
||||||
cout << _("Firewall Builder: policy compiler for ipfw") << endl;
|
cout << "Firewall Builder: policy compiler for ipfw" << endl;
|
||||||
cout << _("Version ") << VERSION << RELEASE_NUM << endl;
|
cout << "Version " << VERSION << RELEASE_NUM << endl;
|
||||||
cout << _("Usage: ") << name << " [-x] [-v] [-V] [-f filename.xml] [-o output.fw] [-d destdir] [-m] firewall_object_name" << endl;
|
cout << "Usage: " << name << " [-x] [-v] [-V] [-f filename.xml] [-o output.fw] [-d destdir] [-m] firewall_object_name" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
@ -150,7 +150,7 @@ int main(int argc, char **argv)
|
|||||||
/* load the data file */
|
/* load the data file */
|
||||||
UpgradePredicate upgrade_predicate;
|
UpgradePredicate upgrade_predicate;
|
||||||
|
|
||||||
cout << _(" *** Loading data ...");
|
cout << " *** Loading data ...";
|
||||||
|
|
||||||
objdb->setReadOnly( false );
|
objdb->setReadOnly( false );
|
||||||
objdb->load( sysfname, &upgrade_predicate, librespath);
|
objdb->load( sysfname, &upgrade_predicate, librespath);
|
||||||
@ -162,7 +162,7 @@ int main(int argc, char **argv)
|
|||||||
objdb->setFileName(filename);
|
objdb->setFileName(filename);
|
||||||
objdb->reIndex();
|
objdb->reIndex();
|
||||||
|
|
||||||
cout << _(" done\n");
|
cout << " done\n";
|
||||||
|
|
||||||
FWObject *slib = objdb->getById(FWObjectDatabase::STANDARD_LIB_ID);
|
FWObject *slib = objdb->getById(FWObjectDatabase::STANDARD_LIB_ID);
|
||||||
if (slib && slib->isReadOnly()) slib->setReadOnly(false);
|
if (slib && slib->isReadOnly()) slib->setReadOnly(false);
|
||||||
@ -194,7 +194,7 @@ int main(int argc, char **argv)
|
|||||||
cerr << ex.what();
|
cerr << ex.what();
|
||||||
return 1;
|
return 1;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
cerr << _("Unsupported exception");
|
cerr << "Unsupported exception";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -498,33 +498,33 @@ bool NATCompiler_ipt::VerifyRules::processNext()
|
|||||||
if (tsrc->getNeg())
|
if (tsrc->getNeg())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Can not use negation in translated source "));
|
"Can not use negation in translated source ");
|
||||||
|
|
||||||
if (tdst->getNeg())
|
if (tdst->getNeg())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Can not use negation in translated destination."));
|
"Can not use negation in translated destination.");
|
||||||
|
|
||||||
if (tsrv->getNeg())
|
if (tsrv->getNeg())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Can not use negation in translated service."));
|
"Can not use negation in translated service.");
|
||||||
|
|
||||||
if (tsrv->size()!=1)
|
if (tsrv->size()!=1)
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Translated service should be 'Original' or should contain single object."));
|
"Translated service should be 'Original' or should contain single object.");
|
||||||
|
|
||||||
if ( Group::cast( compiler->getFirstTSrv(rule) )!=NULL)
|
if ( Group::cast( compiler->getFirstTSrv(rule) )!=NULL)
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Can not use group in translated service."));
|
"Can not use group in translated service.");
|
||||||
|
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::LB)
|
if (rule->getRuleType()==NATRule::LB)
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Load balancing rules are not supported."));
|
"Load balancing rules are not supported.");
|
||||||
|
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::SNAT )
|
if (rule->getRuleType()==NATRule::SNAT )
|
||||||
@ -533,7 +533,7 @@ bool NATCompiler_ipt::VerifyRules::processNext()
|
|||||||
if ( ! tsrc->isAny() && Network::cast(o1)!=NULL)
|
if ( ! tsrc->isAny() && Network::cast(o1)!=NULL)
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Can not use network object in translated source."));
|
"Can not use network object in translated source.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ bool NATCompiler_ipt::VerifyRules::processNext()
|
|||||||
a1->getNetmaskPtr()->getLength() != a2->getNetmaskPtr()->getLength() )
|
a1->getNetmaskPtr()->getLength() != a2->getNetmaskPtr()->getLength() )
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Original and translated source should both be networks of the same size."));
|
"Original and translated source should both be networks of the same size.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::DNetnat && !tsrc->isAny() )
|
if (rule->getRuleType()==NATRule::DNetnat && !tsrc->isAny() )
|
||||||
@ -556,11 +556,11 @@ bool NATCompiler_ipt::VerifyRules::processNext()
|
|||||||
a1->getNetmaskPtr()->getLength() != a2->getNetmaskPtr()->getLength() )
|
a1->getNetmaskPtr()->getLength() != a2->getNetmaskPtr()->getLength() )
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Original and translated destination should both be networks of the same size ."));
|
"Original and translated destination should both be networks of the same size .");
|
||||||
}
|
}
|
||||||
|
|
||||||
Service *osrv_obj = compiler->getFirstOSrv(rule);
|
// Service *osrv_obj = compiler->getFirstOSrv(rule);
|
||||||
Service *tsrv_obj = compiler->getFirstTSrv(rule);
|
// Service *tsrv_obj = compiler->getFirstTSrv(rule);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -587,12 +587,12 @@ bool NATCompiler_ipt::VerifyRules2::processNext()
|
|||||||
if (osrv->isAny() && ! tsrv->isAny())
|
if (osrv->isAny() && ! tsrv->isAny())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Can not use service object in Translated Service if Original Service is 'Any'."));
|
"Can not use service object in Translated Service if Original Service is 'Any'.");
|
||||||
|
|
||||||
if (!tsrv->isAny() && s1->getProtocolNumber()!=s2->getProtocolNumber())
|
if (!tsrv->isAny() && s1->getProtocolNumber()!=s2->getProtocolNumber())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
rule,
|
rule,
|
||||||
_("Translated Service should be either 'Original' or should contain object of the same type as Original Service."));
|
"Translated Service should be either 'Original' or should contain object of the same type as Original Service.");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -764,7 +764,7 @@ bool NATCompiler_ipt::addVirtualAddress::processNext()
|
|||||||
compiler->warning(
|
compiler->warning(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
string(_("Adding of virtual address for address range is not implemented (object ")) +
|
string("Adding of virtual address for address range is not implemented (object ") +
|
||||||
a->getName() + ")" );
|
a->getName() + ")" );
|
||||||
} else
|
} else
|
||||||
compiler->osconfigurator->addVirtualAddressForNAT( a );
|
compiler->osconfigurator->addVirtualAddressForNAT( a );
|
||||||
@ -995,7 +995,8 @@ bool NATCompiler_ipt::ReplaceFirewallObjectsTSrc::processNext()
|
|||||||
{
|
{
|
||||||
char errmsg[1024];
|
char errmsg[1024];
|
||||||
sprintf(errmsg,
|
sprintf(errmsg,
|
||||||
_("Could not find suitable interface for the NAT rule %s. Perhaps all interfaces are unnumbered?"),
|
"Could not find suitable interface for the NAT rule %s. "
|
||||||
|
"Perhaps all interfaces are unnumbered?",
|
||||||
rule->getLabel().c_str() );
|
rule->getLabel().c_str() );
|
||||||
compiler->abort(rule, errmsg);
|
compiler->abort(rule, errmsg);
|
||||||
}
|
}
|
||||||
@ -1165,7 +1166,8 @@ void NATCompiler_ipt::checkForDynamicInterfacesOfOtherObjects::findDynamicInterf
|
|||||||
cerr << endl;
|
cerr << endl;
|
||||||
#endif
|
#endif
|
||||||
char errstr[2048];
|
char errstr[2048];
|
||||||
sprintf(errstr,_("Can not build rule using dynamic interface '%s' of the object '%s' because its address in unknown."),
|
sprintf(errstr, "Can not build rule using dynamic interface '%s' "
|
||||||
|
"of the object '%s' because its address in unknown.",
|
||||||
ifs->getName().c_str(),
|
ifs->getName().c_str(),
|
||||||
ifs->getParent()->getName().c_str());
|
ifs->getParent()->getName().c_str());
|
||||||
|
|
||||||
|
|||||||
@ -181,9 +181,9 @@ void OSConfigurator_linux24::addVirtualAddressForNAT(const Network *nw)
|
|||||||
virtual_addresses.push_back( *(nw->getAddressPtr()) );
|
virtual_addresses.push_back( *(nw->getAddressPtr()) );
|
||||||
registerVirtualAddressForNat();
|
registerVirtualAddressForNat();
|
||||||
} else
|
} else
|
||||||
warning(_("Can not add virtual address ") +
|
warning("Can not add virtual address " +
|
||||||
nw->getAddressPtr()->toString() +
|
nw->getAddressPtr()->toString() +
|
||||||
_(" (object ") + nw->getName() + ")" );
|
" (object " + nw->getName() + ")" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,9 +220,9 @@ void OSConfigurator_linux24::addVirtualAddressForNAT(const Address *addr)
|
|||||||
virtual_addresses.push_back(*(addr->getAddressPtr()));
|
virtual_addresses.push_back(*(addr->getAddressPtr()));
|
||||||
registerVirtualAddressForNat();
|
registerVirtualAddressForNat();
|
||||||
} else
|
} else
|
||||||
warning(_("Can not add virtual address ") +
|
warning("Can not add virtual address " +
|
||||||
addr->getAddressPtr()->toString() +
|
addr->getAddressPtr()->toString() +
|
||||||
_(" (object ") + addr->getName() + ")" );
|
" (object " + addr->getName() + ")" );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -541,7 +541,7 @@ string PolicyCompiler_ipt::PrintRule::_printLogPrefix(const string &rule_num,
|
|||||||
const string &interf,
|
const string &interf,
|
||||||
const string &chain,
|
const string &chain,
|
||||||
const string &ruleset,
|
const string &ruleset,
|
||||||
const string &rule_label,
|
const string& ,
|
||||||
const string &prefix)
|
const string &prefix)
|
||||||
{
|
{
|
||||||
string s = prefix;
|
string s = prefix;
|
||||||
@ -1397,19 +1397,19 @@ string PolicyCompiler_ipt::PrintRule::PolicyRuleToString(PolicyRule *rule)
|
|||||||
ref=srcrel->front();
|
ref=srcrel->front();
|
||||||
Address *src=Address::cast(FWReference::cast(ref)->getPointer());
|
Address *src=Address::cast(FWReference::cast(ref)->getPointer());
|
||||||
if(src==NULL)
|
if(src==NULL)
|
||||||
throw FWException(_("Broken SRC in ")+rule->getLabel());
|
throw FWException(string("Broken SRC in ") + rule->getLabel());
|
||||||
|
|
||||||
RuleElementDst *dstrel=rule->getDst();
|
RuleElementDst *dstrel=rule->getDst();
|
||||||
ref=dstrel->front();
|
ref=dstrel->front();
|
||||||
Address *dst=Address::cast(FWReference::cast(ref)->getPointer());
|
Address *dst=Address::cast(FWReference::cast(ref)->getPointer());
|
||||||
if(dst==NULL)
|
if(dst==NULL)
|
||||||
throw FWException(_("Broken DST in ")+rule->getLabel());
|
throw FWException(string("Broken DST in ") + rule->getLabel());
|
||||||
|
|
||||||
RuleElementSrv *srvrel=rule->getSrv();
|
RuleElementSrv *srvrel=rule->getSrv();
|
||||||
ref=srvrel->front();
|
ref=srvrel->front();
|
||||||
Service *srv=Service::cast(FWReference::cast(ref)->getPointer());
|
Service *srv=Service::cast(FWReference::cast(ref)->getPointer());
|
||||||
if(srv==NULL)
|
if(srv==NULL)
|
||||||
throw FWException(_("Broken SRV in ")+rule->getLabel());
|
throw FWException(string("Broken SRV in ") + rule->getLabel());
|
||||||
|
|
||||||
|
|
||||||
std::ostringstream command_line;
|
std::ostringstream command_line;
|
||||||
|
|||||||
@ -2497,10 +2497,10 @@ bool PolicyCompiler_ipt::specialCaseWithFW1::processNext()
|
|||||||
|
|
||||||
// RuleElementSrc *srcrel=rule->getSrc();
|
// RuleElementSrc *srcrel=rule->getSrc();
|
||||||
Address *src =compiler->getFirstSrc(rule);
|
Address *src =compiler->getFirstSrc(rule);
|
||||||
if(src==NULL) throw(_("Broken SRC in rule ")+rule->getLabel());
|
if(src==NULL) throw(string("Broken SRC in rule ") + rule->getLabel());
|
||||||
// RuleElementDst *dstrel=rule->getDst();
|
// RuleElementDst *dstrel=rule->getDst();
|
||||||
Address *dst =compiler->getFirstDst(rule);
|
Address *dst =compiler->getFirstDst(rule);
|
||||||
if(dst==NULL) throw(_("Broken DST in rule ")+rule->getLabel());
|
if(dst==NULL) throw(string("Broken DST in rule ") + rule->getLabel());
|
||||||
|
|
||||||
if (!src->isAny() && !dst->isAny() &&
|
if (!src->isAny() && !dst->isAny() &&
|
||||||
compiler->complexMatch(src,compiler->fw) &&
|
compiler->complexMatch(src,compiler->fw) &&
|
||||||
|
|||||||
@ -263,7 +263,7 @@ string RoutingCompiler_ipt::PrintRule::RoutingRuleToString(RoutingRule *rule)
|
|||||||
ref=dstrel->front();
|
ref=dstrel->front();
|
||||||
Address *dst=Address::cast(FWReference::cast(ref)->getPointer());
|
Address *dst=Address::cast(FWReference::cast(ref)->getPointer());
|
||||||
if(dst==NULL)
|
if(dst==NULL)
|
||||||
throw FWException(_("Broken DST in ")+rule->getLabel());
|
throw FWException(string("Broken DST in ")+rule->getLabel());
|
||||||
|
|
||||||
ostringstream command_line;
|
ostringstream command_line;
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ string RoutingCompiler_ipt::PrintRule::_printRGtw(RoutingRule *rule)
|
|||||||
ref = gtwrel->front();
|
ref = gtwrel->front();
|
||||||
Address *gtw = Address::cast(FWReference::cast(ref)->getPointer());
|
Address *gtw = Address::cast(FWReference::cast(ref)->getPointer());
|
||||||
if(gtw==NULL)
|
if(gtw==NULL)
|
||||||
throw FWException(_("Broken GTW in ")+rule->getLabel());
|
throw FWException(string("Broken GTW in ")+rule->getLabel());
|
||||||
|
|
||||||
string gateway = _printAddr(gtw);
|
string gateway = _printAddr(gtw);
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ string RoutingCompiler_ipt::PrintRule::_printRDst(RoutingRule *rule)
|
|||||||
ref=dstrel->front();
|
ref=dstrel->front();
|
||||||
Address *dst=Address::cast(FWReference::cast(ref)->getPointer());
|
Address *dst=Address::cast(FWReference::cast(ref)->getPointer());
|
||||||
if(dst==NULL)
|
if(dst==NULL)
|
||||||
throw FWException(_("Broken DST in ")+rule->getLabel());
|
throw FWException(string("Broken DST in ")+rule->getLabel());
|
||||||
|
|
||||||
return _printAddr(dst);
|
return _printAddr(dst);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,16 +58,16 @@ class UpgradePredicate: public XMLTools::UpgradePredicate
|
|||||||
public:
|
public:
|
||||||
virtual bool operator()(const string&) const
|
virtual bool operator()(const string&) const
|
||||||
{
|
{
|
||||||
cout << _("Data file has been created in the old version of Firewall Builder. Use fwbuilder GUI to convert it.") << endl;
|
cout << "Data file has been created in the old version of Firewall Builder. Use fwbuilder GUI to convert it." << endl;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void usage(const char *name)
|
void usage(const char *name)
|
||||||
{
|
{
|
||||||
cout << _("Firewall Builder: policy compiler for OpenBSD PF") << endl;
|
cout << "Firewall Builder: policy compiler for OpenBSD PF" << endl;
|
||||||
cout << _("Version ") << VERSION << RELEASE_NUM << endl;
|
cout << "Version " << VERSION << RELEASE_NUM << endl;
|
||||||
cout << _("Usage: ") << name << " [-x] [-v] [-V] [-f filename.xml] [-o output.fw] [-d destdir] [-m] [-4|-6] firewall_object_name" << endl;
|
cout << "Usage: " << name << " [-x] [-v] [-V] [-f filename.xml] [-o output.fw] [-d destdir] [-m] [-4|-6] firewall_object_name" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ int main(int argc, char **argv)
|
|||||||
cerr << ex.what();
|
cerr << ex.what();
|
||||||
return 1;
|
return 1;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
cerr << _("Unsupported exception");
|
cerr << "Unsupported exception";
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -130,7 +130,7 @@ string CompilerDriver_ipfw::run(const std::string &cluster_id,
|
|||||||
oscnf = std::auto_ptr<OSConfigurator>(new OSConfigurator_freebsd(objdb , fw, false));
|
oscnf = std::auto_ptr<OSConfigurator>(new OSConfigurator_freebsd(objdb , fw, false));
|
||||||
|
|
||||||
if (oscnf.get()==NULL)
|
if (oscnf.get()==NULL)
|
||||||
throw FWException(_("Unrecognized host OS ")+fw->getStr("host_OS")+" (family "+family+")");
|
throw FWException("Unrecognized host OS "+fw->getStr("host_OS")+" (family "+family+")");
|
||||||
|
|
||||||
oscnf->prolog();
|
oscnf->prolog();
|
||||||
|
|
||||||
@ -327,12 +327,12 @@ string CompilerDriver_ipfw::run(const std::string &cluster_id,
|
|||||||
|
|
||||||
script << "#!/bin/sh " << shell_dbg << endl << endl;
|
script << "#!/bin/sh " << shell_dbg << endl << endl;
|
||||||
|
|
||||||
script << _("#\n\
|
script << "#\n\
|
||||||
# This is automatically generated file. DO NOT MODIFY !\n\
|
# This is automatically generated file. DO NOT MODIFY !\n\
|
||||||
#\n\
|
#\n\
|
||||||
# Firewall Builder fwb_ipfw v") << VERSION << "-" << RELEASE_NUM << _(" \n\
|
# Firewall Builder fwb_ipfw v" << VERSION << "-" << RELEASE_NUM << " \n\
|
||||||
#\n\
|
#\n\
|
||||||
# Generated ") << timestr << " " << tzname[stm->tm_isdst] << _(" by ")
|
# Generated " << timestr << " " << tzname[stm->tm_isdst] << " by "
|
||||||
<< user_name << "\n#\n";
|
<< user_name << "\n#\n";
|
||||||
|
|
||||||
script << MANIFEST_MARKER << "* " << QFileInfo(fw_file_name).fileName();
|
script << MANIFEST_MARKER << "* " << QFileInfo(fw_file_name).fileName();
|
||||||
|
|||||||
@ -151,7 +151,7 @@ string CompilerDriver_pf::run(const std::string &cluster_id,
|
|||||||
objdb , fw, false));
|
objdb , fw, false));
|
||||||
|
|
||||||
if (oscnf.get()==NULL)
|
if (oscnf.get()==NULL)
|
||||||
throw FWException(_("Unrecognized host OS ") +
|
throw FWException("Unrecognized host OS " +
|
||||||
fw->getStr("host_OS")+" (family "+family+")");
|
fw->getStr("host_OS")+" (family "+family+")");
|
||||||
|
|
||||||
oscnf->prolog();
|
oscnf->prolog();
|
||||||
@ -489,12 +489,12 @@ string CompilerDriver_pf::run(const std::string &cluster_id,
|
|||||||
script << "#!/bin/sh ";
|
script << "#!/bin/sh ";
|
||||||
script << shell_dbg << "\n";
|
script << shell_dbg << "\n";
|
||||||
|
|
||||||
script << _("#\n\
|
script << "#\n\
|
||||||
# This is automatically generated file. DO NOT MODIFY !\n\
|
# This is automatically generated file. DO NOT MODIFY !\n\
|
||||||
#\n\
|
#\n\
|
||||||
# Firewall Builder fwb_pf v") << VERSION << "-" << RELEASE_NUM << _(" \n\
|
# Firewall Builder fwb_pf v" << VERSION << "-" << RELEASE_NUM << " \n\
|
||||||
#\n\
|
#\n\
|
||||||
# Generated ") << timestr << " " << tzname[stm->tm_isdst] << _(" by ")
|
# Generated " << timestr << " " << tzname[stm->tm_isdst] << " by "
|
||||||
<< user_name << "\n#\n";
|
<< user_name << "\n#\n";
|
||||||
|
|
||||||
info("Output file name: " + fw_file_name.toStdString());
|
info("Output file name: " + fw_file_name.toStdString());
|
||||||
@ -541,8 +541,8 @@ string CompilerDriver_pf::run(const std::string &cluster_id,
|
|||||||
script << "\n";
|
script << "\n";
|
||||||
|
|
||||||
script << "log '";
|
script << "log '";
|
||||||
script << _("Activating firewall script generated ")
|
script << "Activating firewall script generated "
|
||||||
<< timestr << " " << _(" by ")
|
<< timestr << " " << " by "
|
||||||
<< user_name;
|
<< user_name;
|
||||||
script << "'" << "\n";
|
script << "'" << "\n";
|
||||||
|
|
||||||
|
|||||||
@ -74,32 +74,32 @@ bool NATCompiler_ipf::VerifyRules::processNext()
|
|||||||
RuleElementTSrv *tsrv=rule->getTSrv(); assert(tsrv);
|
RuleElementTSrv *tsrv=rule->getTSrv(); assert(tsrv);
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::DNAT && odst->size()!=1)
|
if (rule->getRuleType()==NATRule::DNAT && odst->size()!=1)
|
||||||
throw FWException(_("There should be no more than one object in original destination in the rule ")+rule->getLabel());
|
throw FWException("There should be no more than one object in original destination in the rule "+rule->getLabel());
|
||||||
|
|
||||||
// if (rule->getRuleType()==NATRule::SNAT && tsrc->size()!=1)
|
// if (rule->getRuleType()==NATRule::SNAT && tsrc->size()!=1)
|
||||||
// throw FWException(_("There should be no more than one object in translated source in the rule ")+rule->getLabel());
|
// throw FWException("There should be no more than one object in translated source in the rule "+rule->getLabel());
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::DNAT && osrv->isAny())
|
if (rule->getRuleType()==NATRule::DNAT && osrv->isAny())
|
||||||
throw FWException(_("Service must be specified for destination translation rule. Rule ")+rule->getLabel());
|
throw FWException("Service must be specified for destination translation rule. Rule "+rule->getLabel());
|
||||||
|
|
||||||
if (tsrv->size()!=1)
|
if (tsrv->size()!=1)
|
||||||
throw FWException(_("Translated service should be 'Original' or should contain single object. Rule: ")+rule->getLabel());
|
throw FWException("Translated service should be 'Original' or should contain single object. Rule: "+rule->getLabel());
|
||||||
|
|
||||||
FWObject *o=tsrv->front();
|
FWObject *o=tsrv->front();
|
||||||
if (FWReference::cast(o)!=NULL) o=FWReference::cast(o)->getPointer();
|
if (FWReference::cast(o)!=NULL) o=FWReference::cast(o)->getPointer();
|
||||||
|
|
||||||
if ( Group::cast(o)!=NULL)
|
if ( Group::cast(o)!=NULL)
|
||||||
throw FWException(_("Can not use group in translated service. Rule ")+rule->getLabel());
|
throw FWException("Can not use group in translated service. Rule "+rule->getLabel());
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (rule->getRuleType()==NATRule::SNAT )
|
if (rule->getRuleType()==NATRule::SNAT )
|
||||||
{
|
{
|
||||||
if ( tsrc->size()!=1)
|
if ( tsrc->size()!=1)
|
||||||
throw FWException(_("There should be no more than one object in translated source in the rule ")+rule->getLabel());
|
throw FWException("There should be no more than one object in translated source in the rule "+rule->getLabel());
|
||||||
|
|
||||||
// Address* o1=tsrc->getFirst(true);
|
// Address* o1=tsrc->getFirst(true);
|
||||||
// if ( ! tsrc->isAny() && Network::cast(o1)!=NULL)
|
// if ( ! tsrc->isAny() && Network::cast(o1)!=NULL)
|
||||||
// throw FWException(_("Can not use network object in translated source. Rule ")+rule->getLabel());
|
// throw FWException("Can not use network object in translated source. Rule "+rule->getLabel());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ bool NATCompiler_ipf::VerifyRules::processNext()
|
|||||||
Network *a2=Network::cast(compiler->getFirstTSrc(rule));
|
Network *a2=Network::cast(compiler->getFirstTSrc(rule));
|
||||||
if ( a1==NULL || a2==NULL ||
|
if ( a1==NULL || a2==NULL ||
|
||||||
a1->getNetmaskPtr()->getLength()!=a2->getNetmaskPtr()->getLength() )
|
a1->getNetmaskPtr()->getLength()!=a2->getNetmaskPtr()->getLength() )
|
||||||
throw FWException(_("Original and translated source should both be networks of the same size . Rule ")+rule->getLabel());
|
throw FWException("Original and translated source should both be networks of the same size . Rule "+rule->getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::DNetnat && !tsrc->isAny() ) {
|
if (rule->getRuleType()==NATRule::DNetnat && !tsrc->isAny() ) {
|
||||||
@ -116,17 +116,17 @@ bool NATCompiler_ipf::VerifyRules::processNext()
|
|||||||
Network *a2=Network::cast(compiler->getFirstTDst(rule));
|
Network *a2=Network::cast(compiler->getFirstTDst(rule));
|
||||||
if ( a1==NULL || a2==NULL ||
|
if ( a1==NULL || a2==NULL ||
|
||||||
a1->getNetmaskPtr()->getLength()!=a2->getNetmaskPtr()->getLength() )
|
a1->getNetmaskPtr()->getLength()!=a2->getNetmaskPtr()->getLength() )
|
||||||
throw FWException(_("Original and translated destination should both be networks of the same size . Rule ")+rule->getLabel());
|
throw FWException("Original and translated destination should both be networks of the same size . Rule "+rule->getLabel());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (osrc->getNeg() || odst->getNeg() || osrv->getNeg())
|
if (osrc->getNeg() || odst->getNeg() || osrv->getNeg())
|
||||||
throw FWException(_("Negation in NAT rules is not supported. Rule ")+rule->getLabel());
|
throw FWException("Negation in NAT rules is not supported. Rule "+rule->getLabel());
|
||||||
|
|
||||||
// if (rule->getRuleType()==NATRule::NONAT)
|
// if (rule->getRuleType()==NATRule::NONAT)
|
||||||
// throw FWException(_("Unsupported translation. Rule ")+rule->getLabel());
|
// throw FWException("Unsupported translation. Rule "+rule->getLabel());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -302,9 +302,9 @@ bool NATCompiler_ipf::AssignInterface::processNext()
|
|||||||
default: ;
|
default: ;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw FWException(_("Could not assign NAT rule to the interface. Perhaps one of the \n\
|
throw FWException("Could not assign NAT rule to the interface. Perhaps one of the \n\
|
||||||
objects has address which does not belong to any subnet the firewall has interface on. \n\
|
objects has address which does not belong to any subnet the firewall has interface on. \n\
|
||||||
Rule: ")+rule->getLabel());
|
Rule: "+rule->getLabel());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -223,7 +223,7 @@ bool NATCompiler_pf::NATRuleType::processNext()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
compiler->abort(rule, _("Unsupported translation."));
|
compiler->abort(rule, "Unsupported translation.");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -348,59 +348,59 @@ bool NATCompiler_pf::VerifyRules::processNext()
|
|||||||
RuleElementTSrv *tsrv=rule->getTSrv(); assert(tsrv);
|
RuleElementTSrv *tsrv=rule->getTSrv(); assert(tsrv);
|
||||||
|
|
||||||
// if (rule->getRuleType()==NATRule::LB)
|
// if (rule->getRuleType()==NATRule::LB)
|
||||||
// compiler->abort(_("Load balancing rules are not supported. Rule ")+rule->getLabel());
|
// compiler->abort("Load balancing rules are not supported. Rule "+rule->getLabel());
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::DNAT && odst->size()!=1)
|
if (rule->getRuleType()==NATRule::DNAT && odst->size()!=1)
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("There should be no more than one object in original destination"));
|
"There should be no more than one object in original destination");
|
||||||
|
|
||||||
// if (rule->getRuleType()==NATRule::SNAT && tsrc->size()!=1)
|
// if (rule->getRuleType()==NATRule::SNAT && tsrc->size()!=1)
|
||||||
// compiler->abort(_("There should be no more than one object in translated source in the rule ")+rule->getLabel());
|
// compiler->abort("There should be no more than one object in translated source in the rule "+rule->getLabel());
|
||||||
|
|
||||||
if (osrv->getNeg())
|
if (osrv->getNeg())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Negation in original service is not supported."));
|
"Negation in original service is not supported.");
|
||||||
|
|
||||||
/* bug #1276083: "Destination NAT rules". this restriction is not
|
/* bug #1276083: "Destination NAT rules". this restriction is not
|
||||||
* true at least as of OpenBSD 3.5
|
* true at least as of OpenBSD 3.5
|
||||||
*
|
*
|
||||||
if (rule->getRuleType()==NATRule::DNAT && osrv->isAny())
|
if (rule->getRuleType()==NATRule::DNAT && osrv->isAny())
|
||||||
compiler->abort(_("Service must be specified for destination translation rule. Rule ")+rule->getLabel());
|
compiler->abort("Service must be specified for destination translation rule. Rule "+rule->getLabel());
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::DNAT && osrv->isAny() && !tsrv->isAny())
|
if (rule->getRuleType()==NATRule::DNAT && osrv->isAny() && !tsrv->isAny())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Can not translate 'any' into a specific service."));
|
"Can not translate 'any' into a specific service.");
|
||||||
|
|
||||||
if (tsrc->getNeg())
|
if (tsrc->getNeg())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Can not use negation in translated source."));
|
"Can not use negation in translated source.");
|
||||||
|
|
||||||
if (tdst->getNeg())
|
if (tdst->getNeg())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Can not use negation in translated destination."));
|
"Can not use negation in translated destination.");
|
||||||
|
|
||||||
if (tsrv->getNeg())
|
if (tsrv->getNeg())
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Can not use negation in translated service."));
|
"Can not use negation in translated service.");
|
||||||
|
|
||||||
if (tsrv->size()!=1)
|
if (tsrv->size()!=1)
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Translated service should be 'Original' or should contain single object."));
|
"Translated service should be 'Original' or should contain single object.");
|
||||||
|
|
||||||
FWObject *o=tsrv->front();
|
FWObject *o=tsrv->front();
|
||||||
if (FWReference::cast(o)!=NULL) o=FWReference::cast(o)->getPointer();
|
if (FWReference::cast(o)!=NULL) o=FWReference::cast(o)->getPointer();
|
||||||
@ -409,14 +409,14 @@ bool NATCompiler_pf::VerifyRules::processNext()
|
|||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Can not use group in translated service."));
|
"Can not use group in translated service.");
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (rule->getRuleType()==NATRule::SNAT )
|
if (rule->getRuleType()==NATRule::SNAT )
|
||||||
{
|
{
|
||||||
Address* o1=compiler->getFirstTSrc(rule);
|
Address* o1=compiler->getFirstTSrc(rule);
|
||||||
if ( Network::cast(o1)!=NULL || AddressRange::cast(o1)!=NULL )
|
if ( Network::cast(o1)!=NULL || AddressRange::cast(o1)!=NULL )
|
||||||
compiler->abort(_("Can not use network or address range object in translated source. Rule ")+rule->getLabel());
|
compiler->abort("Can not use network or address range object in translated source. Rule "+rule->getLabel());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -441,14 +441,14 @@ bool NATCompiler_pf::VerifyRules::processNext()
|
|||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("There should be no more than one object in translated destination"));
|
"There should be no more than one object in translated destination");
|
||||||
|
|
||||||
Address* o1=compiler->getFirstTDst(rule);
|
Address* o1=compiler->getFirstTDst(rule);
|
||||||
if ( Network::cast(o1)!=NULL || AddressRange::cast(o1)!=NULL )
|
if ( Network::cast(o1)!=NULL || AddressRange::cast(o1)!=NULL )
|
||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Can not use network or address range object in translated destination."));
|
"Can not use network or address range object in translated destination.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ bool NATCompiler_pf::VerifyRules::processNext()
|
|||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Original and translated source should both be networks of the same size."));
|
"Original and translated source should both be networks of the same size.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rule->getRuleType()==NATRule::DNetnat && !tsrc->isAny() )
|
if (rule->getRuleType()==NATRule::DNetnat && !tsrc->isAny() )
|
||||||
@ -473,7 +473,7 @@ bool NATCompiler_pf::VerifyRules::processNext()
|
|||||||
compiler->abort(
|
compiler->abort(
|
||||||
|
|
||||||
rule,
|
rule,
|
||||||
_("Original and translated destination should both be networks of the same size."));
|
"Original and translated destination should both be networks of the same size.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -761,7 +761,7 @@ bool NATCompiler_pf::ReplaceFirewallObjectsTSrc::processNext()
|
|||||||
{
|
{
|
||||||
char errmsg[1024];
|
char errmsg[1024];
|
||||||
sprintf(errmsg,
|
sprintf(errmsg,
|
||||||
_("Could not find suitable interface for the NAT rule %s. Perhaps all interfaces are unnumbered?"),
|
"Could not find suitable interface for the NAT rule %s. Perhaps all interfaces are unnumbered?",
|
||||||
rule->getLabel().c_str() );
|
rule->getLabel().c_str() );
|
||||||
compiler->abort(rule, errmsg);
|
compiler->abort(rule, errmsg);
|
||||||
}
|
}
|
||||||
@ -811,7 +811,7 @@ bool NATCompiler_pf::ReplaceObjectsTDst::processNext()
|
|||||||
if (loopback_address==NULL)
|
if (loopback_address==NULL)
|
||||||
{
|
{
|
||||||
char errstr[1024];
|
char errstr[1024];
|
||||||
sprintf(errstr, _("Can not configure redirection NAT rule %s because loopback interface is missing.") ,
|
sprintf(errstr, "Can not configure redirection NAT rule %s because loopback interface is missing." ,
|
||||||
rule->getLabel().c_str() );
|
rule->getLabel().c_str() );
|
||||||
compiler->abort(rule, errstr);
|
compiler->abort(rule, errstr);
|
||||||
}
|
}
|
||||||
@ -992,7 +992,7 @@ void NATCompiler_pf::checkForDynamicInterfacesOfOtherObjects::findDynamicInterfa
|
|||||||
{
|
{
|
||||||
char errstr[2048];
|
char errstr[2048];
|
||||||
sprintf(errstr,
|
sprintf(errstr,
|
||||||
_("Can not build rule using dynamic interface '%s' of the object '%s' because its address in unknown."),
|
"Can not build rule using dynamic interface '%s' of the object '%s' because its address in unknown.",
|
||||||
ifs->getName().c_str(),
|
ifs->getName().c_str(),
|
||||||
ifs->getParent()->getName().c_str());
|
ifs->getParent()->getName().c_str());
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ void OSConfigurator_bsd::addVirtualAddressForNAT(const Address *addr)
|
|||||||
|
|
||||||
virtual_addresses.push_back(*(addr->getAddressPtr()));
|
virtual_addresses.push_back(*(addr->getAddressPtr()));
|
||||||
} else
|
} else
|
||||||
warning(_("Can not add virtual address ") +
|
warning("Can not add virtual address " +
|
||||||
addr->getAddressPtr()->toString() );
|
addr->getAddressPtr()->toString() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -66,7 +66,7 @@ void OSConfigurator_freebsd::processFirewallOptions()
|
|||||||
s=options->getStr("freebsd_ip_sourceroute");
|
s=options->getStr("freebsd_ip_sourceroute");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter freebsd_ip_sourceroute: '")+s+"'");
|
throw FWException("Illegal value for OS parameter freebsd_ip_sourceroute: '"+s+"'");
|
||||||
|
|
||||||
output << "$SYSCTL -w net.inet.ip.sourceroute=" << s << endl;
|
output << "$SYSCTL -w net.inet.ip.sourceroute=" << s << endl;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ void OSConfigurator_freebsd::processFirewallOptions()
|
|||||||
s=options->getStr("freebsd_ip_redirect");
|
s=options->getStr("freebsd_ip_redirect");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter freebsd_ip_redirect: '")+s+"'");
|
throw FWException("Illegal value for OS parameter freebsd_ip_redirect: '"+s+"'");
|
||||||
|
|
||||||
output << "$SYSCTL -w net.inet.ip.redirect=" << s << endl;
|
output << "$SYSCTL -w net.inet.ip.redirect=" << s << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ void OSConfigurator_macosx::processFirewallOptions()
|
|||||||
s=options->getStr("macosx_ip_sourceroute");
|
s=options->getStr("macosx_ip_sourceroute");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter macosx_ip_sourceroute: '")+s+"'");
|
throw FWException("Illegal value for OS parameter macosx_ip_sourceroute: '"+s+"'");
|
||||||
|
|
||||||
output << "$SYSCTL -w net.inet.ip.sourceroute=" << s << endl;
|
output << "$SYSCTL -w net.inet.ip.sourceroute=" << s << endl;
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ void OSConfigurator_macosx::processFirewallOptions()
|
|||||||
s=options->getStr("macosx_ip_redirect");
|
s=options->getStr("macosx_ip_redirect");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter macosx_ip_redirect: '")+s+"'");
|
throw FWException("Illegal value for OS parameter macosx_ip_redirect: '"+s+"'");
|
||||||
|
|
||||||
output << "$SYSCTL -w net.inet.ip.redirect=" << s << endl;
|
output << "$SYSCTL -w net.inet.ip.redirect=" << s << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ void OSConfigurator_openbsd::processFirewallOptions()
|
|||||||
s=options->getStr("openbsd_ip_directed_broadcast");
|
s=options->getStr("openbsd_ip_directed_broadcast");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter openbsd_ip_directed_broadcast: '")+s+"'");
|
throw FWException("Illegal value for OS parameter openbsd_ip_directed_broadcast: '"+s+"'");
|
||||||
|
|
||||||
output << "$SYSCTL -w net.inet.ip.directed-broadcast=" << s << endl;
|
output << "$SYSCTL -w net.inet.ip.directed-broadcast=" << s << endl;
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ void OSConfigurator_openbsd::processFirewallOptions()
|
|||||||
s=options->getStr("openbsd_ip_sourceroute");
|
s=options->getStr("openbsd_ip_sourceroute");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter openbsd_ip_sourceroute: '")+s+"'");
|
throw FWException("Illegal value for OS parameter openbsd_ip_sourceroute: '"+s+"'");
|
||||||
|
|
||||||
output << "$SYSCTL -w net.inet.ip.sourceroute=" << s << endl;
|
output << "$SYSCTL -w net.inet.ip.sourceroute=" << s << endl;
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ void OSConfigurator_openbsd::processFirewallOptions()
|
|||||||
s=options->getStr("openbsd_ip_redirect");
|
s=options->getStr("openbsd_ip_redirect");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter openbsd_ip_redirect: '")+s+"'");
|
throw FWException("Illegal value for OS parameter openbsd_ip_redirect: '"+s+"'");
|
||||||
|
|
||||||
output << "$SYSCTL -w net.inet.ip.redirect=" << s << endl;
|
output << "$SYSCTL -w net.inet.ip.redirect=" << s << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ void OSConfigurator_solaris::processFirewallOptions()
|
|||||||
s=options->getStr("solaris_ip_ignore_redirect");
|
s=options->getStr("solaris_ip_ignore_redirect");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter solaris_ip_ignore_redirect: '")+s+"'");
|
throw FWException("Illegal value for OS parameter solaris_ip_ignore_redirect: '"+s+"'");
|
||||||
|
|
||||||
output << "ndd -set /dev/ip ip_ignore_redirect " << s << endl;
|
output << "ndd -set /dev/ip ip_ignore_redirect " << s << endl;
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ void OSConfigurator_solaris::processFirewallOptions()
|
|||||||
s=options->getStr("solaris_ip_respond_to_echo_broadcast");
|
s=options->getStr("solaris_ip_respond_to_echo_broadcast");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter solaris_ip_respond_to_echo_broadcast: '")+s+"'");
|
throw FWException("Illegal value for OS parameter solaris_ip_respond_to_echo_broadcast: '"+s+"'");
|
||||||
|
|
||||||
output << "ndd -set /dev/ip ip_respond_to_echo_broadcast " << s << endl;
|
output << "ndd -set /dev/ip ip_respond_to_echo_broadcast " << s << endl;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ void OSConfigurator_solaris::processFirewallOptions()
|
|||||||
s=options->getStr("solaris_ip_forward_directed_broadcasts");
|
s=options->getStr("solaris_ip_forward_directed_broadcasts");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter solaris_ip_forward_directed_broadcasts: '")+s+"'");
|
throw FWException("Illegal value for OS parameter solaris_ip_forward_directed_broadcasts: '"+s+"'");
|
||||||
|
|
||||||
output << "ndd -set /dev/ip ip_forward_directed_broadcasts " << s << endl;
|
output << "ndd -set /dev/ip ip_forward_directed_broadcasts " << s << endl;
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ void OSConfigurator_solaris::processFirewallOptions()
|
|||||||
s=options->getStr("solaris_ip_forward_src_routed");
|
s=options->getStr("solaris_ip_forward_src_routed");
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (s!="0" && s!="1")
|
if (s!="0" && s!="1")
|
||||||
throw FWException(_("Illegal value for OS parameter solaris_ip_forward_src_routed: '")+s+"'");
|
throw FWException("Illegal value for OS parameter solaris_ip_forward_src_routed: '"+s+"'");
|
||||||
|
|
||||||
output << "ndd -set /dev/ip ip_forward_src_routed " << s << endl;
|
output << "ndd -set /dev/ip ip_forward_src_routed " << s << endl;
|
||||||
}
|
}
|
||||||
@ -113,7 +113,7 @@ void OSConfigurator_solaris::addVirtualAddressForNAT(const Address *addr)
|
|||||||
|
|
||||||
virtual_addresses.push_back(*(addr->getAddressPtr()));
|
virtual_addresses.push_back(*(addr->getAddressPtr()));
|
||||||
} else
|
} else
|
||||||
warning(_("Can not add virtual address ") +
|
warning("Can not add virtual address " +
|
||||||
addr->getAddressPtr()->toString() );
|
addr->getAddressPtr()->toString() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -203,7 +203,7 @@ bool PolicyCompiler_ipf::doSrvNegation::processNext()
|
|||||||
RuleElementSrv *srv=rule->getSrv();
|
RuleElementSrv *srv=rule->getSrv();
|
||||||
|
|
||||||
if (srv->getNeg()) {
|
if (srv->getNeg()) {
|
||||||
throw FWException(_("Negation in Srv is not implemented. Rule: ")+rule->getLabel());
|
throw FWException("Negation in Srv is not implemented. Rule: "+rule->getLabel());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tmp_queue.push_back(rule);
|
tmp_queue.push_back(rule);
|
||||||
|
|||||||
@ -235,7 +235,7 @@ bool PolicyCompiler_ipfw::doSrvNegation::processNext()
|
|||||||
RuleElementSrv *srv=rule->getSrv();
|
RuleElementSrv *srv=rule->getSrv();
|
||||||
|
|
||||||
if (srv->getNeg()) {
|
if (srv->getNeg()) {
|
||||||
throw FWException(_("Negation in Srv is not implemented. Rule: ")+rule->getLabel());
|
throw FWException("Negation in Srv is not implemented. Rule: "+rule->getLabel());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tmp_queue.push_back(rule);
|
tmp_queue.push_back(rule);
|
||||||
|
|||||||
@ -59,7 +59,7 @@ string PolicyCompiler_pf::myPlatformName() { return "pf"; }
|
|||||||
int PolicyCompiler_pf::prolog()
|
int PolicyCompiler_pf::prolog()
|
||||||
{
|
{
|
||||||
if (fw->getStr("platform")!=myPlatformName() )
|
if (fw->getStr("platform")!=myPlatformName() )
|
||||||
abort(_("Unsupported platform ") + fw->getStr("platform") );
|
abort("Unsupported platform " + fw->getStr("platform") );
|
||||||
|
|
||||||
list<FWObject*> l2=fw->getByType(Interface::TYPENAME);
|
list<FWObject*> l2=fw->getByType(Interface::TYPENAME);
|
||||||
for (list<FWObject*>::iterator i=l2.begin(); i!=l2.end(); ++i)
|
for (list<FWObject*>::iterator i=l2.begin(); i!=l2.end(); ++i)
|
||||||
@ -74,7 +74,7 @@ int PolicyCompiler_pf::prolog()
|
|||||||
{
|
{
|
||||||
char errstr[256];
|
char errstr[256];
|
||||||
sprintf(errstr,
|
sprintf(errstr,
|
||||||
_("Dynamic interface %s should not have an IP address object attached to it. This IP address object will be ignored."),
|
"Dynamic interface %s should not have an IP address object attached to it. This IP address object will be ignored.",
|
||||||
iface->getName().c_str() );
|
iface->getName().c_str() );
|
||||||
warning(errstr );
|
warning(errstr );
|
||||||
for (list<FWObject*>::iterator j=l3.begin(); j!=l3.end(); ++j)
|
for (list<FWObject*>::iterator j=l3.begin(); j!=l3.end(); ++j)
|
||||||
@ -263,7 +263,7 @@ bool PolicyCompiler_pf::splitIfFirewallInSrc::processNext()
|
|||||||
FWObject *obj = NULL;
|
FWObject *obj = NULL;
|
||||||
// if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
// if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
||||||
if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
||||||
if (obj==NULL) throw FWException(_("Broken Src object in rule: ")+rule->getLabel());
|
if (obj==NULL) throw FWException("Broken Src object in rule: "+rule->getLabel());
|
||||||
|
|
||||||
if (obj->getId()==compiler->getFwId()) {
|
if (obj->getId()==compiler->getFwId()) {
|
||||||
fw_in_src=o; // can not remove right now because remove invalidates iterator
|
fw_in_src=o; // can not remove right now because remove invalidates iterator
|
||||||
@ -308,7 +308,7 @@ bool PolicyCompiler_pf::splitIfFirewallInDst::processNext()
|
|||||||
FWObject *obj = NULL;
|
FWObject *obj = NULL;
|
||||||
// if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
// if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
||||||
if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
if (FWReference::cast(o)!=NULL) obj=FWReference::cast(o)->getPointer();
|
||||||
if (obj==NULL) throw FWException(_("Broken Dst in rule: ")+rule->getLabel());
|
if (obj==NULL) throw FWException("Broken Dst in rule: "+rule->getLabel());
|
||||||
|
|
||||||
if (obj->getId()==compiler->getFwId()) {
|
if (obj->getId()==compiler->getFwId()) {
|
||||||
fw_in_dst=o; // can not remove right now because remove invalidates iterator
|
fw_in_dst=o; // can not remove right now because remove invalidates iterator
|
||||||
@ -440,7 +440,7 @@ void PolicyCompiler_pf::addDefaultPolicyRule()
|
|||||||
{
|
{
|
||||||
char errstr[256];
|
char errstr[256];
|
||||||
sprintf(errstr,
|
sprintf(errstr,
|
||||||
_("Invalid address for the backup ssh access: '%s'"),
|
"Invalid address for the backup ssh access: '%s'",
|
||||||
mgmt_addr.c_str());
|
mgmt_addr.c_str());
|
||||||
abort(errstr);
|
abort(errstr);
|
||||||
}
|
}
|
||||||
@ -562,7 +562,7 @@ bool PolicyCompiler_pf::ProcessScrubOption::processNext()
|
|||||||
ruleopt->setBool("scrub",false);
|
ruleopt->setBool("scrub",false);
|
||||||
tmp_queue.push_back(rule);
|
tmp_queue.push_back(rule);
|
||||||
|
|
||||||
throw FWException(_("Rule option 'scrub' is supported only for rules with action 'Accept'. Rule: ")+rule->getLabel());
|
throw FWException("Rule option 'scrub' is supported only for rules with action 'Accept'. Rule: "+rule->getLabel());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -701,7 +701,7 @@ bool PolicyCompiler_pf::doSrvNegation::processNext()
|
|||||||
RuleElementSrv *srv=rule->getSrv();
|
RuleElementSrv *srv=rule->getSrv();
|
||||||
|
|
||||||
if (srv->getNeg()) {
|
if (srv->getNeg()) {
|
||||||
throw FWException(_("Negation in Srv is not implemented. Rule: ")+rule->getLabel());
|
throw FWException("Negation in Srv is not implemented. Rule: "+rule->getLabel());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
tmp_queue.push_back(rule);
|
tmp_queue.push_back(rule);
|
||||||
@ -790,7 +790,7 @@ void PolicyCompiler_pf::checkForDynamicInterfacesOfOtherObjects::findDynamicInte
|
|||||||
! ifs->getParent()->getBool("pf_table") )
|
! ifs->getParent()->getBool("pf_table") )
|
||||||
{
|
{
|
||||||
char errstr[2048];
|
char errstr[2048];
|
||||||
sprintf(errstr,_("Can not build rule using dynamic interface '%s' of the object '%s' because its address in unknown. Rule %s"),
|
sprintf(errstr,"Can not build rule using dynamic interface '%s' of the object '%s' because its address in unknown. Rule %s",
|
||||||
ifs->getName().c_str(),
|
ifs->getName().c_str(),
|
||||||
ifs->getParent()->getName().c_str(),
|
ifs->getParent()->getName().c_str(),
|
||||||
rule->getLabel().c_str() );
|
rule->getLabel().c_str() );
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user