2013-05-10 05:00:28 -07: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;
|
2014-05-06 03:32:25 -07:00
|
|
|
include protocol PBlob;
|
|
|
|
include InputStreamParams;
|
2013-05-10 05:00:28 -07: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 03:32:25 -07:00
|
|
|
nsCString addr;
|
2013-05-10 05:00:28 -07:00
|
|
|
uint16_t port;
|
|
|
|
};
|
|
|
|
|
2014-05-06 03:32:25 -07:00
|
|
|
union UDPSocketAddr {
|
|
|
|
UDPAddressInfo;
|
|
|
|
NetAddr;
|
2013-05-10 05:00:28 -07:00
|
|
|
};
|
|
|
|
|
2014-05-06 03:32:25 -07:00
|
|
|
union UDPData {
|
|
|
|
uint8_t[];
|
|
|
|
InputStreamParams;
|
2013-05-10 05:00:28 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace net {
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
protocol PUDPSocket
|
|
|
|
{
|
|
|
|
manager PNecko;
|
|
|
|
|
|
|
|
parent:
|
2014-05-06 03:32:25 -07:00
|
|
|
Bind(UDPAddressInfo addressInfo, bool addressReuse, bool loopback);
|
|
|
|
|
|
|
|
OutgoingData(UDPData data, UDPSocketAddr addr);
|
|
|
|
|
|
|
|
JoinMulticast(nsCString multicastAddress, nsCString iface);
|
|
|
|
LeaveMulticast(nsCString multicastAddress, nsCString iface);
|
|
|
|
|
2013-05-10 05:00:28 -07:00
|
|
|
Close();
|
2014-05-06 03:32:25 -07:00
|
|
|
|
2013-05-10 05:00:28 -07:00
|
|
|
RequestDelete();
|
|
|
|
|
|
|
|
child:
|
2014-05-06 03:32:25 -07:00
|
|
|
CallbackOpened(UDPAddressInfo addressInfo);
|
|
|
|
CallbackClosed();
|
|
|
|
CallbackReceivedData(UDPAddressInfo addressInfo, uint8_t[] data);
|
|
|
|
CallbackError(nsCString message, nsCString filename, uint32_t lineNumber);
|
2013-05-10 05:00:28 -07:00
|
|
|
__delete__();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace net
|
|
|
|
} // namespace mozilla
|
|
|
|
|