wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 07:54:43 -0800 | [diff] [blame] | 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. |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 11 | #ifndef PC_SCTP_UTILS_H_ |
| 12 | #define PC_SCTP_UTILS_H_ |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 13 | |
| 14 | #include <string> |
| 15 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 16 | #include "api/data_channel_interface.h" |
Niels Möller | bfcec4c | 2019-09-25 10:00:34 +0200 | [diff] [blame] | 17 | #include "api/transport/data_channel_transport_interface.h" |
Bjorn A Mellem | bc3eebc | 2019-09-23 14:53:54 -0700 | [diff] [blame] | 18 | #include "media/base/media_channel.h" |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 19 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 20 | namespace rtc { |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 21 | class CopyOnWriteBuffer; |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 +0000 | [diff] [blame] | 22 | } // namespace rtc |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 23 | |
| 24 | namespace webrtc { |
| 25 | struct DataChannelInit; |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 26 | |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 27 | // Read the message type and return true if it's an OPEN message. |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 28 | bool IsOpenMessage(const rtc::CopyOnWriteBuffer& payload); |
deadbeef | ab9b2d1 | 2015-10-14 11:33:11 -0700 | [diff] [blame] | 29 | |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 30 | bool ParseDataChannelOpenMessage(const rtc::CopyOnWriteBuffer& payload, |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 31 | std::string* label, |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 32 | DataChannelInit* config); |
| 33 | |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 34 | bool ParseDataChannelOpenAckMessage(const rtc::CopyOnWriteBuffer& payload); |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 35 | |
| 36 | bool WriteDataChannelOpenMessage(const std::string& label, |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 37 | const DataChannelInit& config, |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 38 | rtc::CopyOnWriteBuffer* payload); |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 39 | |
jbauch | eec21bd | 2016-03-20 06:15:43 -0700 | [diff] [blame] | 40 | void WriteDataChannelOpenAckMessage(rtc::CopyOnWriteBuffer* payload); |
Bjorn A Mellem | bc3eebc | 2019-09-23 14:53:54 -0700 | [diff] [blame] | 41 | |
| 42 | cricket::DataMessageType ToCricketDataMessageType(DataMessageType type); |
| 43 | |
| 44 | DataMessageType ToWebrtcDataMessageType(cricket::DataMessageType type); |
| 45 | |
henrika@webrtc.org | aebb1ad | 2014-01-14 10:00:58 +0000 | [diff] [blame] | 46 | } // namespace webrtc |
wu@webrtc.org | 1d1ffc9 | 2013-10-16 18:12:02 +0000 | [diff] [blame] | 47 | |
Steve Anton | 10542f2 | 2019-01-11 09:11:00 -0800 | [diff] [blame] | 48 | #endif // PC_SCTP_UTILS_H_ |