| OLD | NEW |
| (Empty) | |
| 1 /* Copyright (c) 2011 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_net_address.idl modified Fri Nov 4 12:47:53 2011. */ |
| 7 |
| 8 #ifndef PPAPI_C_PRIVATE_PPB_NET_ADDRESS_H_ |
| 9 #define PPAPI_C_PRIVATE_PPB_NET_ADDRESS_H_ |
| 10 |
| 11 #include "ppapi/c/pp_bool.h" |
| 12 #include "ppapi/c/pp_macros.h" |
| 13 #include "ppapi/c/pp_module.h" |
| 14 #include "ppapi/c/pp_stdint.h" |
| 15 #include "ppapi/c/pp_var.h" |
| 16 |
| 17 #define PPB_NETADDRESS_INTERFACE_0_2 "PPB_NetAddress;0.2" |
| 18 #define PPB_NETADDRESS_INTERFACE PPB_NETADDRESS_INTERFACE_0_2 |
| 19 |
| 20 /** |
| 21 * @file |
| 22 * This file defines the <code>PPB_NetAddress</code> interface. |
| 23 */ |
| 24 |
| 25 |
| 26 /** |
| 27 * @addtogroup Structs |
| 28 * @{ |
| 29 */ |
| 30 /** |
| 31 * This is an opaque type holding a network address. |
| 32 */ |
| 33 struct PP_NetAddress { |
| 34 uint32_t size; |
| 35 char data[128]; |
| 36 }; |
| 37 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_NetAddress, 132); |
| 38 /** |
| 39 * @} |
| 40 */ |
| 41 |
| 42 /** |
| 43 * @addtogroup Interfaces |
| 44 * @{ |
| 45 */ |
| 46 /** |
| 47 * The <code>PPB_NetAddress</code> interface provides operations on |
| 48 * network addresses. |
| 49 */ |
| 50 struct PPB_NetAddress { |
| 51 /** |
| 52 * Returns PP_TRUE if the two addresses are equal (host and port). |
| 53 */ |
| 54 PP_Bool (*AreEqual)(const struct PP_NetAddress* addr1, |
| 55 const struct PP_NetAddress* addr2); |
| 56 /** |
| 57 * Returns PP_TRUE if the two addresses refer to the same host. |
| 58 */ |
| 59 PP_Bool (*AreHostsEqual)(const struct PP_NetAddress* addr1, |
| 60 const struct PP_NetAddress* addr2); |
| 61 /** |
| 62 * Returns a human-readable description of the network address, optionally |
| 63 * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"), |
| 64 * or an undefined var on failure. |
| 65 */ |
| 66 struct PP_Var (*Describe)(PP_Module module, |
| 67 const struct PP_NetAddress* addr, |
| 68 PP_Bool include_port); |
| 69 /** |
| 70 * Replaces the port in the given source address. Returns PP_TRUE on success. |
| 71 */ |
| 72 PP_Bool (*ReplacePort)(const struct PP_NetAddress* src_addr, |
| 73 uint16_t port, |
| 74 struct PP_NetAddress* dest_addr); |
| 75 /** |
| 76 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. |
| 77 */ |
| 78 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress* addr); |
| 79 }; |
| 80 /** |
| 81 * @} |
| 82 */ |
| 83 |
| 84 #endif /* PPAPI_C_PRIVATE_PPB_NET_ADDRESS_H_ */ |
| 85 |
| OLD | NEW |