diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/network/PUDPSocket.ipdl | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/network/PUDPSocket.ipdl')
-rw-r--r-- | dom/network/PUDPSocket.ipdl | 72 |
1 files changed, 72 insertions, 0 deletions
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 + |