From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- dom/network/PUDPSocket.ipdl | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 dom/network/PUDPSocket.ipdl (limited to 'dom/network/PUDPSocket.ipdl') diff --git a/dom/network/PUDPSocket.ipdl b/dom/network/PUDPSocket.ipdl new file mode 100644 index 0000000000..cc5a1729f3 --- /dev/null +++ b/dom/network/PUDPSocket.ipdl @@ -0,0 +1,72 @@ +/* -*- 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; +include protocol PBackground; + +include IPCStream; + +include "mozilla/net/NeckoMessageUtils.h"; +include "mozilla/net/DNS.h"; +include "prio.h"; +include "mozilla/dom/network/UDPSocketParent.h"; +include "mozilla/dom/network/UDPSocketChild.h"; + +using mozilla::net::NetAddr from "mozilla/net/DNS.h"; +using struct mozilla::void_t from "mozilla/ipc/IPCCore.h"; + +struct UDPAddressInfo { + nsCString addr; + uint16_t port; +}; + +union UDPSocketAddr { + UDPAddressInfo; + NetAddr; +}; + +union UDPData { + uint8_t[]; + IPCStream; +}; + +namespace mozilla { +namespace net { + +//------------------------------------------------------------------- +[ManualDealloc, ChildImpl="mozilla::dom::UDPSocketChild", ParentImpl="mozilla::dom::UDPSocketParent"] +protocol PUDPSocket +{ + manager PNecko or PBackground; + +parent: + async Bind(UDPAddressInfo addressInfo, bool addressReuse, bool loopback, + uint32_t recvBufferSize, uint32_t sendBufferSize); + async Connect(UDPAddressInfo addressInfo); + + async OutgoingData(UDPData data, UDPSocketAddr addr); + + async JoinMulticast(nsCString multicastAddress, nsCString iface); + async LeaveMulticast(nsCString multicastAddress, nsCString iface); + + async Close(); + + async RequestDelete(); + +child: + 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__(); +}; + + +} // namespace net +} // namespace mozilla + -- cgit v1.2.3