Commit c2966196 authored by Ryan Jackson's avatar Ryan Jackson
Browse files

Database changes needed for Linux firewall support

parent 51552904
......@@ -376,7 +376,7 @@ CREATE TABLE `datapository_databases` (
DROP TABLE IF EXISTS `default_firewall_rules`;
CREATE TABLE `default_firewall_rules` (
`type` enum('ipfw','ipfw2','ipchains','ipfw2-vlan') NOT NULL default 'ipfw',
`type` enum('ipfw','ipfw2','iptables','ipfw2-vlan', 'iptables-vlan') NOT NULL default 'ipfw',
`style` enum('open','closed','basic','emulab') NOT NULL default 'basic',
`enabled` tinyint(4) NOT NULL default '0',
`ruleno` int(10) unsigned NOT NULL default '0',
......@@ -4254,7 +4254,7 @@ CREATE TABLE `virt_firewalls` (
`eid` varchar(32) NOT NULL default '',
`exptidx` int(11) NOT NULL default '0',
`fwname` varchar(32) NOT NULL default '',
`type` enum('ipfw','ipfw2','ipchains','ipfw2-vlan') NOT NULL default 'ipfw',
`type` enum('ipfw','ipfw2','iptables','ipfw2-vlan', 'iptables-vlan') NOT NULL default 'ipfw',
`style` enum('open','closed','basic','emulab') NOT NULL default 'basic',
`log` tinytext NOT NULL,
PRIMARY KEY (`exptidx`,`fwname`),
......
......@@ -1071,7 +1071,7 @@ REPLACE INTO table_regex VALUES ('virt_nodes','numeric_id','int','redirect','def
REPLACE INTO table_regex VALUES ('virt_firewalls','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_firewalls','eid','text','redirect','experimenets:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_firewalls','fwname','text','redirect','virt_nodes:vname',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_firewalls','type','text','regex','^(ipfw|ipfw2|ipchains|ipfw2-vlan)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_firewalls','type','text','regex','^(ipfw|ipfw2|iptables|ipfw2-vlan|iptables-vlan)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_firewalls','style','text','regex','^(open|closed|basic|emulab)$',0,0,NULL);
REPLACE INTO table_regex VALUES ('mailman_lists','pid_idx','text','redirect','projects:pid_idx',0,0,NULL);
......
#
# Remove old ipchains fw type and replace with iptables, plus
# add support for layer 2 firewalls using Linux.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
DBQueryFatal("REPLACE INTO table_regex VALUES ('virt_firewalls','type','text','regex',".
"'^(ipfw|ipfw2|iptables|ipfw2-vlan|iptables-vlan)\$',0,0,NULL)");
DBQueryFatal("ALTER TABLE virt_firewalls CHANGE type type ".
" enum('ipfw','ipfw2','iptables','ipfw2-vlan','iptables-vlan')".
" not null default 'ipfw'");
DBQueryFatal("ALTER TABLE default_firewall_rules CHANGE type type ".
" enum('ipfw','ipfw2','iptables','ipfw2-vlan','iptables-vlan')".
" not null default 'ipfw'");
return 0;
}
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment