#ifndef CORE_TYPES_H
#define CORE_TYPES_H

#include <cstdint>

namespace dofs {

using uint128_t = __uint128_t;
using PacketGroups = uint128_t;

using EventId = uint64_t;
using InstanceId = uint8_t;

using NodeId = uint16_t;
enum class NodeStatus : uint8_t {
        OK,
        THROTTLING,
        DOWN,
        BOOTING
};

enum class NodeType : uint8_t {
        HOST,
        SWITCH,
        NIC
};

using PortId = uint16_t;

using IPv4Addr = uint32_t;
inline IPv4Addr ipv4(NodeId n, PortId p) noexcept {
        return (static_cast<uint32_t>(n) << 16) | static_cast<uint32_t>(p);
}

using LinkId = uint32_t;
enum class LinkStatus : uint8_t { OK, DOWN, THROTTLING };

using Bytes = uint32_t;
using PacketSeq = uint16_t;
using FlowId = uint16_t;

enum class PacketProtocol : uint8_t {
        DATA,
        ACK,
        NACK,
        HEADER_TRIM,
        HEADER_TRIM_BACK
};

enum class SwitchBufferType : uint8_t { SHARED = 0, DEDICATED = 1 };

enum class FlowPriority : uint8_t {
        CTRL = 0,
        MICE = 1,
        ELEPHANT = 2,
        AUTO
};

enum class CCType : uint8_t {
        DCQCN,
        NSCC
};

enum class LBType : uint8_t {
        RANDOM_PACKET_SPRAYING
};

enum class MgmtKind : uint8_t {
        HEARTBEAT,
        JOB_FINISHED,
        END_SIMULATION
};

} // namespace dofs

#endif // CORE_TYPES_H
