add better handling for parrot playback to do typical eligibility checks; add testcases to test these conditions;

pull/134/head
Bryan Biedenkapp 3 weeks ago
parent 7fa3c16fe1
commit 944a434db3

@ -3161,6 +3161,12 @@ bool TrafficNetwork::writePeerQueue(udp::BufferQueue* buffers, uint32_t peerId,
PeerConnectionPtr connection = findPeer(peerId);
if (connection != nullptr) {
#if defined(CATCH2_TEST_COMPILATION)
if (m_testPeerWriteHandler) {
m_testPeerWriteHandler(peerId, opcode);
return true;
}
#endif
sockaddr_storage addr = connection->socketStorage();
uint32_t addrLen = connection->sockStorageLen();

@ -59,6 +59,9 @@
#include <shared_mutex>
#include <atomic>
#include <array>
#if defined(CATCH2_TEST_COMPILATION)
#include <functional>
#endif
// ---------------------------------------------------------------------------
// Class Prototypes
@ -336,6 +339,7 @@ namespace network
private:
#if defined(CATCH2_TEST_COMPILATION)
friend class ::FNETestHooks;
std::function<void(uint32_t, FrameQueue::OpcodePair)> m_testPeerWriteHandler;
#endif
friend class MetadataNetwork;
friend class callhandler::TagDMRData;

@ -549,8 +549,18 @@ void TagAnalogData::playbackParrot()
// skip peers that are not affiliated with the target group if parrot TG affiliation is enabled
if (tg.config().affiliated()) {
// peer always send list takes priority over any other rules
bool skipChecks = false;
// check if the peer is in the exclusion list
std::vector<uint32_t> exclusion = tg.config().exclusion();
if (exclusion.size() > 0) {
auto it = std::find(exclusion.begin(), exclusion.end(), peer.first);
if (it != exclusion.end()) {
continue;
}
}
// peer always send list takes priority over any other rules
std::vector<uint32_t> alwaysSend = tg.config().alwaysSend();
if (alwaysSend.size() > 0) {
auto it = std::find(alwaysSend.begin(), alwaysSend.end(), peer.first);
@ -559,6 +569,13 @@ void TagAnalogData::playbackParrot()
}
}
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
if (connection != nullptr) {
if (connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
skipChecks = true; // skip any following checks for console peers
}
}
if (!skipChecks) {
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
uint32_t lookupPeerId = peer.first;

@ -26,6 +26,14 @@
#include "network/TrafficNetwork.h"
#include "network/callhandler/packetdata/DMRPacketData.h"
// ---------------------------------------------------------------------------
// Class Prototypes
// ---------------------------------------------------------------------------
#if defined(CATCH2_TEST_COMPILATION)
class FNETestHooks;
#endif
namespace network
{
namespace callhandler
@ -112,6 +120,9 @@ namespace network
uint32_t lastParrotDstId() const { return m_lastParrotDstId; }
private:
#if defined(CATCH2_TEST_COMPILATION)
friend class ::FNETestHooks;
#endif
TrafficNetwork* m_network;
/**

@ -851,8 +851,18 @@ void TagDMRData::playbackParrot()
// skip peers that are not affiliated with the target group if parrot TG affiliation is enabled
if (tg.config().affiliated()) {
// peer always send list takes priority over any other rules
bool skipChecks = false;
// check if the peer is in the exclusion list
std::vector<uint32_t> exclusion = tg.config().exclusion();
if (exclusion.size() > 0) {
auto it = std::find(exclusion.begin(), exclusion.end(), peer.first);
if (it != exclusion.end()) {
continue;
}
}
// peer always send list takes priority over any other rules
std::vector<uint32_t> alwaysSend = tg.config().alwaysSend();
if (alwaysSend.size() > 0) {
auto it = std::find(alwaysSend.begin(), alwaysSend.end(), peer.first);
@ -861,6 +871,13 @@ void TagDMRData::playbackParrot()
}
}
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
if (connection != nullptr) {
if (connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
skipChecks = true; // skip any following checks for console peers
}
}
if (!skipChecks) {
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
uint32_t lookupPeerId = peer.first;

@ -26,6 +26,14 @@
#include "network/TrafficNetwork.h"
#include "network/callhandler/packetdata/DMRPacketData.h"
// ---------------------------------------------------------------------------
// Class Prototypes
// ---------------------------------------------------------------------------
#if defined(CATCH2_TEST_COMPILATION)
class FNETestHooks;
#endif
namespace network
{
namespace callhandler
@ -148,6 +156,9 @@ namespace network
packetdata::DMRPacketData* packetData() { return m_packetData; }
private:
#if defined(CATCH2_TEST_COMPILATION)
friend class ::FNETestHooks;
#endif
TrafficNetwork* m_network;
/**

@ -855,8 +855,18 @@ void TagNXDNData::playbackParrot()
// skip peers that are not affiliated with the target group if parrot TG affiliation is enabled
if (tg.config().affiliated()) {
// peer always send list takes priority over any other rules
bool skipChecks = false;
// check if the peer is in the exclusion list
std::vector<uint32_t> exclusion = tg.config().exclusion();
if (exclusion.size() > 0) {
auto it = std::find(exclusion.begin(), exclusion.end(), peer.first);
if (it != exclusion.end()) {
continue;
}
}
// peer always send list takes priority over any other rules
std::vector<uint32_t> alwaysSend = tg.config().alwaysSend();
if (alwaysSend.size() > 0) {
auto it = std::find(alwaysSend.begin(), alwaysSend.end(), peer.first);
@ -865,6 +875,13 @@ void TagNXDNData::playbackParrot()
}
}
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
if (connection != nullptr) {
if (connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
skipChecks = true; // skip any following checks for console peers
}
}
if (!skipChecks) {
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
uint32_t lookupPeerId = peer.first;

@ -25,6 +25,14 @@
#include "common/nxdn/lc/RCCH.h"
#include "network/TrafficNetwork.h"
// ---------------------------------------------------------------------------
// Class Prototypes
// ---------------------------------------------------------------------------
#if defined(CATCH2_TEST_COMPILATION)
class FNETestHooks;
#endif
namespace network
{
namespace callhandler
@ -122,6 +130,9 @@ namespace network
uint32_t lastParrotDstId() const { return m_lastParrotDstId; }
private:
#if defined(CATCH2_TEST_COMPILATION)
friend class ::FNETestHooks;
#endif
TrafficNetwork* m_network;
/**

@ -1061,8 +1061,18 @@ void TagP25Data::playbackParrot()
// skip peers that are not affiliated with the target group if parrot TG affiliation is enabled
if (tg.config().affiliated()) {
// peer always send list takes priority over any other rules
bool skipChecks = false;
// check if the peer is in the exclusion list
std::vector<uint32_t> exclusion = tg.config().exclusion();
if (exclusion.size() > 0) {
auto it = std::find(exclusion.begin(), exclusion.end(), peer.first);
if (it != exclusion.end()) {
continue;
}
}
// peer always send list takes priority over any other rules
std::vector<uint32_t> alwaysSend = tg.config().alwaysSend();
if (alwaysSend.size() > 0) {
auto it = std::find(alwaysSend.begin(), alwaysSend.end(), peer.first);
@ -1071,8 +1081,14 @@ void TagP25Data::playbackParrot()
}
}
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
if (connection != nullptr) {
if (connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
skipChecks = true; // skip any following checks for console peers
}
}
if (!skipChecks) {
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
uint32_t lookupPeerId = peer.first;
if (connection != nullptr) {
if (connection->ccPeerId() > 0U)

@ -755,8 +755,18 @@ void TagP25P2Data::playbackParrot()
// skip peers that are not affiliated with the target group if parrot TG affiliation is enabled
if (tg.config().affiliated()) {
// peer always send list takes priority over any other rules
bool skipChecks = false;
// check if the peer is in the exclusion list
std::vector<uint32_t> exclusion = tg.config().exclusion();
if (exclusion.size() > 0) {
auto it = std::find(exclusion.begin(), exclusion.end(), peer.first);
if (it != exclusion.end()) {
continue;
}
}
// peer always send list takes priority over any other rules
std::vector<uint32_t> alwaysSend = tg.config().alwaysSend();
if (alwaysSend.size() > 0) {
auto it = std::find(alwaysSend.begin(), alwaysSend.end(), peer.first);
@ -765,6 +775,13 @@ void TagP25P2Data::playbackParrot()
}
}
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
if (connection != nullptr) {
if (connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
skipChecks = true; // skip any following checks for console peers
}
}
if (!skipChecks) {
TrafficNetwork::PeerConnectionPtr connection = peer.first > 0U ? m_network->findPeer(peer.first) : nullptr;
uint32_t lookupPeerId = peer.first;

@ -25,6 +25,14 @@
#include <cstdint>
// ---------------------------------------------------------------------------
// Class Prototypes
// ---------------------------------------------------------------------------
#if defined(CATCH2_TEST_COMPILATION)
class FNETestHooks;
#endif
namespace network
{
namespace callhandler
@ -112,6 +120,9 @@ namespace network
uint32_t lastParrotDstId() const { return m_lastParrotDstId; }
private:
#if defined(CATCH2_TEST_COMPILATION)
friend class ::FNETestHooks;
#endif
TrafficNetwork* m_network;
/**

@ -13,7 +13,9 @@
#include "fne/FNETestHooks.h"
#include "fne/HostFNE.h"
#include "common/lookups/AffiliationLookup.h"
#include "common/lookups/TalkgroupRulesLookup.h"
#include <algorithm>
#include <string>
#include <unordered_map>
#include <vector>
@ -33,27 +35,151 @@ public:
FNEHarness() :
configFile("fne-test.yml"),
host(configFile),
talkgroups("", 0U, true, false),
traffic(&host, "127.0.0.1", 62031U, 999999U, "test-password", "test-fne",
false, false, false, false, true, true, true, true, true,
0U, false, true, true, 5U, 10U, 2U),
metadata(&host, &traffic, "127.0.0.1", 62032U, 2U)
{
/* stub */
traffic.setLookups(nullptr, nullptr, &talkgroups, nullptr, nullptr, nullptr);
}
/**
* @brief Finalizes a instance of the FNEHarness class.
*/
~FNEHarness()
{
FNETestHooks::clearPeerWriteCapture(traffic);
FNETestHooks::clearPeers(traffic);
}
std::string configFile;
HostFNE host;
lookups::TalkgroupRulesLookup talkgroups;
network::TrafficNetwork traffic;
network::MetadataNetwork metadata;
};
TEST_CASE("FNE parrot playback honors affiliated-required talkgroups", "[fne][parrot][affiliations]")
{
constexpr uint32_t PARROT_TG = 3100U;
constexpr uint32_t OTHER_TG = 3200U;
constexpr uint32_t AFFILIATED_PEER = 1001U;
constexpr uint32_t UNAFFILIATED_PEER = 1002U;
constexpr uint32_t OTHER_TG_PEER = 1003U;
FNEHarness harness;
harness.talkgroups.addEntry(PARROT_TG, 0U, true, true);
FNETestHooks::addPeer(harness.traffic, AFFILIATED_PEER, network::NET_STAT_RUNNING, true);
FNETestHooks::addPeer(harness.traffic, UNAFFILIATED_PEER, network::NET_STAT_RUNNING, true);
FNETestHooks::addPeer(harness.traffic, OTHER_TG_PEER, network::NET_STAT_RUNNING, true);
FNETestHooks::addGroupAffiliation(harness.traffic, AFFILIATED_PEER, 2001U, PARROT_TG);
FNETestHooks::addGroupAffiliation(harness.traffic, OTHER_TG_PEER, 2003U, OTHER_TG);
const std::vector<FNETestHooks::ParrotProtocol> protocols = {
FNETestHooks::ParrotProtocol::DMR,
FNETestHooks::ParrotProtocol::P25,
FNETestHooks::ParrotProtocol::P25P2,
FNETestHooks::ParrotProtocol::NXDN,
FNETestHooks::ParrotProtocol::ANALOG
};
for (FNETestHooks::ParrotProtocol protocol : protocols) {
CAPTURE(static_cast<int>(protocol));
std::vector<uint32_t> destinations;
FNETestHooks::capturePeerWrites(harness.traffic, destinations);
FNETestHooks::playbackParrotFrame(harness.traffic, protocol,
UNAFFILIATED_PEER, 2002U, PARROT_TG);
REQUIRE(destinations == std::vector<uint32_t>{ AFFILIATED_PEER });
}
}
TEST_CASE("FNE parrot playback permits always-send and console peers", "[fne][parrot][routing]")
{
constexpr uint32_t PARROT_TG = 3100U;
constexpr uint32_t ALWAYS_SEND_PEER = 1001U;
constexpr uint32_t CONSOLE_PEER = 1002U;
constexpr uint32_t UNAFFILIATED_PEER = 1003U;
FNEHarness harness;
harness.talkgroups.addEntry(PARROT_TG, 0U, true, true);
lookups::TalkgroupRuleGroupVoice talkgroup = harness.talkgroups.find(PARROT_TG);
lookups::TalkgroupRuleConfig config = talkgroup.config();
config.alwaysSend({ ALWAYS_SEND_PEER });
talkgroup.config(config);
harness.talkgroups.addEntry(talkgroup);
FNETestHooks::addPeer(harness.traffic, ALWAYS_SEND_PEER, network::NET_STAT_RUNNING, true);
network::FNEPeerConnection& console = FNETestHooks::addPeer(
harness.traffic, CONSOLE_PEER, network::NET_STAT_RUNNING, true);
console.peerClass(network::PEER_CONN_CLASS_CONSOLE);
FNETestHooks::addPeer(harness.traffic, UNAFFILIATED_PEER, network::NET_STAT_RUNNING, true);
const std::vector<FNETestHooks::ParrotProtocol> protocols = {
FNETestHooks::ParrotProtocol::DMR,
FNETestHooks::ParrotProtocol::P25,
FNETestHooks::ParrotProtocol::P25P2,
FNETestHooks::ParrotProtocol::NXDN,
FNETestHooks::ParrotProtocol::ANALOG
};
for (FNETestHooks::ParrotProtocol protocol : protocols) {
CAPTURE(static_cast<int>(protocol));
std::vector<uint32_t> destinations;
FNETestHooks::capturePeerWrites(harness.traffic, destinations);
FNETestHooks::playbackParrotFrame(harness.traffic, protocol,
UNAFFILIATED_PEER, 2003U, PARROT_TG);
std::sort(destinations.begin(), destinations.end());
REQUIRE(destinations == std::vector<uint32_t>{ ALWAYS_SEND_PEER, CONSOLE_PEER });
}
}
TEST_CASE("FNE parrot playback blocks excluded peers", "[fne][parrot][routing]")
{
constexpr uint32_t PARROT_TG = 3100U;
constexpr uint32_t PERMITTED_PEER = 1001U;
constexpr uint32_t EXCLUDED_PEER = 1002U;
FNEHarness harness;
harness.talkgroups.addEntry(PARROT_TG, 0U, true, true);
lookups::TalkgroupRuleGroupVoice talkgroup = harness.talkgroups.find(PARROT_TG);
lookups::TalkgroupRuleConfig config = talkgroup.config();
config.exclusion({ EXCLUDED_PEER });
config.alwaysSend({ EXCLUDED_PEER });
talkgroup.config(config);
harness.talkgroups.addEntry(talkgroup);
FNETestHooks::addPeer(harness.traffic, PERMITTED_PEER, network::NET_STAT_RUNNING, true);
network::FNEPeerConnection& excluded = FNETestHooks::addPeer(
harness.traffic, EXCLUDED_PEER, network::NET_STAT_RUNNING, true);
excluded.peerClass(network::PEER_CONN_CLASS_CONSOLE);
FNETestHooks::addGroupAffiliation(harness.traffic, PERMITTED_PEER, 2001U, PARROT_TG);
FNETestHooks::addGroupAffiliation(harness.traffic, EXCLUDED_PEER, 2002U, PARROT_TG);
const std::vector<FNETestHooks::ParrotProtocol> protocols = {
FNETestHooks::ParrotProtocol::DMR,
FNETestHooks::ParrotProtocol::P25,
FNETestHooks::ParrotProtocol::P25P2,
FNETestHooks::ParrotProtocol::NXDN,
FNETestHooks::ParrotProtocol::ANALOG
};
for (FNETestHooks::ParrotProtocol protocol : protocols) {
CAPTURE(static_cast<int>(protocol));
std::vector<uint32_t> destinations;
FNETestHooks::capturePeerWrites(harness.traffic, destinations);
FNETestHooks::playbackParrotFrame(harness.traffic, protocol,
PERMITTED_PEER, 2001U, PARROT_TG);
REQUIRE(destinations == std::vector<uint32_t>{ PERMITTED_PEER });
}
}
TEST_CASE("Affiliation snapshots replace prior state", "[fne][affiliations]")
{
lookups::AffiliationLookup affiliations("test-affiliations", nullptr, false);

@ -11,6 +11,10 @@
#include "fne/HostFNE.h"
#include "fne/network/P25OTARService.h"
#include "fne/network/callhandler/TagP25Data.h"
#include "fne/network/callhandler/TagDMRData.h"
#include "fne/network/callhandler/TagP25P2Data.h"
#include "fne/network/callhandler/TagNXDNData.h"
#include "fne/network/callhandler/TagAnalogData.h"
#include "fne/lookups/AffiliationLookup.h"
#include "common/p25/data/Assembler.h"
#include "common/Utils.h"
@ -60,6 +64,122 @@ void FNETestHooks::registerP25Unit(TrafficNetwork& network, uint32_t sitePeerId,
network.m_peerAffiliations[sitePeerId] = affiliations;
}
/* Adds a talkgroup affiliation owned by a site peer. */
void FNETestHooks::addGroupAffiliation(TrafficNetwork& network, uint32_t sitePeerId,
uint32_t unitId, uint32_t talkgroupId)
{
std::shared_ptr<fne_lookups::AffiliationLookup> affiliations =
network.getPeerAffiliations(sitePeerId);
if (affiliations == nullptr) {
affiliations = std::make_shared<fne_lookups::AffiliationLookup>(
"test-parrot-affiliations", nullptr, false);
network.m_peerAffiliations[sitePeerId] = affiliations;
}
affiliations->groupAff(unitId, talkgroupId);
}
/* Captures peer IDs selected by subsequent test writes. */
void FNETestHooks::capturePeerWrites(TrafficNetwork& network, std::vector<uint32_t>& peerIds)
{
network.m_testPeerWriteHandler = [&peerIds](uint32_t peerId, FrameQueue::OpcodePair) {
peerIds.push_back(peerId);
};
}
/* Clears the test peer-write capture callback. */
void FNETestHooks::clearPeerWriteCapture(TrafficNetwork& network)
{
network.m_testPeerWriteHandler = nullptr;
}
/* Queues and plays one synthetic parrot frame through a protocol handler. */
void FNETestHooks::playbackParrotFrame(TrafficNetwork& network, ParrotProtocol protocol,
uint32_t sourcePeerId, uint32_t sourceId, uint32_t talkgroupId)
{
constexpr uint32_t FRAME_LENGTH = 16U;
constexpr uint16_t PACKET_SEQUENCE = 1U;
constexpr uint32_t STREAM_ID = 100U;
switch (protocol) {
case ParrotProtocol::DMR:
{
callhandler::TagDMRData::ParrotFrame frame{};
frame.buffer = new uint8_t[FRAME_LENGTH]();
frame.bufferLen = FRAME_LENGTH;
frame.slotNo = 1U;
frame.pktSeq = PACKET_SEQUENCE;
frame.streamId = STREAM_ID;
frame.peerId = sourcePeerId;
frame.srcId = sourceId;
frame.dstId = talkgroupId;
network.m_tagDMR->m_parrotFrames.push_back(frame);
network.m_tagDMR->playbackParrot();
break;
}
case ParrotProtocol::P25:
{
callhandler::TagP25Data::ParrotFrame frame{};
frame.buffer = new uint8_t[FRAME_LENGTH]();
frame.bufferLen = FRAME_LENGTH;
frame.pktSeq = PACKET_SEQUENCE;
frame.streamId = STREAM_ID;
frame.peerId = sourcePeerId;
frame.srcId = sourceId;
frame.dstId = talkgroupId;
network.m_tagP25->m_parrotFrames.push_back(frame);
network.m_tagP25->playbackParrot();
break;
}
case ParrotProtocol::P25P2:
{
callhandler::TagP25P2Data::ParrotFrame frame{};
frame.buffer = new uint8_t[FRAME_LENGTH]();
frame.bufferLen = FRAME_LENGTH;
frame.pktSeq = PACKET_SEQUENCE;
frame.streamId = STREAM_ID;
frame.peerId = sourcePeerId;
frame.srcId = sourceId;
frame.dstId = talkgroupId;
network.m_tagP25P2->m_parrotFrames.push_back(frame);
network.m_tagP25P2->playbackParrot();
break;
}
case ParrotProtocol::NXDN:
{
callhandler::TagNXDNData::ParrotFrame frame{};
frame.buffer = new uint8_t[FRAME_LENGTH]();
frame.bufferLen = FRAME_LENGTH;
frame.pktSeq = PACKET_SEQUENCE;
frame.streamId = STREAM_ID;
frame.peerId = sourcePeerId;
frame.srcId = sourceId;
frame.dstId = talkgroupId;
network.m_tagNXDN->m_parrotFrames.push_back(frame);
network.m_tagNXDN->playbackParrot();
break;
}
case ParrotProtocol::ANALOG:
{
callhandler::TagAnalogData::ParrotFrame frame{};
frame.buffer = new uint8_t[FRAME_LENGTH]();
frame.bufferLen = FRAME_LENGTH;
frame.pktSeq = PACKET_SEQUENCE;
frame.streamId = STREAM_ID;
frame.peerId = sourcePeerId;
frame.srcId = sourceId;
frame.dstId = talkgroupId;
network.m_tagAnalog->m_parrotFrames.push_back(frame);
network.m_tagAnalog->playbackParrot();
break;
}
}
}
/**
* @brief Initializes an instance of the HostFNE class.
*/

@ -30,6 +30,17 @@
*/
class FNETestHooks {
public:
/**
* @brief Protocol handled by an FNE traffic call handler.
*/
enum class ParrotProtocol {
DMR, //!< DMR traffic.
P25, //!< P25 Phase 1 traffic.
P25P2, //!< P25 Phase 2 traffic.
NXDN, //!< NXDN traffic.
ANALOG //!< Analog traffic.
};
/**
* @brief Tests whether a P25 frame is classified as telephone interconnect traffic.
* @param network The TrafficNetwork instance.
@ -57,6 +68,36 @@ public:
* @param unitId Registered subscriber radio ID.
*/
static void registerP25Unit(network::TrafficNetwork& network, uint32_t sitePeerId, uint32_t unitId);
/**
* @brief Adds a talkgroup affiliation owned by a site peer.
* @param network The TrafficNetwork instance.
* @param sitePeerId Site peer that owns the affiliation.
* @param unitId Subscriber radio ID affiliated to the talkgroup.
* @param talkgroupId Affiliated talkgroup ID.
*/
static void addGroupAffiliation(network::TrafficNetwork& network, uint32_t sitePeerId,
uint32_t unitId, uint32_t talkgroupId);
/**
* @brief Captures peer IDs selected by subsequent test writes.
* @param network The TrafficNetwork instance.
* @param[out] peerIds Destination peer IDs selected for writes.
*/
static void capturePeerWrites(network::TrafficNetwork& network, std::vector<uint32_t>& peerIds);
/**
* @brief Clears the test peer-write capture callback.
* @param network The TrafficNetwork instance.
*/
static void clearPeerWriteCapture(network::TrafficNetwork& network);
/**
* @brief Queues and plays one synthetic parrot frame through a protocol handler.
* @param network The TrafficNetwork instance.
* @param protocol Protocol handler to exercise.
* @param sourcePeerId Peer that originated the parrot frame.
* @param sourceId Source subscriber ID.
* @param talkgroupId Destination talkgroup ID.
*/
static void playbackParrotFrame(network::TrafficNetwork& network, ParrotProtocol protocol,
uint32_t sourcePeerId, uint32_t sourceId, uint32_t talkgroupId);
/**
* @brief Adds a peer to the specified TrafficNetwork.
* @param network The TrafficNetwork instance.

Loading…
Cancel
Save

Powered by TurnKey Linux.