| OLD | NEW |
| (Empty) |
| 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. | |
| 4 */ | |
| 5 | |
| 6 /* From private/ppb_network_list_private.idl, | |
| 7 * modified Wed Sep 4 11:42:02 2013. | |
| 8 */ | |
| 9 | |
| 10 #ifndef PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ | |
| 11 #define PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ | |
| 12 | |
| 13 #include "ppapi/c/pp_array_output.h" | |
| 14 #include "ppapi/c/pp_bool.h" | |
| 15 #include "ppapi/c/pp_macros.h" | |
| 16 #include "ppapi/c/pp_resource.h" | |
| 17 #include "ppapi/c/pp_stdint.h" | |
| 18 #include "ppapi/c/pp_var.h" | |
| 19 | |
| 20 #define PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3 "PPB_NetworkList_Private;0.3" | |
| 21 #define PPB_NETWORKLIST_PRIVATE_INTERFACE PPB_NETWORKLIST_PRIVATE_INTERFACE_0_3 | |
| 22 | |
| 23 /** | |
| 24 * @file | |
| 25 * This file defines the <code>PPB_NetworkList_Private</code> interface. | |
| 26 */ | |
| 27 | |
| 28 | |
| 29 /** | |
| 30 * @addtogroup Enums | |
| 31 * @{ | |
| 32 */ | |
| 33 /** | |
| 34 * Type of a network interface. | |
| 35 */ | |
| 36 typedef enum { | |
| 37 /** | |
| 38 * Type of the network interface is not known. | |
| 39 */ | |
| 40 PP_NETWORKLIST_UNKNOWN = 0, | |
| 41 /** | |
| 42 * Wired Ethernet network. | |
| 43 */ | |
| 44 PP_NETWORKLIST_ETHERNET = 1, | |
| 45 /** | |
| 46 * Wireless Wi-Fi network. | |
| 47 */ | |
| 48 PP_NETWORKLIST_WIFI = 2, | |
| 49 /** | |
| 50 * Cellular network (e.g. LTE). | |
| 51 */ | |
| 52 PP_NETWORKLIST_CELLULAR = 3 | |
| 53 } PP_NetworkListType_Private; | |
| 54 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListType_Private, 4); | |
| 55 | |
| 56 /** | |
| 57 * State of a network interface. | |
| 58 */ | |
| 59 typedef enum { | |
| 60 /** | |
| 61 * Network interface is down. | |
| 62 */ | |
| 63 PP_NETWORKLIST_DOWN = 0, | |
| 64 /** | |
| 65 * Network interface is up. | |
| 66 */ | |
| 67 PP_NETWORKLIST_UP = 1 | |
| 68 } PP_NetworkListState_Private; | |
| 69 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_NetworkListState_Private, 4); | |
| 70 /** | |
| 71 * @} | |
| 72 */ | |
| 73 | |
| 74 /** | |
| 75 * @addtogroup Interfaces | |
| 76 * @{ | |
| 77 */ | |
| 78 /** | |
| 79 * The <code>PPB_NetworkList_Private</code> is used to represent a | |
| 80 * list of network interfaces and their configuration. The content of | |
| 81 * the list is immutable. The current networks configuration can be | |
| 82 * received using the <code>PPB_NetworkMonitor_Private</code> | |
| 83 * interface. | |
| 84 */ | |
| 85 struct PPB_NetworkList_Private_0_3 { | |
| 86 /** | |
| 87 * Determines if the specified <code>resource</code> is a | |
| 88 * <code>NetworkList</code> object. | |
| 89 * | |
| 90 * @param[in] resource A <code>PP_Resource</code> resource. | |
| 91 * | |
| 92 * @return Returns <code>PP_TRUE</code> if <code>resource</code> is | |
| 93 * a <code>PPB_NetworkList_Private</code>, <code>PP_FALSE</code> | |
| 94 * otherwise. | |
| 95 */ | |
| 96 PP_Bool (*IsNetworkList)(PP_Resource resource); | |
| 97 /** | |
| 98 * Gets number of interfaces in the list. | |
| 99 * | |
| 100 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 101 * network list. | |
| 102 * | |
| 103 * @return Returns number of available network interfaces or 0 if | |
| 104 * the list has never been updated. | |
| 105 */ | |
| 106 uint32_t (*GetCount)(PP_Resource resource); | |
| 107 /** | |
| 108 * Gets name of a network interface. | |
| 109 * | |
| 110 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 111 * network list. | |
| 112 * @param[in] index Index of the network interface. | |
| 113 * | |
| 114 * @return Returns name for the network interface with the specified | |
| 115 * <code>index</code>. | |
| 116 */ | |
| 117 struct PP_Var (*GetName)(PP_Resource resource, uint32_t index); | |
| 118 /** | |
| 119 * Gets type of a network interface. | |
| 120 * | |
| 121 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 122 * network list. | |
| 123 * @param[in] index Index of the network interface. | |
| 124 * | |
| 125 * @return Returns type of the network interface with the specified | |
| 126 * <code>index</code>. | |
| 127 */ | |
| 128 PP_NetworkListType_Private (*GetType)(PP_Resource resource, uint32_t index); | |
| 129 /** | |
| 130 * Gets state of a network interface. | |
| 131 * | |
| 132 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 133 * network list. | |
| 134 * @param[in] index Index of the network interface. | |
| 135 * | |
| 136 * @return Returns current state of the network interface with the | |
| 137 * specified <code>index</code>. | |
| 138 */ | |
| 139 PP_NetworkListState_Private (*GetState)(PP_Resource resource, uint32_t index); | |
| 140 /** | |
| 141 * Gets list of IP addresses for a network interface. | |
| 142 * | |
| 143 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 144 * network list. | |
| 145 * @param[in] index Index of the network interface. | |
| 146 * @param[in] output An output array which will receive | |
| 147 * <code>PPB_NetAddress</code> resources on success. Please note that the | |
| 148 * ref count of those resources has already been increased by 1 for the | |
| 149 * caller. | |
| 150 * | |
| 151 * @return An error code from <code>pp_errors.h</code>. | |
| 152 */ | |
| 153 int32_t (*GetIpAddresses)(PP_Resource resource, | |
| 154 uint32_t index, | |
| 155 struct PP_ArrayOutput output); | |
| 156 /** | |
| 157 * Gets display name of a network interface. | |
| 158 * | |
| 159 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 160 * network list. | |
| 161 * @param[in] index Index of the network interface. | |
| 162 * | |
| 163 * @return Returns display name for the network interface with the | |
| 164 * specified <code>index</code>. | |
| 165 */ | |
| 166 struct PP_Var (*GetDisplayName)(PP_Resource resource, uint32_t index); | |
| 167 /** | |
| 168 * Gets MTU (Maximum Transmission Unit) of a network interface. | |
| 169 * | |
| 170 * @param[in] resource A <code>PP_Resource</code> corresponding to a | |
| 171 * network list. | |
| 172 * @param[in] index Index of the network interface. | |
| 173 * | |
| 174 * @return Returns MTU for the network interface with the specified | |
| 175 * <code>index</code> or 0 if MTU is unknown. | |
| 176 */ | |
| 177 uint32_t (*GetMTU)(PP_Resource resource, uint32_t index); | |
| 178 }; | |
| 179 | |
| 180 typedef struct PPB_NetworkList_Private_0_3 PPB_NetworkList_Private; | |
| 181 /** | |
| 182 * @} | |
| 183 */ | |
| 184 | |
| 185 #endif /* PPAPI_C_PRIVATE_PPB_NETWORK_LIST_PRIVATE_H_ */ | |
| 186 | |
| OLD | NEW |