# Copyright (c) 2021 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.

import("../../../webrtc.gni")

rtc_library("data_tracker") {
  deps = [
    "../../../api:array_view",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../../../rtc_base:stringutils",
    "../common:sequence_numbers",
    "../packet:chunk",
    "../packet:data",
    "../public:socket",
    "../timer",
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
  sources = [
    "data_tracker.cc",
    "data_tracker.h",
  ]
}

rtc_source_set("reassembly_streams") {
  deps = [
    "../../../api:array_view",
    "../common:sequence_numbers",
    "../packet:chunk",
    "../packet:data",
    "../public:socket",
    "../public:types",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
  sources = [ "reassembly_streams.h" ]
}

rtc_library("interleaved_reassembly_streams") {
  deps = [
    ":reassembly_streams",
    "../../../api:array_view",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../common:sequence_numbers",
    "../packet:chunk",
    "../packet:data",
    "../public:types",
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
  sources = [
    "interleaved_reassembly_streams.cc",
    "interleaved_reassembly_streams.h",
  ]
}
rtc_library("traditional_reassembly_streams") {
  deps = [
    ":reassembly_streams",
    "../../../api:array_view",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../common:sequence_numbers",
    "../packet:chunk",
    "../packet:data",
    "../public:types",
    "//third_party/abseil-cpp/absl/algorithm:container",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
  sources = [
    "traditional_reassembly_streams.cc",
    "traditional_reassembly_streams.h",
  ]
}

rtc_library("reassembly_queue") {
  deps = [
    ":interleaved_reassembly_streams",
    ":reassembly_streams",
    ":traditional_reassembly_streams",
    "../../../api:array_view",
    "../../../rtc_base:checks",
    "../../../rtc_base:logging",
    "../../../rtc_base:stringutils",
    "../../../rtc_base/containers:flat_set",
    "../common:internal_types",
    "../common:sequence_numbers",
    "../packet:chunk",
    "../packet:data",
    "../packet:parameter",
    "../public:socket",
    "../public:types",
    "//third_party/abseil-cpp/absl/functional:any_invocable",
    "//third_party/abseil-cpp/absl/strings:string_view",
  ]
  sources = [
    "reassembly_queue.cc",
    "reassembly_queue.h",
  ]
}

if (rtc_include_tests) {
  rtc_library("dcsctp_rx_unittests") {
    testonly = true

    deps = [
      ":data_tracker",
      ":interleaved_reassembly_streams",
      ":reassembly_queue",
      ":reassembly_streams",
      ":traditional_reassembly_streams",
      "../../../api:array_view",
      "../../../api/task_queue:task_queue",
      "../../../rtc_base:checks",
      "../../../rtc_base:gunit_helpers",
      "../../../test:test_support",
      "../common:handover_testing",
      "../common:sequence_numbers",
      "../packet:chunk",
      "../packet:data",
      "../public:types",
      "../testing:data_generator",
      "../timer",
    ]
    sources = [
      "data_tracker_test.cc",
      "interleaved_reassembly_streams_test.cc",
      "reassembly_queue_test.cc",
      "traditional_reassembly_streams_test.cc",
    ]
  }
}
