/** @file

  Some small general interest definitions. The general standard is to
  prefix these defines with TS_.

  @section license License

  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you 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.
 */

#pragma once

#define _TS_STR(x) #x
#define TS_STR(x) _TS_STR(x)

#cmakedefine BUILD_MACHINE "@BUILD_MACHINE@"
#cmakedefine BUILD_PERSON "@BUILD_PERSON@"
#cmakedefine BUILD_GROUP "@BUILD_GROUP@"
#define BUILD_NUMBER "@BUILD_NUMBER@"

#cmakedefine HAVE_BROTLI_ENCODE_H 1
#cmakedefine HAVE_CLOCK_GETTIME 1
#cmakedefine HAVE_CURSES_H 1
#cmakedefine HAVE_NCURSES_H 1
#cmakedefine HAVE_NCURSES_CURSES_H 1
#cmakedefine HAVE_NCURSES_NCURSES_H 1
#cmakedefine HAVE_LZMA_H 1
#cmakedefine HAVE_IFADDRS_H 1
#cmakedefine HAVE_LINUX_HDREG_H 1
#cmakedefine HAVE_MALLOC_USABLE_SIZE 1
#cmakedefine HAVE_MCHECK_PEDANTIC 1
#cmakedefine HAVE_POSIX_FADVISE 1
#cmakedefine HAVE_POSIX_FALLOCATE 1
#cmakedefine HAVE_POSIX_MADVISE 1

#cmakedefine HAVE_PTHREAD_GETNAME_NP 1
#cmakedefine HAVE_PTHREAD_GET_NAME_NP 1
#cmakedefine HAVE_PTHREAD_SETNAME_NP_1 1
#cmakedefine HAVE_PTHREAD_SETNAME_NP_2 1
#cmakedefine HAVE_PTHREAD_SET_NAME_NP_1 1
#cmakedefine HAVE_PTHREAD_SET_NAME_NP_2 1

#cmakedefine01 HAVE_GETRESUID
#cmakedefine01 HAVE_GETRESGID
#cmakedefine01 HAVE_GETPAGESIZE
#cmakedefine01 HAVE_GETPEEREID
#cmakedefine01 HAVE_GETPEERUCRED
#cmakedefine01 HAVE_ACCEPT4
#cmakedefine01 HAVE_EVENTFD
#cmakedefine01 HAVE_SYSCONF
#cmakedefine HAVE_RECVMMSG 1
#cmakedefine HAVE_SENDMMSG 1
#cmakedefine01 HAVE_STRLCAT
#cmakedefine01 HAVE_STRLCPY
#cmakedefine01 HAVE_STRSIGNAL
#cmakedefine01 HAVE_SYSINFO
#cmakedefine01 HAVE_PRCTL
#cmakedefine HAVE_SO_TXTIME 1

#cmakedefine01 HAVE_HWLOC_OBJ_PU

#cmakedefine01 HAVE_SSL_CTX_SET_TLSEXT_TICKET_KEY_CB
#cmakedefine01 TS_HAS_TLS_KEYLOGGING

#cmakedefine HAVE_BIO_METH_NEW 1
#cmakedefine HAVE_BIO_SET_DATA 1
#cmakedefine HAVE_BIO_GET_DATA 1
#cmakedefine HAVE_BIO_GET_SHUTDOWN 1
#cmakedefine HAVE_BIO_GET_EX_NEW_INDEX 1
#cmakedefine HAVE_BIO_GET_EX_DATA 1
#cmakedefine HAVE_BIO_SET_EX_DATA 1
#cmakedefine HAVE_BIO_METH_GET_CTRL 1
#cmakedefine HAVE_BIO_METH_GET_CREATE 1
#cmakedefine HAVE_BIO_METH_GET_DESTROY 1
#cmakedefine HAVE_CRYPTO_SET_EX_DATA 1
#cmakedefine HAVE_MD5_INIT 1
#cmakedefine HAVE_NATIVE_DUAL_CERT_SUPPORT 1
#cmakedefine HAVE_CRYPTO_EX_UNUSED 1
#cmakedefine HAVE_CRYPTO_EX_DUP_TYPE1 1

#cmakedefine HAVE_STRUCT_TCP_INFO 1
#cmakedefine HAVE_STRUCT_TCP_INFO_TCPI_TOTAL_RETRANS 1
#cmakedefine HAVE_STRUCT_TCP_INFO_TCPI_DATA_SEGS_OUT 1
#cmakedefine HAVE_STRUCT_TCP_INFO___TCPI_RETRANS 1
#cmakedefine HAVE_STRUCT_SOCKADDR_SA_LEN 1
#cmakedefine HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
#cmakedefine HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
#cmakedefine HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1
#cmakedefine HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
#cmakedefine HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
#cmakedefine HAVE_SYSCTLBYNAME 1
#cmakedefine HAVE_STRUCT_MPTCP_INFO_SUBFLOWS 1

#define SIZEOF_VOIDP @CMAKE_SIZEOF_VOID_P@

#define TS_PKGSYSUSER "@TS_PKGSYSUSER@"
#define TS_PKGSYSGROUP "@TS_PKGSYSGROUP@"

#define TS_BUILD_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define TS_BUILD_EXEC_PREFIX TS_BUILD_PREFIX
#define TS_BUILD_BINDIR "@CMAKE_INSTALL_BINDIR@"
#define TS_BUILD_SBINDIR "@CMAKE_INSTALL_SBINDIR@"
#define TS_BUILD_SYSCONFDIR "@CMAKE_INSTALL_SYSCONFDIR@"
#define TS_BUILD_DATADIR "@CMAKE_INSTALL_DATADIR@"
#define TS_BUILD_INCLUDEDIR "@CMAKE_INSTALL_INCLUDEDIR@"
#define TS_BUILD_LIBDIR "@CMAKE_INSTALL_LIBDIR@"
#define TS_BUILD_LIBEXECDIR "@CMAKE_INSTALL_LIBEXECDIR@"
#define TS_BUILD_LOCALSTATEDIR "@CMAKE_INSTALL_LOCALSTATEDIR@"
#define TS_BUILD_RUNTIMEDIR "@CMAKE_INSTALL_RUNSTATEDIR@"
#define TS_BUILD_LOGDIR "@CMAKE_INSTALL_LOGDIR@"
#define TS_BUILD_MANDIR "@CMAKE_INSTALL_MANDIR@"
#define TS_BUILD_CACHEDIR "@CMAKE_INSTALL_CACHEDIR@"
#define TS_BUILD_INFODIR "@CMAKE_INSTALL_INFODIR@"

#define TS_ABS_TOP_SRCDIR "@CMAKE_SOURCE_DIR@"

/* Build definitions */
const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
#define TS_IP_TRANSPARENT @TS_IP_TRANSPARENT@
#define TS_MAX_HOST_NAME_LEN @TS_MAX_HOST_NAME_LEN@
#define TS_MAX_NUMBER_EVENT_THREADS @TS_MAX_NUMBER_EVENT_THREADS@
#define TS_MAX_THREADS_IN_EACH_THREAD_TYPE @TS_MAX_THREADS_IN_EACH_THREAD_TYPE@

/* Feature Flags */
#cmakedefine01 TS_HAS_128BIT_CAS
#cmakedefine01 TS_HAS_BACKTRACE
#cmakedefine01 TS_HAS_IN6_IS_ADDR_UNSPECIFIED
#cmakedefine01 TS_HAS_IP_TOS
#cmakedefine01 TS_HAS_JEMALLOC
#cmakedefine01 TS_HAS_MIMALLOC
#cmakedefine01 TS_HAS_PROFILER
#cmakedefine01 TS_HAS_QUICHE
#cmakedefine01 TS_HAS_SO_MARK
#cmakedefine01 TS_HAS_SO_PEERCRED
#cmakedefine01 TS_HAS_TESTS
#cmakedefine01 TS_USE_DIAGS
#cmakedefine01 TS_USE_EPOLL
#cmakedefine01 TS_USE_FAST_SDK
#cmakedefine01 TS_ENABLE_FIPS
#cmakedefine01 TS_USE_GET_DH_2048_256
#cmakedefine01 TS_USE_HELLO_CB
#cmakedefine01 TS_USE_HWLOC
#cmakedefine01 TS_USE_KQUEUE
#cmakedefine01 TS_USE_LINUX_IO_URING
#cmakedefine01 TS_USE_MALLOC_ALLOCATOR
#cmakedefine01 TS_USE_ALLOCATOR_METRICS
#cmakedefine01 TS_USE_POSIX_CAP
#cmakedefine01 TS_USE_QUIC
#cmakedefine01 TS_USE_REMOTE_UNWINDING
#cmakedefine01 TS_USE_TLS13
#cmakedefine01 TS_USE_TLS_ASYNC
#cmakedefine01 TS_USE_TPROXY

#cmakedefine01 TS_HAS_VERIFY_CERT_STORE
#cmakedefine01 TS_HAS_TLS_SESSION_TICKET
#cmakedefine01 TS_HAS_TLS_EARLY_DATA
// TODO(cmcfarlen): Verify use of below in iocore/net/SSLNetVConnection (redunant)
#cmakedefine01 HAVE_SSL_READ_EARLY_DATA
#cmakedefine HAVE_SSL_SET_MAX_EARLY_DATA
#cmakedefine01 HAVE_SSL_CTX_SET_CLIENT_HELLO_CB
#cmakedefine01 HAVE_SSL_CTX_SET_SELECT_CERTIFICATE_CB
#cmakedefine01 HAVE_SSL_GET_SHARED_CURVE
#cmakedefine01 HAVE_SSL_GET_CURVE_NAME
#cmakedefine01 HAVE_SSL_ERROR_DESCRIPTION
#cmakedefine01 HAVE_OSSL_PARAM_CONSTRUCT_END
#cmakedefine01 TS_USE_TLS_SET_CIPHERSUITES

#define TS_BUILD_CANONICAL_HOST "@CMAKE_HOST@"

#cmakedefine YAMLCPP_LIB_VERSION "@YAMLCPP_LIB_VERSION@"

#cmakedefine01 TS_HAS_CRIPTS
