blob: 99eb0b054d178fe06882216bef50bac5bc685d9a [file] [log] [blame]
#!/usr/bin/python
import dbus, flimflam, sys
if (len(sys.argv) < 2):
print "Usage: %s <device | interface>" % (sys.argv[0])
sys.exit(1)
(_, name) = sys.argv
flim = flimflam.FlimFlam(dbus.SystemBus())
device = flim.FindElementByNameSubstring('Device', name)
if device is None:
device = flim.FindElementByPropertySubstring('Device', 'Interface', name)
if device is None:
print "No such device or interface %s" % name
sys.exit(1)
properties = device.GetProperties(utf8_strings = True)
for path in properties["IPConfigs"]:
ipconfig = flim.GetObjectInterface("IPConfig", path)
ipconfig_properties = ipconfig.GetProperties(utf8_strings = True)
print "[ %s ]" % (ipconfig.object_path)
for key in ipconfig_properties.keys():
print " %s = %s" % \
(key, flimflam.convert_dbus_value(ipconfig_properties[key], 8))
print