| 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 /** | 6 /** |
| 7 * This file defines the <code>PPB_NetAddress_Private</code> interface. | 7 * This file defines the <code>PPB_NetAddress_Private</code> interface. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 label Chrome { | 10 label Chrome { |
| 11 M17 = 0.1 | 11 M17 = 0.1, |
| 12 M18 = 1.0 |
| 12 }; | 13 }; |
| 13 | 14 |
| 14 /** | 15 /** |
| 15 * This is an opaque type holding a network address. | 16 * This is an opaque type holding a network address. |
| 16 */ | 17 */ |
| 17 [assert_size(132)] | 18 [assert_size(132)] |
| 18 struct PP_NetAddress_Private { | 19 struct PP_NetAddress_Private { |
| 19 uint32_t size; | 20 uint32_t size; |
| 20 char[128] data; | 21 char[128] data; |
| 21 }; | 22 }; |
| 22 | 23 |
| 23 /** | 24 /** |
| 24 * The <code>PPB_NetAddress_Private</code> interface provides operations on | 25 * The <code>PPB_NetAddress_Private</code> interface provides operations on |
| 25 * network addresses. | 26 * network addresses. |
| 26 */ | 27 */ |
| 27 interface PPB_NetAddress_Private { | 28 interface PPB_NetAddress_Private { |
| 28 /** | 29 /** |
| 29 * Returns PP_TRUE if the two addresses are equal (host and port). | 30 * Returns PP_TRUE if the two addresses are equal (host and port). |
| 30 */ | 31 */ |
| 32 [version=0.1] |
| 31 PP_Bool AreEqual([in] PP_NetAddress_Private addr1, | 33 PP_Bool AreEqual([in] PP_NetAddress_Private addr1, |
| 32 [in] PP_NetAddress_Private addr2); | 34 [in] PP_NetAddress_Private addr2); |
| 33 | 35 |
| 34 /** | 36 /** |
| 35 * Returns PP_TRUE if the two addresses refer to the same host. | 37 * Returns PP_TRUE if the two addresses refer to the same host. |
| 36 */ | 38 */ |
| 39 [version=0.1] |
| 37 PP_Bool AreHostsEqual([in] PP_NetAddress_Private addr1, | 40 PP_Bool AreHostsEqual([in] PP_NetAddress_Private addr1, |
| 38 [in] PP_NetAddress_Private addr2); | 41 [in] PP_NetAddress_Private addr2); |
| 39 | 42 |
| 40 /** | 43 /** |
| 41 * Returns a human-readable description of the network address, optionally | 44 * Returns a human-readable description of the network address, optionally |
| 42 * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"), | 45 * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"), |
| 43 * or an undefined var on failure. | 46 * or an undefined var on failure. |
| 44 */ | 47 */ |
| 48 [version=0.1] |
| 45 PP_Var Describe([in] PP_Module module, | 49 PP_Var Describe([in] PP_Module module, |
| 46 [in] PP_NetAddress_Private addr, | 50 [in] PP_NetAddress_Private addr, |
| 47 [in] PP_Bool include_port); | 51 [in] PP_Bool include_port); |
| 48 | 52 |
| 49 /** | 53 /** |
| 50 * Replaces the port in the given source address. Returns PP_TRUE on success. | 54 * Replaces the port in the given source address. Returns PP_TRUE on success. |
| 51 */ | 55 */ |
| 56 [version=0.1] |
| 52 PP_Bool ReplacePort([in] PP_NetAddress_Private src_addr, | 57 PP_Bool ReplacePort([in] PP_NetAddress_Private src_addr, |
| 53 [in] uint16_t port, | 58 [in] uint16_t port, |
| 54 [out] PP_NetAddress_Private dest_addr); | 59 [out] PP_NetAddress_Private dest_addr); |
| 55 | 60 |
| 56 /** | 61 /** |
| 57 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. | 62 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. |
| 58 */ | 63 */ |
| 64 [version=0.1] |
| 59 void GetAnyAddress([in] PP_Bool is_ipv6, | 65 void GetAnyAddress([in] PP_Bool is_ipv6, |
| 60 [out] PP_NetAddress_Private addr); | 66 [out] PP_NetAddress_Private addr); |
| 67 |
| 68 /** |
| 69 * Gets the address family. |
| 70 */ |
| 71 [version=1.0] |
| 72 uint16_t GetFamily([in] PP_NetAddress_Private addr); |
| 73 |
| 74 /** |
| 75 * Gets the port. The port is returned in host byte order. |
| 76 */ |
| 77 [version=1.0] |
| 78 uint16_t GetPort([in] PP_NetAddress_Private addr); |
| 79 |
| 80 /** |
| 81 * Gets the address. The output, address, must be large enough for the |
| 82 * current socket family. The output will be the binary representation of an |
| 83 * address for the current socket family. For IPv4 and IPv6 the address is in |
| 84 * network byte order. True is returned if the address was successfully |
| 85 * retrieved. |
| 86 */ |
| 87 [version=1.0] |
| 88 PP_Bool GetAddress([in] PP_NetAddress_Private addr, |
| 89 [out] mem_t address, |
| 90 [in] uint16_t address_size); |
| 61 }; | 91 }; |
| OLD | NEW |