diff options
| author | Dave Hibberd <hibby@debian.org> | 2024-11-05 21:03:23 +0000 |
|---|---|---|
| committer | Dave Hibberd <hibby@debian.org> | 2024-11-05 21:03:23 +0000 |
| commit | 5767c5f6e8eacf437d0b487d940681b96ac3b32b (patch) | |
| tree | a040d1059df151e2d055afd182631f132da39435 /L2Code.c | |
| parent | 61f49ee46b56cdff6cfae929f7547b36de26f141 (diff) | |
| parent | 424c0bd3e14d3ddda6c2d945b6465d51c462c76b (diff) | |
Update upstream source from tag 'upstream/6.0.24.49'
Update to upstream version '6.0.24.49'
with Debian dir 985e9a7aed1573d949ab4cb30ca01e9f15823223
Diffstat (limited to 'L2Code.c')
| -rw-r--r-- | L2Code.c | 39 |
1 files changed, 21 insertions, 18 deletions
@@ -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);
|
