summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2011-02-14 22:27:46 +0100
committerSeth Mos <seth.mos@dds.nl>2011-02-14 22:27:46 +0100
commitbd40781aaa7aa947e924f21e2845d87be5993bbd (patch)
treecef2222d56ce8069ba83c078f662d7a3fdab8274 /etc
parentac5eb23ba8f9005a2e76015e6f9e41a437127e14 (diff)
downloadpfsense-bd40781aaa7aa947e924f21e2845d87be5993bbd.zip
pfsense-bd40781aaa7aa947e924f21e2845d87be5993bbd.tar.gz
add a ipprotocol variable to the easy add rules
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/easyrule.inc14
1 files changed, 8 insertions, 6 deletions
diff --git a/etc/inc/easyrule.inc b/etc/inc/easyrule.inc
index b5b1620..45d3f74 100644
--- a/etc/inc/easyrule.inc
+++ b/etc/inc/easyrule.inc
@@ -46,7 +46,7 @@ function easyrule_find_rule_interface($int) {
if ($config['pptpd']['mode'] == "server")
$iflist['pptp'] = "PPTP VPN";
- if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
+ if ($config['pppoe']['mode'] == "server")
$iflist['pppoe'] = "PPPoE VPN";
if ($config['l2tp']['mode'] == "server")
@@ -229,7 +229,7 @@ function easyrule_block_host_add($host, $int = 'wan') {
}
}
-function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport) {
+function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport, $ipproto) {
global $config;
/* No rules, start a new array */
@@ -244,6 +244,7 @@ function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport) {
$filterent = array();
$filterent['type'] = 'pass';
$filterent['interface'] = $int;
+ $filterent['ipprotocol'] = $ipproto;
$filterent['descr'] = "Easy Rule: Passed from Firewall Log View";
if ($proto != "any")
@@ -271,7 +272,8 @@ function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport) {
}
}
-function easyrule_parse_block($int, $src) {
+function easyrule_parse_block($int, $src, $ipproto) {
+ $filterent['ipprotocol'] = $ipproto;
if (!empty($src) && !empty($int)) {
if (!is_ipaddr($src)) {
return "Tried to block invalid IP: " . htmlspecialchars($src);
@@ -290,7 +292,7 @@ function easyrule_parse_block($int, $src) {
}
return "Unknown block error.";
}
-function easyrule_parse_pass($int, $proto, $src, $dst, $dstport = 0) {
+function easyrule_parse_pass($int, $proto, $src, $dst, $dstport = 0, $ipproto = inet) {
/* Check for valid int, srchost, dsthost, dstport, and proto */
global $protocols_with_ports;
@@ -319,7 +321,7 @@ function easyrule_parse_pass($int, $proto, $src, $dst, $dstport = 0) {
$dstport = 0;
}
/* Should have valid input... */
- if (easyrule_pass_rule_add($int, $proto, $src, $dst, $dstport)) {
+ if (easyrule_pass_rule_add($int, $proto, $src, $dst, $dstport, $ipproto)) {
return "Successfully added pass rule!";
} else {
return "Failed to add pass rule.";
@@ -330,4 +332,4 @@ function easyrule_parse_pass($int, $proto, $src, $dst, $dstport = 0) {
return "Unknown pass error.";
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud