1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_
11 #include "ppapi/c/private/ppb_network_list_private.h"
12 #include "ppapi/cpp/pass_ref.h"
13 #include "ppapi/cpp/resource.h"
17 class NetworkListPrivate
: public Resource
{
20 NetworkListPrivate(PassRef
, PP_Resource resource
);
22 /// Returns true if the required interface is available.
23 static bool IsAvailable();
25 /// @return Returns the number of available network interfaces or 0
26 /// if the list has never been updated.
27 uint32_t GetCount() const;
29 /// @return Returns the name for the network interface with the
30 /// specified <code>index</code>.
31 std::string
GetName(uint32_t index
) const;
33 /// @return Returns the type of the network interface with the
34 /// specified <code>index</code>.
35 PP_NetworkListType_Private
GetType(uint32_t index
) const;
37 /// @return Returns the current state of the network interface with
38 /// the specified <code>index</code>.
39 PP_NetworkListState_Private
GetState(uint32_t index
) const;
41 /// Gets the list of IP addresses for the network interface with the
42 /// specified <code>index</code> and stores them in
43 /// <code>addresses</code>.
44 void GetIpAddresses(uint32_t index
,
45 std::vector
<PP_NetAddress_Private
>* addresses
) const;
47 /// @return Returns the display name for the network interface with
48 /// the specified <code>index</code>.
49 std::string
GetDisplayName(uint32_t index
) const;
51 /// @return Returns the MTU for the network interface with the
52 /// specified <code>index</code>.
53 uint32_t GetMTU(uint32_t index
) const;
58 #endif // PPAPI_CPP_PRIVATE_NETWORK_LIST_PRIVATE_H_