summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2025-11-09 22:34:20 +0000
committerDave Hibberd <hibby@debian.org>2025-11-09 22:34:20 +0000
commit367ab8fb01191ec54c91810b1896c41fdf7de911 (patch)
tree8f9ac2b818ebb923b47fce00b28eb127556d96fb /config.c
parent7c796758d1b65d4d7585c90ba71b1fb339a4d283 (diff)
New upstream version 6.0.25.9+repack
Diffstat (limited to 'config.c')
-rw-r--r--config.c204
1 files changed, 165 insertions, 39 deletions
diff --git a/config.c b/config.c
index a1b39a2..33213df 100644
--- a/config.c
+++ b/config.c
@@ -305,11 +305,12 @@ static char *keywords[] =
"APPL5ALIAS", "APPL6ALIAS", "APPL7ALIAS", "APPL8ALIAS",
"APPL1QUAL", "APPL2QUAL", "APPL3QUAL", "APPL4QUAL",
"APPL5QUAL", "APPL6QUAL", "APPL7QUAL", "APPL8QUAL",
-"BTEXT:", "NETROMCALL", "C_IS_CHAT", "MAXRTT", "MAXHOPS", // IPGATEWAY= no longer allowed
+
+"BTEXT:", "NETROMCALL", "C_IS_CHAT", "MAXRTT", "MAXTT", "MAXHOPS", // IPGATEWAY= no longer allowed
"LogL4Connects", "LogAllConnects", "SAVEMH", "ENABLEADIFLOG", "ENABLEEVENTS", "SAVEAPRSMSGS",
"EnableM0LTEMap", "MQTT", "MQTT_HOST", "MQTT_PORT", "MQTT_USER", "MQTT_PASS",
"L4Compress", "L4CompMaxframe", "L4CompPaclen", "L2Compress", "L2CompMaxframe",
-"L2CompPaclen", "PREFERINP3ROUTES", "OnlyVer2point0"
+"L2CompPaclen", "PREFERINP3ROUTES", "OnlyVer2point0", "DEBUGINP3", "ENABLEOARCAPI"
}; /* parameter keywords */
static void * offset[] =
@@ -328,11 +329,12 @@ static void * offset[] =
&xxcfg.C_APPL[4].ApplAlias, &xxcfg.C_APPL[5].ApplAlias, &xxcfg.C_APPL[6].ApplAlias, &xxcfg.C_APPL[7].ApplAlias,
&xxcfg.C_APPL[0].ApplQual, &xxcfg.C_APPL[1].ApplQual, &xxcfg.C_APPL[2].ApplQual, &xxcfg.C_APPL[3].ApplQual,
&xxcfg.C_APPL[4].ApplQual, &xxcfg.C_APPL[5].ApplQual, &xxcfg.C_APPL[6].ApplQual, &xxcfg.C_APPL[7].ApplQual,
-&xxcfg.C_BTEXT, &xxcfg.C_NETROMCALL, &xxcfg.C_C, &xxcfg.C_MAXRTT, &xxcfg.C_MAXHOPS, // IPGATEWAY= no longer allowed
+
+&xxcfg.C_BTEXT, &xxcfg.C_NETROMCALL, &xxcfg.C_C, &xxcfg.C_MAXRTT, &xxcfg.C_MAXRTT, &xxcfg.C_MAXHOPS, // IPGATEWAY= no longer allowed
&xxcfg.C_LogL4Connects, &xxcfg.C_LogAllConnects, &xxcfg.C_SaveMH, &xxcfg.C_ADIF, &xxcfg.C_EVENTS, &xxcfg.C_SaveAPRSMsgs,
&xxcfg.C_M0LTEMap, &xxcfg.C_MQTT, &xxcfg.C_MQTT_HOST, &xxcfg.C_MQTT_PORT, &xxcfg.C_MQTT_USER, &xxcfg.C_MQTT_PASS,
&xxcfg.C_L4Compress, &xxcfg.C_L4CompMaxframe, &xxcfg.C_L4CompPaclen, &xxcfg.C_L2Compress, &xxcfg.C_L2CompMaxframe,
-&xxcfg.C_L2CompPaclen, &xxcfg.C_PREFERINP3ROUTES, &xxcfg.C_OnlyVer2point0}; /* offset for corresponding data in config file */
+&xxcfg.C_L2CompPaclen, &xxcfg.C_PREFERINP3ROUTES, &xxcfg.C_OnlyVer2point0, &xxcfg.C_DEBUGINP3, &xxcfg.C_OARCAPI}; /* offset for corresponding data in config file */
static int routine[] =
{
@@ -350,11 +352,12 @@ static int routine[] =
13, 13 ,13, 13,
14, 14, 14, 14,
14, 14 ,14, 14,
-15, 0, 2, 9, 9,
+
+15, 0, 2, 9, 9, 9,
2, 2, 1, 2, 2, 2,
2, 2, 0, 1, 20, 20,
1, 1, 1, 1, 1,
-1, 1, 1} ; // Routine to process param
+1, 1, 1, 1, 1}; // Routine to process param
int PARAMLIM = sizeof(routine)/sizeof(int);
//int NUMBEROFKEYWORDS = sizeof(routine)/sizeof(int);
@@ -376,7 +379,7 @@ static char *pkeywords[] =
"BCALL", "DIGIMASK", "NOKEEPALIVES", "COMPORT", "DRIVER", "WL2KREPORT", "UIONLY",
"UDPPORT", "IPADDR", "I2CBUS", "I2CDEVICE", "UDPTXPORT", "UDPRXPORT", "NONORMALIZE",
"IGNOREUNLOCKEDROUTES", "INP3ONLY", "TCPPORT", "RIGPORT", "PERMITTEDAPPLS", "HIDE",
-"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort", "ALLOWINP3"}; /* parameter keywords */
+"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort", "ALLOWINP3", "ENABLEINP3"}; /* parameter keywords */
static void * poffset[] =
{
@@ -390,7 +393,7 @@ static void * poffset[] =
&xxp.BCALL, &xxp.DIGIMASK, &xxp.DefaultNoKeepAlives, &xxp.IOADDR, &xxp.DLLNAME, &xxp.WL2K, &xxp.UIONLY,
&xxp.IOADDR, &xxp.IPADDR, &xxp.INTLEVEL, &xxp.IOADDR, &xxp.IOADDR, &xxp.ListenPort, &xxp.NoNormalize,
&xxp.IGNOREUNLOCKED, &xxp.INP3ONLY, &xxp.TCPPORT, &xxp.RIGPORT, &xxp.PERMITTEDAPPLS, &xxp.Hide,
-&xxp.SmartID, &xxp.KissParams, &xxp.SendtoM0LTEMap, &xxp.PortFreq, &xxp.M0LTEMapInfo, &xxp.QtSMPort, &xxp.AllowINP3}; /* offset for corresponding data in config file */
+&xxp.SmartID, &xxp.KissParams, &xxp.SendtoM0LTEMap, &xxp.PortFreq, &xxp.M0LTEMapInfo, &xxp.QtSMPort, &xxp.AllowINP3, &xxp.EnableINP3}; /* offset for corresponding data in config file */
static int proutine[] =
{
@@ -404,7 +407,7 @@ static int proutine[] =
0, 1, 2, 18, 15, 16, 2,
1, 17, 1, 1, 1, 1, 2,
2, 2, 1, 1, 19, 2,
-1, 20, 1, 21, 22, 1, 1}; /* routine to process parameter */
+1, 20, 1, 21, 22, 1, 1, 1}; /* routine to process parameter */
int PPARAMLIM = sizeof(proutine)/sizeof(int);
@@ -601,7 +604,6 @@ BOOL ProcessConfig()
for (i=0;i<24;i++)
-
paramok[45+i]=1; /* or APPLCALLS, APPLALIASS APPLQUAL */
paramok[69]=1; // BText optional
@@ -630,7 +632,11 @@ BOOL ProcessConfig()
paramok[90]=1; // L2Compress Maxframe
paramok[91]=1; // L2Compress Paclen
paramok[92]=1; // PREFERINP3ROUTES
- paramok[93]=1; // C_ONLYVer2point0
+ paramok[93]=1; // ONLYVer2point0
+ paramok[94]=1; // DEBUGINP3
+ paramok[95]=1; // EnableOARCAPI
+ paramok[96]=1; // OARCAPI
+
for (i=0; i < PARAMLIM; i++)
{
@@ -1583,32 +1589,160 @@ int routes(int i)
// strtok and sscanf can't handle successive commas, so split up usig strchr
- memset(Param, 0, 2048);
- strlop(rec, 13);
- strlop(rec, ';');
+ // Now support keyword=value format
- ptr1 = rec;
-
- while (ptr1 && *ptr1 && n < 8)
+ if (strchr(rec, '='))
{
- ptr2 = strchr(ptr1, ',');
- if (ptr2) *ptr2++ = 0;
+ // New format
+ // call quality port window frack paclen farquality inp3 nokeepalives tcp
+
+ char * ptr, *context;
+ char copy[512] = "";
+
+ if (strlen(rec) < 512)
+ strcpy(copy, rec);
+
+ _strupr(rec);
+
+ ptr = strtok_s(rec, " ,=", &context);
+
+ while (ptr)
+ {
+ if (strcmp(ptr, "CALL") == 0)
+ {
+ char * Call = strtok_s(NULL, ",=", &context);
+
+ if (strlen(Call) < 80)
+ strcpy(Route->call, Call);
+
+ }
+ else if (strcmp(ptr, "PORT") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->port = atoi(val);
+ }
+
+ else if (strcmp(ptr, "QUALITY") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->quality = atoi(val);
+ }
+
+ else if (strcmp(ptr, "FRACK") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->pfrack = atoi(val);
+ }
+
+ else if (strcmp(ptr, "PACLEN") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->pwind = atoi(val);
+ }
+
+ else if (strcmp(ptr, "WINDOW") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->pwind = atoi(val);
+ }
+
+ else if (strcmp(ptr, "FARQUALITY") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->farQual = atoi(val);
+ }
+
+ else if (strcmp(ptr, "INP3") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->inp3 = atoi(val);
+ }
+
+ else if (strcmp(ptr, "NOKEEPALIVES") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ Route->farQual = atoi(val);
+ }
+
+
+ else if (strcmp(ptr, "TCP") == 0)
+ {
+ char * val = strtok_s(NULL, " ,=", &context);
+
+ if (val)
+ {
+ char * port = strlop(val, ':');
+
+ Route->tcphost = _strdup(val);
+ if (port)
+ Route->tcpport = atoi(port);
+ else
+ Route->tcpport = 53119;
+ }
+ }
+ else
+ {
+ Consoleprintf("Bad Route %s\r\n",rec);
+ err_flag = 1;
+ break;
+ }
- strcpy(&Param[n++][0], ptr1);
- ptr1 = ptr2;
- while(ptr1 && *ptr1 && *ptr1 == ' ')
- ptr1++;
+ ptr = strtok_s(NULL, " ,=", &context);
+ }
}
- strcpy(Route->call, &Param[0][0]);
+ else
+ {
+
+ memset(Param, 0, 2048);
+ strlop(rec, 13);
+ strlop(rec, ';');
- Route->quality = atoi(Param[1]);
- Route->port = atoi(Param[2]);
- Route->pwind = atoi(Param[3]);
- Route->pfrack = atoi(Param[4]);
- Route->ppacl = atoi(Param[5]);
- inp3 = atoi(Param[6]);
- Route->farQual = atoi(Param[7]);
+ ptr1 = rec;
+
+ while (ptr1 && *ptr1 && n < 8)
+ {
+ ptr2 = strchr(ptr1, ',');
+ if (ptr2) *ptr2++ = 0;
+
+ strcpy(&Param[n++][0], ptr1);
+ ptr1 = ptr2;
+ while(ptr1 && *ptr1 && *ptr1 == ' ')
+ ptr1++;
+ }
+
+ strcpy(Route->call, &Param[0][0]);
+
+ Route->quality = atoi(Param[1]);
+ Route->port = atoi(Param[2]);
+ Route->pwind = atoi(Param[3]);
+ Route->pfrack = atoi(Param[4]);
+ Route->ppacl = atoi(Param[5]);
+ inp3 = atoi(Param[6]);
+ Route->farQual = atoi(Param[7]);
+
+ if (inp3 & 1)
+ Route->inp3 = 1;
+
+ if (inp3 & 2)
+ Route->nokeepalives = 1;
+ }
if (Route->farQual < 0 || Route->farQual > 255)
{
@@ -1633,14 +1767,6 @@ int routes(int i)
err_flag = 1;
}
- // Use top bit of window as INP3 Flag, next as NoKeepAlive
-
- if (inp3 & 1)
- Route->pwind |= 0x80;
-
- if (inp3 & 2)
- Route->pwind |= 0x40;
-
if (err_flag == 1)
{
Consoleprintf("%s\r\n",rec);