OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From private/ppb_udp_socket_private.idl modified Mon Jun 24 09:53:43 2013. */ | 6 /* From private/ppb_udp_socket_private.idl modified Mon Dec 15 17:47:37 2014. */ |
7 | 7 |
8 #ifndef PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ | 8 #ifndef PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ |
9 #define PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ | 9 #define PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_completion_callback.h" | 12 #include "ppapi/c/pp_completion_callback.h" |
13 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
14 #include "ppapi/c/pp_macros.h" | 14 #include "ppapi/c/pp_macros.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
17 #include "ppapi/c/pp_var.h" | 17 #include "ppapi/c/pp_var.h" |
18 #include "ppapi/c/private/ppb_net_address_private.h" | 18 #include "ppapi/c/private/ppb_net_address_private.h" |
19 | 19 |
20 #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_2 "PPB_UDPSocket_Private;0.2" | 20 #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_2 "PPB_UDPSocket_Private;0.2" |
21 #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_3 "PPB_UDPSocket_Private;0.3" | 21 #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_3 "PPB_UDPSocket_Private;0.3" |
22 #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_4 "PPB_UDPSocket_Private;0.4" | 22 #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_4 "PPB_UDPSocket_Private;0.4" |
23 #define PPB_UDPSOCKET_PRIVATE_INTERFACE PPB_UDPSOCKET_PRIVATE_INTERFACE_0_4 | 23 #define PPB_UDPSOCKET_PRIVATE_INTERFACE_0_5 "PPB_UDPSocket_Private;0.5" |
| 24 #define PPB_UDPSOCKET_PRIVATE_INTERFACE PPB_UDPSOCKET_PRIVATE_INTERFACE_0_5 |
24 | 25 |
25 /** | 26 /** |
26 * @file | 27 * @file |
27 * This file defines the <code>PPB_UDPSocket_Private</code> interface. | 28 * This file defines the <code>PPB_UDPSocket_Private</code> interface. |
28 */ | 29 */ |
29 | 30 |
30 | 31 |
31 /** | 32 /** |
32 * @addtogroup Enums | 33 * @addtogroup Enums |
33 * @{ | 34 * @{ |
34 */ | 35 */ |
35 typedef enum { | 36 typedef enum { |
36 /* Allow the socket to share the local address to which socket will | 37 /* Allow the socket to share the local address to which socket will |
37 * be bound with other processes. Value's type should be | 38 * be bound with other processes. Value's type should be |
38 * PP_VARTYPE_BOOL. */ | 39 * PP_VARTYPE_BOOL. */ |
39 PP_UDPSOCKETFEATURE_PRIVATE_ADDRESS_REUSE = 0, | 40 PP_UDPSOCKETFEATURE_PRIVATE_ADDRESS_REUSE = 0, |
40 /* Allow sending and receiving packets sent to and from broadcast | 41 /* Allow sending and receiving packets sent to and from broadcast |
41 * addresses. Value's type should be PP_VARTYPE_BOOL. */ | 42 * addresses. Value's type should be PP_VARTYPE_BOOL. */ |
42 PP_UDPSOCKETFEATURE_PRIVATE_BROADCAST = 1, | 43 PP_UDPSOCKETFEATURE_PRIVATE_BROADCAST = 1, |
| 44 /* Whether multicast packets sent from the host to the multicast group should |
| 45 * be looped back to the host or not. Value's type should be PP_VARTYPE_BOOL. |
| 46 * This is only supported in version 0.5 of the API (Chrome 41) and later. */ |
| 47 PP_UDPSOCKETFEATURE_PRIVATE_MULTICAST_LOOP = 2, |
| 48 /* Set time-to-live for multicast packets, from 0 to 255. Value's type should |
| 49 * be PP_VARTYPE_INT32. |
| 50 * This is only supported in version 0.5 of the API (Chrome 41) and later. */ |
| 51 PP_UDPSOCKETFEATURE_PRIVATE_MULTICAST_TTL = 3, |
| 52 /* Set network interface from which the multicast packets will be sent and |
| 53 * received. Value's type should be PP_VARTYPE_INT32. |
| 54 * This is only supported in version 0.5 of the API (Chrome 41) and later. */ |
| 55 PP_UDPSOCKETFEATURE_PRIVATE_MULTICAST_IF = 4, |
| 56 /* Join a multicast group and start receiving packets. Value's type should be |
| 57 * PP_VARTYPE_RESOURCE. |
| 58 * This is only supported in version 0.5 of the API (Chrome 41) and later. */ |
| 59 PP_UDPSOCKETFEATURE_PRIVATE_MULTICAST_JOIN = 5, |
| 60 /* Leave a multicast group previously joined. Value's type should be |
| 61 * PP_VARTYPE_RESOURCE. |
| 62 * This is only supported in version 0.5 of the API (Chrome 41) and later. */ |
| 63 PP_UDPSOCKETFEATURE_PRIVATE_MULTICAST_LEAVE = 6, |
43 /* Special value for counting the number of available | 64 /* Special value for counting the number of available |
44 * features. Should not be passed to SetSocketFeature(). */ | 65 * features. Should not be passed to SetSocketFeature(). */ |
45 PP_UDPSOCKETFEATURE_PRIVATE_COUNT = 2 | 66 PP_UDPSOCKETFEATURE_PRIVATE_COUNT = 7 |
46 } PP_UDPSocketFeature_Private; | 67 } PP_UDPSocketFeature_Private; |
47 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocketFeature_Private, 4); | 68 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_UDPSocketFeature_Private, 4); |
48 /** | 69 /** |
49 * @} | 70 * @} |
50 */ | 71 */ |
51 | 72 |
52 /** | 73 /** |
53 * @addtogroup Interfaces | 74 * @addtogroup Interfaces |
54 * @{ | 75 * @{ |
55 */ | 76 */ |
56 struct PPB_UDPSocket_Private_0_4 { | 77 struct PPB_UDPSocket_Private_0_5 { |
57 /** | 78 /** |
58 * Creates a UDP socket resource. | 79 * Creates a UDP socket resource. |
59 */ | 80 */ |
60 PP_Resource (*Create)(PP_Instance instance_id); | 81 PP_Resource (*Create)(PP_Instance instance_id); |
61 /** | 82 /** |
62 * Determines if a given resource is a UDP socket. | 83 * Determines if a given resource is a UDP socket. |
63 */ | 84 */ |
64 PP_Bool (*IsUDPSocket)(PP_Resource resource_id); | 85 PP_Bool (*IsUDPSocket)(PP_Resource resource_id); |
65 /** | 86 /** |
66 * Sets a socket feature to |udp_socket|. Should be called before | 87 * Sets a socket feature to |udp_socket|. Should be called before |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 */ | 125 */ |
105 int32_t (*SendTo)(PP_Resource udp_socket, | 126 int32_t (*SendTo)(PP_Resource udp_socket, |
106 const char* buffer, | 127 const char* buffer, |
107 int32_t num_bytes, | 128 int32_t num_bytes, |
108 const struct PP_NetAddress_Private* addr, | 129 const struct PP_NetAddress_Private* addr, |
109 struct PP_CompletionCallback callback); | 130 struct PP_CompletionCallback callback); |
110 /* Cancels all pending reads and writes, and closes the socket. */ | 131 /* Cancels all pending reads and writes, and closes the socket. */ |
111 void (*Close)(PP_Resource udp_socket); | 132 void (*Close)(PP_Resource udp_socket); |
112 }; | 133 }; |
113 | 134 |
114 typedef struct PPB_UDPSocket_Private_0_4 PPB_UDPSocket_Private; | 135 typedef struct PPB_UDPSocket_Private_0_5 PPB_UDPSocket_Private; |
115 | 136 |
116 struct PPB_UDPSocket_Private_0_2 { | 137 struct PPB_UDPSocket_Private_0_2 { |
117 PP_Resource (*Create)(PP_Instance instance_id); | 138 PP_Resource (*Create)(PP_Instance instance_id); |
118 PP_Bool (*IsUDPSocket)(PP_Resource resource_id); | 139 PP_Bool (*IsUDPSocket)(PP_Resource resource_id); |
119 int32_t (*Bind)(PP_Resource udp_socket, | 140 int32_t (*Bind)(PP_Resource udp_socket, |
120 const struct PP_NetAddress_Private* addr, | 141 const struct PP_NetAddress_Private* addr, |
121 struct PP_CompletionCallback callback); | 142 struct PP_CompletionCallback callback); |
122 int32_t (*RecvFrom)(PP_Resource udp_socket, | 143 int32_t (*RecvFrom)(PP_Resource udp_socket, |
123 char* buffer, | 144 char* buffer, |
124 int32_t num_bytes, | 145 int32_t num_bytes, |
(...skipping 22 matching lines...) Expand all Loading... |
147 struct PP_CompletionCallback callback); | 168 struct PP_CompletionCallback callback); |
148 PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, | 169 PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, |
149 struct PP_NetAddress_Private* addr); | 170 struct PP_NetAddress_Private* addr); |
150 int32_t (*SendTo)(PP_Resource udp_socket, | 171 int32_t (*SendTo)(PP_Resource udp_socket, |
151 const char* buffer, | 172 const char* buffer, |
152 int32_t num_bytes, | 173 int32_t num_bytes, |
153 const struct PP_NetAddress_Private* addr, | 174 const struct PP_NetAddress_Private* addr, |
154 struct PP_CompletionCallback callback); | 175 struct PP_CompletionCallback callback); |
155 void (*Close)(PP_Resource udp_socket); | 176 void (*Close)(PP_Resource udp_socket); |
156 }; | 177 }; |
| 178 |
| 179 struct PPB_UDPSocket_Private_0_4 { |
| 180 PP_Resource (*Create)(PP_Instance instance_id); |
| 181 PP_Bool (*IsUDPSocket)(PP_Resource resource_id); |
| 182 int32_t (*SetSocketFeature)(PP_Resource udp_socket, |
| 183 PP_UDPSocketFeature_Private_0_4 name, |
| 184 struct PP_Var value); |
| 185 int32_t (*Bind)(PP_Resource udp_socket, |
| 186 const struct PP_NetAddress_Private* addr, |
| 187 struct PP_CompletionCallback callback); |
| 188 PP_Bool (*GetBoundAddress)(PP_Resource udp_socket, |
| 189 struct PP_NetAddress_Private* addr); |
| 190 int32_t (*RecvFrom)(PP_Resource udp_socket, |
| 191 char* buffer, |
| 192 int32_t num_bytes, |
| 193 struct PP_CompletionCallback callback); |
| 194 PP_Bool (*GetRecvFromAddress)(PP_Resource udp_socket, |
| 195 struct PP_NetAddress_Private* addr); |
| 196 int32_t (*SendTo)(PP_Resource udp_socket, |
| 197 const char* buffer, |
| 198 int32_t num_bytes, |
| 199 const struct PP_NetAddress_Private* addr, |
| 200 struct PP_CompletionCallback callback); |
| 201 void (*Close)(PP_Resource udp_socket); |
| 202 }; |
157 /** | 203 /** |
158 * @} | 204 * @} |
159 */ | 205 */ |
160 | 206 |
161 #endif /* PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ */ | 207 #endif /* PPAPI_C_PRIVATE_PPB_UDP_SOCKET_PRIVATE_H_ */ |
162 | 208 |
OLD | NEW |