blob: b4d0b6cd3106b578816418b4cb96ed916df0f323 [file] [log] [blame]
// Copyright 2018 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.
#include <string>
#include <base/macros.h>
#include "shill/device.h"
#include "shill/ipconfig.h"
#include "shill/service.h"
#include "shill/technology.h"
namespace shill {
// A VirtualDevice represents a device that doesn't provide its own
// physical layer. This includes, e.g., tunnel interfaces used for
// OpenVPN, and PPP devices used for L2TPIPSec and 3G PPP dongles.
// (PPP devices are represented via the PPPDevice subclass.)
class VirtualDevice : public Device {
VirtualDevice(Manager* manager,
const std::string& link_name,
int interface_index,
Technology technology);
~VirtualDevice() override;
bool Load(StoreInterface* storage) override;
bool Save(StoreInterface* storage) override;
void Start(Error* error,
const EnabledStateChangedCallback& callback) override;
void Stop(Error* error, const EnabledStateChangedCallback& callback) override;
virtual void UpdateIPConfig(const IPConfig::Properties& properties);
// Expose protected device methods to manager of this device.
// (E.g. Cellular, L2TPIPSecDriver, OpenVPNDriver.)
void DropConnection() override;
virtual void SelectService(const ServiceRefPtr& service);
void SetServiceState(Service::ConnectState state) override;
void SetServiceFailure(Service::ConnectFailure failure_state) override;
void SetServiceFailureSilent(Service::ConnectFailure failure_state) override;
} // namespace shill