summaryrefslogtreecommitdiff
path: root/L2Code.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 /L2Code.c
parenteb0d36d3f67be13de74023adb6d30362d47805fe (diff)
New upstream version 6.0.24.49upstream/6.0.24.49
Diffstat (limited to 'L2Code.c')
-rw-r--r--L2Code.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/L2Code.c b/L2Code.c
index da2d7d7..78369c7 100644
--- a/L2Code.c
+++ b/L2Code.c
@@ -110,7 +110,7 @@ int seeifInterlockneeded(struct PORTCONTROL * PORT);
int seeifUnlockneeded(struct _LINKTABLE * LINK);
int CheckKissInterlock(struct PORTCONTROL * MYPORT, int Exclusive);
void hookL2SessionAccepted(int Port, char * fromCall, char * toCall, struct _LINKTABLE * LINK);
-void hookL2SessionDeleted(int Port, char * fromCall, char * toCall, struct _LINKTABLE * LINK);
+void hookL2SessionDeleted(struct _LINKTABLE * LINK);
void hookL2SessionAttempt(int Port, char * fromCall, char * toCall, struct _LINKTABLE * LINK);
@@ -1131,6 +1131,9 @@ VOID L2SABM(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * Buffe
return;
}
+ toCall[ConvFromAX25(ADJBUFFER->DEST, toCall)] = 0;
+ fromCall[ConvFromAX25(ADJBUFFER->ORIGIN, fromCall)] = 0;
+
SETUPNEWL2SESSION(LINK, PORT, Buffer, MSGFLAG);
if (LINK->L2STATE != 5) // Setup OK?
@@ -1143,10 +1146,6 @@ VOID L2SABM(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * Buffe
seeifInterlockneeded(PORT);
- toCall[ConvFromAX25(ADJBUFFER->DEST, toCall)] = 0;
- fromCall[ConvFromAX25(ADJBUFFER->ORIGIN, fromCall)] = 0;
-
-
// IF CONNECT TO APPL ADDRESS, SET UP APPL SESSION
if (APPLMASK == 0)
@@ -1161,13 +1160,8 @@ VOID L2SABM(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * Buffe
int Paclen= PORT->PORTPACLEN;
UCHAR * ptr;
- if (LogAllConnects)
- {
- char toCall[12], fromCall[12];
- toCall[ConvFromAX25(ADJBUFFER->DEST, toCall)] = 0;
- fromCall[ConvFromAX25(ADJBUFFER->ORIGIN, fromCall)] = 0;
+ if (LogAllConnects)
WriteConnectLog(fromCall, toCall, "AX.25");
- }
hookL2SessionAccepted(PORT->PORTNUMBER, fromCall, toCall, LINK);
@@ -1284,7 +1278,9 @@ VOID L2SABM(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * Buffe
// ACCEPT THE CONNECT, THEN INVOKE THE ALIAS
L2SENDUA(PORT, Buffer, ADJBUFFER);
-
+
+ hookL2SessionAccepted(PORT->PORTNUMBER, fromCall, toCall, LINK);
+
if (PORT->TNC && PORT->TNC->Hardware == H_KISSHF)
{
struct DATAMESSAGE * Msg;
@@ -1383,6 +1379,9 @@ VOID L2SABM(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE * Buffe
L2SENDUA(PORT, Buffer, ADJBUFFER);
+ hookL2SessionAccepted(PORT->PORTNUMBER, fromCall, toCall, LINK);
+
+
if (PORT->TNC && PORT->TNC->Hardware == H_KISSHF)
{
struct DATAMESSAGE * Msg;
@@ -2442,6 +2441,8 @@ VOID PROC_I_FRAME(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, MESSAGE *
Length = Buffer->LENGTH - (MSGHDDRLEN + 15); // Buffer Header + addrs + CTL
Info = &Buffer->PID;
+ LINK->bytesRXed += Length;
+
// Adjust for DIGIS
EOA = &Buffer->ORIGIN[6]; // End of address Bit
@@ -2647,6 +2648,13 @@ VOID RESET2(struct _LINKTABLE * LINK)
VOID SENDSABM(struct _LINKTABLE * LINK)
{
+ char toCall[10];
+ char fromCall[10];
+
+ toCall[ConvFromAX25(LINK->LINKCALL, toCall)] = 0;
+ fromCall[ConvFromAX25(LINK->OURCALL, fromCall)] = 0;
+ hookL2SessionAttempt(LINK->LINKPORT->PORTNUMBER, fromCall, toCall, LINK);
+
L2SENDCOMMAND(LINK, SABM | PFBIT);
}
@@ -3260,12 +3268,7 @@ VOID SENDFRMR(struct _LINKTABLE * LINK)
VOID CLEAROUTLINK(struct _LINKTABLE * LINK)
{
- char toCall[12], fromCall[12];
-
- toCall[ConvFromAX25(LINK->LINKCALL, toCall)] = 0;
- fromCall[ConvFromAX25(LINK->OURCALL, fromCall)] = 0;
-
- hookL2SessionDeleted(LINK->LINKPORT->PORTNUMBER, fromCall, toCall, LINK);
+ hookL2SessionDeleted(LINK);
seeifUnlockneeded(LINK);