removed all possible configure.h defined values

pull/1/head
Tom Early 3 years ago
parent c21521eb10
commit f4aab8cfc1

@ -27,6 +27,7 @@
bool CBMProtocol::Initialize(const char *type, const EProtocol ptype, const uint16_t port, const bool has_ipv4, const bool has_ipv6)
{
m_HasTranscoder = g_Conf.IsString(g_Keys.modules.tcmodules);
if (! CProtocol::Initialize(type, ptype, port, has_ipv4, has_ipv6))
return false;
@ -225,11 +226,10 @@ void CBMProtocol::HandleQueue(void)
break;
case EProtoRev::ambe:
default:
#ifdef TRANSCODED_MODULES
Send(buffer, client->GetIp());
#else
Send(bufferLegacy, client->GetIp());
#endif
if (m_HasTranscoder)
Send(buffer, client->GetIp());
else
Send(bufferLegacy, client->GetIp());
break;
}
}

@ -73,4 +73,6 @@ protected:
// time
CTimer m_LastKeepaliveTime;
CTimer m_LastPeersLinkTime;
// config data;
bool m_HasTranscoder;
};

@ -92,9 +92,7 @@ bool CGateKeeper::MayLink(const CCallsign &callsign, const CIp &ip, EProtocol pr
case EProtocol::p25:
case EProtocol::usrp:
case EProtocol::nxdn:
#ifndef NO_G3
case EProtocol::g3:
#endif
// first check is IP & callsigned listed OK
ok &= IsNodeListedOk(callsign, ip);
// todo: then apply any protocol specific authorisation for the operation
@ -141,9 +139,7 @@ bool CGateKeeper::MayTransmit(const CCallsign &callsign, const CIp &ip, const EP
case EProtocol::p25:
case EProtocol::nxdn:
case EProtocol::usrp:
#ifndef NO_G3
case EProtocol::g3:
#endif
// first check is IP & callsigned listed OK
ok = ok && IsNodeListedOk(callsign, ip, module);
// todo: then apply any protocol specific authorisation for the operation
@ -300,10 +296,8 @@ const std::string CGateKeeper::ProtocolName(const EProtocol p) const
return "USRP";
case EProtocol::bm:
return "Brandmeister";
#ifndef NO_G3
case EProtocol::g3:
return "Icom G3";
#endif
default:
return "NONE";
}

@ -25,7 +25,7 @@ INICHECK = inicheck
include configure.mk
ifeq ($(debug), true)
CFLAGS = -ggdb3 -W -Werror -c -std=c++11 -MMD -MD
CFLAGS = -ggdb3 -DDEBUG -W -Werror -c -std=c++11 -MMD -MD
else
CFLAGS = -W -Werror -std=c++11 -MMD -MD
endif

@ -22,11 +22,7 @@
////////////////////////////////////////////////////////////////////////////////////////
// constructor
#ifdef TRANSCODED_MODULES
CPacketStream::CPacketStream(std::shared_ptr<CUnixDgramReader> reader)
#else
CPacketStream::CPacketStream()
#endif
{
m_bOpen = false;
m_uiStreamId = 0;

@ -25,6 +25,9 @@
#include "YSFProtocol.h"
#include "Global.h"
#define REG_NAME_SIZE 16
#define REG_DESC_SIZE 14
////////////////////////////////////////////////////////////////////////////////////////
// constructor
CYsfProtocol::CYsfProtocol()
@ -39,6 +42,11 @@ bool CYsfProtocol::Initialize(const char *type, const EProtocol ptype, const uin
{
// config data
m_AutolinkModule = g_Conf.GetAutolinkModule(g_Keys.ysf.autolinkmod);
m_RegistrationId = g_Conf.GetUnsigned(g_Keys.ysf.ysfreflectordb.id);
m_RegistrationName.assign(g_Conf.GetString(g_Keys.ysf.ysfreflectordb.name));
m_RegistrationDesc.assign(g_Conf.GetString(g_Keys.ysf.ysfreflectordb.description));
m_RegistrationName.resize(REG_NAME_SIZE, ' ');
m_RegistrationDesc.resize(REG_DESC_SIZE, ' ');
// base class
if (! CProtocol::Initialize(type, ptype, port, has_ipv4, has_ipv6))
@ -982,32 +990,20 @@ bool CYsfProtocol::IsValidOptionsPacket(const CBuffer &Buffer) const
bool CYsfProtocol::EncodeServerStatusPacket(CBuffer *Buffer) const
{
uint8_t tag[] = { 'Y','S','F','S' };
uint8_t description[14];
uint8_t callsign[16];
#ifdef YSF_REFLECTOR_DESCRIPTION
const std::string desc = YSF_REFLECTOR_DESCRIPTION;
#else
const std::string desc("URF Reflector");
#endif
uint8_t description[REG_DESC_SIZE];
uint8_t callsign[REG_NAME_SIZE];
// tag
Buffer->Set(tag, sizeof(tag));
// hash
memset(callsign, ' ', sizeof(callsign));
#ifdef YSF_REFLECTOR_NAME
const std::string cs = YSF_REFLECTOR_NAME;
memcpy(callsign, cs.c_str(), cs.size() > 16 ? 16 : cs.size());
#else
g_Refl.GetCallsign().GetCallsign(callsign);
#endif
memcpy(callsign, m_RegistrationName.c_str(), 16);
char sz[16];
::sprintf(sz, "%05u", CalcHash(callsign, 16) % 100000U);
::sprintf(sz, "%05u", CalcHash(callsign, REG_NAME_SIZE) % 100000U);
Buffer->Append((uint8_t *)sz, 5);
// name
Buffer->Append(callsign, 16);
Buffer->Append(callsign, REG_NAME_SIZE);
// description
memset(description, ' ', sizeof(description));
memcpy(description, desc.c_str(), desc.size() > 14 ? 14 : desc.size());
Buffer->Append(description, 14);
memcpy(description, m_RegistrationDesc.c_str(), REG_DESC_SIZE);
Buffer->Append(description, REG_DESC_SIZE);
// connected clients
CClients *clients = g_Refl.GetClients();
int count = MIN(999, clients->GetSize());
@ -1021,10 +1017,7 @@ bool CYsfProtocol::EncodeServerStatusPacket(CBuffer *Buffer) const
uint32_t CYsfProtocol::CalcHash(const uint8_t *buffer, int len) const
{
#ifdef YSF_REFLECTOR_ID
uint32_t hash = YSF_REFLECTOR_ID;
#else
uint32_t hash = 0U;
uint32_t hash = m_RegistrationId;
for ( int i = 0; i < len; i++)
{
@ -1032,7 +1025,6 @@ uint32_t CYsfProtocol::CalcHash(const uint8_t *buffer, int len) const
hash += (hash << 10);
hash ^= (hash >> 6);
}
#endif
hash += (hash << 3);
hash ^= (hash >> 11);

@ -133,4 +133,6 @@ protected:
// config data
char m_AutolinkModule;
unsigned m_RegistrationId;
std::string m_RegistrationName, m_RegistrationDesc;
};

Loading…
Cancel
Save

Powered by TurnKey Linux.