diff options
author | Marcello Coutinho <marcellocoutinho@gmail.com> | 2011-12-19 03:28:38 -0200 |
---|---|---|
committer | marcelloc <marcellocoutinho@gmail.com> | 2011-12-19 03:28:38 -0200 |
commit | 682b36edb471b970e6f5b7251daf1a4bef1b4a5e (patch) | |
tree | 316cb7e1d14f5e55573dc4fdcb74467a8b3a9e52 /config/pf-blocker/pfblocker.inc | |
parent | 9fa3b7fed179955897979c64e11af07208997f8a (diff) | |
download | pfsense-packages-682b36edb471b970e6f5b7251daf1a4bef1b4a5e.tar.gz pfsense-packages-682b36edb471b970e6f5b7251daf1a4bef1b4a5e.tar.bz2 pfsense-packages-682b36edb471b970e6f5b7251daf1a4bef1b4a5e.zip |
pfblocker - version 1.0.1 with minor fixes
Diffstat (limited to 'config/pf-blocker/pfblocker.inc')
-rwxr-xr-x | config/pf-blocker/pfblocker.inc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/config/pf-blocker/pfblocker.inc b/config/pf-blocker/pfblocker.inc index fcaad65f..3472aea8 100755 --- a/config/pf-blocker/pfblocker.inc +++ b/config/pf-blocker/pfblocker.inc @@ -167,6 +167,15 @@ function sync_package_pfblocker() { "detail"=> "DO NOT EDIT THIS ALIAS"); #Create rule if action permits switch($continent_config['action']){ + case "Deny_Both": + $rule = $base_rule; + $rule["type"] = $deny_action_inbound; + $rule["descr"]= "$pfb_alias auto rule"; + $rule["source"]= array("address"=> $pfb_alias); + $rule["destination"]=array("any"=>""); + if ($pfblocker_config['enable_log']) + $rule["log"]=""; + $deny_inbound[]=$rule; case "Deny_Outbound": $rule = $base_rule; $rule["type"] = $deny_action_outbound; @@ -254,6 +263,11 @@ function sync_package_pfblocker() { ${$alias}.= $matches[1]."\n"; $new_file.= $matches[1]."\n"; } + # Single ip addresses + if (preg_match("/(\d+\.\d+\.\d+\.\d+)\s+/",$line,$matches)){ + ${$alias}.= $matches[1]."/32\n"; + $new_file.= $matches[1]."/32\n"; + } # Network range 192.168.0.0-192.168.0.254 if (preg_match("/(\d+\.\d+\.\d+\.\d+)-(\d+\.\d+\.\d+\.\d+)/",$line,$matches)){ $cidr= pfblocker_Range2CIDR($matches[1],$matches[2]); @@ -289,6 +303,15 @@ function sync_package_pfblocker() { "detail"=> "DO NOT EDIT THIS ALIAS"); #Create rule if action permits switch($list['action']){ + case "Deny_Both": + $rule = $base_rule; + $rule["type"] = $deny_action_inbound; + $rule["descr"]= "$alias auto rule"; + $rule["source"]= array("address"=> $alias); + $rule["destination"]=array("any"=>""); + if ($pfblocker_config['enable_log']) + $rule["log"]=""; + $deny_inbound[]=$rule; case "Deny_Outbound": $rule = $base_rule; $rule["type"] = $deny_action_outbound; |