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 // IPC messages for the P2P Transport API. | 5 // IPC messages for the P2P Transport API. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/common/p2p_socket_type.h" | 10 #include "content/common/p2p_socket_type.h" |
11 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
12 #include "net/base/ip_endpoint.h" | |
13 #include "net/base/net_util.h" | 12 #include "net/base/net_util.h" |
14 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" | 13 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" |
15 | 14 |
16 #undef IPC_MESSAGE_EXPORT | 15 #undef IPC_MESSAGE_EXPORT |
17 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 16 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
18 #define IPC_MESSAGE_START P2PMsgStart | 17 #define IPC_MESSAGE_START P2PMsgStart |
19 | 18 |
20 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketType, | 19 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketType, |
21 content::P2P_SOCKET_TYPE_LAST) | 20 content::P2P_SOCKET_TYPE_LAST) |
22 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketOption, | 21 IPC_ENUM_TRAITS_MAX_VALUE(content::P2PSocketOption, |
(...skipping 12 matching lines...) Expand all Loading... |
35 IPC_STRUCT_TRAITS_MEMBER(srtp_auth_key) | 34 IPC_STRUCT_TRAITS_MEMBER(srtp_auth_key) |
36 IPC_STRUCT_TRAITS_MEMBER(srtp_auth_tag_len) | 35 IPC_STRUCT_TRAITS_MEMBER(srtp_auth_tag_len) |
37 IPC_STRUCT_TRAITS_MEMBER(srtp_packet_index) | 36 IPC_STRUCT_TRAITS_MEMBER(srtp_packet_index) |
38 IPC_STRUCT_TRAITS_END() | 37 IPC_STRUCT_TRAITS_END() |
39 | 38 |
40 IPC_STRUCT_TRAITS_BEGIN(talk_base::PacketOptions) | 39 IPC_STRUCT_TRAITS_BEGIN(talk_base::PacketOptions) |
41 IPC_STRUCT_TRAITS_MEMBER(dscp) | 40 IPC_STRUCT_TRAITS_MEMBER(dscp) |
42 IPC_STRUCT_TRAITS_MEMBER(packet_time_params) | 41 IPC_STRUCT_TRAITS_MEMBER(packet_time_params) |
43 IPC_STRUCT_TRAITS_END() | 42 IPC_STRUCT_TRAITS_END() |
44 | 43 |
| 44 IPC_STRUCT_TRAITS_BEGIN(content::P2PHostAndIPEndPoint) |
| 45 IPC_STRUCT_TRAITS_MEMBER(hostname) |
| 46 IPC_STRUCT_TRAITS_MEMBER(ip_address) |
| 47 IPC_STRUCT_TRAITS_END() |
| 48 |
45 // P2P Socket messages sent from the browser to the renderer. | 49 // P2P Socket messages sent from the browser to the renderer. |
46 | 50 |
47 IPC_MESSAGE_CONTROL1(P2PMsg_NetworkListChanged, | 51 IPC_MESSAGE_CONTROL1(P2PMsg_NetworkListChanged, |
48 net::NetworkInterfaceList /* networks */) | 52 net::NetworkInterfaceList /* networks */) |
49 | 53 |
50 IPC_MESSAGE_CONTROL2(P2PMsg_GetHostAddressResult, | 54 IPC_MESSAGE_CONTROL2(P2PMsg_GetHostAddressResult, |
51 int32 /* request_id */, | 55 int32 /* request_id */, |
52 net::IPAddressList /* address list*/) | 56 net::IPAddressList /* address list*/) |
53 | 57 |
54 IPC_MESSAGE_CONTROL2(P2PMsg_OnSocketCreated, | 58 IPC_MESSAGE_CONTROL2(P2PMsg_OnSocketCreated, |
(...skipping 24 matching lines...) Expand all Loading... |
79 IPC_MESSAGE_CONTROL0(P2PHostMsg_StopNetworkNotifications) | 83 IPC_MESSAGE_CONTROL0(P2PHostMsg_StopNetworkNotifications) |
80 | 84 |
81 IPC_MESSAGE_CONTROL2(P2PHostMsg_GetHostAddress, | 85 IPC_MESSAGE_CONTROL2(P2PHostMsg_GetHostAddress, |
82 std::string /* host_name */, | 86 std::string /* host_name */, |
83 int32 /* request_id */) | 87 int32 /* request_id */) |
84 | 88 |
85 IPC_MESSAGE_CONTROL4(P2PHostMsg_CreateSocket, | 89 IPC_MESSAGE_CONTROL4(P2PHostMsg_CreateSocket, |
86 content::P2PSocketType /* type */, | 90 content::P2PSocketType /* type */, |
87 int /* socket_id */, | 91 int /* socket_id */, |
88 net::IPEndPoint /* local_address */, | 92 net::IPEndPoint /* local_address */, |
89 net::IPEndPoint /* remote_address */) | 93 content::P2PHostAndIPEndPoint /* remote_address */) |
90 | 94 |
91 IPC_MESSAGE_CONTROL3(P2PHostMsg_AcceptIncomingTcpConnection, | 95 IPC_MESSAGE_CONTROL3(P2PHostMsg_AcceptIncomingTcpConnection, |
92 int /* listen_socket_id */, | 96 int /* listen_socket_id */, |
93 net::IPEndPoint /* remote_address */, | 97 net::IPEndPoint /* remote_address */, |
94 int /* connected_socket_id */) | 98 int /* connected_socket_id */) |
95 | 99 |
96 // TODO(sergeyu): Use shared memory to pass the data. | 100 // TODO(sergeyu): Use shared memory to pass the data. |
97 IPC_MESSAGE_CONTROL5(P2PHostMsg_Send, | 101 IPC_MESSAGE_CONTROL5(P2PHostMsg_Send, |
98 int /* socket_id */, | 102 int /* socket_id */, |
99 net::IPEndPoint /* socket_address */, | 103 net::IPEndPoint /* socket_address */, |
100 std::vector<char> /* data */, | 104 std::vector<char> /* data */, |
101 talk_base::PacketOptions /* packet options */, | 105 talk_base::PacketOptions /* packet options */, |
102 uint64 /* packet_id */) | 106 uint64 /* packet_id */) |
103 | 107 |
104 IPC_MESSAGE_CONTROL1(P2PHostMsg_DestroySocket, | 108 IPC_MESSAGE_CONTROL1(P2PHostMsg_DestroySocket, |
105 int /* socket_id */) | 109 int /* socket_id */) |
106 | 110 |
107 IPC_MESSAGE_CONTROL3(P2PHostMsg_SetOption, | 111 IPC_MESSAGE_CONTROL3(P2PHostMsg_SetOption, |
108 int /* socket_id */, | 112 int /* socket_id */, |
109 content::P2PSocketOption /* socket option type */, | 113 content::P2PSocketOption /* socket option type */, |
110 int /* value */) | 114 int /* value */) |
OLD | NEW |