~jpakkane/+junk/gtestfix

« back to all changes in this revision

Viewing changes to dbus-cpp/services/nm.h

  • Committer: Antti Kaijanmäki
  • Date: 2014-01-31 09:35:35 UTC
  • Revision ID: antti.kaijanmaki@canonical.com-20140131093535-8o4xea4i22avmc81
Use defines from NetworkManager.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <core/dbus/types/stl/tuple.h>
31
31
#include <core/dbus/types/stl/vector.h>
32
32
 
 
33
#include <NetworkManager/NetworkManager.h>
 
34
 
33
35
namespace org
34
36
{
35
37
namespace freedesktop
42
44
        {
43
45
            static const std::string& name()
44
46
            {
45
 
                static const std::string s{"org.freedesktop.NetworkManager.AccessPoint"};
 
47
                static const std::string s{NM_DBUS_INTERFACE_ACCESS_POINT};
46
48
                return s;
47
49
            }
48
50
 
174
176
        {
175
177
            static const std::string& name()
176
178
            {
177
 
                static const std::string s{"org.freedesktop.NetworkManager.Connection.Active"};
 
179
                static const std::string s{NM_DBUS_INTERFACE_ACTIVE_CONNECTION};
178
180
                return s;
179
181
            }
180
182
 
213
215
 
214
216
            static const std::string& name()
215
217
            {
216
 
                static const std::string s{"org.freedesktop.NetworkManager.Settings.Connection"};
 
218
                static const std::string s{NM_DBUS_IFACE_SETTINGS_CONNECTION};
217
219
                return s;
218
220
            }
219
221
 
252
254
        {
253
255
            static const std::string& name()
254
256
            {
255
 
                static const std::string s{"org.freedesktop.NetworkManager.Device"};
 
257
                static const std::string s{NM_DBUS_INTERFACE_DEVICE};
256
258
                return s;
257
259
            }
258
260
 
259
261
            enum class Type
260
262
            {
261
 
                unknown = 0,
262
 
                ethernet = 1,
263
 
                wifi = 2,
264
 
                unused_1 = 3,
265
 
                unused_2 = 4,
266
 
                bluetooth = 5,
267
 
                olpc_mesh = 6,
268
 
                wimax = 7,
269
 
                modem = 8,
270
 
                infiniband = 9,
271
 
                bond = 10,
272
 
                vlan = 11,
273
 
                adsl = 12,
274
 
                bridge = 13
 
263
                unknown     = NM_DEVICE_TYPE_UNKNOWN,
 
264
                ethernet    = NM_DEVICE_TYPE_ETHERNET,
 
265
                wifi        = NM_DEVICE_TYPE_WIFI,
 
266
                unused_1    = NM_DEVICE_TYPE_UNUSED1,
 
267
                unused_2    = NM_DEVICE_TYPE_UNUSED2,
 
268
                bluetooth   = NM_DEVICE_TYPE_BT,
 
269
                olpc_mesh   = NM_DEVICE_TYPE_OLPC_MESH,
 
270
                wimax       = NM_DEVICE_TYPE_WIMAX,
 
271
                modem       = NM_DEVICE_TYPE_MODEM,
 
272
                infiniband  = NM_DEVICE_TYPE_INFINIBAND,
 
273
                bond        = NM_DEVICE_TYPE_BOND,
 
274
                vlan        = NM_DEVICE_TYPE_VLAN,
 
275
                adsl        = NM_DEVICE_TYPE_ADSL,
 
276
                bridge      = NM_DEVICE_TYPE_BRIDGE
275
277
            };
276
278
 
277
279
            struct Wireless
278
280
            {
279
281
                static const std::string& name()
280
282
                {
281
 
                    static const std::string s{"org.freedesktop.NetworkManager.Device.Wireless"};
 
283
                    static const std::string s{NM_DBUS_INTERFACE_DEVICE_WIRELESS};
282
284
                    return s;
283
285
                }
284
286
 
511
513
        {
512
514
            static const std::string& name()
513
515
            {
514
 
                static const std::string s{"org.freedesktop.NetworkManager"};
 
516
                static const std::string s{NM_DBUS_INTERFACE};
515
517
                return s;
516
518
            }
517
519
 
717
719
        Service(const core::dbus::Bus::Ptr& bus)
718
720
        {
719
721
            auto service = core::dbus::Service::use_service<Interface::NetworkManager>(bus);
720
 
            auto object = service->object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/NetworkManager"));
 
722
            auto object = service->object_for_path(core::dbus::types::ObjectPath(NM_DBUS_PATH));
721
723
            nm = std::make_shared<Interface::NetworkManager>(service, object);
722
724
        }
723
725
 
728
730
            Mock(const core::dbus::Bus::Ptr& bus)
729
731
            {
730
732
                auto service = core::dbus::Service::add_service<Interface::NetworkManager>(bus);
731
 
                auto object = service->add_object_for_path(core::dbus::types::ObjectPath("/org/freedesktop/NetworkManager"));
 
733
                auto object = service->add_object_for_path(core::dbus::types::ObjectPath(NM_DBUS_PATH));
732
734
                nm = std::make_shared<Interface::NetworkManager>(service, object);
733
735
            }
734
736
        };