diff options
| author | Dave Hibberd <hibby@debian.org> | 2024-11-05 21:03:15 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2024-11-05 21:03:15 +0000 |
| commit | 424c0bd3e14d3ddda6c2d945b6465d51c462c76b (patch) | |
| tree | 80b44cbe3f5fc19de1c057e37c761a95a0518a44 /FreeDATA.c | |
| parent | eb0d36d3f67be13de74023adb6d30362d47805fe (diff) | |
New upstream version 6.0.24.49upstream/6.0.24.49
Diffstat (limited to 'FreeDATA.c')
| -rw-r--r-- | FreeDATA.c | 78 |
1 files changed, 19 insertions, 59 deletions
@@ -971,7 +971,7 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff) memset(STREAM->RemoteCall, 0, 10);
strcpy(STREAM->RemoteCall, &buff->L2DATA[2]);
STREAM->ConnectTime = time(NULL);
- STREAM->BytesRXed = STREAM->BytesTXed = STREAM->PacketsSent = 0;
+ STREAM->bytesRXed = STREAM->bytesTXed = STREAM->PacketsSent = 0;
sprintf(TNC->WEB_TNCSTATE, "%s Connecting to %s", STREAM->MyCall, STREAM->RemoteCall);
MySetWindowText(TNC->xIDC_TNCSTATE, TNC->WEB_TNCSTATE);
@@ -1950,7 +1950,7 @@ VOID FreeDataProcessTNCMessage(struct TNCINFO * TNC, char * Call, unsigned char MySetWindowText(TNC->xIDC_TNCSTATE, TNC->WEB_TNCSTATE);
STREAM->ConnectTime = time(NULL);
- STREAM->BytesRXed = STREAM->BytesTXed = STREAM->PacketsSent = 0;
+ STREAM->bytesRXed = STREAM->bytesTXed = STREAM->PacketsSent = 0;
STREAM->Connected = TRUE;
// Send Connect ACK
@@ -2019,20 +2019,7 @@ VOID FreeDataProcessTNCMessage(struct TNCINFO * TNC, char * Call, unsigned char {
// Create a traffic record
- char logmsg[120];
- time_t Duration;
-
- Duration = time(NULL) - STREAM->ConnectTime;
-
- if (Duration == 0)
- Duration = 1;
-
- sprintf(logmsg,"Port %2d %9s Bytes Sent %d BPS %d Bytes Received %d BPS %d Time %d Seconds",
- TNC->Port, STREAM->RemoteCall,
- STREAM->BytesTXed, (int)(STREAM->BytesTXed/Duration),
- STREAM->BytesRXed, (int)(STREAM->BytesRXed/Duration), (int)Duration);
-
- Debugprintf(logmsg);
+ hookL4SessionDeleted(TNC, STREAM);
}
STREAM->Connected = FALSE; // Back to Command Mode
@@ -2062,7 +2049,7 @@ VOID FreeDataProcessTNCMessage(struct TNCINFO * TNC, char * Call, unsigned char WritetoTrace(TNC, Msg, 256);
Len -= 256;
Msg += 256;
- STREAM->BytesRXed += 256;
+ STREAM->bytesRXed += 256;
}
@@ -2071,9 +2058,9 @@ VOID FreeDataProcessTNCMessage(struct TNCINFO * TNC, char * Call, unsigned char memcpy(buffptr->Data, Msg, Len);
C_Q_ADD(&STREAM->PACTORtoBPQ_Q, buffptr);
WritetoTrace(TNC, Msg, Len);
- STREAM->BytesRXed += Len;
+ STREAM->bytesRXed += Len;
sprintf(TNC->WEB_TRAFFIC, "Sent %d RXed %d Queued %d",
- STREAM->BytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->BytesRXed, TNC->FreeDataInfo->toSendCount);
+ STREAM->bytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->bytesRXed, TNC->FreeDataInfo->toSendCount);
MySetWindowText(TNC->xIDC_TRAFFIC, TNC->WEB_TRAFFIC);
return;
@@ -2326,7 +2313,7 @@ VOID FreeDataProcessNewConnect(struct TNCINFO * TNC, char * fromCall, char * toC MySetWindowText(TNC->xIDC_TNCSTATE, TNC->WEB_TNCSTATE);
STREAM->ConnectTime = time(NULL);
- STREAM->BytesRXed = STREAM->BytesTXed = STREAM->PacketsSent = 0;
+ STREAM->bytesRXed = STREAM->bytesTXed = STREAM->PacketsSent = 0;
STREAM->Connected = TRUE;
return;
@@ -2426,7 +2413,7 @@ void FlushData(struct TNCINFO * TNC) Info->toSendTimeout = 0;
sprintf(TNC->WEB_TRAFFIC, "Sent %d RXed %d Queued %d",
- STREAM->BytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->BytesRXed, TNC->FreeDataInfo->toSendCount);
+ STREAM->bytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->bytesRXed, TNC->FreeDataInfo->toSendCount);
MySetWindowText(TNC->xIDC_TRAFFIC, TNC->WEB_TRAFFIC);
}
@@ -2449,10 +2436,10 @@ static int SendAsFile(struct TNCINFO * TNC, char * Call, char * Msg, int Len) Info->toSendCount += Len;
Info->toSendTimeout = 10; // About a second
- STREAM->BytesTXed += Len;
+ STREAM->bytesTXed += Len;
sprintf(TNC->WEB_TRAFFIC, "Sent %d RXed %d Queued %d",
- STREAM->BytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->BytesRXed, TNC->FreeDataInfo->toSendCount);
+ STREAM->bytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->bytesRXed, TNC->FreeDataInfo->toSendCount);
MySetWindowText(TNC->xIDC_TRAFFIC, TNC->WEB_TRAFFIC);
return Len;
@@ -2719,7 +2706,7 @@ void ProcessMessageObject(struct TNCINFO * TNC, char * This) WritetoTrace(TNC, Line, 256);
Len -= 256;
Line += 256;
- STREAM->BytesRXed += 256;
+ STREAM->bytesRXed += 256;
}
buffptr = GetBuff();
@@ -2727,12 +2714,12 @@ void ProcessMessageObject(struct TNCINFO * TNC, char * This) memcpy(buffptr->Data, Line, Len);
C_Q_ADD(&STREAM->PACTORtoBPQ_Q, buffptr);
WritetoTrace(TNC, Line, Len);
- STREAM->BytesRXed += Len;
+ STREAM->bytesRXed += Len;
}
sprintf(TNC->WEB_TRAFFIC, "Sent %d RXed %d Queued %d",
- STREAM->BytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->BytesRXed, TNC->FreeDataInfo->toSendCount);
+ STREAM->bytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->bytesRXed, TNC->FreeDataInfo->toSendCount);
MySetWindowText(TNC->xIDC_TRAFFIC, TNC->WEB_TRAFFIC);
}
return;
@@ -2811,7 +2798,7 @@ void ProcessMessageObject(struct TNCINFO * TNC, char * This) WritetoTrace(TNC, Line, 256);
Len -= 256;
TEXT += 256;
- STREAM->BytesRXed += 256;
+ STREAM->bytesRXed += 256;
}
buffptr = GetBuff();
@@ -2819,14 +2806,14 @@ void ProcessMessageObject(struct TNCINFO * TNC, char * This) memcpy(buffptr->Data, Line, Len);
C_Q_ADD(&STREAM->PACTORtoBPQ_Q, buffptr);
WritetoTrace(TNC, Line, Len);
- STREAM->BytesRXed += Len;
+ STREAM->bytesRXed += Len;
TEXT = rest;
rest = strlop(TEXT, 10); // FreeData chat ues LF
}
sprintf(TNC->WEB_TRAFFIC, "Sent %d RXed %d Queued %d",
- STREAM->BytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->BytesRXed, TNC->FreeDataInfo->toSendCount);
+ STREAM->bytesTXed - TNC->FreeDataInfo->toSendCount, STREAM->bytesRXed, TNC->FreeDataInfo->toSendCount);
MySetWindowText(TNC->xIDC_TRAFFIC, TNC->WEB_TRAFFIC);
}
}
@@ -3158,22 +3145,8 @@ void ProcessTNCJSON(struct TNCINFO * TNC, char * Msg, int Len) if (STREAM->Connected)
{
- // Create a traffic record
-
- char logmsg[120];
- time_t Duration;
-
- Duration = time(NULL) - STREAM->ConnectTime;
-
- if (Duration == 0)
- Duration = 1;
-
- sprintf(logmsg,"Port %2d %9s Bytes Sent %d BPS %d Bytes Received %d BPS %d Time %d Seconds",
- TNC->Port, STREAM->RemoteCall,
- STREAM->BytesTXed, (int)(STREAM->BytesTXed/Duration),
- STREAM->BytesRXed, (int)(STREAM->BytesRXed/Duration), (int)Duration);
-
- Debugprintf(logmsg);
+
+ hookL4SessionDeleted(TNC, STREAM);
STREAM->Connected = FALSE; // Back to Command Mode
STREAM->ReportDISC = TRUE; // Tell Node
@@ -3351,20 +3324,7 @@ void ProcessTNCJSON(struct TNCINFO * TNC, char * Msg, int Len) {
// Create a traffic record
- char logmsg[120];
- time_t Duration;
-
- Duration = time(NULL) - STREAM->ConnectTime;
-
- if (Duration == 0)
- Duration = 1;
-
- sprintf(logmsg,"Port %2d %9s Bytes Sent %d BPS %d Bytes Received %d BPS %d Time %d Seconds",
- TNC->Port, STREAM->RemoteCall,
- STREAM->BytesTXed, (int)(STREAM->BytesTXed/Duration),
- STREAM->BytesRXed, (int)(STREAM->BytesRXed/Duration), (int)Duration);
-
- Debugprintf(logmsg);
+ hookL4SessionDeleted(TNC, STREAM);
STREAM->Connected = FALSE; // Back to Command Mode
STREAM->ReportDISC = TRUE; // Tell Node
|
