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

Side by Side Diff: ppapi/c/private/ppb_net_address_private.h

Issue 9235035: Add getter methods for sockaddr. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Fixing errors found by review system. Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_net_address_private.idl, 6 /* From private/ppb_net_address_private.idl,
7 * modified Wed Jan 4 11:09:00 2012. 7 * modified Fri Jan 06 11:20:11 2012.
8 */ 8 */
9 9
10 #ifndef PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ 10 #ifndef PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ 11 #define PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_
12 12
13 #include "ppapi/c/pp_bool.h" 13 #include "ppapi/c/pp_bool.h"
14 #include "ppapi/c/pp_macros.h" 14 #include "ppapi/c/pp_macros.h"
15 #include "ppapi/c/pp_module.h" 15 #include "ppapi/c/pp_module.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 18
19 #define PPB_NETADDRESS_PRIVATE_INTERFACE_0_1 "PPB_NetAddress_Private;0.1" 19 #define PPB_NETADDRESS_PRIVATE_INTERFACE_0_1 "PPB_NetAddress_Private;0.1"
20 #define PPB_NETADDRESS_PRIVATE_INTERFACE PPB_NETADDRESS_PRIVATE_INTERFACE_0_1 20 #define PPB_NETADDRESS_PRIVATE_INTERFACE_1_0 "PPB_NetAddress_Private;1.0"
21 #define PPB_NETADDRESS_PRIVATE_INTERFACE PPB_NETADDRESS_PRIVATE_INTERFACE_1_0
21 22
22 /** 23 /**
23 * @file 24 * @file
24 * This file defines the <code>PPB_NetAddress_Private</code> interface. 25 * This file defines the <code>PPB_NetAddress_Private</code> interface.
25 */ 26 */
26 27
27 28
28 /** 29 /**
29 * @addtogroup Structs 30 * @addtogroup Structs
30 * @{ 31 * @{
(...skipping 11 matching lines...) Expand all
42 */ 43 */
43 44
44 /** 45 /**
45 * @addtogroup Interfaces 46 * @addtogroup Interfaces
46 * @{ 47 * @{
47 */ 48 */
48 /** 49 /**
49 * The <code>PPB_NetAddress_Private</code> interface provides operations on 50 * The <code>PPB_NetAddress_Private</code> interface provides operations on
50 * network addresses. 51 * network addresses.
51 */ 52 */
52 struct PPB_NetAddress_Private_0_1 { 53 struct PPB_NetAddress_Private_1_0 {
53 /** 54 /**
54 * Returns PP_TRUE if the two addresses are equal (host and port). 55 * Returns PP_TRUE if the two addresses are equal (host and port).
55 */ 56 */
56 PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1, 57 PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1,
57 const struct PP_NetAddress_Private* addr2); 58 const struct PP_NetAddress_Private* addr2);
58 /** 59 /**
59 * Returns PP_TRUE if the two addresses refer to the same host. 60 * Returns PP_TRUE if the two addresses refer to the same host.
60 */ 61 */
61 PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1, 62 PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1,
62 const struct PP_NetAddress_Private* addr2); 63 const struct PP_NetAddress_Private* addr2);
63 /** 64 /**
64 * Returns a human-readable description of the network address, optionally 65 * Returns a human-readable description of the network address, optionally
65 * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"), 66 * including the port (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80"),
66 * or an undefined var on failure. 67 * or an undefined var on failure.
67 */ 68 */
68 struct PP_Var (*Describe)(PP_Module module, 69 struct PP_Var (*Describe)(PP_Module module,
69 const struct PP_NetAddress_Private* addr, 70 const struct PP_NetAddress_Private* addr,
70 PP_Bool include_port); 71 PP_Bool include_port);
71 /** 72 /**
72 * Replaces the port in the given source address. Returns PP_TRUE on success. 73 * Replaces the port in the given source address. Returns PP_TRUE on success.
73 */ 74 */
74 PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr, 75 PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr,
75 uint16_t port, 76 uint16_t port,
76 struct PP_NetAddress_Private* dest_addr); 77 struct PP_NetAddress_Private* dest_addr);
77 /** 78 /**
78 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind. 79 * Gets the "any" address (for IPv4 or IPv6); for use with UDP Bind.
79 */ 80 */
80 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr); 81 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr);
82 /**
83 * Gets the address family.
84 */
85 uint16_t (*GetFamily)(const struct PP_NetAddress_Private* addr);
86 /**
87 * Gets the port. The port is returned in host byte order.
88 */
89 uint16_t (*GetPort)(const struct PP_NetAddress_Private* addr);
90 /**
91 * Gets the address. The output, address, must be large enough for the
92 * current socket family. The output will be the binary representation of an
93 * address for the current socket family. For IPv4 and IPv6 the address is in
94 * network byte order. True is returned if the address was successfully
95 * retrieved.
96 */
97 PP_Bool (*GetAddress)(const struct PP_NetAddress_Private* addr,
98 void* address,
99 uint16_t address_size);
81 }; 100 };
82 101
83 typedef struct PPB_NetAddress_Private_0_1 PPB_NetAddress_Private; 102 typedef struct PPB_NetAddress_Private_1_0 PPB_NetAddress_Private;
103
104 struct PPB_NetAddress_Private_0_1 {
105 PP_Bool (*AreEqual)(const struct PP_NetAddress_Private* addr1,
106 const struct PP_NetAddress_Private* addr2);
107 PP_Bool (*AreHostsEqual)(const struct PP_NetAddress_Private* addr1,
108 const struct PP_NetAddress_Private* addr2);
109 struct PP_Var (*Describe)(PP_Module module,
110 const struct PP_NetAddress_Private* addr,
111 PP_Bool include_port);
112 PP_Bool (*ReplacePort)(const struct PP_NetAddress_Private* src_addr,
113 uint16_t port,
114 struct PP_NetAddress_Private* dest_addr);
115 void (*GetAnyAddress)(PP_Bool is_ipv6, struct PP_NetAddress_Private* addr);
116 };
84 /** 117 /**
85 * @} 118 * @}
86 */ 119 */
87 120
88 #endif /* PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ */ 121 #endif /* PPAPI_C_PRIVATE_PPB_NET_ADDRESS_PRIVATE_H_ */
89 122
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698