Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Unified Diff: ppapi/api/private/ppb_net_address_private.idl

Issue 9722008: Add CreateFromIPv[46]Address() in PPB_NetAddress_Private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/ui/ppapi_uitest.cc ('k') | ppapi/c/private/ppb_net_address_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/api/private/ppb_net_address_private.idl
diff --git a/ppapi/api/private/ppb_net_address_private.idl b/ppapi/api/private/ppb_net_address_private.idl
index 01a370b41206261ed9e55bc53220a6f485ee0771..222097fca9ea846b39a89eff45c99be9f67b6f7d 100644
--- a/ppapi/api/private/ppb_net_address_private.idl
+++ b/ppapi/api/private/ppb_net_address_private.idl
@@ -9,7 +9,8 @@
label Chrome {
M17 = 0.1,
- M19 = 1.0
+ M19_0 = 1.0,
+ M19_1 = 1.1
};
[assert_size(4)]
@@ -29,7 +30,8 @@ enum PP_NetAddressFamily_Private {
};
/**
- * This is an opaque type holding a network address.
+ * This is an opaque type holding a network address. Plugins must
+ * never access members of this struct directly.
*/
[assert_size(132)]
struct PP_NetAddress_Private {
@@ -43,60 +45,84 @@ struct PP_NetAddress_Private {
*/
interface PPB_NetAddress_Private {
/**
- * Returns PP_TRUE if the two addresses are equal (host and port).
- */
+ * Returns PP_TRUE if the two addresses are equal (host and port).
+ */
PP_Bool AreEqual([in] PP_NetAddress_Private addr1,
[in] PP_NetAddress_Private addr2);
/**
- * Returns PP_TRUE if the two addresses refer to the same host.
- */
+ * Returns PP_TRUE if the two addresses refer to the same host.
+ */
PP_Bool AreHostsEqual([in] PP_NetAddress_Private addr1,
[in] PP_NetAddress_Private addr2);
/**
- * Returns a human-readable description of the network address, optionally
- * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"),
- * or an undefined var on failure.
- */
+ * Returns a human-readable description of the network address, optionally
+ * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"),
+ * or an undefined var on failure.
+ */
PP_Var Describe([in] PP_Module module,
[in] PP_NetAddress_Private addr,
[in] PP_Bool include_port);
/**
- * Replaces the port in the given source address. Returns PP_TRUE on success.
- */
+ * Replaces the port in the given source address. Returns PP_TRUE on success.
+ */
PP_Bool ReplacePort([in] PP_NetAddress_Private src_addr,
[in] uint16_t port,
- [out] PP_NetAddress_Private dest_addr);
+ [out] PP_NetAddress_Private addr_out);
/**
- * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind.
- */
+ * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind.
+ */
void GetAnyAddress([in] PP_Bool is_ipv6,
[out] PP_NetAddress_Private addr);
/**
- * Gets the address family.
- */
+ * Gets the address family.
+ */
[version=1.0]
PP_NetAddressFamily_Private GetFamily([in] PP_NetAddress_Private addr);
/**
- * Gets the port. The port is returned in host byte order.
- */
+ * Gets the port. The port is returned in host byte order.
+ */
[version=1.0]
uint16_t GetPort([in] PP_NetAddress_Private addr);
/**
- * Gets the address. The output, address, must be large enough for the
- * current socket family. The output will be the binary representation of an
- * address for the current socket family. For IPv4 and IPv6 the address is in
- * network byte order. PP_TRUE is returned if the address was successfully
- * retrieved.
- */
+ * Gets the address. The output, address, must be large enough for the
+ * current socket family. The output will be the binary representation of an
+ * address for the current socket family. For IPv4 and IPv6 the address is in
+ * network byte order. PP_TRUE is returned if the address was successfully
+ * retrieved.
+ */
[version=1.0]
PP_Bool GetAddress([in] PP_NetAddress_Private addr,
[out] mem_t address,
[in] uint16_t address_size);
+
+ /**
+ * Returns ScopeID for IPv6 addresses or 0 for IPv4.
+ */
+ [version=1.1]
+ uint32_t GetScopeID([in] PP_NetAddress_Private addr);
+
+ /**
+ * Creates NetAddress with the specified IPv4 address and port
+ * number.
+ */
+ [version=1.1]
+ void CreateFromIPv4Address([in] uint8_t[4] ip,
+ [in] uint16_t port,
+ [out] PP_NetAddress_Private addr_out);
+ /**
+ * Creates NetAddress with the specified IPv6 address, scope_id and
+ * port number.
+ */
+ [version=1.1]
+ void CreateFromIPv6Address([in] uint8_t[16] ip,
+ [in] uint32_t scope_id,
+ [in] uint16_t port,
+ [out] PP_NetAddress_Private addr_out);
};
« no previous file with comments | « chrome/test/ui/ppapi_uitest.cc ('k') | ppapi/c/private/ppb_net_address_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698