summaryrefslogtreecommitdiffstats
path: root/etc/inc/util.inc
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-04-21 17:03:45 -0400
committerjim-p <jim@pingle.org>2010-04-21 17:03:45 -0400
commitc7de8be425e6061bedd63bfc2294d990ff576bc2 (patch)
treeaa7c774a07376d33aab185b28f8a3b4ce283f564 /etc/inc/util.inc
parent74e861e30bb58eb1513bb806e04a471cda1578ec (diff)
downloadpfsense-c7de8be425e6061bedd63bfc2294d990ff576bc2.zip
pfsense-c7de8be425e6061bedd63bfc2294d990ff576bc2.tar.gz
Add a new alias type, urltable, which downloads a file of IP/CIDR addresses and loads them into a pf persist table instead of importing the addresses directly into a traditional alias. This allows for using huge tables of addresses that would otherwise break the GUI and/or fail to load into pf. Part of ticket #512
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r--etc/inc/util.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index ea18345..d71c512 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -851,6 +851,22 @@ function alias_expand($name) {
return null;
}
+function alias_expand_urltable($name) {
+ global $config;
+ $urltable_prefix = "/var/db/aliastables/";
+ $urltable_filename = $urltable_prefix . $name . ".txt";
+
+ foreach ($config['aliases']['alias'] as $alias) {
+ if (($alias['type'] == 'urltable') && ($alias['name'] == $name)) {
+ if (is_URL($alias["url"]) && file_exists($urltable_filename))
+ return $urltable_filename;
+ else if (process_alias_urltable($name, $alias["url"], 0, true))
+ return $urltable_filename;
+ }
+ }
+ return null;
+}
+
/* find out whether two subnets overlap */
function check_subnets_overlap($subnet1, $bits1, $subnet2, $bits2) {
OpenPOWER on IntegriCloud