diff options
| author | Dave Hibberd <hibby@debian.org> | 2025-11-11 21:50:47 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2025-11-11 21:50:47 +0000 |
| commit | 85f200a46cf5e002e59e36b11ab4fba2f0422b33 (patch) | |
| tree | 0ff6b163c3b3acd64194c7b933505a2a159e42ee /cMain.c | |
| parent | 9aad97786d945165530dcac2216c5b75e4632f82 (diff) | |
New upstream version 6.0.25.11+repackupstream/6.0.25.11+repack
Diffstat (limited to 'cMain.c')
| -rw-r--r-- | cMain.c | 86 |
1 files changed, 65 insertions, 21 deletions
@@ -38,6 +38,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses #include "cheaders.h"
#include "tncinfo.h"
#include "mqtt.h"
+#include "kiss.h"
VOID L2Routine(struct PORTCONTROL * PORT, PMESSAGE Buffer);
VOID ProcessIframe(struct _LINKTABLE * LINK, PDATAMESSAGE Buffer);
@@ -57,13 +58,7 @@ VOID L2SENDCOMMAND(struct _LINKTABLE * LINK, int CMD); void WritePacketLogThread(void * param);
void hookNodeStarted();
void hookNodeRunning();
-<<<<<<< Updated upstream
-void APIL2Trace(struct _MESSAGE * Message, char Dirn);
-||||||| Stash base
-
-=======
void APIL2Trace(struct _MESSAGE * Message, char * Dirn);
->>>>>>> Stashed changes
#include "configstructs.h"
@@ -1023,6 +1018,7 @@ BOOL Start() PORT->INP3ONLY = PortRec->INP3ONLY;
PORT->ALLOWINP3 = PortRec->AllowINP3;
PORT->ENABLEINP3 = PortRec->EnableINP3;
+ PORT->isRF = PortRec->isRF;
PORT->PORTWINDOW = (UCHAR)PortRec->MAXFRAME;
@@ -1422,13 +1418,9 @@ BOOL Start() {
ROUTE->TCPHost = Rcfg->tcphost;
ROUTE->TCPPort = Rcfg->tcpport;
-<<<<<<< Updated upstream
-||||||| Stash base
-=======
ROUTE->TCPAddress = (struct addrinfo *)zalloc(sizeof(struct addrinfo));
ROUTE->TCPAddress->ai_addr = (struct sockaddr *) zalloc(sizeof(struct sockaddr));
->>>>>>> Stashed changes
}
Rcfg++;
@@ -2292,12 +2284,7 @@ VOID TIMERINTERRUPT() Message = (struct _MESSAGE *)Buffer;
if(NodeAPISocket)
-<<<<<<< Updated upstream
- APIL2Trace(Message, 'T');
-||||||| Stash base
-=======
APIL2Trace(Message, "sent");
->>>>>>> Stashed changes
Message->PORT |= 0x80; // Set TX Bit
@@ -2412,12 +2399,7 @@ L2Packet: MQTTKISSRX(Buffer);
if(NodeAPISocket &&PORT->PROTOCOL == 0)
-<<<<<<< Updated upstream
- APIL2Trace(Message, 'R');
-||||||| Stash base
-=======
APIL2Trace(Message, "rcvd");
->>>>>>> Stashed changes
// Bridge if requested
@@ -2788,6 +2770,7 @@ VOID INITIALISEPORTS() {
char INITMSG[80];
struct PORTCONTROL * PORT = PORTTABLE;
+ struct PORTCONTROL * SAVEPORT;
while (PORT)
{
@@ -2795,7 +2778,68 @@ VOID INITIALISEPORTS() WritetoConsoleLocal(INITMSG);
PORT->PORTINITCODE(PORT);
- PORT = PORT->PORTPOINTER;
+ SAVEPORT=PORT;
+
+ // See if it is an RF port
+
+ if (PORT->isRF == -1) // Not set
+ {
+ // Try to determine if RF
+
+ if (PORT->PORTTYPE == 0)
+ {
+ struct KISSINFO * KISS = (struct KISSINFO *)PORT;
+ NPASYINFO Port;
+
+ if (KISS->FIRSTPORT && KISS->FIRSTPORT != KISS)
+ {
+ // Not first port on device
+
+ PORT = (struct PORTCONTROL *)KISS->FIRSTPORT;
+ }
+
+ Port = KISSInfo[PORT->PORTNUMBER];
+
+ if (Port)
+ {
+ // KISS like
+
+ if (PORT->PORTIPADDR.s_addr || PORT->KISSSLAVE)
+ {
+ // KISS over UDP or TCP
+
+ if (PORT->KISSTCP)
+ PORT->isRF = 1; // Assume TCP is RF (software modem)
+ else
+ PORT->isRF = 0; // Assuem UDP is Internet
+ }
+ else
+ PORT->isRF = 1; // Serial port
+ }
+ }
+ else if (PORT->PORTTYPE == 14) // Loopback
+ PORT->isRF = 0;
+
+ else if (PORT->PORTTYPE == 16) // External
+ {
+ if (PORT->PROTOCOL == 10) // 'HF' Port
+ {
+ struct TNCINFO * TNC = TNCInfo[PORT->PORTNUMBER];
+
+ if (TNC && TNC->Hardware == H_TELNET)
+ PORT->isRF = 0;
+ else
+ PORT->isRF = 1; // ARDOP etc
+ }
+ else
+ {
+ // External but not HF - AXIP, BPQETHER VKISS, ??
+
+ PORT->isRF = 0;
+ }
+ }
+ }
+ PORT = SAVEPORT->PORTPOINTER;
}
}
|
