def _add_faucet_switch(self, sid_prefix, dpid, ovs_type, switch_cls): """Add a FAUCET switch.""" switch_name = 's%s' % sid_prefix return self.addSwitch(name=switch_name, cls=switch_cls, datapath=ovs_type, dpid=mininet_test_util.mininet_dpid(dpid))
def _add_faucet_switch(self, switch_index): """ Adds a Faucet switch to the topology Args: sid_prefix (str): SID prefix to generate the switch name switch_index (int): Switch index to generate the host name dpid (int): Switch DP ID """ sid_prefix = self._generate_sid_prefix() switch_cls = FaucetSwitch switch_name = 's%s' % sid_prefix if switch_index == 0 and self.hw_dpid: self.hw_name = switch_name self.dpids_by_id[switch_index] = self.hw_dpid dpid = str(int(self.hw_dpid) + 1) output( 'bridging hardware switch DPID %s (%x) dataplane via OVS DPID %s (%x)\n' % (self.hw_dpid, int(self.hw_dpid), dpid, int(dpid))) switch_cls = NoControllerFaucetSwitch else: dpid = self.dp_dpid(switch_index) self.dpids_by_id[switch_index] = dpid self.switches_by_id[switch_index] = switch_name return self.addSwitch(name=switch_name, cls=switch_cls, datapath=self.ovs_type, dpid=mininet_test_util.mininet_dpid(dpid), switch_n=switch_index)
def _add_faucet_switch(self, sid_prefix, dpid, ovs_type, switch_cls): """Add a FAUCET switch.""" switch_name = 's%s' % sid_prefix return self.addSwitch( name=switch_name, cls=switch_cls, datapath=ovs_type, dpid=mininet_test_util.mininet_dpid(dpid))
def _add_faucet_switch(self, sid_prefix, dpid, hw_dpid, ovs_type): """Add a FAUCET switch.""" switch_cls = FaucetSwitch if hw_dpid and hw_dpid == dpid: remap_dpid = str(int(dpid) + 1) output( 'bridging hardware switch DPID %s (%x) dataplane via OVS DPID %s (%x)' % (dpid, int(dpid), remap_dpid, int(remap_dpid))) dpid = remap_dpid switch_cls = NoControllerFaucetSwitch switch_name = 's%s' % sid_prefix return self.addSwitch(name=switch_name, cls=switch_cls, datapath=ovs_type, dpid=mininet_test_util.mininet_dpid(dpid))
def _add_faucet_switch(self, sid_prefix, dpid, hw_dpid, ovs_type): """Add a FAUCET switch.""" switch_cls = FaucetSwitch switch_name = 's%s' % sid_prefix self.switch_dpids[switch_name] = dpid # External clients refer to the hardware dpid, but # internally we use the ovs dpid if hw_dpid and hw_dpid == dpid: remap_dpid = str(int(dpid) + 1) output( 'bridging hardware switch DPID %s (%x) dataplane via OVS DPID %s (%x)' % (dpid, int(dpid), remap_dpid, int(remap_dpid))) # Allow lookup by hardware dpid as well as ovs dpid self.dpid_names[dpid] = switch_name dpid = remap_dpid switch_cls = NoControllerFaucetSwitch self.dpid_names[dpid] = switch_name return self.addSwitch(name=switch_name, cls=switch_cls, datapath=ovs_type, dpid=mininet_test_util.mininet_dpid(dpid))