2013-10-16 18:12:02 +00:00
|
|
|
/*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Copyright 2013 The WebRTC project authors. All Rights Reserved.
|
2013-10-16 18:12:02 +00:00
|
|
|
*
|
2016-02-10 07:54:43 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2013-10-16 18:12:02 +00:00
|
|
|
*/
|
|
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#ifndef PC_SCTP_UTILS_H_
|
|
|
|
|
#define PC_SCTP_UTILS_H_
|
2013-10-16 18:12:02 +00:00
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "api/data_channel_interface.h"
|
2019-09-25 10:00:34 +02:00
|
|
|
#include "api/transport/data_channel_transport_interface.h"
|
2019-09-23 14:53:54 -07:00
|
|
|
#include "media/base/media_channel.h"
|
2021-01-29 14:45:08 +00:00
|
|
|
#include "rtc_base/copy_on_write_buffer.h"
|
2014-01-14 10:00:58 +00:00
|
|
|
|
2014-07-29 17:36:52 +00:00
|
|
|
namespace rtc {
|
2016-03-20 06:15:43 -07:00
|
|
|
class CopyOnWriteBuffer;
|
2014-07-29 17:36:52 +00:00
|
|
|
} // namespace rtc
|
2013-10-16 18:12:02 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
struct DataChannelInit;
|
|
|
|
|
|
2015-10-14 11:33:11 -07:00
|
|
|
// Read the message type and return true if it's an OPEN message.
|
2016-03-20 06:15:43 -07:00
|
|
|
bool IsOpenMessage(const rtc::CopyOnWriteBuffer& payload);
|
2015-10-14 11:33:11 -07:00
|
|
|
|
2016-03-20 06:15:43 -07:00
|
|
|
bool ParseDataChannelOpenMessage(const rtc::CopyOnWriteBuffer& payload,
|
2013-10-16 18:12:02 +00:00
|
|
|
std::string* label,
|
2014-01-14 10:00:58 +00:00
|
|
|
DataChannelInit* config);
|
|
|
|
|
|
2016-03-20 06:15:43 -07:00
|
|
|
bool ParseDataChannelOpenAckMessage(const rtc::CopyOnWriteBuffer& payload);
|
2013-10-16 18:12:02 +00:00
|
|
|
|
|
|
|
|
bool WriteDataChannelOpenMessage(const std::string& label,
|
2014-01-14 10:00:58 +00:00
|
|
|
const DataChannelInit& config,
|
2016-03-20 06:15:43 -07:00
|
|
|
rtc::CopyOnWriteBuffer* payload);
|
2013-10-16 18:12:02 +00:00
|
|
|
|
2016-03-20 06:15:43 -07:00
|
|
|
void WriteDataChannelOpenAckMessage(rtc::CopyOnWriteBuffer* payload);
|
2019-09-23 14:53:54 -07:00
|
|
|
|
2014-01-14 10:00:58 +00:00
|
|
|
} // namespace webrtc
|
2013-10-16 18:12:02 +00:00
|
|
|
|
2019-01-11 09:11:00 -08:00
|
|
|
#endif // PC_SCTP_UTILS_H_
|