2cd0424d9c75619bec48ceaf2b5ff408c9a964b2
[connman] / test / list-interfaces
1 #!/usr/bin/python
2
3 import dbus
4
5 bus = dbus.SystemBus()
6
7 manager = dbus.Interface(bus.get_object('org.freedesktop.connman', "/"),
8                                         'org.freedesktop.connman.Manager')
9
10 interfaces = manager.ListInterfaces()
11
12 for path in interfaces:
13         print "[ %s ]" % (path)
14
15         interface = dbus.Interface(bus.get_object('org.freedesktop.connman', path),
16                                         'org.freedesktop.connman.Interface')
17
18         properties = interface.GetProperties()
19         for key in properties.keys():
20                 print "    %s = %s" % (key, properties[key])
21
22         ipv4 = interface.GetIPv4()
23         for key in ipv4.keys():
24                 print "    IPv4.%s = %s" % (key, ipv4[key])
25
26         print