blob: c2593bdedc431057cbda6fc4a79195ad890bfb63 [file] [log] [blame]
[email protected]6c54e7e42011-03-02 20:52:341// Copyright (c) 2011 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5// IPC messages for the P2P Transport API.
[email protected]db803aae2011-03-05 02:00:426// Multiply-included message file, hence no include guard.
[email protected]6c54e7e42011-03-02 20:52:347
8#include "content/common/p2p_sockets.h"
9#include "ipc/ipc_message_macros.h"
[email protected]1a2123c62011-03-12 04:42:3910#include "net/base/ip_endpoint.h"
[email protected]91ed478b2011-04-21 23:20:0711#include "net/base/net_util.h"
[email protected]6c54e7e42011-03-02 20:52:3412
13#define IPC_MESSAGE_START P2PMsgStart
14
[email protected]b3f8f9722011-08-25 20:56:0715IPC_ENUM_TRAITS(content::P2PSocketType)
[email protected]db803aae2011-03-05 02:00:4216
[email protected]91ed478b2011-04-21 23:20:0717IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface)
18 IPC_STRUCT_TRAITS_MEMBER(name)
19 IPC_STRUCT_TRAITS_MEMBER(address)
20IPC_STRUCT_TRAITS_END()
21
[email protected]6c54e7e42011-03-02 20:52:3422// P2P Socket messages sent from the browser to the renderer.
23
[email protected]6d802c62011-07-13 18:20:4424IPC_MESSAGE_ROUTED1(P2PMsg_NetworkListChanged,
[email protected]91ed478b2011-04-21 23:20:0725 net::NetworkInterfaceList /* networks */)
26
[email protected]efa5d9382011-08-09 20:09:1427IPC_MESSAGE_ROUTED2(P2PMsg_GetHostAddressResult,
28 int32 /* request_id */,
29 net::IPAddressNumber /* address */)
30
[email protected]6c54e7e42011-03-02 20:52:3431IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated,
32 int /* socket_id */,
[email protected]1a2123c62011-03-12 04:42:3933 net::IPEndPoint /* socket_address */)
[email protected]6c54e7e42011-03-02 20:52:3434
35IPC_MESSAGE_ROUTED1(P2PMsg_OnError,
36 int /* socket_id */)
37
[email protected]0f2b2e952011-04-19 04:40:5638IPC_MESSAGE_ROUTED2(P2PMsg_OnIncomingTcpConnection,
39 int /* socket_id */,
40 net::IPEndPoint /* socket_address */)
41
[email protected]6c54e7e42011-03-02 20:52:3442IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived,
43 int /* socket_id */,
[email protected]1a2123c62011-03-12 04:42:3944 net::IPEndPoint /* socket_address */,
[email protected]6c54e7e42011-03-02 20:52:3445 std::vector<char> /* data */)
46
47// P2P Socket messages sent from the renderer to the browser.
48
[email protected]6d802c62011-07-13 18:20:4449// Start/stop sending P2PMsg_NetworkListChanged messages when network
50// configuration changes.
51IPC_MESSAGE_ROUTED0(P2PHostMsg_StartNetworkNotifications)
52IPC_MESSAGE_ROUTED0(P2PHostMsg_StopNetworkNotifications)
[email protected]91ed478b2011-04-21 23:20:0753
[email protected]efa5d9382011-08-09 20:09:1454IPC_MESSAGE_ROUTED2(P2PHostMsg_GetHostAddress,
55 std::string /* host_name */,
56 int32 /* request_id */)
57
[email protected]73a19c12011-04-20 00:25:4458IPC_MESSAGE_ROUTED4(P2PHostMsg_CreateSocket,
[email protected]b3f8f9722011-08-25 20:56:0759 content::P2PSocketType /* type */,
[email protected]6c54e7e42011-03-02 20:52:3460 int /* socket_id */,
[email protected]73a19c12011-04-20 00:25:4461 net::IPEndPoint /* local_address */,
[email protected]1a2123c62011-03-12 04:42:3962 net::IPEndPoint /* remote_address */)
[email protected]6c54e7e42011-03-02 20:52:3463
[email protected]0f2b2e952011-04-19 04:40:5664IPC_MESSAGE_ROUTED3(P2PHostMsg_AcceptIncomingTcpConnection,
65 int /* listen_socket_id */,
66 net::IPEndPoint /* remote_address */,
67 int /* connected_socket_id */)
68
[email protected]6c54e7e42011-03-02 20:52:3469// TODO(sergeyu): Use shared memory to pass the data.
70IPC_MESSAGE_ROUTED3(P2PHostMsg_Send,
71 int /* socket_id */,
[email protected]1a2123c62011-03-12 04:42:3972 net::IPEndPoint /* socket_address */,
[email protected]6c54e7e42011-03-02 20:52:3473 std::vector<char> /* data */)
74
75IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket,
[email protected]1a2123c62011-03-12 04:42:3976 int /* socket_id */)