D-Plus priority

pull/12/head
Tom Early 7 years ago
parent 45dacb59ed
commit 89223678b7

@ -314,8 +314,8 @@ void CQnetLink::print_status_file()
bool CQnetLink::load_gwys(const std::string &filename)
{
// DPlus Authenticate
if (dplus_authorize) {
CDPlusAuthenticator auth(owner, std::string("auth.dstargateway.org"));
if (dplus_authorize && !dplus_priority) {
CDPlusAuthenticator auth(login_call, std::string("auth.dstargateway.org"));
if (auth.Process(gwy_list, dplus_reflectors, dplus_repeaters))
fprintf(stdout, "DPlus Authorization complete.\n");
else
@ -409,6 +409,14 @@ bool CQnetLink::load_gwys(const std::string &filename)
gwy_list[call] = payload;
}
fclose(fp);
// DPlus Authenticate
if (dplus_authorize && dplus_priority) {
CDPlusAuthenticator auth(login_call, std::string("auth.dstargateway.org"));
if (auth.Process(gwy_list, dplus_reflectors, dplus_repeaters))
fprintf(stdout, "DPlus Authorization complete.\n");
else
fprintf(stderr, "DPlus Authorization failed!\n");
}
for (auto it=gwy_list.begin(); it!=gwy_list.end(); it++)
printf("%s %s\n", it->first.c_str(), it->second.c_str());
@ -595,12 +603,13 @@ bool CQnetLink::read_config(const char *cfgFile)
cfg.GetValue(key+"use_reflectors", estr, dplus_reflectors);
cfg.GetValue(key+"use_repeaters", estr, dplus_repeaters);
cfg.GetValue(key+"ref_login", estr, login_call, 0, 6);
if (login_call.length() < 4)
if (login_call.length() < 4) {
login_call.assign(owner);
else {
} else {
ToUpper(login_call);
login_call.resize(CALL_SIZE, ' ');
}
cfg.GetValue(key+"priority", estr, dplus_priority);
return false;
}

@ -86,7 +86,7 @@ private:
/* configuration data */
std::string login_call, owner, to_g2_external_ip, my_g2_link_ip, gwys, status_file, qnvoice_file, announce_dir;
bool only_admin_login, only_link_unlink, qso_details, bool_rptr_ack, announce;
bool dplus_authorize, dplus_reflectors, dplus_repeaters;
bool dplus_authorize, dplus_reflectors, dplus_repeaters, dplus_priority;
int rmt_xrf_port, rmt_ref_port, rmt_dcs_port, my_g2_link_port, to_g2_external_port, delay_between, delay_before;
std::string link_at_startup[3];
unsigned int max_dongles, saved_max_dongles;

@ -156,7 +156,7 @@ dplus_authorize_d=false # set to true if you want to use the closed-source D
dplus_ref_login_d='' # for logging into REF reflectors, if empty, ircddb_login will be used
dplus_use_reflectors_d=true # set to false if you are not going to link to DPlus reflectors
dplus_use_repeaters_d=true # set to false if you are not going to link to DPlus repeaters
# any gateways in your gwys.txt file will override any reflectors or repeaters that DPlus authorization returns.
dplus_priority_d=false # set to true if you want DPlus reflector read after gwys.txt
##########################################################################################################################
#

@ -84,6 +84,7 @@ LinkMenu () {
echo
echo " Legacy D-Plus Repeaters and Reflectors"
echo -n "au : Authorize Legacy D-Plus Linking = "; EvaluateVar dplus_authorize{,_d}
echo -n "ap : DPlus Priority = "; EvaluateVar dplus_priority{,_d}
if [ -n "$em" ]; then
echo -n "lo : Login call for authorization server = "; EvaluateVar dplus_ref_login{,_d}
echo -n "RF : Add legacy reflectors to gateway list = "; EvaluateVar dplus_use_reflectors{,_d}
@ -102,6 +103,7 @@ LinkMenu () {
elif [[ "$key" == ac* ]]; then SetBooleanValue link_acknowledge "$value"
elif [[ "$key" == m* ]]; then link_max_dongles="$value"
elif [[ "$key" == au* ]]; then SetBooleanValue dplus_authorize "$value"
elif [[ "$key" == ap* ]]; then SetBooleanValue dplus_priority "$value"
elif [[ "$key" == lo* ]]; then dplus_ref_login="${value^^}"
elif [[ "$key" == RF* ]]; then SetBooleanValue dplus_use_reflectors "$value"
elif [[ "$key" == RP* ]]; then SetBooleanValue dplus_use_repeaters "$value"
@ -117,6 +119,7 @@ LinkMenu () {
elif [[ "$value" == ac* ]]; then unset link_acknowledge
elif [[ "$value" == m* ]]; then unset link_max_dongles
elif [[ "$value" == au* ]]; then unset dplus_authorize
elif [[ "$value" == ap* ]]; then unset dplus_priority
elif [[ "$value" == lo* ]]; then unset dplus_ref_login
elif [[ "$value" == RF* ]]; then unset dplus_use_reflectors
elif [[ "$value" == RP* ]]; then unset dplus_use_repeaters
@ -533,6 +536,7 @@ WriteCFGFile () {
[ -z "${log_dtmf+x}" ] || echo "log_dtmf=${log_dtmf}" >> $outFile
# dplus_ section
[ -z "${dplus_authorize+x}" ] || echo "dplus_authorize=${dplus_authorize}" >> $outFile
[ -z "${dplus_priority+x}" ] || echo "dplus_priority=${dplus_priority}" >> $outFile
[ -z "${dplus_ref_login+x}" ] || echo "dplus_ref_login='${dplus_ref_login}'" >> $outFile
[ -z "${dplus_use_repeaters+x}" ] || echo "dplus_use_repeaters=${dplus_use_repeaters}" >> $outFile
[ -z "${dplus_use_reflectors+x}" ] || echo "dplus_use_reflectors=${dplus_use_reflectors}" >> $outFile

Loading…
Cancel
Save

Powered by TurnKey Linux.