blob: da854458f492f5e40927be3d84e4fec76c16038a [file] [log] [blame]
wu@webrtc.org1d1ffc92013-10-16 18:12:021/*
kjellanderb24317b2016-02-10 15:54:432 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
wu@webrtc.org1d1ffc92013-10-16 18:12:023 *
kjellanderb24317b2016-02-10 15:54:434 * 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.org1d1ffc92013-10-16 18:12:029 */
10
Steve Anton10542f22019-01-11 17:11:0011#ifndef PC_SCTP_UTILS_H_
12#define PC_SCTP_UTILS_H_
wu@webrtc.org1d1ffc92013-10-16 18:12:0213
14#include <string>
15
Steve Anton10542f22019-01-11 17:11:0016#include "api/data_channel_interface.h"
Niels Möllerbfcec4c2019-09-25 08:00:3417#include "api/transport/data_channel_transport_interface.h"
Bjorn A Mellembc3eebc2019-09-23 21:53:5418#include "media/base/media_channel.h"
Harald Alvestrand5761e7b2021-01-29 14:45:0819#include "rtc_base/copy_on_write_buffer.h"
henrika@webrtc.orgaebb1ad2014-01-14 10:00:5820
buildbot@webrtc.orgd4e598d2014-07-29 17:36:5221namespace rtc {
jbaucheec21bd2016-03-20 13:15:4322class CopyOnWriteBuffer;
buildbot@webrtc.orgd4e598d2014-07-29 17:36:5223} // namespace rtc
wu@webrtc.org1d1ffc92013-10-16 18:12:0224
25namespace webrtc {
26struct DataChannelInit;
wu@webrtc.org1d1ffc92013-10-16 18:12:0227
deadbeefab9b2d12015-10-14 18:33:1128// Read the message type and return true if it's an OPEN message.
jbaucheec21bd2016-03-20 13:15:4329bool IsOpenMessage(const rtc::CopyOnWriteBuffer& payload);
deadbeefab9b2d12015-10-14 18:33:1130
jbaucheec21bd2016-03-20 13:15:4331bool ParseDataChannelOpenMessage(const rtc::CopyOnWriteBuffer& payload,
wu@webrtc.org1d1ffc92013-10-16 18:12:0232 std::string* label,
henrika@webrtc.orgaebb1ad2014-01-14 10:00:5833 DataChannelInit* config);
34
jbaucheec21bd2016-03-20 13:15:4335bool ParseDataChannelOpenAckMessage(const rtc::CopyOnWriteBuffer& payload);
wu@webrtc.org1d1ffc92013-10-16 18:12:0236
37bool WriteDataChannelOpenMessage(const std::string& label,
henrika@webrtc.orgaebb1ad2014-01-14 10:00:5838 const DataChannelInit& config,
jbaucheec21bd2016-03-20 13:15:4339 rtc::CopyOnWriteBuffer* payload);
wu@webrtc.org1d1ffc92013-10-16 18:12:0240
jbaucheec21bd2016-03-20 13:15:4341void WriteDataChannelOpenAckMessage(rtc::CopyOnWriteBuffer* payload);
Bjorn A Mellembc3eebc2019-09-23 21:53:5442
henrika@webrtc.orgaebb1ad2014-01-14 10:00:5843} // namespace webrtc
wu@webrtc.org1d1ffc92013-10-16 18:12:0244
Steve Anton10542f22019-01-11 17:11:0045#endif // PC_SCTP_UTILS_H_