diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 20:29:46 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-08 20:29:46 +0000 |
commit | 7a2d96a5c7776d4811eb6a8a38e3d24fcf688e05 (patch) | |
tree | 5aac2872b0d97446acba4f436ee152e5e8a64419 /ppapi/c | |
parent | 1b645f3a76c8bcafb679124126551e689f8fba7a (diff) | |
download | chromium_src-7a2d96a5c7776d4811eb6a8a38e3d24fcf688e05.zip chromium_src-7a2d96a5c7776d4811eb6a8a38e3d24fcf688e05.tar.gz chromium_src-7a2d96a5c7776d4811eb6a8a38e3d24fcf688e05.tar.bz2 |
Add private Pepper API for dealing with PP_Flash_NetAddress.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/8357030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/private/ppb_flash_net_address.h | 85 | ||||
-rw-r--r-- | ppapi/c/private/ppb_flash_tcp_socket.h | 19 | ||||
-rw-r--r-- | ppapi/c/private/ppb_flash_udp_socket.h | 4 |
3 files changed, 89 insertions, 19 deletions
diff --git a/ppapi/c/private/ppb_flash_net_address.h b/ppapi/c/private/ppb_flash_net_address.h new file mode 100644 index 0000000..20b2ac9 --- /dev/null +++ b/ppapi/c/private/ppb_flash_net_address.h @@ -0,0 +1,85 @@ +/* Copyright (c) 2011 The Chromium Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/* From private/ppb_flash_net_address.idl modified Fri Nov 4 12:47:53 2011. */ + +#ifndef PPAPI_C_PRIVATE_PPB_FLASH_NET_ADDRESS_H_ +#define PPAPI_C_PRIVATE_PPB_FLASH_NET_ADDRESS_H_ + +#include "ppapi/c/pp_bool.h" +#include "ppapi/c/pp_macros.h" +#include "ppapi/c/pp_module.h" +#include "ppapi/c/pp_stdint.h" +#include "ppapi/c/pp_var.h" + +#define PPB_FLASH_NETADDRESS_INTERFACE_0_1 "PPB_Flash_NetAddress;0.1" +#define PPB_FLASH_NETADDRESS_INTERFACE PPB_FLASH_NETADDRESS_INTERFACE_0_1 + +/** + * @file + * This file defines the <code>PPB_Flash_NetAddress</code> interface. + */ + + +/** + * @addtogroup Structs + * @{ + */ +/** + * This is an opaque type holding a network address. + */ +struct PP_Flash_NetAddress { + uint32_t size; + char data[128]; +}; +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Flash_NetAddress, 132); +/** + * @} + */ + +/** + * @addtogroup Interfaces + * @{ + */ +/** + * The <code>PPB_Flash_NetAddress</code> interface provides operations on + * network addresses. + */ +struct PPB_Flash_NetAddress { + /** + * Returns PP_TRUE if the two addresses are equal (host and port). + */ + PP_Bool (*AreEqual)(const struct PP_Flash_NetAddress* addr1, + const struct PP_Flash_NetAddress* addr2); + /** + * Returns PP_TRUE if the two addresses refer to the same host. + */ + PP_Bool (*AreHostsEqual)(const struct PP_Flash_NetAddress* addr1, + const struct PP_Flash_NetAddress* 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. + */ + struct PP_Var (*Describe)(PP_Module module, + const struct PP_Flash_NetAddress* addr, + PP_Bool include_port); + /** + * Replaces the port in the given source address. Returns PP_TRUE on success. + */ + PP_Bool (*ReplacePort)(const struct PP_Flash_NetAddress* src_addr, + uint16_t port, + struct PP_Flash_NetAddress* dest_addr); + /** + * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. + */ + void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_Flash_NetAddress* addr); +}; +/** + * @} + */ + +#endif /* PPAPI_C_PRIVATE_PPB_FLASH_NET_ADDRESS_H_ */ + diff --git a/ppapi/c/private/ppb_flash_tcp_socket.h b/ppapi/c/private/ppb_flash_tcp_socket.h index 0cad5bc..cf75df9 100644 --- a/ppapi/c/private/ppb_flash_tcp_socket.h +++ b/ppapi/c/private/ppb_flash_tcp_socket.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From private/ppb_flash_tcp_socket.idl modified Fri Sep 23 17:09:42 2011. */ +/* From private/ppb_flash_tcp_socket.idl modified Mon Oct 17 16:09:17 2011. */ #ifndef PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ #define PPAPI_C_PRIVATE_PPB_FLASH_TCP_SOCKET_H_ @@ -14,6 +14,7 @@ #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" +#include "ppapi/c/private/ppb_flash_net_address.h" #define PPB_FLASH_TCPSOCKET_INTERFACE_0_2 "PPB_Flash_TCPSocket;0.2" #define PPB_FLASH_TCPSOCKET_INTERFACE PPB_FLASH_TCPSOCKET_INTERFACE_0_2 @@ -25,22 +26,6 @@ /** - * @addtogroup Structs - * @{ - */ -/** - * This is an opaque type holding a network address. - */ -struct PP_Flash_NetAddress { - uint32_t size; - char data[128]; -}; -PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Flash_NetAddress, 132); -/** - * @} - */ - -/** * @addtogroup Interfaces * @{ */ diff --git a/ppapi/c/private/ppb_flash_udp_socket.h b/ppapi/c/private/ppb_flash_udp_socket.h index 0909363..b7fc66e 100644 --- a/ppapi/c/private/ppb_flash_udp_socket.h +++ b/ppapi/c/private/ppb_flash_udp_socket.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppb_flash_udp_socket.idl modified Mon Sep 26 09:04:41 2011. */ +/* From private/ppb_flash_udp_socket.idl modified Mon Oct 17 15:55:01 2011. */ #ifndef PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ #define PPAPI_C_PRIVATE_PPB_FLASH_UDP_SOCKET_H_ @@ -14,7 +14,7 @@ #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_stdint.h" -#include "ppapi/c/private/ppb_flash_tcp_socket.h" +#include "ppapi/c/private/ppb_flash_net_address.h" #define PPB_FLASH_UDPSOCKET_INTERFACE_0_1 "PPB_Flash_UDPSocket;0.1" #define PPB_FLASH_UDPSOCKET_INTERFACE PPB_FLASH_UDPSOCKET_INTERFACE_0_1 |