diff options
Diffstat (limited to 'mpm/python/usrp_mpm/xports')
-rw-r--r-- | mpm/python/usrp_mpm/xports/xportmgr_liberio.py | 12 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/xports/xportmgr_udp.py | 17 |
2 files changed, 29 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/xports/xportmgr_liberio.py b/mpm/python/usrp_mpm/xports/xportmgr_liberio.py index 8ac2f06f3..f1e9fe2de 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_liberio.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_liberio.py @@ -38,6 +38,18 @@ class XportMgrLiberio(object): " Clean up after a session terminates " self._data_chan_ctr = 0 + def get_xport_info(self): + """ + Returns a dictionary of useful information, e.g. for appending into the + device info. + + Note: This can be run by callers not owning a claim, even when the + device has been claimed by someone else. + + In this case, returns an empty dict. + """ + return {} + def request_xport( self, sid, diff --git a/mpm/python/usrp_mpm/xports/xportmgr_udp.py b/mpm/python/usrp_mpm/xports/xportmgr_udp.py index dd783e132..5e565ba86 100644 --- a/mpm/python/usrp_mpm/xports/xportmgr_udp.py +++ b/mpm/python/usrp_mpm/xports/xportmgr_udp.py @@ -112,6 +112,23 @@ class XportMgrUDP(object): " Clean up after a session terminates " self._allocations = {} + def get_xport_info(self): + """ + Returns a dictionary of useful information, e.g. for appending into the + device info. + + Note: This can be run by callers not owning a claim, even when the + device has been claimed by someone else. + + In this case, returns the available IP addresses. + """ + available_interfaces = \ + self._init_interfaces(self._possible_chdr_ifaces) + return dict(zip( + ("addr", "second_addr", "third_addr", "fourth_addr"), + (x['ip_addr'] for x in itervalues(available_interfaces)) + )) + def _preload_ethtables(self, eth_dispatchers, table_file): """ Populates the ethernet tables from a JSON file |