Commit 90a6e82b authored by Leigh B. Stoller's avatar Leigh B. Stoller

Initial DB support for wireless nodes. Added a "protocol" text field and

an "is_accesspoint" boolean to virt_lans. The former defaults to
"ethernet" but can be set to anything (80211a, 80211b, etc) in the NS
file. The is_accesspoint is temporary, and simply allows you to set
which node is the accesspoint in the NS file. This slot will probably
move to another table at some point.

Added interface_capabilities table, which is intended to list the
capabilities and the default values, for interfaces listed in the
interface_types table. This allows a more flexible description of
interfaces, expecially wireless devices. Initially, I have seeded the
table with just the default protocol (ethernet) and the speed. For
example, the fxp:

	fxp              | protocols         | ethernet |
	fxp              | ethernet_defspeed | 100000   |

As you can see, protocols is plural, and is intended to be a comma
separated list. So, for the atheros wireless card:

	ath              | protocols         | 80211a,80211b,80211g |
	ath              | 80211a_defspeed   | 54000                |
	ath              | 80211b_defspeed   | 11000                |
	ath              | 80211g_defspeed   | 54000                |

I gave up on using the entire row as a primary key; this is just too
painful from perl/php/python where hashes are the most popular data
structure, and duplicate columns get overwritten.
parent da3bcef0
......@@ -450,6 +450,17 @@ CREATE TABLE interface_types (
PRIMARY KEY (type)
) TYPE=MyISAM;
--
-- Table structure for table `interface_capabilities`
--
CREATE TABLE interface_capabilities (
type varchar(30) NOT NULL default '',
capkey varchar(64) NOT NULL default '',
capval varchar(64) NOT NULL default '',
PRIMARY KEY (type, capkey)
) TYPE=MyISAM;
--
-- Table structure for table `interfaces`
--
......@@ -1592,6 +1603,8 @@ CREATE TABLE virt_lans (
nobwshaping tinyint(4) default '0',
usevethiface tinyint(4) default '0',
trivial_ok tinyint(4) default '1',
protocol varchar(30) NOT NULL default 'ethernet',
is_accesspoint tinyint(4) default '0',
KEY pid (pid,eid,vname)
) TYPE=MyISAM;
......
......@@ -524,6 +524,8 @@ REPLACE INTO table_regex VALUES ('virt_lans','uselinkdelay','int','redirect','de
REPLACE INTO table_regex VALUES ('virt_lans','nobwshaping','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','usevethiface','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','trivial_ok','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','protocol','text','redirect','default:tinytext',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_lans','is_accesspoint','int','redirect','default:boolean',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_node_desires','pid','text','redirect','projects:pid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_node_desires','eid','text','redirect','experiments:eid',0,0,NULL);
REPLACE INTO table_regex VALUES ('virt_node_desires','vname','text','redirect','virt_nodes:vname',0,0,NULL);
......
......@@ -1412,3 +1412,23 @@ last_net_act,last_cpu_act,last_ext_act);
alter table node_types add column isplabphysnode tinyint(4) not null \
default 0 after isplabdslice;
1.235: Initial wireless support.
alter table virt_lans add column protocol varchar(30) NOT NULL \
default 'ethernet' AFTER trivial_ok;
alter table virt_lans add column is_accesspoint tinyint(4) \
default '0' AFTER protocol;
CREATE TABLE interface_capabilities (
type varchar(30) NOT NULL default '',
capkey varchar(64) NOT NULL default '',
capval varchar(64) NOT NULL default '',
PRIMARY KEY (type, capkey)
) TYPE=MyISAM;
insert into interface_capabilities (type, capkey, capval) \
select type,"protocols","ethernet" from interface_types;
insert into interface_capabilities (type, capkey, capval) \
select type,"ethernet_defspeed",max_speed from interface_types;
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