/*
 * Ouroboros - Copyright (C) 2016 - 2026
 *
 * Ouroboros library configuration
 *
 *    Dimitri Staessens <dimitri@ouroboros.rocks>
 *    Sander Vrijders   <sander@ouroboros.rocks>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public License
 * version 2.1 as published by the Free Software Foundation.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., http://www.fsf.org/about/contact/.
 */

#cmakedefine HAVE_SYS_RANDOM
#cmakedefine HAVE_EXPLICIT_BZERO
#cmakedefine HAVE_LIBGCRYPT
#cmakedefine HAVE_OPENSSL
#ifdef HAVE_OPENSSL
#cmakedefine HAVE_OPENSSL_ML_KEM
#cmakedefine HAVE_OPENSSL_ML_DSA
#cmakedefine HAVE_OPENSSL_SLH_DSA
#define HAVE_ENCRYPTION
#define SECMEM_GUARD             @SECMEM_GUARD@
#endif
#define PROC_SECMEM_MAX          @PROC_SECMEM_MAX@

#define SYS_MAX_FLOWS            @SYS_MAX_FLOWS@

#cmakedefine                     QOS_DISABLE_CRC
#cmakedefine                     HAVE_OPENSSL_RNG
#cmakedefine                     HAVE_PCLMUL
#cmakedefine                     HAVE_PMULL

#define SHM_LOCKFILE_NAME        "@SHM_LOCKFILE_NAME@"
#define FLOW_ALLOC_TIMEOUT        @FLOW_ALLOC_TIMEOUT@

#define TPM_DEBUG_REPORT_INTERVAL @TPM_DEBUG_REPORT_INTERVAL@
#define TPM_DEBUG_ABORT_TIMEOUT   @TPM_DEBUG_ABORT_TIMEOUT@

#if defined(__linux__) || (defined(__MACH__) && !defined(__APPLE__))
/* Avoid a bug in robust mutex implementation of glibc 2.25 */
    #include <features.h>
    #if !defined(__GLIBC__) || !(__GLIBC__ == 2 && __GLIBC_MINOR__ == 25)
    #cmakedefine HAVE_ROBUST_MUTEX
    #endif
#else
#cmakedefine HAVE_ROBUST_MUTEX
#endif

#cmakedefine HAVE_FUSE
#ifdef HAVE_FUSE
#define FUSE_PREFIX         "@FUSE_PREFIX@"
#cmakedefine PROC_FLOW_STATS
#endif

#define PTHREAD_COND_CLOCK  @PTHREAD_COND_CLOCK@

#define PROG_MAX_FLOWS      @PROG_MAX_FLOWS@
#define PROG_RES_FDS        @PROG_RES_FDS@
#define PROG_MAX_FQUEUES    @PROG_MAX_FQUEUES@

/* Default Delta-t parameters */
#cmakedefine                FRCT_LINUX_RTT_ESTIMATOR
#define DELT_A              (@DELTA_T_ACK@)                  /* ns */
#define DELT_R              (@DELTA_T_RTX@)                  /* ns */

#define RQ_SIZE             (@FRCT_REORDER_QUEUE_SIZE@)
#define START_WINDOW        (@FRCT_START_WINDOW@)
#define RTO_MIN             (@FRCT_RTO_MIN@ * 1000)
#define RTO_DIV             (@FRCT_RTO_INC_FACTOR@)
#define MDEV_MUL            (@FRCT_RTO_MDEV_MULTIPLIER@)

#define TICTIME             (@FRCT_TICK_TIME@ * 1000)        /* ns */

/* Retransmission tuning */
#cmakedefine                RXM_BUFFER_ON_HEAP
#cmakedefine                RXM_BLOCKING

#define RXMQ_RES            (@RXM_MIN_RESOLUTION@)           /* 2^N ns */
#define RXMQ_BUMP           (@RXM_WHEEL_MULTIPLIER@)
#define RXMQ_LVLS           (@RXM_WHEEL_LEVELS@)
#define RXMQ_SLOTS          (@RXM_WHEEL_SLOTS_PER_LEVEL@)

#define ACKQ_SLOTS          (@ACK_WHEEL_SLOTS@)
#define ACKQ_RES            (@ACK_WHEEL_RESOLUTION@)         /* 2^N ns */

#define KEY_ROTATION_BIT    (@KEY_ROTATION_BIT@)             /* Bit for key rotation */
