Add skeleton for IPv4 configuration plugin
[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.moblin.connman', "/"),
8                                         'org.moblin.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.moblin.connman', path),
16                                         'org.moblin.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         networks = interface.ListNetworks()
27         for i in networks:
28                 print "    Network.Path = %s" % (i)
29
30                 network = dbus.Interface(bus.get_object('org.moblin.connman', i),
31                                                 'org.moblin.connman.Network')
32
33                 print "    Network.Identifier = %s" % (network.GetIdentifier())
34                 print "    Network.Passphrase = %s" % (network.GetPassphrase())
35
36         print