xref: /aosp_15_r20/external/webrtc/rtc_base/net_helper.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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 #ifndef RTC_BASE_NET_HELPER_H_
11 #define RTC_BASE_NET_HELPER_H_
12 
13 #include <string>
14 
15 #include "absl/strings/string_view.h"
16 
17 // This header contains helper functions and constants used by different types
18 // of transports.
19 namespace cricket {
20 
21 extern const char UDP_PROTOCOL_NAME[];
22 extern const char TCP_PROTOCOL_NAME[];
23 extern const char SSLTCP_PROTOCOL_NAME[];
24 extern const char TLS_PROTOCOL_NAME[];
25 
26 constexpr int kTcpHeaderSize = 20;
27 constexpr int kUdpHeaderSize = 8;
28 
29 // Get the transport layer overhead per packet based on the protocol.
30 int GetProtocolOverhead(absl::string_view protocol);
31 
32 }  // namespace cricket
33 
34 #endif  // RTC_BASE_NET_HELPER_H_
35