mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
Feature #4215: Support IPv6 in VR management
This commit is contained in:
parent
e3ffbd2409
commit
831372003d
@ -167,8 +167,6 @@ define(function(require) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: VR edges with floating IPs
|
||||
|
||||
$.each(vrs, function(j,vr){
|
||||
var nodeId = "vr"+vr;
|
||||
|
||||
@ -223,9 +221,14 @@ define(function(require) {
|
||||
|
||||
var label = undefined;
|
||||
|
||||
// TODO: IPv6 IPs
|
||||
if (lease.IP != undefined){
|
||||
label = lease.IP;
|
||||
} else if (lease.IP6_GLOBAL != undefined){
|
||||
label = lease.IP6_GLOBAL;
|
||||
} else if (lease.IP6_ULA != undefined){
|
||||
label = lease.IP6_ULA;
|
||||
} else if (lease.IP6_LINK != undefined){
|
||||
label = lease.IP6_LINK;
|
||||
}
|
||||
|
||||
edges.push({from: vnetNodeId, to: nodeId, label: label});
|
||||
@ -242,9 +245,14 @@ define(function(require) {
|
||||
|
||||
var label = undefined;
|
||||
|
||||
// TODO: IPv6 IPs
|
||||
if (lease.IP != undefined){
|
||||
label = lease.IP;
|
||||
} else if (lease.IP6_GLOBAL != undefined){
|
||||
label = lease.IP6_GLOBAL;
|
||||
} else if (lease.IP6_ULA != undefined){
|
||||
label = lease.IP6_ULA;
|
||||
} else if (lease.IP6_LINK != undefined){
|
||||
label = lease.IP6_LINK;
|
||||
}
|
||||
|
||||
edges.push({from: vnetNodeId, to: nodeId, label: label});
|
||||
|
@ -401,13 +401,25 @@ int VirtualRouter::release_network_leases(VectorAttribute const * nic)
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void vrouter_prefix(VectorAttribute* nic, const string& attr)
|
||||
{
|
||||
string val;
|
||||
|
||||
if (nic->vector_value(attr.c_str(), val) == 0)
|
||||
{
|
||||
nic->remove(attr);
|
||||
nic->replace("VROUTER_"+attr, val);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
Template * VirtualRouter::get_nics() const
|
||||
{
|
||||
Template * tmpl = new Template();
|
||||
|
||||
int num_nics;
|
||||
bool floating;
|
||||
string ip;
|
||||
vector<Attribute * > nics;
|
||||
VectorAttribute * nic;
|
||||
|
||||
@ -429,13 +441,12 @@ Template * VirtualRouter::get_nics() const
|
||||
|
||||
if (floating)
|
||||
{
|
||||
// TODO: this is IPv4 only
|
||||
nic->remove("MAC");
|
||||
if (nic->vector_value("IP", ip) == 0)
|
||||
{
|
||||
nic->remove("IP");
|
||||
nic->replace("VROUTER_IP", ip);
|
||||
}
|
||||
|
||||
vrouter_prefix(nic, "IP");
|
||||
vrouter_prefix(nic, "IP6_LINK");
|
||||
vrouter_prefix(nic, "IP6_ULA");
|
||||
vrouter_prefix(nic, "IP6_GLOBAL");
|
||||
|
||||
// TODO: remove all other attrs, such as AR, BRIDGE, etc?
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user