Commit 728bd3bd authored by Leigh B Stoller's avatar Leigh B Stoller

A tiny little tweak that allows you to set the IPs on layer 1 link

ifaces that correspond to endpoints on nodes. Makes it easier to
do something like this, if we init the interfaces on the nodes with IP
and mask and bring it up.

	# Add a raw PC to the request and give it an interface.
	node1 = request.RawPC("node1")
	iface1 = node1.addInterface()

	# Specify the IPv4 address
	iface1.addAddress(pg.IPv4Address("192.168.1.1", "255.255.255.0"))

	# Add another raw PC to the request and give it an interface.
	node2 = request.RawPC("node2")
	iface2 = node2.addInterface()

	# Specify the IPv4 address
	iface2.addAddress(pg.IPv4Address("192.168.1.2", "255.255.255.0"))

	# Add L1 link from node1 to node2
	link1 = request.L1Link("link1")
	link1.addInterface(iface1)
	link1.addInterface(iface2)
parent 7b8f84c0
......@@ -2729,8 +2729,15 @@ sub GetTicketAuxAux($)
}
# XXX
$ip = "10.10.${linknum}.${ifacenum}" if (!defined($ip));
$mask = "255.255.255.0" if (!defined($mask));
if ($layer == 1 && !defined($ip)) {
# Do not provide an IP for layer 1 links unless user says to.
$ip = "";
$mask = "255.255.255.0"
}
elsif (!defined($ip)) {
$ip = "10.10.${linknum}.${ifacenum}";
$mask = "255.255.255.0" if (!defined($mask));
}
my $member = "$node_nickname:$iface_vport";
my $bandwidth = $default_bandwidth;
my $rbandwidth= $default_bandwidth;
......
......@@ -9167,7 +9167,8 @@ sub UpLoadIPAddresses($)
my $mask = $virtlan->_mask();
next
if ($virtlan->_layer() != 2 && $virtlan->_layer() != 3);
if (!($virtlan->_layer() == 2 || $virtlan->_layer() == 3 ||
($virtlan->_layer() == 1 && $self->experiment()->geniflags)));
foreach my $member ($virtlan->memberlist()) {
# Will this happen?
......
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