turn_customizer.h (1411B)
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 #include "api/transport/stun.h" 17 #include "p2p/base/port_interface.h" 18 19 namespace webrtc { 20 21 class TurnCustomizer { 22 public: 23 // This is called before a TURN message is sent. 24 // This could be used to add implementation specific attributes to a request. 25 virtual void MaybeModifyOutgoingStunMessage(PortInterface* port, 26 StunMessage* message) = 0; 27 28 // TURN can send data using channel data messages or Send indication. 29 // This method should return false if `data` should be sent using 30 // a Send indication instead of a ChannelData message, even if a 31 // channel is bound. 32 virtual bool AllowChannelData(PortInterface* port, 33 const void* data, 34 size_t size, 35 bool payload) = 0; 36 37 virtual ~TurnCustomizer() {} 38 }; 39 40 } // namespace webrtc 41 42 #endif // API_TURN_CUSTOMIZER_H_