• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
11 #ifndef API_TURN_CUSTOMIZER_H_
12 #define API_TURN_CUSTOMIZER_H_
13 
14 #include <stdlib.h>
15 
16 namespace cricket {
17 class PortInterface;
18 class StunMessage;
19 }  // namespace cricket
20 
21 namespace webrtc {
22 
23 class 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 
~TurnCustomizer()40   virtual ~TurnCustomizer() {}
41 };
42 
43 }  // namespace webrtc
44 
45 #endif  // API_TURN_CUSTOMIZER_H_
46