turn_customizer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright 2017 The WebRTC Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef API_TURN_CUSTOMIZER_H_
  11. #define API_TURN_CUSTOMIZER_H_
  12. #include <stdlib.h>
  13. namespace cricket {
  14. class PortInterface;
  15. class StunMessage;
  16. } // namespace cricket
  17. namespace webrtc {
  18. class TurnCustomizer {
  19. public:
  20. // This is called before a TURN message is sent.
  21. // This could be used to add implementation specific attributes to a request.
  22. virtual void MaybeModifyOutgoingStunMessage(
  23. cricket::PortInterface* port,
  24. cricket::StunMessage* message) = 0;
  25. // TURN can send data using channel data messages or Send indication.
  26. // This method should return false if |data| should be sent using
  27. // a Send indication instead of a ChannelData message, even if a
  28. // channel is bound.
  29. virtual bool AllowChannelData(cricket::PortInterface* port,
  30. const void* data,
  31. size_t size,
  32. bool payload) = 0;
  33. virtual ~TurnCustomizer() {}
  34. };
  35. } // namespace webrtc
  36. #endif // API_TURN_CUSTOMIZER_H_