blob: 50e406516e87cd83a4741e1977749bc8669bae4f [file] [log] [blame]
Jonas Orelandbdcee282017-10-10 14:01:40 +02001/*
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
Steve Anton10542f22019-01-11 09:11:00 -080011#ifndef API_TURN_CUSTOMIZER_H_
12#define API_TURN_CUSTOMIZER_H_
Jonas Orelandbdcee282017-10-10 14:01:40 +020013
14#include <stdlib.h>
15
16namespace cricket {
17class PortInterface;
18class StunMessage;
19} // namespace cricket
20
Jonas Orelandbdcee282017-10-10 14:01:40 +020021namespace webrtc {
22
23class TurnCustomizer {
24 public:
25 // This is called before a TURN message is sent.
26 // This could be used to add implementation specific attributes to a request.
27 virtual void MaybeModifyOutgoingStunMessage(
28 cricket::PortInterface* port,
29 cricket::StunMessage* message) = 0;
30
31 // TURN can send data using channel data messages or Send indication.
Artem Titov0e61fdd2021-07-25 21:50:14 +020032 // This method should return false if `data` should be sent using
Jonas Orelandbdcee282017-10-10 14:01:40 +020033 // a Send indication instead of a ChannelData message, even if a
34 // channel is bound.
35 virtual bool AllowChannelData(cricket::PortInterface* port,
36 const void* data,
37 size_t size,
38 bool payload) = 0;
39
40 virtual ~TurnCustomizer() {}
41};
42
43} // namespace webrtc
44
Steve Anton10542f22019-01-11 09:11:00 -080045#endif // API_TURN_CUSTOMIZER_H_