Pepper_42_C_interfaces
ppb_udp_socket_extension_samsung.h
Go to the documentation of this file.
1 /* Copyright (c) 2015 Samsung Electronics. All rights reserved.
2  */
3 
4 /* From samsung/ppb_udp_socket_extension_samsung.idl,
5  * modified Thu Mar 5 09:49:54 2015.
6  */
7 
8 #ifndef PPAPI_C_SAMSUNG_PPB_UDP_SOCKET_EXTENSION_SAMSUNG_H_
9 #define PPAPI_C_SAMSUNG_PPB_UDP_SOCKET_EXTENSION_SAMSUNG_H_
10 
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_completion_callback.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_resource.h"
15 #include "ppapi/c/pp_stdint.h"
16 #include "ppapi/c/pp_var.h"
17 #include "ppapi/c/ppb_udp_socket.h"
18 
19 #define PPB_UDPSOCKETEXTENSION_SAMSUNG_INTERFACE_0_1 \
20  "PPB_UDPSocketExtension_Samsung;0.1"
21 #define PPB_UDPSOCKETEXTENSION_SAMSUNG_INTERFACE \
22  PPB_UDPSOCKETEXTENSION_SAMSUNG_INTERFACE_0_1
23 
24 /**
25  * @file
26  * This file defines the <code>PPB_UDPSocketExtension_Samsung</code> interface.
27  */
28 
29 
30 /**
31  * @addtogroup Structs
32  * @{
33  */
34 /**
35  * Multicast membership addresses.
36  */
38  /**
39  * A <code>PPB_NetAddress</code> resource holding the IP multicast group
40  * address.
41  */
43  /**
44  * A <code>PPB_NetAddress</code> resource holding the IP address of local
45  * interface.
46  */
48  /**
49  * (Optional) A <code>PPB_NetAddress</code> resource holding the IP address of
50  * multicast source.
51  * Specify to join/leave only given source on multicast address.
52  */
54 };
55 /**
56  * @}
57  */
58 
59 /**
60  * @addtogroup Interfaces
61  * @{
62  */
63 /**
64  * The <code>PPB_UDPSocketExtension_Samsung</code> interface provides
65  * additional sockets functionality for PPB_UDPSocket. To use this
66  * interface, one have to create standard UDPSocket object.
67  *
68  * Permissions: This interface does not require additional permissions
69  * in relation to standard sockets.
70  */
72  /**
73  * Get a socket option on the associated socket.
74  * Please see the <code>PP_UDPSocket_Option</code> description for option
75  * names, value types and allowed values.
76  * Socket need to be already bound and method will fail with
77  * <code>PP_ERROR_FAILED</code> if it's not.
78  *
79  * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
80  * socket.
81  * @param[in] name The option to get.
82  * @param[out] Value of requested option.
83  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
84  * completion.
85  *
86  * @return An int32_t containing an error code from <code>pp_errors.h</code>.
87  */
88  int32_t (*GetOption)(PP_Resource udp_socket,
90  struct PP_Var* value,
91  struct PP_CompletionCallback callback);
92  /**
93  * Join a multicast group. Use optional <code>source_addr</code> to allow
94  * receiving data only from a specified source. This option can be used
95  * multiple times to allow receiving data from more than one source.
96  * Socket need to be already bound and method will fail with
97  * <code>PP_ERROR_FAILED</code> if it's not.
98  *
99  * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
100  * socket.
101  * @param[in] membership A <code>PP_MulticastMembership</code> multicast
102  * group and optional source IP.
103  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
104  * completion.
105  *
106  * @return An int32_t containing an error code from <code>pp_errors.h</code>.
107  */
108  int32_t (*JoinMulticast)(PP_Resource udp_socket,
109  const struct PP_MulticastMembership* membership,
110  struct PP_CompletionCallback callback);
111  /**
112  * Leave a multicast group. Use optional member <code>source_addr</code>
113  * to stop receiving data from multicast group that come from a given source.
114  * If the application has subscribed to multiple sources within the same
115  * group, data from the remaining sources will still be delivered.
116  * Socket need to be already bound and method will fail with
117  * <code>PP_ERROR_FAILED</code> if it's not.
118  *
119  * @param[in] udp_socket A <code>PP_Resource</code> corresponding to a UDP
120  * socket.
121  * @param[in] membership A <code>PP_MulticastMembership</code> multicast
122  * group and optional source IP.
123  * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon
124  * completion.
125  *
126  * @return An int32_t containing an error code from <code>pp_errors.h</code>.
127  */
128  int32_t (*LeaveMulticast)(PP_Resource udp_socket,
129  const struct PP_MulticastMembership* membership,
130  struct PP_CompletionCallback callback);
131 };
132 
135 /**
136  * @}
137  */
138 
139 #endif /* PPAPI_C_SAMSUNG_PPB_UDP_SOCKET_EXTENSION_SAMSUNG_H_ */
140 
PP_UDPSocket_Option
int32_t(* JoinMulticast)(PP_Resource udp_socket, const struct PP_MulticastMembership *membership, struct PP_CompletionCallback callback)
int32_t PP_Resource
Definition: pp_resource.h:40
union PP_VarValue value
Definition: pp_var.h:180
int32_t(* LeaveMulticast)(PP_Resource udp_socket, const struct PP_MulticastMembership *membership, struct PP_CompletionCallback callback)
Definition: pp_var.h:166
int32_t(* GetOption)(PP_Resource udp_socket, PP_UDPSocket_Option name, struct PP_Var *value, struct PP_CompletionCallback callback)