/* SPDX-License-Identifier: GPL-3.0-only */
#include "n3n_path.h"

htp_n3n_peer_path htp_n3n_classify_peer_path(
    htp_n3n_transport transport,
    int connected,
    time_t last_p2p,
    time_t last_relay) {
    if (!connected) return HTP_N3N_PEER_PATH_UNKNOWN;
    if (transport != HTP_N3N_TRANSPORT_UDP_P2P) return HTP_N3N_PEER_PATH_RELAY;
    if (last_p2p > last_relay) return HTP_N3N_PEER_PATH_P2P;
    if (last_relay > last_p2p) return HTP_N3N_PEER_PATH_RELAY;
    return HTP_N3N_PEER_PATH_UNKNOWN;
}
