summaryrefslogtreecommitdiff
path: root/AGWAPI.c
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-11-05 21:03:15 +0000
committerDave Hibberd <hibby@debian.org>2024-11-05 21:03:15 +0000
commit424c0bd3e14d3ddda6c2d945b6465d51c462c76b (patch)
tree80b44cbe3f5fc19de1c057e37c761a95a0518a44 /AGWAPI.c
parenteb0d36d3f67be13de74023adb6d30362d47805fe (diff)
New upstream version 6.0.24.49upstream/6.0.24.49
Diffstat (limited to 'AGWAPI.c')
-rw-r--r--AGWAPI.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/AGWAPI.c b/AGWAPI.c
index 5e46d7e..e84a1d1 100644
--- a/AGWAPI.c
+++ b/AGWAPI.c
@@ -563,10 +563,28 @@ int AGWConnected(struct BPQConnectionInfo * Con, int Stream)
(memcmp(sockptr->CallSign1, ApplCall, 10) == 0) || (memcmp(sockptr->CallSign2, ApplCall, 10) == 0))
{
// Create Key
-
+
+ char callsign[10];
+ int port;
+ int sesstype;
+ int paclen;
+ int maxframe;
+ int l4window;
+
+
keyptr=(byte *)&Con->CallKey;
- *(keyptr++)='1';
+ // Try using the BPQ Port Number if a L2 connect, first free port number if not
+
+ GetConnectionInfo(Stream, callsign,
+ &port, &sesstype, &paclen,
+ &maxframe, &l4window);
+
+
+ if (port == 0)
+ port = 64;
+
+ *(keyptr++)='0' + port;
memcpy(keyptr, ApplCall, 10);
keyptr+=10;
memcpy(keyptr,ConnectingCall, 10);
@@ -686,8 +704,9 @@ int AGWDoMonitorData()
struct AGWSocketConnectionInfo * sockptr;
byte AGWBuffer[1000];
int n;
- int Stamp, Frametype;
+ int Frametype;
BOOL RXFlag;
+ time_t Stamp;
// Look for Monitor Data
@@ -708,7 +727,7 @@ int AGWDoMonitorData()
return 0;
}
- Stamp = (UINT)monbuff->Timestamp;
+ Stamp = monbuff->Timestamp;
memcpy(Buffer, monbuff, RawLen);