blob: e027c3671150b98162306362b2405b04a3398b12 [file] [log] [blame]
// Copyright 2015 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 THERMALD_NETWORK_INTERFACE_H_
#define THERMALD_NETWORK_INTERFACE_H_
#include <string>
#include "base/macros.h"
namespace thermald {
// Class to interact with a network interface.
class NetworkInterface {
public:
explicit NetworkInterface(const std::string &name) : name_(name) {}
// Returns true if the network interface is activated, false otherwise.
bool IsUp();
std::string name() const { return name_; }
// Returns true if a network interface with the given name exists, false
// otherwise.
static bool Exists(const std::string &name);
private:
const std::string name_;
DISALLOW_COPY_AND_ASSIGN(NetworkInterface);
};
} // namespace thermald
#endif // THERMALD_NETWORK_INTERFACE_H_