# Copyright (c) 2020 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("//build_overrides/chip.gni")
import("//build_overrides/nlassert.gni")
import("//build_overrides/nlfaultinjection.gni")
import("//build_overrides/nlio.gni")

import("${chip_root}/src/platform/device.gni")
import("${chip_root}/gn/chip/tests.gni")
import("inet.gni")

declare_args() {
  # Extra header to include in SystemConfig.h for project.
  inet_project_config_include = ""
}

config("inet_config") {
  configs = [ "${chip_root}/src:includes" ]

  defines = []
  if (inet_project_config_include != "") {
    defines += [ "INET_PROJECT_CONFIG_INCLUDE=${inet_project_config_include}" ]
  }
  if (inet_platform_config_include != "") {
    defines +=
        [ "INET_PLATFORM_CONFIG_INCLUDE=${inet_platform_config_include}" ]
  }
  if (chip_build_tests) {
    defines += [ "INET_CONFIG_TEST=1" ]
  } else {
    defines += [ "INET_CONFIG_TEST=0" ]
  }
  if (inet_config_enable_ipv4) {
    defines += [ "INET_CONFIG_ENABLE_IPV4=1" ]
  } else {
    defines += [ "INET_CONFIG_ENABLE_IPV4=0" ]
  }
  if (inet_config_enable_dns_resolver) {
    defines += [ "INET_CONFIG_ENABLE_DNS_RESOLVER=1" ]
  } else {
    defines += [ "INET_CONFIG_ENABLE_DNS_RESOLVER=0" ]
  }
  if (inet_config_enable_async_dns_sockets) {
    defines += [ "INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS=1" ]
  } else {
    defines += [ "INET_CONFIG_ENABLE_ASYNC_DNS_SOCKETS=0" ]
  }
  if (inet_config_enable_raw_endpoint) {
    defines += [ "INET_CONFIG_ENABLE_RAW_ENDPOINT=1" ]
  } else {
    defines += [ "INET_CONFIG_ENABLE_RAW_ENDPOINT=0" ]
  }
  if (inet_config_enable_tcp_endpoint) {
    defines += [ "INET_CONFIG_ENABLE_TCP_ENDPOINT=1" ]
  } else {
    defines += [ "INET_CONFIG_ENABLE_TCP_ENDPOINT=0" ]
  }
  if (inet_config_enable_tun_endpoint) {
    defines += [ "INET_CONFIG_ENABLE_TUN_ENDPOINT=1" ]
  } else {
    defines += [ "INET_CONFIG_ENABLE_TUN_ENDPOINT=0" ]
  }
  if (inet_config_enable_udp_endpoint) {
    defines += [ "INET_CONFIG_ENABLE_UDP_ENDPOINT=1" ]
  } else {
    assert(false, "CHIP currently request UDP endpoint")
  }
}

source_set("inet_config_header") {
  sources = [ "InetConfig.h" ]

  public_configs = [ ":inet_config" ]

  public_deps = [ "${chip_root}/src/system:system_config_header" ]
}

static_library("inet") {
  output_name = "libInetLayer"

  sources = [
    "EndPointBasis.cpp",
    "EndPointBasis.h",
    "IANAConstants.h",
    "IPAddress-StringFuncts.cpp",
    "IPAddress.cpp",
    "IPAddress.h",
    "IPEndPointBasis.cpp",
    "IPEndPointBasis.h",
    "IPPrefix.cpp",
    "IPPrefix.h",
    "Inet.h",
    "InetArgParser.cpp",
    "InetArgParser.h",
    "InetError.cpp",
    "InetError.h",
    "InetFaultInjection.h",
    "InetInterface.cpp",
    "InetInterface.h",
    "InetLayer.cpp",
    "InetLayer.h",
    "InetLayerBasis.cpp",
    "InetLayerBasis.h",
    "InetLayerEvents.h",
    "InetUtils.cpp",
    "RawEndPoint.cpp",
    "RawEndPoint.h",
    "TCPEndPoint.cpp",
    "TCPEndPoint.h",
    "UDPEndPoint.cpp",
    "UDPEndPoint.h",
    "arpa-inet-compatibility.h",
  ]

  public_deps = [
    ":inet_config_header",
    "${chip_root}/src/lib/support",
    "${chip_root}/src/system",
    "${nlio_root}:nlio",
  ]

  if (inet_config_enable_dns_resolver) {
    sources += [
      "DNSResolver.cpp",
      "DNSResolver.h",
    ]
  }

  if (inet_config_enable_async_dns_sockets) {
    sources += [
      "AsyncDNSResolverSockets.cpp",
      "AsyncDNSResolverSockets.h",
    ]
  }

  if (inet_config_enable_tun_endpoint) {
    sources += [
      "TunEndPoint.cpp",
      "TunEndPoint.h",
    ]
  }

  if (chip_with_nlfaultinjection) {
    sources += [ "InetFaultInjection.cpp" ]
    public_deps += [ "${nlfaultinjection_root}:nlfaultinjection" ]
  }
}
