mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-23 11:47:24 +01:00
support for the "new" module "time" in iptables
This commit is contained in:
parent
ca3511a8e7
commit
3315c64c35
@ -1,3 +1,6 @@
|
||||
2008-06-10 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
* PolicyCompiler_PrintRule.cpp (PrintRule::_printTimeInterval):
|
||||
|
||||
2008-06-08 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
@ -61,11 +64,12 @@
|
||||
|
||||
* PolicyCompiler_PrintRule.cpp (PrintRule::_printTimeInterval):
|
||||
Support for --weekdays parameter in iptables 1.4.0 module "time".
|
||||
Per bug #1914371: "iptables 1.4.0"
|
||||
Per bugs #1914371: "iptables 1.4.0", #1806045: "latest 1.3.8
|
||||
time match changed", #853364: "Time Restriction feature request".
|
||||
|
||||
* platforms.cpp (list): Added iptables version 1.4.0 to the list.
|
||||
Will use it for the "new" time module support. Bug #1914371:
|
||||
"iptables 1.4.0"
|
||||
Will use it for the "new" time module support. Bugs #1914371:
|
||||
"iptables 1.4.0" and #1806045: "latest 1.3.8 time match changed"
|
||||
|
||||
2008-05-30 Vadim Kurland <vadim@vk.crocodile.org>
|
||||
|
||||
|
||||
@ -252,25 +252,6 @@ void TimeDialog::applyChanges()
|
||||
obj->setInt( "from_minute" , m_dialog->startTime->time().minute());
|
||||
obj->setInt( "from_hour" , m_dialog->startTime->time().hour() );
|
||||
|
||||
QString sFromWeekday ;
|
||||
if (m_dialog->cbStart7_2->checkState ()==Qt::Checked)
|
||||
sFromWeekday+="0,";
|
||||
if (m_dialog->cbStart1_2->checkState ()==Qt::Checked)
|
||||
sFromWeekday+="1,";
|
||||
if (m_dialog->cbStart2_2->checkState ()==Qt::Checked)
|
||||
sFromWeekday+="2,";
|
||||
if (m_dialog->cbStart3_2->checkState ()==Qt::Checked)
|
||||
sFromWeekday+="3,";
|
||||
if (m_dialog->cbStart4_2->checkState ()==Qt::Checked)
|
||||
sFromWeekday+="4,";
|
||||
if (m_dialog->cbStart5_2->checkState ()==Qt::Checked)
|
||||
sFromWeekday+="5,";
|
||||
if (m_dialog->cbStart6_2->checkState ()==Qt::Checked)
|
||||
sFromWeekday+="6,";
|
||||
if (sFromWeekday.length()>0)
|
||||
sFromWeekday.remove(sFromWeekday.length()-1,0);
|
||||
|
||||
s->setDaysOfWeek(sFromWeekday.toAscii().data());
|
||||
if (m_dialog->useEndDate->isChecked())
|
||||
{
|
||||
obj->setInt( "to_day" , m_dialog->endDate->date().day() );
|
||||
@ -285,7 +266,25 @@ void TimeDialog::applyChanges()
|
||||
obj->setInt( "to_minute" , m_dialog->endTime->time().minute() );
|
||||
obj->setInt( "to_hour" , m_dialog->endTime->time().hour() );
|
||||
|
||||
mw->updateObjName(obj,QString::fromUtf8(oldname.c_str()));
|
||||
QStringList weekDays ;
|
||||
if (m_dialog->cbStart7_2->checkState ()==Qt::Checked)
|
||||
weekDays.append("0");
|
||||
if (m_dialog->cbStart1_2->checkState ()==Qt::Checked)
|
||||
weekDays.append("1");
|
||||
if (m_dialog->cbStart2_2->checkState ()==Qt::Checked)
|
||||
weekDays.append("2");
|
||||
if (m_dialog->cbStart3_2->checkState ()==Qt::Checked)
|
||||
weekDays.append("3");
|
||||
if (m_dialog->cbStart4_2->checkState ()==Qt::Checked)
|
||||
weekDays.append("4");
|
||||
if (m_dialog->cbStart5_2->checkState ()==Qt::Checked)
|
||||
weekDays.append("5");
|
||||
if (m_dialog->cbStart6_2->checkState ()==Qt::Checked)
|
||||
weekDays.append("6");
|
||||
|
||||
s->setDaysOfWeek(weekDays.join(",").toAscii().data());
|
||||
|
||||
mw->updateObjName(obj, QString::fromUtf8(oldname.c_str()));
|
||||
|
||||
//apply->setEnabled( false );
|
||||
mw->updateLastModifiedTimestampForAllFirewalls(obj);
|
||||
|
||||
@ -1016,6 +1016,8 @@ string PolicyCompiler_ipt::PrintRule::_printTimeInterval(PolicyRule *r)
|
||||
if (version == "1.4.0")
|
||||
{
|
||||
// in 1.4.0 date format has changed, it is now ISO 8601
|
||||
// http://www.w3.org/TR/NOTE-datetime
|
||||
|
||||
if (sday>0 && smonth>0 && syear>0)
|
||||
{
|
||||
ostr << "--datestart "
|
||||
@ -1023,7 +1025,7 @@ string PolicyCompiler_ipt::PrintRule::_printTimeInterval(PolicyRule *r)
|
||||
<< setw(2) << setfill('0') << smonth << "-"
|
||||
<< setw(2) << setfill('0') << sday << "T"
|
||||
<< setw(2) << setfill('0') << shour << ":"
|
||||
<< setw(2) << setfill('0') << smin << ":00 ";
|
||||
<< setw(2) << setfill('0') << smin << ":00Z ";
|
||||
use_timestart_timestop = false;
|
||||
}
|
||||
|
||||
@ -1034,11 +1036,10 @@ string PolicyCompiler_ipt::PrintRule::_printTimeInterval(PolicyRule *r)
|
||||
<< setw(2) << setfill('0') << smonth << "-"
|
||||
<< setw(2) << setfill('0') << sday << "T"
|
||||
<< setw(2) << setfill('0') << ehour << ":"
|
||||
<< setw(2) << setfill('0') << emin << ":00 ";
|
||||
<< setw(2) << setfill('0') << emin << ":00Z ";
|
||||
use_timestart_timestop = false;
|
||||
}
|
||||
|
||||
|
||||
if (use_timestart_timestop )
|
||||
{
|
||||
ostr << " --timestart "
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user