blob: 59f6a8f629a8aea087c275a3c21e850247537049 [file] [log] [blame]
[email protected]7de84042012-02-21 16:04:501// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]6c54e7e42011-03-02 20:52:342// 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
[email protected]7de84042012-02-21 16:04:508#include "content/common/content_export.h"
[email protected]6c54e7e42011-03-02 20:52:349#include "content/common/p2p_sockets.h"
10#include "ipc/ipc_message_macros.h"
[email protected]1a2123c62011-03-12 04:42:3911#include "net/base/ip_endpoint.h"
[email protected]91ed478b2011-04-21 23:20:0712#include "net/base/net_util.h"
[email protected]6c54e7e42011-03-02 20:52:3413
[email protected]7de84042012-02-21 16:04:5014#undef IPC_MESSAGE_EXPORT
15#define IPC_MESSAGE_EXPORT CONTENT_EXPORT
[email protected]6c54e7e42011-03-02 20:52:3416#define IPC_MESSAGE_START P2PMsgStart
17
[email protected]b3f8f9722011-08-25 20:56:0718IPC_ENUM_TRAITS(content::P2PSocketType)
[email protected]db803aae2011-03-05 02:00:4219
[email protected]91ed478b2011-04-21 23:20:0720IPC_STRUCT_TRAITS_BEGIN(net::NetworkInterface)
21 IPC_STRUCT_TRAITS_MEMBER(name)
22 IPC_STRUCT_TRAITS_MEMBER(address)
23IPC_STRUCT_TRAITS_END()
24
[email protected]6c54e7e42011-03-02 20:52:3425// P2P Socket messages sent from the browser to the renderer.
26
[email protected]4761cf12012-09-12 10:37:5527IPC_MESSAGE_CONTROL1(P2PMsg_NetworkListChanged,
28 net::NetworkInterfaceList /* networks */)
[email protected]91ed478b2011-04-21 23:20:0729
[email protected]4761cf12012-09-12 10:37:5530IPC_MESSAGE_CONTROL2(P2PMsg_GetHostAddressResult,
31 int32 /* request_id */,
32 net::IPAddressNumber /* address */)
[email protected]efa5d9382011-08-09 20:09:1433
[email protected]4761cf12012-09-12 10:37:5534IPC_MESSAGE_CONTROL2(P2PMsg_OnSocketCreated,
35 int /* socket_id */,
36 net::IPEndPoint /* socket_address */)
[email protected]6c54e7e42011-03-02 20:52:3437
[email protected]4761cf12012-09-12 10:37:5538IPC_MESSAGE_CONTROL1(P2PMsg_OnError,
39 int /* socket_id */)
[email protected]6c54e7e42011-03-02 20:52:3440
[email protected]4761cf12012-09-12 10:37:5541IPC_MESSAGE_CONTROL2(P2PMsg_OnIncomingTcpConnection,
42 int /* socket_id */,
43 net::IPEndPoint /* socket_address */)
[email protected]0f2b2e952011-04-19 04:40:5644
[email protected]4761cf12012-09-12 10:37:5545IPC_MESSAGE_CONTROL3(P2PMsg_OnDataReceived,
46 int /* socket_id */,
47 net::IPEndPoint /* socket_address */,
48 std::vector<char> /* data */)
[email protected]6c54e7e42011-03-02 20:52:3449
50// P2P Socket messages sent from the renderer to the browser.
51
[email protected]6d802c62011-07-13 18:20:4452// Start/stop sending P2PMsg_NetworkListChanged messages when network
53// configuration changes.
[email protected]4761cf12012-09-12 10:37:5554IPC_MESSAGE_CONTROL0(P2PHostMsg_StartNetworkNotifications)
55IPC_MESSAGE_CONTROL0(P2PHostMsg_StopNetworkNotifications)
[email protected]91ed478b2011-04-21 23:20:0756
[email protected]4761cf12012-09-12 10:37:5557IPC_MESSAGE_CONTROL2(P2PHostMsg_GetHostAddress,
[email protected]efa5d9382011-08-09 20:09:1458 std::string /* host_name */,
59 int32 /* request_id */)
60
[email protected]4761cf12012-09-12 10:37:5561IPC_MESSAGE_CONTROL4(P2PHostMsg_CreateSocket,
62 content::P2PSocketType /* type */,
63 int /* socket_id */,
64 net::IPEndPoint /* local_address */,
65 net::IPEndPoint /* remote_address */)
[email protected]6c54e7e42011-03-02 20:52:3466
[email protected]4761cf12012-09-12 10:37:5567IPC_MESSAGE_CONTROL3(P2PHostMsg_AcceptIncomingTcpConnection,
[email protected]0f2b2e952011-04-19 04:40:5668 int /* listen_socket_id */,
69 net::IPEndPoint /* remote_address */,
70 int /* connected_socket_id */)
71
[email protected]6c54e7e42011-03-02 20:52:3472// TODO(sergeyu): Use shared memory to pass the data.
[email protected]4761cf12012-09-12 10:37:5573IPC_MESSAGE_CONTROL3(P2PHostMsg_Send,
74 int /* socket_id */,
75 net::IPEndPoint /* socket_address */,
76 std::vector<char> /* data */)
[email protected]6c54e7e42011-03-02 20:52:3477
[email protected]4761cf12012-09-12 10:37:5578IPC_MESSAGE_CONTROL1(P2PHostMsg_DestroySocket,
79 int /* socket_id */)