Hi,
To know all registered switches try:
"""
from ryu.controller.dpset import DPSet
class MyApp(app_manager.RyuApp):
# ...
_CONTEXTS = {'dpset': DPSet}
def __init__(self, *args, **kwargs):
super(MyApp, self).__init__(*args, **kwargs)
# ...
self.dpset = kwargs['dpset']
# ...
"""
Then fetch switches:
>> switches = self.dpset.get_all()
>> mac_addresses = [(s[0], s[1].ports[OFPP_LOCAL].hw_addr) for s in
switches]
It will return tuple(dpid, mac_address), like this:
[(1, '0a:74:ba:ce:11:47'), (2, '32:5b:11:d9:72:4f')]
пт, 16 сент. 2016 г. в 15:25, Alan Wang <[email protected]>:
> Hi All,
>
> I want to know the mac address of all switches from controller. How to get
> the mac
>
> address of switch?
>
> Thanks,
>
> Alan
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Ryu-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ryu-devel
>
------------------------------------------------------------------------------
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel