
The methodology used to generate this CL is documented in https://crbug.com/1098010#c95. No-Try: true Bug: 1098010 Change-Id: I6ae92e5d7ccbf73b176588124b2f8b4067f805b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3900575 Reviewed-by: Mark Mentovai <mark@chromium.org> Owners-Override: Avi Drissman <avi@chromium.org> Commit-Queue: Avi Drissman <avi@chromium.org> Auto-Submit: Avi Drissman <avi@chromium.org> Cr-Commit-Position: refs/heads/main@{#1047628}
63 lines
1.8 KiB
C++
63 lines
1.8 KiB
C++
// Copyright 2012 The Chromium Authors
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef PPAPI_CPP_NETWORK_LIST_H_
|
|
#define PPAPI_CPP_NETWORK_LIST_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "ppapi/c/ppb_network_list.h"
|
|
#include "ppapi/cpp/pass_ref.h"
|
|
#include "ppapi/cpp/resource.h"
|
|
|
|
namespace pp {
|
|
|
|
class NetAddress;
|
|
|
|
class NetworkList : public Resource {
|
|
public:
|
|
NetworkList();
|
|
NetworkList(PassRef, PP_Resource resource);
|
|
|
|
/// Returns true if the required interface is available.
|
|
static bool IsAvailable();
|
|
|
|
/// @return Returns the number of available network interfaces or 0
|
|
/// if the list has never been updated.
|
|
uint32_t GetCount() const;
|
|
|
|
/// @return Returns the name for the network interface with the
|
|
/// specified <code>index</code>.
|
|
std::string GetName(uint32_t index) const;
|
|
|
|
/// @return Returns the type of the network interface with the
|
|
/// specified <code>index</code>.
|
|
PP_NetworkList_Type GetType(uint32_t index) const;
|
|
|
|
/// @return Returns the current state of the network interface with
|
|
/// the specified <code>index</code>.
|
|
PP_NetworkList_State GetState(uint32_t index) const;
|
|
|
|
/// Gets the list of IP addresses for the network interface with the
|
|
/// specified <code>index</code> and stores them in
|
|
/// <code>addresses</code>.
|
|
int32_t GetIpAddresses(uint32_t index,
|
|
std::vector<NetAddress>* addresses) const;
|
|
|
|
/// @return Returns the display name for the network interface with
|
|
/// the specified <code>index</code>.
|
|
std::string GetDisplayName(uint32_t index) const;
|
|
|
|
/// @return Returns the MTU for the network interface with the
|
|
/// specified <code>index</code>.
|
|
uint32_t GetMTU(uint32_t index) const;
|
|
};
|
|
|
|
} // namespace pp
|
|
|
|
#endif // PPAPI_CPP_NETWORK_LIST_H_
|