blob: f0bf0d9a3591d21301076e1a1687bcdb081f860e [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.
32 // This method should return false if |data| should be sent using
33 // 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_