PUDPSocket.ipdl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. include protocol PNecko;
  6. include protocol PBackground;
  7. include protocol PBlob;
  8. include InputStreamParams;
  9. include "mozilla/net/NeckoMessageUtils.h";
  10. include "mozilla/net/DNS.h";
  11. include "prio.h";
  12. using mozilla::net::NetAddr from "mozilla/net/DNS.h";
  13. using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
  14. struct UDPAddressInfo {
  15. nsCString addr;
  16. uint16_t port;
  17. };
  18. union UDPSocketAddr {
  19. UDPAddressInfo;
  20. NetAddr;
  21. };
  22. union UDPData {
  23. uint8_t[];
  24. InputStreamParams;
  25. };
  26. namespace mozilla {
  27. namespace net {
  28. //-------------------------------------------------------------------
  29. protocol PUDPSocket
  30. {
  31. manager PNecko or PBackground;
  32. parent:
  33. async Bind(UDPAddressInfo addressInfo, bool addressReuse, bool loopback,
  34. uint32_t recvBufferSize, uint32_t sendBufferSize);
  35. async Connect(UDPAddressInfo addressInfo);
  36. async OutgoingData(UDPData data, UDPSocketAddr addr);
  37. async JoinMulticast(nsCString multicastAddress, nsCString iface);
  38. async LeaveMulticast(nsCString multicastAddress, nsCString iface);
  39. async Close();
  40. async RequestDelete();
  41. child:
  42. async CallbackOpened(UDPAddressInfo addressInfo);
  43. async CallbackConnected(UDPAddressInfo addressInfo);
  44. async CallbackClosed();
  45. async CallbackReceivedData(UDPAddressInfo addressInfo, uint8_t[] data);
  46. async CallbackError(nsCString message, nsCString filename, uint32_t lineNumber);
  47. async __delete__();
  48. };
  49. } // namespace net
  50. } // namespace mozilla