From 2374ebeaf2382574fb2f350a39cc09254c14e07e Mon Sep 17 00:00:00 2001 From: Tom Early Date: Sat, 4 Dec 2021 05:53:11 -0700 Subject: [PATCH] config files & better CCodecStream msgs --- config/urfd.blacklist | 12 ++++++++++++ config/urfd.interlink | 16 ++++++++++++++++ config/urfd.terminal | 17 +++++++++++++++++ config/urfd.whitelist | 13 +++++++++++++ reflector/CodecStream.cpp | 11 +++++------ 5 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 config/urfd.blacklist create mode 100644 config/urfd.interlink create mode 100644 config/urfd.terminal create mode 100644 config/urfd.whitelist diff --git a/config/urfd.blacklist b/config/urfd.blacklist new file mode 100644 index 0000000..d377a78 --- /dev/null +++ b/config/urfd.blacklist @@ -0,0 +1,12 @@ +############################################################################## +# URFD blacklist file +# +# one line per entry +# each entry is explicitely denied access (blacklisted) +# you can use * as last wildcard character +# example: +# * -> deny access to eveybody !!! +# LX* -> deny access to all callsign starting with LX +# LX3JL -> deny access to LX3JL exactly +# +############################################################################# diff --git a/config/urfd.interlink b/config/urfd.interlink new file mode 100644 index 0000000..b895a7d --- /dev/null +++ b/config/urfd.interlink @@ -0,0 +1,16 @@ +############################################################################## +# URFD interlink file +# +# one line per entry +# each entry specifies a remote XLX or XRF to peer with +# format: +# +# +# example: +# URF270 158.64.26.132 ACD +# XRF270 158.64.26.132 BB +# +# note: the remote XLX must list this XLX in its interlink file +# for the link to be established +# +############################################################################# diff --git a/config/urfd.terminal b/config/urfd.terminal new file mode 100644 index 0000000..d368b3f --- /dev/null +++ b/config/urfd.terminal @@ -0,0 +1,17 @@ +######################################################################################### +# URFD terminal option file +# +# one line per entry +# each entry specifies a terminal option +# +# Valid option: +# address - Ip address to be used by the terminal route responder +# By default, the request destination address is used. +# If the system is behind a router, set it to the public IP +# If the system runs on the public IP, leave unset. +# modules - a string with all modules to accept a terminal connection +# Default value is "*", meaning accept all +# +######################################################################################### +#address 193.1.2.3 +#modules BCD diff --git a/config/urfd.whitelist b/config/urfd.whitelist new file mode 100644 index 0000000..c3d43b0 --- /dev/null +++ b/config/urfd.whitelist @@ -0,0 +1,13 @@ +############################################################################## +# URFD whitelist file +# +# one line per entry +# each entry is explicitely authorised (whitelisted) +# you can use * as last wildcard character +# example: +# * -> authorize eveybody +# LX* -> authorize all callsign starting with LX +# LX3JL -> authorize LX3JL exactly +# +############################################################################# +* diff --git a/reflector/CodecStream.cpp b/reflector/CodecStream.cpp index 439321d..2daea27 100644 --- a/reflector/CodecStream.cpp +++ b/reflector/CodecStream.cpp @@ -89,18 +89,17 @@ void CCodecStream::Thread() // display stats if (m_fPingMin >= 0.0) { - char sz[64]; double min = m_fPingMin * 1000.0; double max = m_fPingMax * 1000.0; double ave = (m_fPingCount > 0) ? m_fPingSum / m_fPingCount * 1000.0 : 0.0; - sprintf(sz, "ambed stats (ms) : %.1f/%.1f/%.1f", min, ave, max); - std::cout << sz << std::endl; + auto prec = std::cout.precision(); + std::cout.precision(1); + std::cout << "Transcoder Stats (ms): " << min << "/" << ave << "/" << max << std::endl; + std::cout.precision(prec); } if (m_uiTimeoutPackets) { - char sz[64]; - sprintf(sz, "ambed %d of %d packets timed out", m_uiTimeoutPackets, m_uiTotalPackets); - std::cout << sz << std::endl; + std::cout << m_uiTimeoutPackets << " of " << m_uiTotalPackets << " packets timed out" << std::endl; } }