blob: a004cc79307b161e3994a6ae827f7badd1fe7c5e [file] [log] [blame]
// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SHILL_VPN_SERVICE_
#define SHILL_VPN_SERVICE_
#include <base/memory/scoped_ptr.h>
#include <gtest/gtest_prod.h> // for FRIEND_TEST
#include "shill/service.h"
namespace shill {
class KeyValueStore;
class VPNDriver;
class VPNService : public Service {
public:
VPNService(ControlInterface *control,
EventDispatcher *dispatcher,
Metrics *metrics,
Manager *manager,
VPNDriver *driver); // Takes ownership of |driver|.
virtual ~VPNService();
// Inherited from Service.
virtual void Connect(Error *error);
virtual void Disconnect(Error *error);
virtual std::string GetStorageIdentifier() const;
VPNDriver *driver() const { return driver_.get(); }
static std::string CreateStorageIdentifier(const KeyValueStore &args,
Error *error);
void set_storage_id(const std::string &id) { storage_id_ = id; }
private:
FRIEND_TEST(VPNServiceTest, GetDeviceRpcId);
virtual std::string GetDeviceRpcId(Error *error);
std::string storage_id_;
scoped_ptr<VPNDriver> driver_;
DISALLOW_COPY_AND_ASSIGN(VPNService);
};
} // namespace shill
#endif // SHILL_VPN_SERVICE_