iceudpmuxlistener.hpp 1016 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * Copyright (c) 2025 Alex Potsides
  3. * Copyright (c) 2025 Paul-Louis Ageneau
  4. *
  5. * This Source Code Form is subject to the terms of the Mozilla Public
  6. * License, v. 2.0. If a copy of the MPL was not distributed with this
  7. * file, You can obtain one at https://mozilla.org/MPL/2.0/.
  8. */
  9. #ifndef RTC_ICE_UDP_MUX_LISTENER_H
  10. #define RTC_ICE_UDP_MUX_LISTENER_H
  11. #include "common.hpp"
  12. namespace rtc {
  13. namespace impl {
  14. struct IceUdpMuxListener;
  15. } // namespace impl
  16. struct IceUdpMuxRequest { // TODO change name
  17. string localUfrag;
  18. string remoteUfrag;
  19. string remoteAddress;
  20. uint16_t remotePort;
  21. };
  22. class RTC_CPP_EXPORT IceUdpMuxListener final : private CheshireCat<impl::IceUdpMuxListener> {
  23. public:
  24. IceUdpMuxListener(uint16_t port, optional<string> bindAddress = nullopt);
  25. ~IceUdpMuxListener();
  26. void stop();
  27. uint16_t port() const;
  28. void OnUnhandledStunRequest(std::function<void(IceUdpMuxRequest)> callback);
  29. private:
  30. using CheshireCat<impl::IceUdpMuxListener>::impl;
  31. };
  32. } // namespace rtc
  33. #endif