blob: 2dce91196c7399994ff3dc125038eeb6146da55e [file] [log] [blame]
Zhi Huang942bc2e2017-11-13 21:26:071/*
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 */
Steve Anton10542f22019-01-11 17:11:0010#ifndef RTC_BASE_NET_HELPER_H_
11#define RTC_BASE_NET_HELPER_H_
Zhi Huang942bc2e2017-11-13 21:26:0712
Zhi Huang942bc2e2017-11-13 21:26:0713#include <string>
14
Ali Tofigh7fa90572022-03-17 14:47:4915#include "absl/strings/string_view.h"
Mirko Bonadei62ba3792023-01-20 17:32:0716#include "rtc_base/system/rtc_export.h"
Ali Tofigh7fa90572022-03-17 14:47:4917
Zhi Huang942bc2e2017-11-13 21:26:0718// This header contains helper functions and constants used by different types
19// of transports.
20namespace cricket {
21
Mirko Bonadei62ba3792023-01-20 17:32:0722RTC_EXPORT extern const char UDP_PROTOCOL_NAME[];
23RTC_EXPORT extern const char TCP_PROTOCOL_NAME[];
Zhi Huang942bc2e2017-11-13 21:26:0724extern const char SSLTCP_PROTOCOL_NAME[];
25extern const char TLS_PROTOCOL_NAME[];
26
Sebastian Janssondb5d7e42020-03-02 10:32:2327constexpr int kTcpHeaderSize = 20;
28constexpr int kUdpHeaderSize = 8;
Zhi Huang942bc2e2017-11-13 21:26:0729
30// Get the transport layer overhead per packet based on the protocol.
Ali Tofigh7fa90572022-03-17 14:47:4931int GetProtocolOverhead(absl::string_view protocol);
Zhi Huang942bc2e2017-11-13 21:26:0732
33} // namespace cricket
34
Steve Anton10542f22019-01-11 17:11:0035#endif // RTC_BASE_NET_HELPER_H_