2013-05-10 16:00:28 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
|
|
|
|
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
include protocol PNecko;
|
2015-05-29 17:14:14 +03:00
|
|
|
include protocol PBackground;
|
2017-03-09 16:09:54 +03:00
|
|
|
include protocol PFileDescriptorSet; // FIXME: bug #792908
|
2017-03-14 14:28:58 +03:00
|
|
|
include protocol PChildToParentStream; //FIXME: bug #792908
|
2017-03-14 14:29:43 +03:00
|
|
|
include protocol PParentToChildStream; //FIXME: bug #792908
|
2017-03-09 16:09:54 +03:00
|
|
|
|
|
|
|
include IPCStream;
|
2013-05-10 16:00:28 +04:00
|
|
|
|
|
|
|
include "mozilla/net/NeckoMessageUtils.h";
|
|
|
|
include "mozilla/net/DNS.h";
|
|
|
|
include "prio.h";
|
|
|
|
|
|
|
|
using mozilla::net::NetAddr from "mozilla/net/DNS.h";
|
|
|
|
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
|
|
|
|
|
|
|
|
struct UDPAddressInfo {
|
2014-05-06 14:32:25 +04:00
|
|
|
nsCString addr;
|
2013-05-10 16:00:28 +04:00
|
|
|
uint16_t port;
|
|
|
|
};
|
|
|
|
|
2014-05-06 14:32:25 +04:00
|
|
|
union UDPSocketAddr {
|
|
|
|
UDPAddressInfo;
|
|
|
|
NetAddr;
|
2013-05-10 16:00:28 +04:00
|
|
|
};
|
|
|
|
|
2014-05-06 14:32:25 +04:00
|
|
|
union UDPData {
|
|
|
|
uint8_t[];
|
2017-03-09 16:09:54 +03:00
|
|
|
IPCStream;
|
2013-05-10 16:00:28 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
protocol PUDPSocket
|
|
|
|
{
|
2015-05-29 17:14:14 +03:00
|
|
|
manager PNecko or PBackground;
|
2013-05-10 16:00:28 +04:00
|
|
|
|
|
|
|
parent:
|
2016-04-09 02:51:21 +03:00
|
|
|
async Bind(UDPAddressInfo addressInfo, bool addressReuse, bool loopback,
|
|
|
|
uint32_t recvBufferSize, uint32_t sendBufferSize);
|
2016-01-27 00:51:53 +03:00
|
|
|
async Connect(UDPAddressInfo addressInfo);
|
2014-05-06 14:32:25 +04:00
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async OutgoingData(UDPData data, UDPSocketAddr addr);
|
2014-05-06 14:32:25 +04:00
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async JoinMulticast(nsCString multicastAddress, nsCString iface);
|
|
|
|
async LeaveMulticast(nsCString multicastAddress, nsCString iface);
|
2014-05-06 14:32:25 +04:00
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async Close();
|
2014-05-06 14:32:25 +04:00
|
|
|
|
2016-01-27 00:51:53 +03:00
|
|
|
async RequestDelete();
|
2013-05-10 16:00:28 +04:00
|
|
|
|
|
|
|
child:
|
2016-01-27 00:51:53 +03:00
|
|
|
async CallbackOpened(UDPAddressInfo addressInfo);
|
|
|
|
async CallbackConnected(UDPAddressInfo addressInfo);
|
|
|
|
async CallbackClosed();
|
|
|
|
async CallbackReceivedData(UDPAddressInfo addressInfo, uint8_t[] data);
|
|
|
|
async CallbackError(nsCString message, nsCString filename, uint32_t lineNumber);
|
|
|
|
async __delete__();
|
2013-05-10 16:00:28 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|