updated config group 'g2_link' to 'link'

pull/2/head
Tom Early 8 years ago
parent f440f9428e
commit 88747bc082

2
.gitignore vendored

@ -6,4 +6,4 @@ qnlink
qngateway qngateway
qnlinktest qnlinktest
qnlinktestaudio qnlinktestaudio
qnmodem qnrelay

@ -60,10 +60,18 @@ system should work. It just needs a g++ compiler with version greater than 4.9.
} }
} }
link = {
admin = [ "AA0AAA" , "BB1BBB" , "CC3CCC" ]
}
where x is the lowercase module you specified in the MMDVM.qn file. Use B and b where x is the lowercase module you specified in the MMDVM.qn file. Use B and b
or C and c. Don't mix them up! You can add more stuff to the gn.cfg file. Please or C and c. Don't mix them up! You can add more stuff to the gn.cfg file. Please
see the qn.everything.cfg example. see the qn.everything.cfg example.
Only callsigns in the admin list can execute scripts. Two scripts are include:
YR = _ _ _ _ _ R X will reboot you system, and
YR = _ _ _ _ _ H X will halt your system (never unplug a running computer!)
13) You need a gwys.txt file for all the reflectors: ./reflist.sh 13) You need a gwys.txt file for all the reflectors: ./reflist.sh
14) Install and start the three QnetGateway services: sudo make install 14) Install and start the three QnetGateway services: sudo make install

@ -3177,13 +3177,11 @@ int main(int argc, const char **argv)
ptt_off[4] = Send_Modem_Header[4]; ptt_off[4] = Send_Modem_Header[4];
write(fd_ser, ptt_off, 8); write(fd_ser, ptt_off, 8);
printf("End RF, ber=%.02f\n", printf("End RF, ber=%.02f\n", (num_dv_frames == 0) ? 0.00 : 100.00 * ((float)num_bit_errors / (float)(num_dv_frames * 24.00)) );
(num_dv_frames == 0)?0.00:100.00 * ((float)num_bit_errors / (float)(num_dv_frames * 24.00)) );
last_RF_time = 0; last_RF_time = 0;
if (IS_ENABLED && RPTR_ACK) if (IS_ENABLED && RPTR_ACK)
send_ack(ok?myCall:RPTR, send_ack(ok ? myCall : RPTR, (num_dv_frames == 0) ? 0.00 : 100.00 * ((float)num_bit_errors / (float)(num_dv_frames * 24.00)) );
(num_dv_frames == 0)?0.00:100.00 * ((float)num_bit_errors / (float)(num_dv_frames * 24.00)) );
ok = false; ok = false;
} }
} }

@ -315,10 +315,10 @@ bool CQnetGateway::read_config(char *cfgFile)
get_value(cfg, "gateway.internal.port", g2_internal.port, 16000, 65535, 19000); get_value(cfg, "gateway.internal.port", g2_internal.port, 16000, 65535, 19000);
if (! get_value(cfg, "g2_link.outgoing_ip", g2_link.ip, 7, IP_SIZE, "127.0.0.1")) if (! get_value(cfg, "link.outgoing_ip", g2_link.ip, 7, IP_SIZE, "127.0.0.1"))
return true; return true;
get_value(cfg, "g2_link.port", g2_link.port, 16000, 65535, 18997); get_value(cfg, "link.port", g2_link.port, 16000, 65535, 18997);
get_value(cfg, "log.qso", bool_qso_details, false); get_value(cfg, "log.qso", bool_qso_details, false);
@ -1078,7 +1078,7 @@ void CQnetGateway::process()
printf("Failed to validate MYCALL [%s], regexec error=%d\n", temp_radio_user, mycall_valid); printf("Failed to validate MYCALL [%s], regexec error=%d\n", temp_radio_user, mycall_valid);
} }
/* send data g2_link */ /* send data qnlink */
if (mycall_valid == REG_NOERROR) if (mycall_valid == REG_NOERROR)
sendto(srv_sock, rptrbuf.pkt_id, recvlen, 0, (struct sockaddr *)&plug, sizeof(struct sockaddr_in)); sendto(srv_sock, rptrbuf.pkt_id, recvlen, 0, (struct sockaddr *)&plug, sizeof(struct sockaddr_in));
@ -1917,7 +1917,7 @@ void CQnetGateway::process()
} }
} }
/* send data to g2_link */ /* send data to qnlink */
sendto(srv_sock, rptrbuf.pkt_id, recvlen, 0, (struct sockaddr *)&plug, sizeof(struct sockaddr_in)); sendto(srv_sock, rptrbuf.pkt_id, recvlen, 0, (struct sockaddr *)&plug, sizeof(struct sockaddr_in));
/* aprs processing */ /* aprs processing */
@ -2582,7 +2582,7 @@ int CQnetGateway::init(char *cfgfile)
to_remote_g2[i].last_time = 0; to_remote_g2[i].last_time = 0;
} }
/* where to send packets to g2_link */ /* where to send packets to qnlink */
memset(&plug, 0, sizeof(struct sockaddr_in)); memset(&plug, 0, sizeof(struct sockaddr_in));
plug.sin_family = AF_INET; plug.sin_family = AF_INET;
plug.sin_port = htons(g2_link.port); plug.sin_port = htons(g2_link.port);

@ -696,7 +696,7 @@ static bool read_config(char *cfgFile)
} }
std::string value; std::string value;
std::string key = "g2_link.ref_login"; std::string key = "link.ref_login";
if (cfg.lookupValue(key, login_call) || cfg.lookupValue("ircddb.login", login_call)) { if (cfg.lookupValue(key, login_call) || cfg.lookupValue("ircddb.login", login_call)) {
int l = login_call.length(); int l = login_call.length();
if (l<3 || l>CALL_SIZE-2) { if (l<3 || l>CALL_SIZE-2) {
@ -715,7 +715,7 @@ static bool read_config(char *cfgFile)
return false; return false;
} }
key = "g2_link.admin"; key = "link.admin";
only_admin_login = false; only_admin_login = false;
if (cfg.exists(key)) { if (cfg.exists(key)) {
Setting &userlist = cfg.lookup(key); Setting &userlist = cfg.lookup(key);
@ -750,7 +750,7 @@ static bool read_config(char *cfgFile)
fprintf(stdout, " ]\n"); fprintf(stdout, " ]\n");
} }
key = "g2_link.link_unlink"; key = "link.link_unlink";
only_link_unlink = false; only_link_unlink = false;
if (cfg.exists(key)) { if (cfg.exists(key)) {
Setting &unlinklist = cfg.lookup(key); Setting &unlinklist = cfg.lookup(key);
@ -801,13 +801,13 @@ static bool read_config(char *cfgFile)
} }
} }
get_value(cfg, "g2_link.ref_port", rmt_ref_port, 10000, 65535, 20001); get_value(cfg, "link.ref_port", rmt_ref_port, 10000, 65535, 20001);
get_value(cfg, "g2_link.xrf_port", rmt_xrf_port, 10000, 65535, 30001); get_value(cfg, "link.xrf_port", rmt_xrf_port, 10000, 65535, 30001);
get_value(cfg, "g2_link.dcs_port", rmt_dcs_port, 10000, 65535, 30051); get_value(cfg, "link.dcs_port", rmt_dcs_port, 10000, 65535, 30051);
if (! get_value(cfg, "g2_link.incoming_ip", my_g2_link_ip, 7, IP_SIZE, "0.0.0.0")) if (! get_value(cfg, "link.incoming_ip", my_g2_link_ip, 7, IP_SIZE, "0.0.0.0"))
return false; return false;
get_value(cfg, "g2_link.port", my_g2_link_port, 10000, 65535, 18997); get_value(cfg, "link.port", my_g2_link_port, 10000, 65535, 18997);
if (! get_value(cfg, "gateway.internal.ip", to_g2_external_ip, 7, IP_SIZE, "0.0.0.0")) if (! get_value(cfg, "gateway.internal.ip", to_g2_external_ip, 7, IP_SIZE, "0.0.0.0"))
return false; return false;
@ -823,9 +823,9 @@ static bool read_config(char *cfgFile)
get_value(cfg, "timing.play.delay", delay_between, 9, 25, 19); get_value(cfg, "timing.play.delay", delay_between, 9, 25, 19);
get_value(cfg, "g2_link.acknowledge", bool_rptr_ack, true); get_value(cfg, "link.acknowledge", bool_rptr_ack, true);
get_value(cfg, "g2_link.announce", announce, true); get_value(cfg, "link.announce", announce, true);
if (! get_value(cfg, "file.announce_dir", announce_dir, 2, FILENAME_MAX, "/usr/local/etc")) if (! get_value(cfg, "file.announce_dir", announce_dir, 2, FILENAME_MAX, "/usr/local/etc"))
return false; return false;
@ -833,14 +833,14 @@ static bool read_config(char *cfgFile)
get_value(cfg, "timing.play.wait", delay_before, 1, 10, 2); get_value(cfg, "timing.play.wait", delay_before, 1, 10, 2);
memset(link_at_startup, 0, CALL_SIZE+1); memset(link_at_startup, 0, CALL_SIZE+1);
if (get_value(cfg, "g2_link.link_at_start", value, 5, CALL_SIZE, "NONE")) { if (get_value(cfg, "link.link_at_start", value, 5, CALL_SIZE, "NONE")) {
if (strcasecmp(value.c_str(), "none")) if (strcasecmp(value.c_str(), "none"))
strcpy(link_at_startup, value.c_str()); strcpy(link_at_startup, value.c_str());
} else } else
return false; return false;
int maxdongle; int maxdongle;
get_value(cfg, "g2_link.max_dongles", maxdongle, 0, 10, 5); get_value(cfg, "link.max_dongles", maxdongle, 0, 10, 5);
saved_max_dongles = max_dongles = (unsigned int)maxdongle; saved_max_dongles = max_dongles = (unsigned int)maxdongle;
for (i=0; i<3; i++) { for (i=0; i<3; i++) {

@ -10,7 +10,7 @@ ircddb = {
module = { module = {
c = { // change the module to "b" if you have a 70cm DVAP c = { // change the module to "b" if you have a 70cm DVAP
type = "dvap" type = "dvap"
serial_number = "AP123456" // your serial number is visible through the case serial_number = "AP123456" // your serial number is visible through the case
frequency = 145.5 // this is the default value, chose a quiet frequency frequency = 145.5 // this is the default value, chose a quiet frequency
# uncomment and set if you want the following to appear on you ircddb host website. # uncomment and set if you want the following to appear on you ircddb host website.
@ -23,7 +23,7 @@ module = {
} }
} }
g2_link = { glink = {
# add the callsigns that can shutdown or reboot your system # add the callsigns that can shutdown or reboot your system
# admin = [ "XX0XXX" , "YY0YYY" ] // only these users can execute scripts # admin = [ "XX0XXX" , "YY0YYY" ] // only these users can execute scripts

@ -261,11 +261,11 @@ aprs = { # APRS.NET connect info
# filter = "" # filter = ""
} }
g2_link = { link = {
# link_at_start = "NONE" # Link to a reflector at startup. # link_at_start = "NONE" # Link to a reflector at startup.
# to link repeater module B to REF001 C, use "BREF001C" # to link repeater module B to REF001 C, use "BREF001C"
# ref_login = "" # for loging into REF reflectors, if undefined, ircddb.username will be used # ref_login = "" # for loging into REF reflectors, if undefined, ircddb.username will be used
# admin = [ "CALL1", "CALL2", "CALL3" ] # if defined, only these users can execute scripts, block dongles and reload the gwys.txt # admin = [ "CALL1", "CALL2", "CALL3" ] # only these users can execute scripts, block dongles and reload the gwys.txt
# you probabaly want you own callsign in the admin list! # you probabaly want you own callsign in the admin list!
# link_unlink = [ "CALL4", "CALL5", "CALL6" ] # if defined, only these users can link and unlink a repeater # link_unlink = [ "CALL4", "CALL5", "CALL6" ] # if defined, only these users can link and unlink a repeater
# incoming_ip = "0.0.0.0" # incoming ip address, "0.0.0.0" means accepts all connections. # incoming_ip = "0.0.0.0" # incoming ip address, "0.0.0.0" means accepts all connections.

Loading…
Cancel
Save

Powered by TurnKey Linux.