Commit 3423f711 authored by Jonathon Duerig's avatar Jonathon Duerig
Browse files

Add 'mode' field to external_networks.

The mode determines whether to negotiate for a vlan or not rather than the type of the special node.
parent 5c80cb32
......@@ -2219,7 +2219,7 @@ sub GetTicketAuxAux($$$$$$$$$)
my $network = $stitching_paths{$linkname}->{'network'};
my $slice_urn = $slice->urn();
my $retries = 10;
my $chainmode = ($network->node_type() eq "interconnect-vm" ? 1 : 0);
my $chainmode = ($network->mode() eq "chain" ? 1 : 0);
my $madevlan = 0;
#
......
......@@ -1465,6 +1465,7 @@ CREATE TABLE `external_networks` (
`external_manager` tinytext,
`external_interface` tinytext,
`external_wire` tinytext,
`mode` enum('chain','tree') NOT NULL default 'tree',
PRIMARY KEY (`network_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
#
# Add 'mode' field to table 'external_networks'
#
use strict;
use libdb;
my $impotent = 0;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
if (!DBSlotExists("external_networks", "mode")) {
DBQueryFatal("alter table external_networks add ".
" `mode` enum('chain','tree') ".
" NOT NULL default 'tree'");
}
return 0;
}
1;
......@@ -31,13 +31,13 @@ use File::Temp qw(tempfile);
#
sub usage()
{
print STDERR "Usage: addexternalnetwork [-d] [-n] [-w external_wire_urn] [-i external_interface_urn] <network_id> <node_id> <external_manager> <minvlan>-<maxvlan>\n";
print STDERR "Usage: addexternalnetwork [-d] [-n] [-w external_wire_urn] [-i external_interface_urn] [-t vm-type] <network_id> <node_id> <external_manager> <minvlan>-<maxvlan>\n";
print STDERR "Options:\n";
print STDERR " -d - Turn on debugging\n";
print STDERR " -n - Dry run mode\n";
exit(-1);
}
my $optlist = "hdnw:i:";
my $optlist = "hdnw:i:t:";
my $debug = 0;
my $impotent = 0;
my $network;
......@@ -48,6 +48,7 @@ my $minvlan;
my $maxvlan;
my $wire;
my $iface;
my $vmtype;
# Protos
sub fatal($);
......@@ -101,6 +102,9 @@ if (defined($options{'w'})) {
if (defined($options{'i'})) {
$iface = $options{'i'};
}
if (defined($options{'t'})) {
$vmtype = $options{'t'};
}
usage()
if (scalar(@ARGV) != 4);
......@@ -133,6 +137,9 @@ if (! defined($node)) {
}
my $type = $node->type();
if (defined($vmtype)) {
$type = $vmtype;
}
sub fatal($)
{
......
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