From 3073c4809cd41081b08f8f2aed61d18df9612360 Mon Sep 17 00:00:00 2001 From: Per K Date: Tue, 22 Oct 2024 14:02:33 +0000 Subject: [PATCH] Move rtc_base/network/ecn_marking.h to api/transport For now, old file forward include api/transport/ecn_marking.h Done in preparation for more usage of this enum when handling received RFC8888 feedback. Bug: webrtc:42225697 Change-Id: I022c2b7f1e7f986b24aa32b8911ad67c6640a5c0 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/366440 Reviewed-by: Danil Chapovalov Reviewed-by: Harald Alvestrand Commit-Queue: Per Kjellander Cr-Commit-Position: refs/heads/main@{#43282} --- api/transport/BUILD.gn | 5 ++++ api/transport/ecn_marking.h | 42 ++++++++++++++++++++++++++++++++++ rtc_base/network/BUILD.gn | 1 + rtc_base/network/ecn_marking.h | 30 ++++-------------------- 4 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 api/transport/ecn_marking.h diff --git a/api/transport/BUILD.gn b/api/transport/BUILD.gn index c84b71ed6e..5d340655c2 100644 --- a/api/transport/BUILD.gn +++ b/api/transport/BUILD.gn @@ -28,6 +28,11 @@ rtc_library("bandwidth_estimation_settings") { deps = [ "../../rtc_base/system:rtc_export" ] } +rtc_source_set("ecn_marking") { + visibility = [ "*" ] + sources = [ "ecn_marking.h" ] +} + rtc_source_set("enums") { visibility = [ "*" ] sources = [ "enums.h" ] diff --git a/api/transport/ecn_marking.h b/api/transport/ecn_marking.h new file mode 100644 index 0000000000..bbcab6eb0f --- /dev/null +++ b/api/transport/ecn_marking.h @@ -0,0 +1,42 @@ +/* + * Copyright 2024 The WebRTC Project Authors. All rights reserved. + * + * 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. + */ + +#ifndef API_TRANSPORT_ECN_MARKING_H_ +#define API_TRANSPORT_ECN_MARKING_H_ + +namespace webrtc { + +// TODO: bugs.webrtc.org/42225697 - L4S support is slowly being developed. +// Help is appreciated. + +// L4S Explicit Congestion Notification (ECN) . +// https://www.rfc-editor.org/rfc/rfc9331.html ECT stands for ECN-Capable +// Transport and CE stands for Congestion Experienced. + +// RFC-3168, Section 5 +// +-----+-----+ +// | ECN FIELD | +// +-----+-----+ +// ECT CE [Obsolete] RFC 2481 names for the ECN bits. +// 0 0 Not-ECT +// 0 1 ECT(1) +// 1 0 ECT(0) +// 1 1 CE + +enum class EcnMarking { + kNotEct = 0, // Not ECN-Capable Transport + kEct1 = 1, // ECN-Capable Transport + kEct0 = 2, // Not used by L4s (or webrtc.) + kCe = 3, // Congestion experienced +}; + +} // namespace webrtc + +#endif // API_TRANSPORT_ECN_MARKING_H_ diff --git a/rtc_base/network/BUILD.gn b/rtc_base/network/BUILD.gn index d4933f2e79..0b9b1369c5 100644 --- a/rtc_base/network/BUILD.gn +++ b/rtc_base/network/BUILD.gn @@ -19,6 +19,7 @@ rtc_library("sent_packet") { rtc_source_set("ecn_marking") { visibility = [ "*" ] sources = [ "ecn_marking.h" ] + deps = [ "../../api/transport:ecn_marking" ] } rtc_library("received_packet") { diff --git a/rtc_base/network/ecn_marking.h b/rtc_base/network/ecn_marking.h index e186080a2d..357e3299d0 100644 --- a/rtc_base/network/ecn_marking.h +++ b/rtc_base/network/ecn_marking.h @@ -7,36 +7,14 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ - #ifndef RTC_BASE_NETWORK_ECN_MARKING_H_ #define RTC_BASE_NETWORK_ECN_MARKING_H_ +// // TODO: bugs.webrtc.org/42225697 - delete this file. +#include "api/transport/ecn_marking.h" + namespace rtc { - -// TODO(https://bugs.webrtc.org/15368): L4S support is slowly being developed. -// Help is appreciated. - -// L4S Explicit Congestion Notification (ECN) . -// https://www.rfc-editor.org/rfc/rfc9331.html ECT stands for ECN-Capable -// Transport and CE stands for Congestion Experienced. - -// RFC-3168, Section 5 -// +-----+-----+ -// | ECN FIELD | -// +-----+-----+ -// ECT CE [Obsolete] RFC 2481 names for the ECN bits. -// 0 0 Not-ECT -// 0 1 ECT(1) -// 1 0 ECT(0) -// 1 1 CE - -enum class EcnMarking { - kNotEct = 0, // Not ECN-Capable Transport - kEct1 = 1, // ECN-Capable Transport - kEct0 = 2, // Not used by L4s (or webrtc.) - kCe = 3, // Congestion experienced -}; - +using ::webrtc::EcnMarking; } // namespace rtc #endif // RTC_BASE_NETWORK_ECN_MARKING_H_