#pragma once

#include <chrono>
#include <sys/socket.h>

#include "behavior/tasks/types.hpp"


// TODO(Faraphel): should be split in multiple files.


/**
 * Contains common information about a certain peer.
 */
struct Peer {
    std::uint32_t id = 0;

    bool serverEnabled = false;
    drp::task::TaskType status = drp::task::TaskType::UNDEFINED;
    std::uint8_t channel = 0;

    std::chrono::high_resolution_clock::duration latencyAverage = std::chrono::high_resolution_clock::duration::max();
};


/**
 * Contains information about a distant peer.
 */
struct RemotePeer {
    // communication
    sockaddr_storage address {};
    socklen_t addressLength = 0;

    std::chrono::high_resolution_clock::duration latency = std::chrono::high_resolution_clock::duration::max();

    // information
    Peer information;
};
