#ifndef NET_BASE_NETWORK_INTERFACES_FUCHSIA_H_
#define NET_BASE_NETWORK_INTERFACES_FUCHSIA_H_
#include <fuchsia/net/interfaces/cpp/fidl.h>
#include <stdint.h>
#include "net/base/network_change_notifier.h"
#include "net/base/network_interfaces.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
namespace net::internal {
class InterfaceProperties final {
public:
using InterfaceId = uint64_t;
static absl::optional<InterfaceProperties> VerifyAndCreate(
fuchsia::net::interfaces::Properties properties);
InterfaceProperties(InterfaceProperties&& interface);
InterfaceProperties& operator=(InterfaceProperties&& interface);
~InterfaceProperties();
bool Update(fuchsia::net::interfaces::Properties properties);
void AppendNetworkInterfaces(NetworkInterfaceList* interfaces) const;
bool IsPubliclyRoutable() const;
bool HasAddresses() const { return !properties_.addresses().empty(); }
InterfaceId id() const { return properties_.id(); }
bool online() const { return properties_.online(); }
const fuchsia::net::interfaces::DeviceClass& device_class() const {
return properties_.device_class();
}
private:
explicit InterfaceProperties(fuchsia::net::interfaces::Properties properties);
fuchsia::net::interfaces::Properties properties_;
};
NetworkChangeNotifier::ConnectionType ConvertConnectionType(
const fuchsia::net::interfaces::DeviceClass& device_class);
bool VerifyCompleteInterfaceProperties(
const fuchsia::net::interfaces::Properties& properties);
}
#endif