because we are now getting varying types of peer connection classes, lets properly change the growing list of booleans to a proper class value and perform logic based on that instead; begin adding support for a console connection class (this operatess ssimilarly to sysview with validation freedoms, but does not get diagnostic messaging;

r05a06_dev
Bryan Biedenkapp 1 week ago
parent 01979084df
commit 3033a5889c

@ -189,7 +189,10 @@ bool PeerNetwork::writeConfig()
rcon["port"].set<uint16_t>(m_metadata->restApiPort); // REST API Port
config["rcon"].set<json::object>(rcon);
config["software"].set<std::string>(std::string(software)); // Software ID
uint32_t peerClass = PEER_CONN_CLASS::PEER_CONN_CLASS_STANDARD;
config["peerClass"].set<uint32_t>(peerClass); // Peer Connection Class
config["software"].set<std::string>(std::string(software)); // Software ID
json::value v = json::value(config);
std::string json = v.serialize();

@ -154,6 +154,26 @@ namespace network
NET_CTRL_U2U = 0x01U, //!< Unit-to-Unit
};
/**
* @brief Peer Connection Class Enumerations
* @note These values define which connection class a peer connection belongs to. This is used for determining how
* to handle traffic from the peer.
* @ingroup network_core
*/
enum PEER_CONN_CLASS {
PEER_CONN_CLASS_UNKNOWN, //!< Unknown
PEER_CONN_CLASS_NEIGHBOR, //!< Neighbor FNE Peer
PEER_CONN_CLASS_STANDARD, //!< Standard Peer
PEER_CONN_CLASS_SYSVIEW, //!< SysView Peer
PEER_CONN_CLASS_CONSOLE, //!< Console Peer
// this should always be last
PEER_CONN_CLASS_INVALID
};
/**
* @brief RTP Stream Multiplex Validation Return Codes
* @ingroup network_core

@ -1531,6 +1531,9 @@ bool Network::writeConfig()
rcon["port"].set<uint16_t>(m_metadata->restApiPort); // REST API Port
config["rcon"].set<json::object>(rcon);
uint32_t peerClass = PEER_CONN_CLASS::PEER_CONN_CLASS_STANDARD;
config["peerClass"].set<uint32_t>(peerClass); // Peer Connection Class
// Flags
config["conventionalPeer"].set<bool>(m_metadata->isConventional); // Conventional Peer Marker

@ -59,10 +59,9 @@ namespace network
m_lastPing(0U),
m_missedMetadataUpdates(0U),
m_hasCallPriority(false),
m_isNeighborFNEPeer(false),
m_peerClass(PEER_CONN_CLASS_UNKNOWN),
m_isReplica(false),
m_isConventionalPeer(false),
m_isSysView(false),
m_isConventional(false),
m_config(),
m_peerLockMtx(),
m_jitterBuffers(),
@ -95,10 +94,9 @@ namespace network
m_lastPing(0U),
m_missedMetadataUpdates(0U),
m_hasCallPriority(false),
m_isNeighborFNEPeer(false),
m_peerClass(PEER_CONN_CLASS_UNKNOWN),
m_isReplica(false),
m_isConventionalPeer(false),
m_isSysView(false),
m_isConventional(false),
m_config(),
m_peerLockMtx(),
m_jitterBuffers(),
@ -119,11 +117,13 @@ namespace network
*/
std::string identWithQualifier() const
{
if (isSysView())
if (m_peerClass == PEER_CONN_CLASS_CONSOLE)
return "!" + identity();
if (m_peerClass == PEER_CONN_CLASS_SYSVIEW)
return "@" + identity();
if (isReplica())
return "%" + identity();
if (isNeighborFNEPeer())
if (m_peerClass == PEER_CONN_CLASS_NEIGHBOR)
return "+" + identity();
return " " + m_identity;
@ -245,22 +245,17 @@ namespace network
DECLARE_PROPERTY_PLAIN(bool, hasCallPriority);
/**
* @brief Flag indicating this connection is from an downstream neighbor FNE peer.
* @brief Peer class for this connection.
*/
DECLARE_PROPERTY_PLAIN(bool, isNeighborFNEPeer);
DECLARE_PROPERTY_PLAIN(PEER_CONN_CLASS, peerClass);
/**
* @brief Flag indicating this connection is from a neighbor FNE peer that is replica enabled.
*/
DECLARE_PROPERTY_PLAIN(bool, isReplica);
/**
* @brief Flag indicating this connection is from an conventional peer.
*/
DECLARE_PROPERTY_PLAIN(bool, isConventionalPeer);
/**
* @brief Flag indicating this connection is from an SysView peer.
*/
DECLARE_PROPERTY_PLAIN(bool, isSysView);
DECLARE_PROPERTY_PLAIN(bool, isConventional);
/**
* @brief JSON objecting containing peer configuration information.

@ -210,7 +210,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req)
if (network->m_peers.find(req->rtpHeader.getSSRC()) != network->m_peers.end()) {
FNEPeerConnection* connection = network->m_peers[req->rtpHeader.getSSRC()];
if (connection != nullptr) {
if (connection->isNeighborFNEPeer() && connection->isReplica()) {
if (connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR && connection->isReplica()) {
validPeerId = true;
pktPeerId = req->rtpHeader.getSSRC();
}
@ -252,7 +252,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req)
if (network->m_peers.size() > 0U) {
for (auto peer : network->m_peers) {
if (peer.second != nullptr) {
if (peer.second->isSysView()) {
if (peer.second->peerClass() == PEER_CONN_CLASS_SYSVIEW) {
sockaddr_storage addr = peer.second->socketStorage();
uint32_t addrLen = peer.second->sockStorageLen();
@ -338,7 +338,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req)
// attempt to repeat status traffic to SysView clients
for (auto peer : network->m_peers) {
if (peer.second != nullptr) {
if (peer.second->isSysView()) {
if (peer.second->peerClass() == PEER_CONN_CLASS_SYSVIEW) {
sockaddr_storage addr = peer.second->socketStorage();
uint32_t addrLen = peer.second->sockStorageLen();
@ -391,7 +391,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req)
std::string ip = udp::Socket::address(req->address);
// validate peer (simple validation really)
if (connection->connected() && connection->address() == ip && connection->isNeighborFNEPeer() &&
if (connection->connected() && connection->address() == ip && connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR &&
connection->isReplica()) {
DECLARE_UINT8_ARRAY(rawPayload, req->length);
::memcpy(rawPayload, req->buffer, req->length);
@ -496,7 +496,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req)
std::string ip = udp::Socket::address(req->address);
// validate peer (simple validation really)
if (connection->connected() && connection->address() == ip && connection->isNeighborFNEPeer() &&
if (connection->connected() && connection->address() == ip && connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR &&
connection->isReplica()) {
DECLARE_UINT8_ARRAY(rawPayload, req->length);
::memcpy(rawPayload, req->buffer, req->length);
@ -581,7 +581,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req)
std::string ip = udp::Socket::address(req->address);
// validate peer (simple validation really)
if (connection->connected() && connection->address() == ip && connection->isNeighborFNEPeer()) {
if (connection->connected() && connection->address() == ip && connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR) {
DECLARE_UINT8_ARRAY(rawPayload, req->length);
::memcpy(rawPayload, req->buffer, req->length);
@ -695,7 +695,7 @@ void MetadataNetwork::taskNetworkRx(NetPacketRequest* req)
break;
default:
// diagostic network ignores unknowns for everything else...
// metadata network ignores unknowns for everything else...
break;
}
}

@ -521,13 +521,9 @@ bool PeerNetwork::writeConfig()
rcon["port"].set<uint16_t>(m_metadata->restApiPort); // REST API Port
config["rcon"].set<json::object>(rcon);
// Flags
/*
** bryanb: don't change externalPeer to neighborPeer -- this will break backward
** compat with older FNE versions (we're stuck with this naming :()
*/
bool external = true;
config["externalPeer"].set<bool>(external); // External FNE Neighbor Peer Marker
uint32_t peerClass = (uint32_t)PEER_CONN_CLASS::PEER_CONN_CLASS_NEIGHBOR;
config["peerClass"].set<uint32_t>(peerClass); // Peer Connection Class
config["masterPeerId"].set<uint32_t>(m_masterPeerId); // Master Peer ID
config["software"].set<std::string>(std::string(software)); // Software ID

@ -559,7 +559,7 @@ void TrafficNetwork::clock(uint32_t ms)
FNEPeerConnection* connection = peer.second;
if (connection != nullptr) {
uint64_t dt = 0U;
if (connection->isNeighborFNEPeer() || connection->isReplica())
if (connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR || connection->isReplica())
dt = connection->lastPing() + ((m_host->m_pingTime * 1000) * (m_host->m_maxMissedPings * 2U));
else
dt = connection->lastPing() + ((m_host->m_pingTime * 1000) * m_host->m_maxMissedPings);
@ -1405,12 +1405,67 @@ void TrafficNetwork::taskNetworkRx(NetPacketRequest* req)
LogInfoEx(LOG_MASTER, "PEER %u >> Software Version [%s]", peerId, software.c_str());
}
// is the peer reporting it is a SysView peer?
if (peerConfig["sysView"].is<bool>()) {
bool sysView = peerConfig["sysView"].get<bool>();
connection->isSysView(sysView);
if (sysView)
/*
** bryanb: this is support for older configuration structs, newer peers should
** send the peerClass value
*/
{
// is the peer reporting it is a SysView peer?
if (peerConfig["sysView"].is<bool>()) {
bool sysView = peerConfig["sysView"].get<bool>();
if (sysView)
connection->peerClass(PEER_CONN_CLASS_SYSVIEW);
if (sysView)
LogInfoEx(LOG_MASTER, "PEER %u >> SysView Peer", peerId);
}
// is the peer reporting it is a downstream FNE neighbor peer?
if (peerConfig["externalPeer"].is<bool>()) {
bool externalPeer = peerConfig["externalPeer"].get<bool>();
if (externalPeer)
connection->peerClass(PEER_CONN_CLASS_NEIGHBOR);
}
}
// determine the peer class
if (peerConfig["peerClass"].is<uint32_t>()) {
uint32_t peerClass = peerConfig["peerClass"].get<uint32_t>();
if (peerClass >= PEER_CONN_CLASS_INVALID)
peerClass = PEER_CONN_CLASS_STANDARD;
connection->peerClass((PEER_CONN_CLASS)peerClass);
} else {
if (connection->peerClass() == PEER_CONN_CLASS_UNKNOWN) {
connection->peerClass(PEER_CONN_CLASS_STANDARD);
}
}
// is the peer reporting it is a conventional peer?
if (peerConfig["conventionalPeer"].is<bool>()) {
if (network->m_allowConvSiteAffOverride) {
bool convPeer = peerConfig["conventionalPeer"].get<bool>();
connection->isConventional(convPeer);
}
}
// report peer class in log
switch (connection->peerClass()) {
case PEER_CONN_CLASS_NEIGHBOR:
LogInfoEx(LOG_MASTER, "PEER %u >> Downstream Neighbor FNE Peer", peerId);
break;
case PEER_CONN_CLASS_SYSVIEW:
LogInfoEx(LOG_MASTER, "PEER %u >> SysView Peer", peerId);
connection->isReplica(true);
break;
case PEER_CONN_CLASS_CONSOLE:
LogInfoEx(LOG_MASTER, "PEER %u >> Console Peer", peerId);
break;
case PEER_CONN_CLASS_STANDARD:
default:
if (connection->isConventional())
LogInfoEx(LOG_MASTER, "PEER %u >> Conventional Peer", peerId);
else
LogInfoEx(LOG_MASTER, "PEER %u >> Standard Peer", peerId);
break;
}
// is the peer reporting it is an downstream FNE neighbor peer?
@ -1418,12 +1473,7 @@ void TrafficNetwork::taskNetworkRx(NetPacketRequest* req)
** bryanb: don't change externalPeer to neighborPeer -- this will break backward
** compat with older FNE versions (we're stuck with this naming :()
*/
if (peerConfig["externalPeer"].is<bool>()) {
bool neighbor = peerConfig["externalPeer"].get<bool>();
connection->isNeighborFNEPeer(neighbor);
if (neighbor)
LogInfoEx(LOG_MASTER, "PEER %u >> Downstream Neighbor FNE Peer", peerId);
if (connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR) {
uint32_t masterPeerId = 0U;
if (peerConfig["masterPeerId"].is<uint32_t>()) {
masterPeerId = peerConfig["masterPeerId"].get<uint32_t>();
@ -1442,12 +1492,11 @@ void TrafficNetwork::taskNetworkRx(NetPacketRequest* req)
if (!peerEntry.peerDefault()) {
if (peerEntry.peerReplica()) {
connection->isReplica(true);
if (neighbor)
LogInfoEx(LOG_MASTER, "PEER %u >> Participates in Peer Replication", peerId);
LogInfoEx(LOG_MASTER, "PEER %u >> Participates in Peer Replication", peerId);
}
}
if (network->m_enableSpanningTree && !connection->isSysView()) {
if (network->m_enableSpanningTree) {
network->m_treeLock.lock();
// check if this peer is already connected via another peer
@ -1486,16 +1535,6 @@ void TrafficNetwork::taskNetworkRx(NetPacketRequest* req)
network->writePeerACK(peerId, streamId, buffer, 1U);
LogInfoEx(LOG_MASTER, "PEER %u RPTC ACK, completed the configuration exchange", peerId);
// is the peer reporting it is a conventional peer?
if (peerConfig["conventionalPeer"].is<bool>()) {
if (network->m_allowConvSiteAffOverride) {
bool convPeer = peerConfig["conventionalPeer"].get<bool>();
connection->isConventionalPeer(convPeer);
if (convPeer)
LogInfoEx(LOG_MASTER, "PEER %u >> Conventional Peer", peerId);
}
}
// setup the affiliations list for this peer
std::stringstream peerName;
peerName << "PEER " << peerId;
@ -1587,7 +1626,7 @@ void TrafficNetwork::taskNetworkRx(NetPacketRequest* req)
// ensure STP sanity, when we receive a ping from a downstream leaf
// this check ensures a STP entry for a downstream leaf isn't accidentally blown off
// the tree during a fast reconnect
if (network->m_enableSpanningTree && connection->isNeighborFNEPeer() && !connection->isSysView()) {
if (network->m_enableSpanningTree && connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR) {
std::lock_guard<std::mutex> guard(network->m_treeLock);
if ((connection->masterId() != peerId) && (connection->masterId() != 0U)) {
@ -2211,7 +2250,7 @@ void TrafficNetwork::erasePeer(uint32_t peerId)
{
auto it = std::find_if(m_peers.begin(), m_peers.end(), [&](PeerMapPair x) { return x.first == peerId; });
if (it != m_peers.end()) {
neighborFNE = it->second->isNeighborFNEPeer();
neighborFNE = it->second->peerClass() == PEER_CONN_CLASS_NEIGHBOR;
m_peers.erase(peerId);
}
}
@ -2481,7 +2520,7 @@ void TrafficNetwork::processInCallCtrl(network::NET_ICC::ENUM command, network::
continue;
}
if (conn->isNeighborFNEPeer()) {
if (conn->peerClass() == PEER_CONN_CLASS_NEIGHBOR) {
LogInfoEx(LOG_MASTER, "PEER %u In-Call Control Request to Neighbors, peerId = %u, dstId = %u, slot = %u, ssrc = %u, streamId = %u", peerId, peer.first, dstId, slotNo, ssrc, streamId);
// send ICC request to local peer
@ -2567,7 +2606,7 @@ void TrafficNetwork::taskMetadataUpdate(MetadataUpdateRequest* req)
// if the connection is a downstream neighbor FNE peer, and peer is participating in peer link,
// send the peer proper configuration data
if (connection->isNeighborFNEPeer() && connection->isReplica()) {
if (connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR && connection->isReplica()) {
LogInfoEx(LOG_MASTER, "PEER %u (%s) sending replica network metadata updates", req->peerId, peerIdentity.c_str());
network->writeWhitelistRIDs(req->peerId, streamId, true);
@ -3213,7 +3252,7 @@ bool TrafficNetwork::writePeerQueue(udp::BufferQueue* buffers, uint32_t peerId,
if (m_maskOutboundPeerID)
ssrc = m_peerId; // mask the source SSRC to our own peer ID
else {
if ((connection->isNeighborFNEPeer() && !connection->isReplica()) && m_maskOutboundPeerIDForNonPL) {
if ((connection->peerClass() == PEER_CONN_CLASS_NEIGHBOR && !connection->isReplica()) && m_maskOutboundPeerIDForNonPL) {
// if the peer is a downstream FNE neighbor peer, and not a replica peer, we need to send the packet
// to the neighbor FNE peer with our peer ID as the source instead of the originating peer
// because we have routed it

@ -609,18 +609,18 @@ bool TagAnalogData::isPeerPermitted(uint32_t peerId, data::NetData& data, uint32
// is this peer a conventional peer?
if (m_network->m_allowConvSiteAffOverride) {
if (connection != nullptr) {
if (connection->isConventionalPeer()) {
if (connection->peerClass() == PEER_CONN_CLASS_STANDARD && connection->isConventional()) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for conventional peers
}
}
}
// is this peer a SysView peer?
// is this peer a SysView or console peer?
if (connection != nullptr) {
if (connection->isSysView()) {
if (connection->peerClass() == PEER_CONN_CLASS_SYSVIEW || connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for SysView peers
// for SysView or console peers
}
}

@ -481,7 +481,7 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
if (peerId != peer.first) {
FNEPeerConnection* conn = peer.second;
if (conn != nullptr) {
if (conn->isNeighborFNEPeer()) {
if (conn->peerClass() == PEER_CONN_CLASS_NEIGHBOR) {
continue;
}
}
@ -521,7 +521,7 @@ bool TagDMRData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
// is this peer an upstream neighbor peer?
bool neighbor = false;
if (conn != nullptr) {
neighbor = conn->isNeighborFNEPeer();
neighbor = conn->peerClass() == PEER_CONN_CLASS_NEIGHBOR;
}
// is this a private call?
@ -1018,18 +1018,18 @@ bool TagDMRData::isPeerPermitted(uint32_t peerId, data::NetData& data, uint32_t
// is this peer a conventional peer?
if (m_network->m_allowConvSiteAffOverride) {
if (connection != nullptr) {
if (connection->isConventionalPeer()) {
if (connection->peerClass() == PEER_CONN_CLASS_STANDARD && connection->isConventional()) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for conventional peers
}
}
}
// is this peer a SysView peer?
// is this peer a SysView or console peer?
if (connection != nullptr) {
if (connection->isSysView()) {
if (connection->peerClass() == PEER_CONN_CLASS_SYSVIEW || connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for SysView peers
// for SysView or console peers
}
}

@ -500,7 +500,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
if (peerId != peer.first) {
FNEPeerConnection* conn = peer.second;
if (conn != nullptr) {
if (conn->isNeighborFNEPeer()) {
if (conn->peerClass() == PEER_CONN_CLASS_NEIGHBOR) {
continue;
}
}
@ -540,7 +540,7 @@ bool TagNXDNData::processFrame(const uint8_t* data, uint32_t len, uint32_t peerI
// is this peer an upstream neighbor peer?
bool neighbor = false;
if (conn != nullptr) {
neighbor = conn->isNeighborFNEPeer();
neighbor = conn->peerClass() == PEER_CONN_CLASS_NEIGHBOR;
}
// is this a private call?
@ -892,18 +892,18 @@ bool TagNXDNData::isPeerPermitted(uint32_t peerId, lc::RTCH& lc, uint8_t message
// is this peer a conventional peer?
if (m_network->m_allowConvSiteAffOverride) {
if (connection != nullptr) {
if (connection->isConventionalPeer()) {
if (connection->peerClass() == PEER_CONN_CLASS_STANDARD && connection->isConventional()) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for conventional peers
}
}
}
// is this peer a SysView peer?
// is this peer a SysView or console peer?
if (connection != nullptr) {
if (connection->isSysView()) {
if (connection->peerClass() == PEER_CONN_CLASS_SYSVIEW || connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for SysView peers
// for SysView or console peers
}
}

@ -580,7 +580,7 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
if (peerId != peer.first) {
FNEPeerConnection* conn = peer.second;
if (conn != nullptr) {
if (conn->isNeighborFNEPeer()) {
if (conn->peerClass() == PEER_CONN_CLASS_NEIGHBOR) {
continue;
}
}
@ -620,7 +620,7 @@ bool TagP25Data::processFrame(const uint8_t* data, uint32_t len, uint32_t peerId
// is this peer an upstream neighbor peer?
bool neighbor = false;
if (conn != nullptr) {
neighbor = conn->isNeighborFNEPeer();
neighbor = conn->peerClass() == PEER_CONN_CLASS_NEIGHBOR;
}
// is this a private call?
@ -1460,18 +1460,18 @@ bool TagP25Data::isPeerPermitted(uint32_t peerId, lc::LC& control, DUID::E duid,
// is this peer a conventional peer?
if (m_network->m_allowConvSiteAffOverride) {
if (connection != nullptr) {
if (connection->isConventionalPeer()) {
if (connection->peerClass() == PEER_CONN_CLASS_STANDARD && connection->isConventional()) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for conventional peers
}
}
}
// is this peer a SysView peer?
// is this peer a SysView or console peer?
if (connection != nullptr) {
if (connection->isSysView()) {
if (connection->peerClass() == PEER_CONN_CLASS_SYSVIEW || connection->peerClass() == PEER_CONN_CLASS_CONSOLE) {
fromUpstream = true; // we'll just set the fromUpstream flag to disable the affiliation check
// for SysView peers
// for SysView or console peers
}
}

@ -1833,8 +1833,12 @@ void RESTAPI::restAPI_GetStats(const HTTPPayload& request, HTTPPayload& reply, c
uint32_t missedMetadataUpdates = peer->missedMetadataUpdates();
peerObj["missedMetadataUpdates"].set<uint32_t>(missedMetadataUpdates);
bool isNeighbor = peer->isNeighborFNEPeer();
bool isNeighbor = (peer->peerClass() == PEER_CONN_CLASS_NEIGHBOR);
bool isReplica = peer->isReplica();
bool isSysView = (peer->peerClass() == PEER_CONN_CLASS_SYSVIEW);
bool isConsole = (peer->peerClass() == PEER_CONN_CLASS_CONSOLE);
peerObj["isConsole"].set<bool>(isConsole);
peerObj["isSysView"].set<bool>(isSysView);
peerObj["isNeighbor"].set<bool>(isNeighbor);
peerObj["isReplica"].set<bool>(isReplica);

@ -189,7 +189,10 @@ bool PeerNetwork::writeConfig()
rcon["port"].set<uint16_t>(m_metadata->restApiPort); // REST API Port
config["rcon"].set<json::object>(rcon);
config["software"].set<std::string>(std::string(software)); // Software ID
uint32_t peerClass = PEER_CONN_CLASS::PEER_CONN_CLASS_STANDARD;
config["peerClass"].set<uint32_t>(peerClass); // Peer Connection Class
config["software"].set<std::string>(std::string(software)); // Software ID
json::value v = json::value(config);
std::string json = v.serialize();

@ -277,14 +277,8 @@ bool PeerNetwork::writeConfig()
rcon["port"].set<uint16_t>(m_metadata->restApiPort); // REST API Port
config["rcon"].set<json::object>(rcon);
// Flags
bool external = true;
config["externalPeer"].set<bool>(external); // External Peer Marker
config["masterPeerId"].set<uint32_t>(m_peerId); // Master Peer ID
bool convPeer = true;
config["conventionalPeer"].set<bool>(convPeer); // Conventional Peer Marker
bool sysView = true;
config["sysView"].set<bool>(sysView); // SysView Peer Marker
uint32_t peerClass = PEER_CONN_CLASS::PEER_CONN_CLASS_SYSVIEW;
config["peerClass"].set<uint32_t>(peerClass); // Peer Connection Class
config["software"].set<std::string>(std::string(software)); // Software ID

Loading…
Cancel
Save

Powered by TurnKey Linux.