Currently trema-switch configuration looks like the following:
trema_switch( "lsw" ) {
datapath_id "0xabc"
ports "trema0-0,trema1-0"
}
vhost ("host1") {
ip "192.168.0.1"
netmask "255.255.0.0"
mac "00:00:00:01:00:01"
}
vhost ("host2") {
ip "192.168.0.2"
netmask "255.255.0.0"
mac "00:00:00:01:00:02"
}
link "host1", "lsw"
link "host2", "lsw"
In link.rb
the link name is hardcoded to trema name. I would like to use as link names trema-switch's ports attribute.
Is there a simple way of achieving this somehow copy those values to @stanza or?
Maybe you can determine the
ports
attribute of trema_switch automatically as follows. This uses Trema::Link.instances (from Trema::NetworkComponent) to get known links list.