mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-03-21 18:57:14 +01:00
see #2367 using QComboBox to choose between "none", "queue" and "pipe" for ipfw classification
This commit is contained in:
parent
7feb2f4731
commit
3c276bc40b
@ -103,6 +103,7 @@ void RuleOptionsDialog::loadFWObject(FWObject *o)
|
||||
// build a map for combobox so visible combobox items can be localized
|
||||
QStringList route_options = getRouteOptions_pf_ipf(platform);
|
||||
QStringList route_load_options = getRouteLoadOptions_pf(platform);
|
||||
QStringList classify_options_ipfw = getClassifyOptions_ipfw(platform);
|
||||
|
||||
Rule *rule = dynamic_cast<Rule*>(o);
|
||||
FWOptions *ropt = rule->getOptionsObject();
|
||||
@ -241,9 +242,10 @@ void RuleOptionsDialog::loadFWObject(FWObject *o)
|
||||
data.registerOption(m_dialog->ipf_keep_frags, ropt, "ipf_keep_frags");
|
||||
|
||||
// Route
|
||||
data.registerOption(m_dialog->ipf_route_option, ropt, "ipf_route_option",
|
||||
route_options);
|
||||
data.registerOption(m_dialog->ipf_route_opt_if, ropt, "ipf_route_opt_if");
|
||||
data.registerOption(m_dialog->ipf_route_option, ropt,
|
||||
"ipf_route_option", route_options);
|
||||
data.registerOption(m_dialog->ipf_route_opt_if, ropt,
|
||||
"ipf_route_opt_if");
|
||||
data.registerOption(m_dialog->ipf_route_opt_addr, ropt,
|
||||
"ipf_route_opt_addr");
|
||||
}
|
||||
@ -292,6 +294,12 @@ void RuleOptionsDialog::loadFWObject(FWObject *o)
|
||||
data.registerOption(m_dialog->pf_synproxy, ropt,
|
||||
"pf_synproxy");
|
||||
|
||||
// Tag
|
||||
FWObject *o = policy_rule->getTagObject();
|
||||
m_dialog->pfTagDropArea->setObject(o);
|
||||
m_dialog->pfTagDropArea->update();
|
||||
|
||||
// Classify
|
||||
data.registerOption(m_dialog->pf_classify_str, ropt, "pf_classify_str");
|
||||
|
||||
// Route
|
||||
@ -302,27 +310,17 @@ void RuleOptionsDialog::loadFWObject(FWObject *o)
|
||||
route_options);
|
||||
data.registerOption(m_dialog->pf_route_opt_if, ropt, "pf_route_opt_if");
|
||||
data.registerOption(m_dialog->pf_route_opt_addr, ropt, "pf_route_opt_addr");
|
||||
|
||||
FWObject *o = policy_rule->getTagObject();
|
||||
m_dialog->pfTagDropArea->setObject(o);
|
||||
m_dialog->pfTagDropArea->update();
|
||||
}
|
||||
|
||||
if (platform=="ipfw")
|
||||
{
|
||||
data.registerOption(m_dialog->ipfw_stateless, ropt,"stateless");
|
||||
data.registerOption(m_dialog->usePortNum, ropt, "ipfw_pipe_queue_num");
|
||||
data.registerOption(m_dialog->ipfw_stateless, ropt, "stateless");
|
||||
|
||||
/* #2367 */
|
||||
|
||||
data.registerOption(m_dialog->ipfw_classify, ropt, "classification");
|
||||
|
||||
if (ropt->getInt("ipfw_classify_method") == DUMMYNETPIPE)
|
||||
{
|
||||
m_dialog->useDummyNetPipe->setChecked(1);
|
||||
} else {
|
||||
m_dialog->useDummyNetQueue->setChecked(1);
|
||||
}
|
||||
// Classify
|
||||
data.registerOption(m_dialog->ipfw_classify_method, ropt,
|
||||
"ipfw_classify_method", classify_options_ipfw);
|
||||
data.registerOption(m_dialog->usePortNum, ropt, "ipfw_pipe_queue_num");
|
||||
}
|
||||
|
||||
if (platform=="iosacl" || platform=="procurve_acl")
|
||||
@ -446,29 +444,24 @@ void RuleOptionsDialog::applyChanges()
|
||||
policy_rule->setTagObject(tag_object);
|
||||
|
||||
policy_rule->setClassification(
|
||||
! ropt->getStr("pf_classify_str").empty());
|
||||
! new_rule_options->getStr("pf_classify_str").empty());
|
||||
|
||||
policy_rule->setRouting(
|
||||
! ropt->getStr("pf_route_option").empty() &&
|
||||
ropt->getStr("pf_route_option") != "none");
|
||||
! new_rule_options->getStr("pf_route_option").empty() &&
|
||||
new_rule_options->getStr("pf_route_option") != "none");
|
||||
}
|
||||
|
||||
if (platform=="ipf")
|
||||
{
|
||||
policy_rule->setRouting(
|
||||
! ropt->getStr("ipf_route_option").empty() &&
|
||||
ropt->getStr("ipf_route_option") != "none");
|
||||
! new_rule_options->getStr("ipf_route_option").empty() &&
|
||||
new_rule_options->getStr("ipf_route_option") != "none");
|
||||
}
|
||||
|
||||
if (platform=="ipfw")
|
||||
{
|
||||
// rule option "classification" is set via checkbox and was
|
||||
// set by the call to data.saveAll() above
|
||||
|
||||
if (m_dialog->useDummyNetPipe->isChecked())
|
||||
new_rule_options->setInt("ipfw_classify_method", DUMMYNETPIPE);
|
||||
else
|
||||
new_rule_options->setInt("ipfw_classify_method", DUMMYNETQUEUE);
|
||||
policy_rule->setClassification(
|
||||
new_rule_options->getInt("ipfw_classify_method") > -1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -63,6 +63,7 @@ QStringList actionsOnReject;
|
||||
QStringList routeOptions_pf_ipf;
|
||||
QStringList routeLoadOptions_pf;
|
||||
QStringList limitSuffixes;
|
||||
QStringList classifyOptions_ipfw;
|
||||
|
||||
void init_platforms()
|
||||
{
|
||||
@ -166,6 +167,13 @@ void init_platforms()
|
||||
routeLoadOptions_pf.push_back(QObject::tr("Round Robin"));
|
||||
routeLoadOptions_pf.push_back("round_robin");
|
||||
|
||||
classifyOptions_ipfw.push_back(QObject::tr("None"));
|
||||
classifyOptions_ipfw.push_back("-1");
|
||||
classifyOptions_ipfw.push_back(QObject::tr("dummynet(4) 'pipe'"));
|
||||
classifyOptions_ipfw.push_back("1");
|
||||
classifyOptions_ipfw.push_back(QObject::tr("dummynet(4) 'queue'"));
|
||||
classifyOptions_ipfw.push_back("2");
|
||||
|
||||
limitSuffixes.push_back("");
|
||||
limitSuffixes.push_back("");
|
||||
limitSuffixes.push_back(QObject::tr("/day"));
|
||||
@ -673,6 +681,11 @@ const QStringList& getRouteLoadOptions_pf(const QString&)
|
||||
return routeLoadOptions_pf;
|
||||
}
|
||||
|
||||
const QStringList& getClassifyOptions_ipfw(const QString&)
|
||||
{
|
||||
return classifyOptions_ipfw;
|
||||
}
|
||||
|
||||
const QStringList& getLimitSuffixes(const QString&)
|
||||
{
|
||||
return limitSuffixes;
|
||||
|
||||
@ -139,6 +139,8 @@ const QStringList& getRouteOptions_pf_ipf(const QString &platform);
|
||||
|
||||
const QStringList& getRouteLoadOptions_pf(const QString &platform);
|
||||
|
||||
const QStringList& getClassifyOptions_ipfw(const QString &platform);
|
||||
|
||||
/**
|
||||
* returns a list of Limit Suffixes (mapping list)
|
||||
*/
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1412</width>
|
||||
<height>332</height>
|
||||
<width>1580</width>
|
||||
<height>357</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -41,7 +41,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="ipt">
|
||||
<layout class="QGridLayout">
|
||||
@ -1635,7 +1635,7 @@
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab12">
|
||||
<attribute name="title">
|
||||
@ -2480,7 +2480,7 @@
|
||||
<enum>QTabWidget::Triangular</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_7">
|
||||
<attribute name="title">
|
||||
@ -2556,13 +2556,6 @@
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_19">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="ipfw_classify">
|
||||
<property name="text">
|
||||
<string>Classify packets</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QLabel" name="textLabel1_9">
|
||||
<property name="text">
|
||||
<string>Packet classification can be implemented in different ways:</string>
|
||||
@ -2575,27 +2568,32 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="buttonGroup1">
|
||||
<property name="title">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_17">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<widget class="QRadioButton" name="useDummyNetPipe">
|
||||
<property name="text">
|
||||
<string>use dummynet(4) 'pipe'</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" colspan="2">
|
||||
<widget class="QRadioButton" name="useDummyNetQueue">
|
||||
<property name="text">
|
||||
<string>use dummynet(4) 'queue'</string>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QComboBox" name="ipfw_classify_method">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>None</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>dummynet(4) 'pipe'</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>dummynet(4) 'queue'</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@ -2608,7 +2606,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="usePortNum">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@ -2621,7 +2619,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer_15">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -2637,7 +2635,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<item row="1" column="1">
|
||||
<spacer name="horizontalSpacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
@ -2650,7 +2648,7 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="2" column="0">
|
||||
<spacer name="spacer_11">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@ -3013,9 +3011,6 @@
|
||||
<tabstop>pf_fastroute</tabstop>
|
||||
<tabstop>pf_route_load_option</tabstop>
|
||||
<tabstop>ipfw_stateless</tabstop>
|
||||
<tabstop>ipfw_classify</tabstop>
|
||||
<tabstop>useDummyNetPipe</tabstop>
|
||||
<tabstop>useDummyNetQueue</tabstop>
|
||||
<tabstop>usePortNum</tabstop>
|
||||
<tabstop>pix_disable_rule_log</tabstop>
|
||||
<tabstop>pix_logLevel</tabstop>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user