blob: e5010dd3149c000d5ebbf800cb9a83c5904b0ca9 [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]db803aae2011-03-05 02:00:4215IPC_ENUM_TRAITS(P2PSocketType)
16
[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]91ed478b2011-04-21 23:20:0724IPC_MESSAGE_ROUTED1(P2PMsg_NetworkList,
25 net::NetworkInterfaceList /* networks */)
26
[email protected]6c54e7e42011-03-02 20:52:3427IPC_MESSAGE_ROUTED2(P2PMsg_OnSocketCreated,
28 int /* socket_id */,
[email protected]1a2123c62011-03-12 04:42:3929 net::IPEndPoint /* socket_address */)
[email protected]6c54e7e42011-03-02 20:52:3430
31IPC_MESSAGE_ROUTED1(P2PMsg_OnError,
32 int /* socket_id */)
33
[email protected]0f2b2e952011-04-19 04:40:5634IPC_MESSAGE_ROUTED2(P2PMsg_OnIncomingTcpConnection,
35 int /* socket_id */,
36 net::IPEndPoint /* socket_address */)
37
[email protected]6c54e7e42011-03-02 20:52:3438IPC_MESSAGE_ROUTED3(P2PMsg_OnDataReceived,
39 int /* socket_id */,
[email protected]1a2123c62011-03-12 04:42:3940 net::IPEndPoint /* socket_address */,
[email protected]6c54e7e42011-03-02 20:52:3441 std::vector<char> /* data */)
42
43// P2P Socket messages sent from the renderer to the browser.
44
[email protected]91ed478b2011-04-21 23:20:0745IPC_MESSAGE_ROUTED0(P2PHostMsg_GetNetworkList)
46
[email protected]73a19c12011-04-20 00:25:4447IPC_MESSAGE_ROUTED4(P2PHostMsg_CreateSocket,
[email protected]6c54e7e42011-03-02 20:52:3448 P2PSocketType /* type */,
49 int /* socket_id */,
[email protected]73a19c12011-04-20 00:25:4450 net::IPEndPoint /* local_address */,
[email protected]1a2123c62011-03-12 04:42:3951 net::IPEndPoint /* remote_address */)
[email protected]6c54e7e42011-03-02 20:52:3452
[email protected]0f2b2e952011-04-19 04:40:5653IPC_MESSAGE_ROUTED3(P2PHostMsg_AcceptIncomingTcpConnection,
54 int /* listen_socket_id */,
55 net::IPEndPoint /* remote_address */,
56 int /* connected_socket_id */)
57
[email protected]6c54e7e42011-03-02 20:52:3458// TODO(sergeyu): Use shared memory to pass the data.
59IPC_MESSAGE_ROUTED3(P2PHostMsg_Send,
60 int /* socket_id */,
[email protected]1a2123c62011-03-12 04:42:3961 net::IPEndPoint /* socket_address */,
[email protected]6c54e7e42011-03-02 20:52:3462 std::vector<char> /* data */)
63
64IPC_MESSAGE_ROUTED1(P2PHostMsg_DestroySocket,
[email protected]1a2123c62011-03-12 04:42:3965 int /* socket_id */)