Compare commits

...

169 commits

Author SHA1 Message Date
Hibby ee15c1a996 Release! 2025-11-22 15:14:42 +00:00
Hibby 944fdfc524 Update upstream source from tag 'upstream/6.0.25.12+repack'
Update to upstream version '6.0.25.12+repack'
with Debian dir 0b59d86e0b
2025-11-22 15:09:25 +00:00
Hibby 52e35f45b4 New upstream version 6.0.25.12+repack 2025-11-22 15:09:21 +00:00
Hibby 3fbe745ec9 Release 25.11 2025-11-11 21:53:27 +00:00
Hibby 1338e2c0a4 Update upstream source from tag 'upstream/6.0.25.11+repack'
Update to upstream version '6.0.25.11+repack'
with Debian dir 9c0f82ee4c
2025-11-11 21:50:49 +00:00
Hibby 85f200a46c New upstream version 6.0.25.11+repack 2025-11-11 21:50:47 +00:00
Hibby 9aad97786d 6.0.25.9 2025-11-11 21:42:35 +00:00
Hibby 8dc88bc829 Changelog update, release 2025-11-09 22:45:36 +00:00
Hibby 58ab380142 Refresh patches 2025-11-09 22:35:15 +00:00
Hibby 3c2c1cf9f8 Update upstream source from tag 'upstream/6.0.25.9+repack'
Update to upstream version '6.0.25.9+repack'
with Debian dir 15e3115d6f
2025-11-09 22:34:23 +00:00
Hibby 367ab8fb01 New upstream version 6.0.25.9+repack 2025-11-09 22:34:20 +00:00
Hibby e569b24f9a Changelog! 2025-10-24 00:48:59 +01:00
Hibby 272c31f62b Refresh patches with gbp pq! 2025-10-24 00:40:43 +01:00
Hibby f99a060918 Update upstream source from tag 'upstream/6.0.25.8+repack'
Update to upstream version '6.0.25.8+repack'
with Debian dir 34f11488df
2025-10-24 00:36:53 +01:00
Hibby 13c0b79af7 Don't forget about the changelog 2025-10-10 23:55:55 +01:00
Hibby 2e55f0a4ca Build on latest gcc standards 2025-10-10 23:54:35 +01:00
Hibby acbaf26ac1 New upstream 2025-10-10 23:51:40 +01:00
Hibby 70d9b41cc1 Update upstream source from tag 'upstream/6.0.25.06+repack'
Update to upstream version '6.0.25.06+repack'
with Debian dir 0466cb7b03
2025-10-10 23:37:36 +01:00
Hibby c0425ff0e2 Migrate patches tp gbp pq 2025-09-20 15:58:22 +01:00
Hibby e4d8eadb91 Set c standard, it builds! 2025-09-20 15:41:51 +01:00
Hibby ac03394a07
First work on new version 2025-09-09 22:10:43 +01:00
Hibby d0f299bc02 Update upstream source from tag 'upstream/6.0.25.1+repack'
Update to upstream version '6.0.25.1+repack'
with Debian dir 5c600492d3
2025-09-04 22:52:15 +01:00
Hibby 78f78927ab
Release new version 2025-08-17 22:40:01 +01:00
Hibby 27d95452b1 Update upstream source from tag 'upstream/6.0.24.82+repack'
Update to upstream version '6.0.24.82+repack'
with Debian dir a145ad04db
2025-08-17 22:31:33 +01:00
Hibby e925e16114 New upstream version 6.0.24.82+repack 2025-08-17 22:31:27 +01:00
Hibby d97d9d821b
Commit before next update! 2025-08-17 22:30:20 +01:00
Hibby a6b3c4bdc9 Update upstream source from tag 'upstream/6.0.24.80+repack'
Update to upstream version '6.0.24.80+repack'
with Debian dir 9e943f8d36
2025-08-12 20:09:07 +01:00
Hibby 3e1cbdfa4d New upstream version 6.0.24.80+repack 2025-08-12 20:09:04 +01:00
Hibby 7a5122a60f
Changelog for release, makefile patch refresh 2025-07-31 01:31:52 +01:00
Hibby 0013c3199a Update upstream source from tag 'upstream/6.0.24.78+repack'
Update to upstream version '6.0.24.78+repack'
with Debian dir 819c1fdecb
2025-07-31 01:28:57 +01:00
Hibby 5d30fbc104
New files to exclude 2025-07-31 01:28:13 +01:00
Hibby e21707174e
Release! 2025-07-22 21:52:16 +01:00
Hibby 26324bdc39
First build 2025-07-22 21:44:33 +01:00
Hibby 1cc87cf766 Update upstream source from tag 'upstream/6.0.24.77+repack'
Update to upstream version '6.0.24.77+repack'
with Debian dir bbbd57413e
2025-07-22 20:57:03 +01:00
Hibby 30b1e26a04
Did a port on minibuildd for +1, this is technically +2 2025-07-16 19:16:00 +01:00
Hibby 31bda6ce76
Trixie release 2025-07-16 19:11:08 +01:00
Hibby d2c3489aef
Release 2025-07-15 01:11:11 +01:00
Hibby 6371d5385a Update upstream source from tag 'upstream/6.0.24.75+repack'
Update to upstream version '6.0.24.75+repack'
with Debian dir 8aa30a6de8
2025-07-14 23:14:14 +01:00
Hibby b2315840b2 New upstream version 6.0.24.75+repack 2025-07-14 23:14:11 +01:00
Hibby 8d3874ec4e
Update d/copyright to ignore svn 2025-07-14 23:12:11 +01:00
Hibby 6a4b588a48
Release and autoport magic 2025-05-21 22:12:07 +01:00
Hibby 426f47ccb6
It builds successfully! 2025-05-21 21:45:54 +01:00
Hibby 3ecb593511 Update upstream source from tag 'upstream/6.0.24.71+repack'
Update to upstream version '6.0.24.71+repack'
with Debian dir d79186aef0
2025-05-21 21:33:54 +01:00
Hibby 0d3ee7fd56 New upstream version 6.0.24.71+repack 2025-05-21 21:33:52 +01:00
Hibby 96197688e7
New upstream version 6.0.24.69.1+repack 2025-05-21 21:32:18 +01:00
Hibby d3b4158645
New upstream version 6.0.24.69+repack 2025-05-21 21:32:18 +01:00
Hibby fec78cece5
Update changelog 2025-05-21 21:32:17 +01:00
Hibby bdf8a8367e
New upstream version 6.0.24.67+repack 2025-05-21 21:32:17 +01:00
Hibby f0ac0675f6
Release, try out some MINI_BUILDD_OPTIONS 2025-03-11 00:51:56 +00:00
Hibby 329e2f441d
Who knows at this point 2025-03-11 00:28:11 +00:00
Hibby 0b4a17004f
New upstream 2025-03-04 22:50:37 +00:00
Hibby f0b507a096 Update upstream source from tag 'upstream/6.0.24.66+repack'
Update to upstream version '6.0.24.66+repack'
with Debian dir 0a1e01b2c4
2025-03-04 22:46:54 +00:00
Hibby 9d0d20064d
Release! 2025-02-25 09:39:10 +00:00
Hibby ead72b2575
New import packaging 2025-02-25 09:35:39 +00:00
Hibby f1d8b647c7 Update upstream source from tag 'upstream/6.0.24.65+repack'
Update to upstream version '6.0.24.65+repack'
with Debian dir 324f0a8474
2025-02-25 09:32:59 +00:00
Hibby bfcf049c56
New packaging tweaks 2025-02-03 22:35:11 +00:00
Hibby 488e218d34 Update upstream source from tag 'upstream/6.0.24.59a+repack'
Update to upstream version '6.0.24.59a+repack'
with Debian dir 618298da94
2025-02-03 22:19:01 +00:00
Hibby 3efea8aa10
Release 2025-01-06 21:41:04 +00:00
Hibby 8e9260b52d
Updates for .56 2025-01-06 21:37:03 +00:00
Hibby 5105f0adf3 Update upstream source from tag 'upstream/6.0.24.56+repack'
Update to upstream version '6.0.24.56+repack'
with Debian dir 5e2bea687a
2025-01-06 21:26:32 +00:00
Hibby b060bf5d39
Update upstream source from tag 'upstream/6.0.24.55+repack'
Update to upstream version '6.0.24.55+repack'
with Debian dir ba150ac059
2025-01-05 23:35:13 +00:00
Hibby 33d8e6f75a
Release to unstable 2024-12-17 16:51:59 +00:00
Hibby 58d2baad53
New upstream and packaging tweaks 2024-12-17 16:45:51 +00:00
Hibby 1f73eb5601 Update upstream source from tag 'upstream/6.0.24.54+repack'
Update to upstream version '6.0.24.54+repack'
with Debian dir f571d496d3
2024-12-16 17:54:18 +00:00
Hibby a7d635fe2f New upstream version 6.0.24.54+repack 2024-12-16 17:54:16 +00:00
Hibby eab73bee95
.53 build 2024-12-09 10:06:20 +00:00
Hibby 745a9f8e88 Update upstream source from tag 'upstream/6.0.24.53+repack'
Update to upstream version '6.0.24.53+repack'
with Debian dir 64961bc210
2024-12-03 00:27:59 +00:00
Hibby dd84b546a0
Release 2024-11-30 22:14:12 +00:00
Hibby 3a600bee23 Update upstream source from tag 'upstream/6.0.24.52+repack'
Update to upstream version '6.0.24.52+repack'
with Debian dir 0b34b91ce1
2024-11-30 21:42:45 +00:00
Hibby d09a168608 Update upstream source from tag 'upstream/6.0.24.51.3+repack+really50'
Update to upstream version '6.0.24.51.3+repack+really50'
with Debian dir 0b34b91ce1
2024-11-30 11:27:30 +00:00
Hibby 757c658adc Update upstream source from tag 'upstream/6.0.24.51.2+repack+really.50'
Update to upstream version '6.0.24.51.2+repack+really.50'
with Debian dir 0b34b91ce1
2024-11-30 11:21:00 +00:00
Hibby 37bacc3178
Update required for build on trixie - I knew there was weirdness
somewhere!
2024-11-29 19:57:43 +00:00
Hibby 7690eb8f59
Release! 2024-11-29 19:33:20 +00:00
Hibby a675c89dc3 Update upstream source from tag 'upstream/6.0.24.51.1+repack'
Update to upstream version '6.0.24.51.1+repack'
with Debian dir 345d0bf3b0
2024-11-29 19:19:21 +00:00
Hibby 7433c77604
little tweaks before import 2024-11-29 19:18:48 +00:00
Hibby 6bd281ab30
Tweaks to get functionality 2024-11-29 16:13:51 +00:00
Hibby c0637b3841
Last batch of changes, ready for release! 2024-11-29 13:23:18 +00:00
Hibby 3a840054a7 Update upstream source from tag 'upstream/6.0.24.51+repack'
Update to upstream version '6.0.24.51+repack'
with Debian dir cbfe17e0e2
2024-11-29 12:56:28 +00:00
Hibby 8a18ca1868
pull more files out, update watch for repack 2024-11-29 12:55:39 +00:00
Hibby 49e27728c3
Removal of files I don't think we need to ship 2024-11-29 12:09:05 +00:00
Hibby 8e7a943558
This builds and links to system libs! 2024-11-29 12:04:09 +00:00
Hibby e35489a925
Latest revisions 2024-11-29 11:37:37 +00:00
Hibby c77b3e9f47
More updates, large makefile rewrite for dynamic linking and cleaner
build, WIP.
2024-11-29 02:24:20 +00:00
Hibby 1e83f7e725
First pass of fixes for new build 2024-11-28 22:50:13 +00:00
Hibby 5d8d8963ef Update upstream source from tag 'upstream/6.0.24.51'
Update to upstream version '6.0.24.51'
with Debian dir b28e5722f6
2024-11-28 22:34:01 +00:00
Hibby 96d6e87d12
Release! 2024-11-12 21:58:14 +00:00
Hibby 5bd018b10f
Little packaging tidies 2024-11-12 21:53:24 +00:00
Hibby 4d14474d92 Update upstream source from tag 'upstream/6.0.24.50'
Update to upstream version '6.0.24.50'
with Debian dir 3f4098912b
2024-11-12 21:20:03 +00:00
Hibby 1b40c8c7b5
Try files-excluded, Tidy up copyright! 2024-11-12 21:18:17 +00:00
Hibby a5ce8b2319
Release! 2024-11-05 22:09:13 +00:00
Hibby 6b795ee1f6
Patch Refresh and mqtt details 2024-11-05 21:46:27 +00:00
Hibby 5767c5f6e8 Update upstream source from tag 'upstream/6.0.24.49'
Update to upstream version '6.0.24.49'
with Debian dir 985e9a7aed
2024-11-05 21:03:23 +00:00
Hibby 61f49ee46b
Release for hibbian 2024-10-11 15:49:55 +01:00
Hibby 6e6693fde1
Refresh Patches 2024-10-11 15:46:34 +01:00
Hibby 1a7f29f7d7
Look at me, I am the master now 2024-10-11 15:42:39 +01:00
Hibby f527c60884
Merge branch 'debian/latest' into hibbian/latest 2024-10-11 15:42:00 +01:00
Hibby 3de6b0150f Update upstream source from tag 'upstream/6.0.24.45'
Update to upstream version '6.0.24.45'
with Debian dir 9a5822f2bb
2024-10-11 15:37:17 +01:00
Hibby 0d48067b82
Sneak in the 32bit fixes 2024-09-26 23:13:41 +01:00
Hibby b18a579b0c
Updates to .42 2024-09-25 01:37:12 +01:00
Hibby ba9f74d1b8
more tweaks to get to build 2024-08-30 12:38:57 +01:00
Hibby 550b4483cb
we can't build without this backup! 2024-08-30 12:25:12 +01:00
Hibby 383e238d61
32bit fix release 2024-08-30 12:23:59 +01:00
Hibby 371dac17ff
32bits isn't building 2024-08-30 12:21:15 +01:00
Hibby 24843bc9cd
Add additional group membership for ninotnc SMT users
Fixes: #1
2024-08-30 12:06:42 +01:00
Hibby f17801297c
Release 2024-08-30 11:54:54 +01:00
Hibby f62a0288be
Try hardening on for size 2024-08-30 11:54:32 +01:00
Hibby 85da9edc16
Try hardening on for size 2024-08-30 11:46:56 +01:00
Hibby 666c2aabb4
Start tidying up headers 2024-08-30 11:46:04 +01:00
Hibby a47cc11d8a
First build needs 2024-08-30 10:23:16 +01:00
Hibby b26c87817a Update upstream source from tag 'upstream/6.0.24.42'
Update to upstream version '6.0.24.42'
with Debian dir 41e80b6ddf
2024-08-30 10:15:03 +01:00
Hibby 60585818de
Move config back to /etc on install 2024-08-18 01:44:28 +01:00
Hibby 9dacd97014
Release 2024-07-07 16:09:46 +01:00
Hibby fc0275b903
Upstream revision 2024-07-07 16:08:01 +01:00
Hibby ca2a16b7fc Update upstream source from tag 'upstream/6.0.24.40'
Update to upstream version '6.0.24.40'
with Debian dir 5582820246
2024-07-07 16:06:15 +01:00
Hibby d122a87dd1
New patch to run secure-by-default until upstream patch 2024-07-05 08:35:03 +01:00
Hibby 5b3543c12a
Merge pull request #4 from Online-Amateur-Radio-Club-M0OUK/secure-by-default
Change default value for SECURETELNET from 0 to 1
2024-07-05 08:30:10 +01:00
Tom Fanning d37331205e Create secure-by-default.patch 2024-07-03 10:02:44 +01:00
Tom M0LTE 026ad61c90
Merge pull request #1 from mquin/patch-1
bpq32.cfg: Set SECURETELNET on Telnet port
2024-07-03 09:33:30 +01:00
Mike Quin 5d125856cd
bpq32.cfg: Set SECURETELNET on Telnet port
The SECURETELNET option restricts outbound telnet connections from the node to users who have authenticated.
2024-07-02 19:48:28 +01:00
Hibby a7ecf779fc
Let's fly 2024-06-09 22:38:58 +01:00
Hibby c26f6fe9d8
Packaging updates round 2 2024-06-09 22:34:46 +01:00
Hibby 91fc60e6f0
Packaging updates 2024-06-09 21:52:56 +01:00
Hibby 3b36ba2a06 Update upstream source from tag 'upstream/6.0.24.38'
Update to upstream version '6.0.24.38'
with Debian dir 05f0c663f1
2024-06-09 21:48:46 +01:00
Hibby ec1e97d985
Update bpq32.cfg
Based on feedback, chat app is now ID 2
2024-06-09 11:15:36 +01:00
Hibby 75eadc6bbe
Release -2 update 2024-04-08 22:27:43 +01:00
Hibby eaab24a3c0
Update postinst 2024-04-08 23:21:31 +02:00
Hibby 4b1144ed94
New upstream 2024-04-06 02:15:37 +01:00
Hibby 37b1c8b074 Update upstream source from tag 'upstream/6.0.24.34'
Update to upstream version '6.0.24.34'
with Debian dir e7ec7ee355
2024-04-06 02:10:15 +01:00
Hibby 0b5e0e5023
Merge branch 'debian/latest' of github.com:Online-Amateur-Radio-Club-M0OUK/oarc-bpqnode into debian/latest 2024-03-26 20:58:02 +00:00
Hibby 66ff00a200
Release 2024-03-26 20:57:34 +00:00
Hibby 566b839fd4
Release 2024-03-26 20:24:27 +00:00
Hibby 5f9fb109ff
New upstream & Packaging tidy 2024-03-26 01:28:08 +00:00
Hibby 94179f117a Update upstream source from tag 'upstream/6.0.24.33'
Update to upstream version '6.0.24.33'
with Debian dir 1cb47d2883
2024-03-26 00:53:01 +00:00
Hibby 831f4a75eb
Release 2024-02-23 23:25:02 +00:00
Hibby 3f1fd46905
Upstream revision 2024-02-23 21:38:02 +00:00
Hibby 5b1c61bd78 Update upstream source from tag 'upstream/6.0.24.30'
Update to upstream version '6.0.24.30'
with Debian dir 4f7e13431e
2024-02-23 21:36:42 +00:00
Hibby ee7345ce92
Release 2024-02-13 00:07:16 +00:00
Hibby 733afdfcbc
New upstream 2024-02-13 00:03:15 +00:00
Hibby 2dd6d1f7bf Update upstream source from tag 'upstream/6.0.24.29'
Update to upstream version '6.0.24.29'
with Debian dir ba277a512a
2024-02-12 23:26:50 +00:00
Dave Hibberd 6ee8a719cf
Release 2024-01-18 10:32:10 +00:00
Dave Hibberd d4d0aaa8ab
Update permissions post install on config to allow for web ui edits 2024-01-18 10:31:35 +00:00
Dave Hibberd 710cc6fde7
Release 2024-01-16 20:52:57 +00:00
Dave Hibberd eec767af84
First build of new revision 2024-01-16 20:44:01 +00:00
Dave Hibberd 0c8b9a1da7 Update upstream source from tag 'upstream/6.0.24.27'
Update to upstream version '6.0.24.27'
with Debian dir be0d74d7ed
2024-01-16 20:42:35 +00:00
Dave Hibberd 018d733dee
release 2023-12-28 10:45:07 +00:00
Dave Hibberd 851dcb6fd8
first build of new upstream 2023-12-28 10:44:40 +00:00
Dave Hibberd ce4f1b11b0 Update upstream source from tag 'upstream/6.0.24.25'
Update to upstream version '6.0.24.25'
with Debian dir c5f88a7af8
2023-12-28 10:31:16 +00:00
Dave Hibberd 1fbded9d3a
Tested final release for new layout 2023-12-16 14:40:33 +00:00
Dave Hibberd a4103962fc
bpq config move 2023-12-16 13:35:16 +00:00
Dave Hibberd 397da35dac
Release 2023-12-08 12:29:51 +00:00
Dave Hibberd 9c15385cb6
Upstream import 2023-12-08 12:27:53 +00:00
Dave Hibberd fd1249b1e2 Update upstream source from tag 'upstream/6.0.24.22'
Update to upstream version '6.0.24.22'
with Debian dir 0520fb299a
2023-12-08 12:26:59 +00:00
Dave Hibberd fda3d6ffac
Release! 2023-10-31 22:50:30 +00:00
Dave Hibberd 37a1ea33be
Update changelog 2023-10-31 22:47:35 +00:00
Dave Hibberd 78e830ab37 Update upstream source from tag 'upstream/6.0.24.16'
Update to upstream version '6.0.24.16'
with Debian dir 638c20d26e
2023-10-31 22:42:30 +00:00
Dave Hibberd 9155d3ba64
New control file 2023-10-31 22:42:17 +00:00
Dave Hibberd 6adcb91ee5
release 2023-10-15 21:45:42 +01:00
Dave Hibberd 77f96f5b63
Update and add conffiles 2023-10-15 21:40:20 +01:00
Dave Hibberd 6f53d92599
release after successful build 2023-10-10 22:20:19 +01:00
Dave Hibberd 46c6058d94
upstream revision 2023-10-10 22:17:39 +01:00
Dave Hibberd 3e029049d7 Update upstream source from tag 'upstream/6.0.24.15'
Update to upstream version '6.0.24.15'
with Debian dir 55d9f12f07
2023-10-10 22:07:21 +01:00
Dave Hibberd b6a50b9b6c
Release the first version into the wild 2023-08-28 23:21:21 +01:00
Dave Hibberd fc474c29fe
Adding run-as-user and a user with the folder as ~ 2023-08-28 23:18:58 +01:00
Dave Hibberd 6546bac3f5
Updates based on feedback from M0LTE 2023-08-28 21:00:50 +01:00
Dave Hibberd ee2ac63a82
Start with the new 6.0.24.2 from upstream 2023-08-28 20:40:52 +01:00
Dave Hibberd 95a6ab069f
Merge branch 'upstream/latest' into debian/latest 2023-08-28 20:39:34 +01:00
Dave Hibberd 055c1c1891 Tweaks to copyright so it's correct 2023-07-18 01:31:08 +01:00
Dave Hibberd 964b72495c Adding gbp.conf so it builds under gbp 2023-07-18 01:29:10 +01:00
Dave Hibberd acb26fd980 Added Debian packaging so far 2023-07-18 01:26:17 +01:00
54 changed files with 2320 additions and 1010 deletions

View file

@ -1041,10 +1041,12 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
{ {
TNC->Busy--; TNC->Busy--;
if (TNC->Busy == 0) if (TNC->Busy == 0)
{
MySetWindowText(TNC->xIDC_CHANSTATE, "Clear"); MySetWindowText(TNC->xIDC_CHANSTATE, "Clear");
strcpy(TNC->WEB_CHANSTATE, "Clear"); strcpy(TNC->WEB_CHANSTATE, "Clear");
} }
} }
}
if (TNC->BusyDelay) if (TNC->BusyDelay)
{ {

View file

@ -3701,7 +3701,7 @@ void DoKillCommand(CIRCUIT * conn, struct UserInfo * user, char * Cmd, char * Ar
if (conn->sysop) if (conn->sysop)
{ {
if (Arg1) if (Arg1)
if (KillMessagesFrom(conn, user, Arg1) == 0); if (KillMessagesFrom(conn, user, Arg1) == 0)
BBSputs(conn, "No Messages found\r"); BBSputs(conn, "No Messages found\r");
return; return;
@ -6556,7 +6556,7 @@ nextline:
{ {
char APRS[128]; char APRS[128];
char Call[16]; char Call[16];
int SSID = user->flags >> 28; int SSID = (user->flags >> 28) & 15; // on some platforms this is treated as signed ??
if (SSID) if (SSID)
sprintf(Call, "%s-%d", Msg->to, SSID); sprintf(Call, "%s-%d", Msg->to, SSID);
@ -13395,7 +13395,7 @@ int DeleteRedundantMessages()
{ {
while(n--) while(n--)
{ {
if (stat(namelist[n]->d_name, &STAT) == 0); if (stat(namelist[n]->d_name, &STAT) == 0)
{ {
Msgno = atoi(&namelist[n]->d_name[2]); Msgno = atoi(&namelist[n]->d_name[2]);

View file

@ -35,8 +35,6 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include <fcntl.h> #include <fcntl.h>
//#include "vmm.h" //#include "vmm.h"
uint64_t INP3timeLoadedMS = 0;
extern int DEBUGINP3; extern int DEBUGINP3;
VOID SendNegativeInfo(); VOID SendNegativeInfo();
@ -64,11 +62,16 @@ static VOID SendNetFrame(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
typedef struct _RTTMSG typedef struct _RTTMSG
{ {
UCHAR ID[7]; UCHAR ID[6];
UCHAR TXTIME[11]; UCHAR Space1;
UCHAR SMOOTHEDRTT[11]; UCHAR TXTIME[10];
UCHAR LASTRTT[11]; UCHAR Space2;
UCHAR POINTER[11]; UCHAR SMOOTHEDRTT[10];
UCHAR Space3;
UCHAR LASTRTT[10];
UCHAR Space4;
UCHAR RTTID[10];
UCHAR Space5;
UCHAR ALIAS[7]; UCHAR ALIAS[7];
UCHAR VERSION[12]; UCHAR VERSION[12];
UCHAR SWVERSION[9]; UCHAR SWVERSION[9];
@ -110,6 +113,8 @@ extern int RTTInterval; // 4 Minutes
int RTTRetries = 2; int RTTRetries = 2;
int RTTTimeout = 6; // 1 Min (Horizon is 1 min) int RTTTimeout = 6; // 1 Min (Horizon is 1 min)
uint32_t RTTID = 1;
VOID InitialiseRTT() VOID InitialiseRTT()
{ {
UCHAR temp[256] = ""; UCHAR temp[256] = "";
@ -161,6 +166,7 @@ VOID DeleteINP3Routes(struct ROUTE * Route)
Route->BCTimer = 0; Route->BCTimer = 0;
Route->Status = 0; Route->Status = 0;
Route->Timeout = 0; Route->Timeout = 0;
Route->NeighbourSRTT = 0;
Dest--; Dest--;
@ -340,8 +346,8 @@ VOID TellINP3LinkSetupFailed(struct ROUTE * Route)
VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff) VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
{ {
int RTT; uint32_t RTT;
unsigned int OrigTime; uint32_t OrigTime;
char Normcall[10]; char Normcall[10];
@ -349,10 +355,10 @@ VOID ProcessRTTReply(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff)
Route->Timeout = 0; // Got Response Route->Timeout = 0; // Got Response
sscanf(&Buff->L4DATA[6], "%d", &OrigTime); sscanf(&Buff->L4DATA[6], "%u", &OrigTime);
RTT = (int)((GetTickCount() - INP3timeLoadedMS) / 10 - (OrigTime)); // We work internally in mS RTT = GetTickCountINP3() - OrigTime; // We work internally in mS
if (RTT > 60000) if (RTT > 60000 || RTT < 0)
return; // Ignore if more than 60 secs (why ??) return; // Ignore if more than 60 secs (why ??)
Route->RTT = RTT; Route->RTT = RTT;
@ -747,6 +753,9 @@ VOID SortRoutes(struct DEST_LIST * Dest)
{ {
char Call1[10], Call2[10], Call3[10]; char Call1[10], Call2[10], Call3[10];
// force route re-evaluation
Dest->DEST_ROUTE = 0;
// May now be out of order // May now be out of order
@ -887,8 +896,8 @@ VOID UpdateRoute(struct DEST_LIST * Dest, struct INP3_DEST_ROUTE_ENTRY * ROUTEPT
VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len, int Port) VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len, int Port)
{ {
int OtherRTT; uint32_t OtherRTT;
int Dummy; uint32_t Dummy;
char * ptr; char * ptr;
struct _RTTMSG * RTTMsg = (struct _RTTMSG *)&Buff->L4DATA[0]; struct _RTTMSG * RTTMsg = (struct _RTTMSG *)&Buff->L4DATA[0];
char Normcall[10]; char Normcall[10];
@ -917,6 +926,14 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
return; // We don't want to use INP3 return; // We don't want to use INP3
} }
// Basic Validation - look for spaces in the right place
if ((RTTMsg->Space1 | RTTMsg->Space2 | RTTMsg->Space3 | RTTMsg->Space4 | RTTMsg->Space5) != ' ')
{
Debugprintf("Corrupt INP3 RTT Message %s", &Buff->L4DATA[0]);
}
else
{
// Extract other end's SRTT // Extract other end's SRTT
// Get SWVERSION to see if other end is old (Buggy) BPQ // Get SWVERSION to see if other end is old (Buggy) BPQ
@ -926,9 +943,11 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
else else
Route->OldBPQ = 0; Route->OldBPQ = 0;
sscanf(&Buff->L4DATA[6], "%d %d", &Dummy, &OtherRTT); sscanf(&Buff->L4DATA[6], "%u %u", &Dummy, &OtherRTT);
if (OtherRTT < 60000) // Don't save suspect values
Route->NeighbourSRTT = OtherRTT; Route->NeighbourSRTT = OtherRTT;
}
// Look for $M and $H (MAXRTT MAXHOPS) // Look for $M and $H (MAXRTT MAXHOPS)
@ -942,6 +961,8 @@ VOID ProcessRTTMsg(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Buff, int Len
if (ptr) if (ptr)
Route->RemoteMAXHOPS = atoi(ptr + 2); Route->RemoteMAXHOPS = atoi(ptr + 2);
// Echo Back to sender // Echo Back to sender
SendNetFrame(Route, Buff); SendNetFrame(Route, Buff);
@ -962,7 +983,8 @@ VOID SendRTTMsg(struct ROUTE * Route)
char Stamp[50]; char Stamp[50];
char Normcall[10]; char Normcall[10];
unsigned char temp[256]; unsigned char temp[256];
uint64_t sendTime; uint32_t sendTime;
int n;
Normcall[ConvFromAX25(Route->NEIGHBOUR_CALL, Normcall)] = 0; Normcall[ConvFromAX25(Route->NEIGHBOUR_CALL, Normcall)] = 0;
@ -982,14 +1004,21 @@ VOID SendRTTMsg(struct ROUTE * Route)
Msg->L4TXNO = 0; Msg->L4TXNO = 0;
Msg->L4FLAGS = L4INFO; Msg->L4FLAGS = L4INFO;
// The timestamp can possibly exceed 10 digits. INP3 only works on differece between send and received, so base can be reset safely. // Windows GetTickCount wraps every 54 days or so. INP3 doesn't care, so long as the edge
// case where timer wraps between sending msg and getting response is ignored
// For platform independence use GetTickCountINP3() and map as appropriate
sendTime = ((uint64_t)GetTickCount() - INP3timeLoadedMS) / 10; // 10mS units sendTime = GetTickCountINP3(); // 10mS units
if (sendTime > 9999999999) sprintf(Stamp, "%10u %10d %10d %10d ", sendTime, Route->SRTT, Route->RTT, RTTID++);
sendTime = INP3timeLoadedMS = 0;
sprintf(Stamp, "%10llu %10d %10d %10d ", sendTime, Route->SRTT, Route->RTT, 0); n = strlen(Stamp);
if (n != 44)
{
Debugprintf("Trying to send corrupt RTT message %s", Stamp);
return;
}
memcpy(RTTMsg.TXTIME, Stamp, 44); memcpy(RTTMsg.TXTIME, Stamp, 44);
@ -1206,6 +1235,7 @@ int SendRIPTimer()
} }
L2SETUPCROSSLINKEX(Route, 2); // Only try SABM twice L2SETUPCROSSLINKEX(Route, 2); // Only try SABM twice
Route->NeighbourSRTT = 0; // just in case!
Route->LastConnectAttempt = REALTIMETICKS; Route->LastConnectAttempt = REALTIMETICKS;

101
Bpq32.c
View file

@ -1298,6 +1298,10 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
// Add Paula's Netromx (allows connects to different applications using Node call) (8) // Add Paula's Netromx (allows connects to different applications using Node call) (8)
// Add Netrom over TCP (8) // Add Netrom over TCP (8)
// Fix FRMR caused by sending SREJ when no frames outstanding (8) // Fix FRMR caused by sending SREJ when no frames outstanding (8)
// Fix some issues with NetromX connects and Route Selection when running INP3 and NODES routing (9)
// Fix connecting to a netrom node with c p node command (10)
// Add validation of INP3 RTT messages and various INP3 fixes (12)
// Change NetromX connect syntax to Service@Node to fix passing commands to local applications (12)
#define CKernel #define CKernel
@ -1406,6 +1410,7 @@ void initAIS();
void initADSB(); void initADSB();
int CloseAllSessions(); int CloseAllSessions();
int CloseAllLinks(); int CloseAllLinks();
void NETROMTCPResolve();
extern BOOL ADIFLogEnabled; extern BOOL ADIFLogEnabled;
@ -1413,6 +1418,8 @@ int CloseOnError = 0;
char UIClassName[]="UIMAINWINDOW"; // the main window class name char UIClassName[]="UIMAINWINDOW"; // the main window class name
char ClosingClassName[]="CLOSING"; // the main window class name
HWND UIhWnd; HWND UIhWnd;
extern char AUTOSAVE; extern char AUTOSAVE;
@ -1535,7 +1542,6 @@ extern char ReportDest[7];
extern UCHAR ConfigDirectory[260]; extern UCHAR ConfigDirectory[260];
extern uint64_t INP3timeLoadedMS;
VOID __cdecl Debugprintf(const char * format, ...); VOID __cdecl Debugprintf(const char * format, ...);
VOID __cdecl Consoleprintf(const char * format, ...); VOID __cdecl Consoleprintf(const char * format, ...);
@ -2216,6 +2222,8 @@ VOID TimerProcX()
Start(); Start();
NETROMTCPResolve();
INITIALISEPORTS(); // Restart Ports INITIALISEPORTS(); // Restart Ports
SetApplPorts(); SetApplPorts();
@ -2398,7 +2406,7 @@ VOID TimerProcX()
if (CloseAllSessions() == 0) if (CloseAllSessions() == 0)
{ {
if (CloseAllLinks() == 0) // No sessions closed so close links now if (CloseAllLinks() == 0) // No sessions closed so close links now
CloseAllTimer = 0; // No Links so close now CloseAllTimer = 1; // No Links so close now
else else
CloseAllTimer = 39; // ~4 secs for links to close CloseAllTimer = 39; // ~4 secs for links to close
} }
@ -2474,8 +2482,6 @@ FirstInit()
EnumProcessesPtr = (FARPROCX)GetProcAddress(ExtDriver,"EnumProcesses"); EnumProcessesPtr = (FARPROCX)GetProcAddress(ExtDriver,"EnumProcesses");
} }
INP3timeLoadedMS = GetTickCount();
srand(time(NULL)); srand(time(NULL));
INITIALISEPORTS(); INITIALISEPORTS();
@ -2632,6 +2638,7 @@ Check_Timer()
WSAStartup(MAKEWORD(2, 0), &WsaData); WSAStartup(MAKEWORD(2, 0), &WsaData);
// Load Psapi.dll if possible // Load Psapi.dll if possible
ExtDriver = LoadLibrary("Psapi.dll"); ExtDriver = LoadLibrary("Psapi.dll");
@ -2646,6 +2653,8 @@ Check_Timer()
Start(); Start();
NETROMTCPResolve();
INITIALISEPORTS(); INITIALISEPORTS();
OpenReportingSockets(); OpenReportingSockets();
@ -2969,6 +2978,8 @@ BOOL APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReser
} }
else else
{ {
NETROMTCPResolve();
SetApplPorts(); SetApplPorts();
GetUIConfig(); GetUIConfig();
@ -5967,14 +5978,96 @@ DllExport VOID APIENTRY CreateNewTrayIcon()
void hookNodeClosing(char * Reason); void hookNodeClosing(char * Reason);
BOOL CALLBACK ClosaAllProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
int wmId, wmEvent;
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_CTLCOLORDLG:
return (LONG)bgBrush;
case WM_CTLCOLORSTATIC:
{
HDC hdcStatic = (HDC)wParam;
SetTextColor(hdcStatic, RGB(0, 0, 0));
SetBkMode(hdcStatic, TRANSPARENT);
return (LONG)bgBrush;
}
case WM_COMMAND:
return 0;
case WM_SYSCOMMAND:
wmId = LOWORD(wParam); // Remember, these are...
wmEvent = HIWORD(wParam); // ...different for Win32!
switch (wmId)
{
case SC_RESTORE:
return (DefWindowProc(hWnd, message, wParam, lParam));
case SC_MINIMIZE:
if (MinimizetoTray)
return ShowWindow(hWnd, SW_HIDE);
else
return (DefWindowProc(hWnd, message, wParam, lParam));
break;
default:
return (DefWindowProc(hWnd, message, wParam, lParam));
}
case WM_CLOSE:
return(DestroyWindow(hWnd));
default:
return (DefWindowProc(hWnd, message, wParam, lParam));
}
return (0);
}
HWND hwndClosing = NULL; // Window handle of dialog box
DllExport VOID APIENTRY CloseAllPrograms() DllExport VOID APIENTRY CloseAllPrograms()
{ {
WNDCLASS wc;
CLOSING = TRUE; CLOSING = TRUE;
// Tell BG to shut when all links are gone or after 5 secs // Tell BG to shut when all links are gone or after 5 secs
CloseAllTimer = 50; CloseAllTimer = 50;
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = ClosaAllProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE(BPQICON) );
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = bgBrush;
wc.lpszMenuName = NULL;
wc.lpszClassName = ClosingClassName;
RegisterClass(&wc);
hwndClosing = CreateDialog(hInstance, ClosingClassName, NULL, (DLGPROC)ClosaAllProc);
ShowWindow(hwndClosing, SW_SHOW);
} }
VOID RealCloseAllPrograms() VOID RealCloseAllPrograms()

164
Cmd.c
View file

@ -130,6 +130,8 @@ int NOBUFFCOUNT = 0;
int BUFFERWAITS = 0; int BUFFERWAITS = 0;
int MAXDESTS = 0; int MAXDESTS = 0;
int NUMBEROFNODES = 0; int NUMBEROFNODES = 0;
int L2CONNECTSOUT = 0;
int L2CONNECTSIN = 0;
int L4CONNECTSOUT = 0; int L4CONNECTSOUT = 0;
int L4CONNECTSIN = 0; int L4CONNECTSIN = 0;
int L4FRAMESTX = 0; int L4FRAMESTX = 0;
@ -836,13 +838,14 @@ BOOL cATTACHTOBBS(TRANSPORTENTRY * Session, UINT Mask, int Paclen, int * AnySess
return FALSE; return FALSE;
} }
void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int ServiceIndex, char * Node, int Stay) void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int Service, char * Node, int Stay)
{ {
struct DEST_LIST * Dest = DESTS; struct DEST_LIST * Dest = DESTS;
int n = MAXDESTS; int n = MAXDESTS;
int gotDest = 0; int gotDest = 0;
unsigned char axcall[7]; unsigned char axcall[7];
int Service = -1; char cmdName[80];
int i;
// Make Sure Node is Known // Make Sure Node is Known
@ -887,9 +890,20 @@ void ConnecttoService(TRANSPORTENTRY * Session, char * Bufferptr, int ServiceInd
Session->STAYFLAG = Stay; Session->STAYFLAG = Stay;
Service = SERVICES[ServiceIndex].ServiceNo; // Get command name if a named command
Bufferptr = Cmdprintf(Session, Bufferptr, "Connecting to Service %s on Node %s \r", SERVICES[ServiceIndex].ServiceName, Node); sprintf(cmdName, "%d", Service); // default to number
for (i = 0; i < NUMBEROFSSERVICES; i++)
{
if (SERVICES[i].ServiceNo == Service)
{
strcpy(cmdName, SERVICES[i].ServiceName);
break;
}
}
Bufferptr = Cmdprintf(Session, Bufferptr, "Connecting to Service %s on Node %s \r", cmdName, Node);
DoNetromConnect(Session, Bufferptr, Dest, 0, Service); DoNetromConnect(Session, Bufferptr, Dest, 0, Service);
@ -903,8 +917,12 @@ int checkifService(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, s
BOOL Stay = FALSE; BOOL Stay = FALSE;
char * ptr, *Context; char * ptr, *Context;
int i; int i;
char TailCopy[256];
ptr = strtok_s(CmdTail, " ", &Context); strcpy(TailCopy, CmdTail);
ptr = strtok_s(TailCopy, " ", &Context);
// see if any param. if longer than two chars treat as remote node // see if any param. if longer than two chars treat as remote node
@ -924,7 +942,7 @@ int checkifService(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, s
{ {
if (strcmp(APPName, SERVICES[i].ServiceName) == 0) if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
{ {
ConnecttoService(Session, Bufferptr, i, ptr, Stay); ConnecttoService(Session, Bufferptr, SERVICES[i].ServiceNo, ptr, Stay);
return 1; return 1;
} }
} }
@ -942,7 +960,6 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
char * ptr1, *ptr2; char * ptr1, *ptr2;
int n = 12; int n = 12;
BOOL Stay = FALSE; BOOL Stay = FALSE;
char * ptr, *Context;
// Copy Appl and Null Terminate // Copy Appl and Null Terminate
@ -961,14 +978,17 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
return; return;
} }
ptr = strtok_s(CmdTail, " ", &Context);
// ptr is first param. Context is rest of string; if (CmdTail[0] == 'S')
Stay = TRUE;
if (ptr)
{
// could be Node for NETROMX connect or S flag // could be Node for NETROMX connect or S flag
// We now use service@node, so can't get here
/*
if (ptr)
{
int i; int i;
if (strlen(ptr) > 1) if (strlen(ptr) > 1)
@ -978,6 +998,8 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
// See if APPL is one of Paula's service // See if APPL is one of Paula's service
for (i = 0; i < NUMBEROFSSERVICES; i++) for (i = 0; i < NUMBEROFSSERVICES; i++)
{ {
if (strcmp(APPName, SERVICES[i].ServiceName) == 0) if (strcmp(APPName, SERVICES[i].ServiceName) == 0)
@ -997,7 +1019,7 @@ VOID APPLCMD(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct
else if (ptr[0] == 'S') else if (ptr[0] == 'S')
Session->STAYFLAG = Stay; Session->STAYFLAG = Stay;
} }
*/
memcpy(Session->APPL, CMD->String, 12); memcpy(Session->APPL, CMD->String, 12);
// SEE IF THERE IS AN ALIAS DEFINDED FOR THIS COMMAND // SEE IF THERE IS AN ALIAS DEFINDED FOR THIS COMMAND
@ -2566,6 +2588,56 @@ VOID CMDC00(TRANSPORTENTRY * Session, char * Bufferptr, char * CmdTail, struct C
return; return;
} }
// See if NETROMX connect c service@node
if (strchr(ptr, '@'))
{
// We now use service@node, unlike xr
char * Context1;
char * Cmd = strtok_s(ptr, "@", &Context1);
char * Node = strtok_s(NULL, " ", &Context1);
int i;
int Stay = 0;
if (Context1 && Context1[0] == 'S')
Session->STAYFLAG = Stay;
for (i = 0; i < NUMBEROFSSERVICES; i++)
{
if (strcmp(Cmd, SERVICES[i].ServiceName) == 0)
{
if (Node)
{
ConnecttoService(Session, Bufferptr, SERVICES[i].ServiceNo, Node, Stay);
return;
}
}
}
// May be numeric service
for (i = 0; i < strlen(Cmd); i++)
{
if (!isdigit(Cmd[i]))
break;
}
if (i == strlen(Cmd))
{
if (Node)
{
ConnecttoService(Session, Bufferptr, atoi(Cmd), Node, Stay);
return;
}
}
Bufferptr = Cmdprintf(Session, Bufferptr, "Invalid NetromX command\r");
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
return;
}
Port = atoi(ptr); Port = atoi(ptr);
if (Port) if (Port)
@ -2665,7 +2737,7 @@ NoPort:
// SEE IF CALL TO ANY OF OUR HOST SESSIONS - UNLESS DIGIS SPECIFIED // SEE IF CALL TO ANY OF OUR HOST SESSIONS - UNLESS DIGIS SPECIFIED
if (axcalls[7] == 0 && axcalls[9] ) if (axcalls[7] == 0)
{ {
// If this connect is as a result of a command alias, don't check appls or we will loop // If this connect is as a result of a command alias, don't check appls or we will loop
@ -2716,28 +2788,7 @@ NoPort:
} }
} }
// if no digis see if connect to known node. But now could have a single numeric param as a service number (Paula's Netromx) if (axcalls[7] == 0)
// cmdCopy is command tail (after call)
// Make sure field is numeric
i = 0;
while (cmdCopy[i] >= '0' && cmdCopy[i]<= '9')
i++;
if (cmdCopy[i] != ' ')
goto Downlink;
else
{
if (i > 0) // Some digits
{
haveService = 1;
Service = atoi(cmdCopy);
}
}
if (axcalls[7] == 0 || haveService)
{ {
// SEE IF CALL TO ANOTHER NODE // SEE IF CALL TO ANOTHER NODE
@ -2780,9 +2831,6 @@ Downlink:
// L2 NEEDS PORT NUMBER // L2 NEEDS PORT NUMBER
Bufferptr = Cmdprintf(Session, Bufferptr, "Downlink connect needs port number - C P CALLSIGN\r"); Bufferptr = Cmdprintf(Session, Bufferptr, "Downlink connect needs port number - C P CALLSIGN\r");
// Send Port List
SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER)); SendCommandReply(Session, REPLYBUFFER, (int)(Bufferptr - (char *)REPLYBUFFER));
return; return;
} }
@ -5070,6 +5118,7 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
int n; int n;
int i, Service = -1; int i, Service = -1;
char * Cmd, *Node, *Context; char * Cmd, *Node, *Context;
int Stay = 0;
ptr1 = &COMMANDBUFFER[0]; // ptr1 = &COMMANDBUFFER[0]; //
@ -5164,28 +5213,47 @@ VOID DoTheCommand(TRANSPORTENTRY * Session)
// See if a NETROMX Service // See if a NETROMX Service
Cmd = strtok_s(ptr1, " ", &Context); // We now use service@node, unlike xr
if (strchr(ptr1, '@'))
{
Cmd = strtok_s(ptr1, "@", &Context);
Node = strtok_s(NULL, " ", &Context); Node = strtok_s(NULL, " ", &Context);
if (Cmd && Node)
{
if (Context && Context[0] == 'S')
Session->STAYFLAG = Stay;
for (i = 0; i < NUMBEROFSSERVICES; i++) for (i = 0; i < NUMBEROFSSERVICES; i++)
{ {
if (strcmp(Cmd, SERVICES[i].ServiceName) == 0) if (strcmp(Cmd, SERVICES[i].ServiceName) == 0)
{ {
int Stay = 0; ConnecttoService(Session, ReplyPointer, SERVICES[i].ServiceNo, Node, Stay);
if (Context && Context[0] == 'S')
Session->STAYFLAG = Stay;
if (Node)
{
ConnecttoService(Session, ReplyPointer, i, Node, Stay);
return; return;
} }
}
// Connecting to service on local node - msy be possible sometime // May be numeric service
for (i = 0; i < strlen(Cmd); i++)
{
if (!isdigit(Cmd[i]))
break;
}
if (i == strlen(Cmd))
{
ConnecttoService(Session, ReplyPointer, atoi(Cmd), Node, Stay);
return;
} }
} }
ReplyPointer = Cmdprintf(Session, ReplyPointer, "Invalid NetromX command\r");
SendCommandReply(Session, REPLYBUFFER, (int)(ReplyPointer - (char *)REPLYBUFFER));
return;
}
Session->BADCOMMANDS++; Session->BADCOMMANDS++;
if (Session->BADCOMMANDS > 6) // TOO MANY ERRORS if (Session->BADCOMMANDS > 6) // TOO MANY ERRORS

View file

@ -75,6 +75,7 @@ void printStack(void);
char * FormatMH(PMHSTRUC MH, char Format); char * FormatMH(PMHSTRUC MH, char Format);
void WriteConnectLog(char * fromCall, char * toCall, UCHAR * Mode); void WriteConnectLog(char * fromCall, char * toCall, UCHAR * Mode);
void SendDataToPktMap(); void SendDataToPktMap();
void NETROMTCPResolve();
extern BOOL LogAllConnects; extern BOOL LogAllConnects;
extern BOOL M0LTEMap; extern BOOL M0LTEMap;
@ -3740,14 +3741,13 @@ VOID ResolveUpdateThread(void * Unused)
} }
} }
NETROMTCPResolve();
if (HostEnt1 && HostEnt2) if (HostEnt1 && HostEnt2)
{ {
Sleep(1000 * 60 * 30); Sleep(1000 * 60 * 15);
continue; continue;
} }
Debugprintf("Resolve Failed for update.g8bpq.net or chatmap.g8bpq.net");
Sleep(1000 * 60 * 5);
} }
} }

View file

@ -578,6 +578,7 @@ int doinflate(unsigned char * source, unsigned char * dest, int Len, int destlen
strm.next_in = Z_NULL; strm.next_in = Z_NULL;
ret = inflateInit(&strm); ret = inflateInit(&strm);
if (ret != Z_OK) if (ret != Z_OK)
return ret; return ret;

263
Events.c
View file

@ -26,6 +26,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "asmstrucs.h" #include "asmstrucs.h"
#include "tncinfo.h" #include "tncinfo.h"
#include "cheaders.h" #include "cheaders.h"
#include "kiss.h"
VOID __cdecl Debugprintf(const char * format, ...); VOID __cdecl Debugprintf(const char * format, ...);
@ -44,7 +45,9 @@ void MQTTReportSession(char * Msg);
extern int MQTT; extern int MQTT;
extern time_t TimeLoaded; extern time_t TimeLoaded;
int UDPSeq = 1; uint16_t UDPSeq = 1;
int linkSeq = 1;
int cctSeq = 1;
extern SOCKET NodeAPISocket; extern SOCKET NodeAPISocket;
extern SOCKADDR_IN UDPreportdest; extern SOCKADDR_IN UDPreportdest;
@ -57,6 +60,8 @@ extern char LOC[7];
extern char VersionString[50]; extern char VersionString[50];
extern double LatFromLOC; extern double LatFromLOC;
extern double LonFromLOC; extern double LonFromLOC;
extern int NUMBEROFNODES, MAXDESTS, L4CONNECTSOUT, L4CONNECTSIN, L4FRAMESTX, L4FRAMESRX, L4FRAMESRETRIED, OLDFRAMES;
extern int L2CONNECTSOUT, L2CONNECTSIN;
void hookL2SessionClosed(struct _LINKTABLE * LINK, char * Reason, char * Direction); void hookL2SessionClosed(struct _LINKTABLE * LINK, char * Reason, char * Direction);
int ConvFromAX25(unsigned char * incall, unsigned char * outcall); int ConvFromAX25(unsigned char * incall, unsigned char * outcall);
@ -66,6 +71,7 @@ int decodeNETROMUIMsg(unsigned char * Msg, int iLen, char * Buffer, int BufferLe
int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferLen); int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferLen);
int decodeINP3RIF(unsigned char * Msg, int iLen, char * Buffer, int BufferLen); int decodeINP3RIF(unsigned char * Msg, int iLen, char * Buffer, int BufferLen);
int decodeRecordRoute(L3MESSAGE * L3, int iLen, char * Buffer, int BufferLen); int decodeRecordRoute(L3MESSAGE * L3, int iLen, char * Buffer, int BufferLen);
char * byte_base64_encode(char *str, int len);
// Runs use specified routine on certain event // Runs use specified routine on certain event
@ -145,9 +151,12 @@ void hookL2SessionAccepted(int Port, char * remotecall, char * ourcall, struct _
char UDPMsg[1024]; char UDPMsg[1024];
int udplen; int udplen;
LINK->ConnectTime = time(NULL); L2CONNECTSIN++;
LINK->bytesTXed = LINK->bytesRXed = LINK->framesResent = LINK->framesRXed = LINK->framesTXed = 0; LINK->apiSeq = linkSeq++;
LINK->lastStatusSentTime = LINK->ConnectTime = time(NULL);
LINK->bytesTXed = LINK->bytesRXed = LINK->framesResent = LINK->framesRXed = LINK->framesTXed = 0;
LINK->LastStatusbytesTXed = LINK->LastStatusbytesRXed = 0;
strcpy(LINK->callingCall, remotecall); strcpy(LINK->callingCall, remotecall);
strcpy(LINK->receivingCall, ourcall); strcpy(LINK->receivingCall, ourcall);
strcpy(LINK->Direction, "In"); strcpy(LINK->Direction, "In");
@ -156,8 +165,8 @@ void hookL2SessionAccepted(int Port, char * remotecall, char * ourcall, struct _
{ {
LINK->lastStatusSentTime = time(NULL); LINK->lastStatusSentTime = time(NULL);
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"}", udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\", \"isRF\": %s}",
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall); NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall, (LINK->LINKPORT->isRF)?"true":"false");
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
@ -217,9 +226,9 @@ void hookL2SessionDeleted(struct _LINKTABLE * LINK)
void hookL2SessionAttempt(int Port, char * ourcall, char * remotecall, struct _LINKTABLE * LINK) void hookL2SessionAttempt(int Port, char * ourcall, char * remotecall, struct _LINKTABLE * LINK)
{ {
LINK->ConnectTime = time(NULL); LINK->lastStatusSentTime = LINK->ConnectTime = time(NULL);
LINK->bytesTXed = LINK->bytesRXed = LINK->framesResent = LINK->framesRXed = LINK->framesTXed = 0; LINK->bytesTXed = LINK->bytesRXed = LINK->framesResent = LINK->framesRXed = LINK->framesTXed = 0;
LINK->LastStatusbytesTXed = LINK->LastStatusbytesRXed = 0;
strcpy(LINK->callingCall, ourcall); strcpy(LINK->callingCall, ourcall);
strcpy(LINK->receivingCall, remotecall); strcpy(LINK->receivingCall, remotecall);
strcpy(LINK->Direction, "Out"); strcpy(LINK->Direction, "Out");
@ -232,12 +241,15 @@ void hookL2SessionConnected(struct _LINKTABLE * LINK)
char UDPMsg[1024]; char UDPMsg[1024];
int udplen; int udplen;
L2CONNECTSOUT++;
LINK->apiSeq = linkSeq++;
if (NodeAPISocket) if (NodeAPISocket)
{ {
LINK->lastStatusSentTime = time(NULL); LINK->lastStatusSentTime = time(NULL);
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"}", udplen = sprintf(UDPMsg, "{\"@type\":\"LinkUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\", \"isRF\": %s}",
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall); NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall, (LINK->LINKPORT->isRF)?"true":"false");
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
@ -251,6 +263,7 @@ void hookL2SessionClosed(struct _LINKTABLE * LINK, char * Reason, char * Directi
char UDPMsg[1024]; char UDPMsg[1024];
int udplen; int udplen;
time_t Now = time(NULL);
if (NodeAPISocket) if (NodeAPISocket)
{ {
@ -259,14 +272,18 @@ void hookL2SessionClosed(struct _LINKTABLE * LINK, char * Reason, char * Directi
if (strcmp(Direction, "Out") == 0) if (strcmp(Direction, "Out") == 0)
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"," udplen = sprintf(UDPMsg, "{\"@type\":\"LinkDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\"}", "\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\","
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall, " \"time\": %d, \"upForSecs\": %d, \"frmsQdPeak\": %d, \"isRF\": %s}",
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason); NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall,
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason,
(int)Now, (int)Now - LINK->ConnectTime, LINK->maxQueued, (LINK->LINKPORT->isRF)?"true":"false");
else else
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"," udplen = sprintf(UDPMsg, "{\"@type\":\"LinkDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\"}", "\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d, \"reason\": \"%s\","
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall, " \"time\": %d, \"upForSecs\": %d, \"frmsQdPeak\": %d, \"isRF\": %s}",
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason); NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall,
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent, Reason,
(int)Now, (int)Now - LINK->ConnectTime, LINK->maxQueued, (LINK->LINKPORT->isRF)?"true":"false");
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
@ -280,24 +297,37 @@ void hookL2SessionStatus(struct _LINKTABLE * LINK)
char UDPMsg[1024]; char UDPMsg[1024];
int udplen; int udplen;
time_t Now = time(NULL);
int bpsTx, bpsRx, interval;
if (NodeAPISocket) if (NodeAPISocket)
{ {
LINK->lastStatusSentTime = time(NULL); interval = Now - (int)LINK->lastStatusSentTime;
bpsTx = (LINK->bytesTXed - LINK->LastStatusbytesTXed) / interval;
bpsRx = (LINK->bytesRXed - LINK->LastStatusbytesRXed) / interval;
LINK->lastStatusSentTime = Now;
LINK->LastStatusbytesTXed = LINK->bytesTXed;
LINK->LastStatusbytesRXed = LINK->bytesRXed;
if (strcmp(LINK->Direction, "Out") == 0) if (strcmp(LINK->Direction, "Out") == 0)
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"," udplen = sprintf(UDPMsg, "{\"@type\":\"LinkStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d}", "\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d,"
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall, "\"upForSecs\": %d, \"frmsQdPeak\": %d, \"bpsTxMean\": %d, \"bpsRxMean\": %d, \"frmQMax\": %d, \"l2rttMs\": %d, \"isRF\": %s}",
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, 0, LINK->framesResent); NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->receivingCall, LINK->callingCall,
LINK->bytesTXed, LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, 0, LINK->framesResent,
(int)Now - LINK->ConnectTime, LINK->maxQueued, bpsTx, bpsRx, LINK->intervalMaxQueued, LINK->RTT, (LINK->LINKPORT->isRF)?"true":"false");
else else
udplen = sprintf(UDPMsg, "{\"@type\":\"LinkStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\"," udplen = sprintf(UDPMsg, "{\"@type\":\"LinkStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", \"port\": \"%d\", \"remote\": \"%s\", \"local\": \"%s\","
"\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d}", "\"bytesSent\": %d, \"bytesRcvd\": %d, \"frmsSent\": %d, \"frmsRcvd\": %d, \"frmsQueued\": %d, \"frmsResent\": %d,"
NODECALLLOPPED, UDPSeq++, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall, "\"upForSecs\": %d, \"frmsQdPeak\": %d, \"bpsTxMean\": %d, \"bpsRxMean\": %d, \"frmQMax\": %d, \"l2rttMs\": %d, \"isRF\": %s}",
LINK->bytesTXed , LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, COUNT_AT_L2(LINK), LINK->framesResent); NODECALLLOPPED, LINK->apiSeq, LINK->LINKPORT->PORTNUMBER, LINK->callingCall, LINK->receivingCall,
LINK->bytesTXed, LINK->bytesRXed, LINK->framesTXed, LINK->framesRXed, 0, LINK->framesResent,
(int)Now - LINK->ConnectTime, LINK->maxQueued, bpsTx, bpsRx, LINK->intervalMaxQueued, LINK->RTT, (LINK->LINKPORT->isRF)?"true":"false");
LINK->intervalMaxQueued = 0;
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest)); sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
} }
} }
@ -412,8 +442,9 @@ void hookNodeClosing(char * Reason)
if (NodeAPISocket) if (NodeAPISocket)
{ {
udplen = sprintf(UDPMsg, "{\"@type\": \"NodeDownEvent\", \"nodeCall\": \"%s\", \"nodeAlias\": \"%s\", \"reason\": \"%s\"}", udplen = sprintf(UDPMsg, "{\"@type\": \"NodeDownEvent\", \"nodeCall\": \"%s\", \"nodeAlias\": \"%s\", \"reason\": \"%s\", \"uptimeSecs\": %d,"
NODECALLLOPPED, MYALIASLOPPED, Reason); "\"linksIn\": %d, \"linksOut\": %d, \"cctsIn\": %d, \"cctsOut\": %d, \"l3Relayed\": %d}",
NODECALLLOPPED, MYALIASLOPPED, Reason, time(NULL) - TimeLoaded, L2CONNECTSIN, L2CONNECTSOUT, L4CONNECTSIN, L4CONNECTSOUT, L3FRAMES);
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
@ -438,9 +469,10 @@ void hookNodeRunning()
{ {
udplen = sprintf(UDPMsg, "{\"@type\": \"NodeStatus\", \"nodeCall\": \"%s\", \"nodeAlias\": \"%s\", \"locator\": \"%s\"," udplen = sprintf(UDPMsg, "{\"@type\": \"NodeStatus\", \"nodeCall\": \"%s\", \"nodeAlias\": \"%s\", \"locator\": \"%s\","
"\"latitude\": %f, \"longitude\": %f, \"software\": \"%s\", \"version\": \"%s\", \"uptimeSecs\": %d}", "\"latitude\": %f, \"longitude\": %f, \"software\": \"%s\", \"version\": \"%s\", \"uptimeSecs\": %d,"
NODECALLLOPPED, MYALIASLOPPED, LOC, LatFromLOC, LonFromLOC, Software, VersionString, time(NULL) - TimeLoaded); "\"linksIn\": %d, \"linksOut\": %d, \"cctsIn\": %d, \"cctsOut\": %d, \"l3Relayed\": %d}",
NODECALLLOPPED, MYALIASLOPPED, LOC, LatFromLOC, LonFromLOC, Software, VersionString, time(NULL) - TimeLoaded,
L2CONNECTSIN, L2CONNECTSOUT, L4CONNECTSIN, L4CONNECTSOUT, L3FRAMES);
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
@ -456,11 +488,17 @@ void IncomingL4ConnectionEvent(TRANSPORTENTRY * L4)
char remotecall[64]; char remotecall[64];
char ourcall[64]; char ourcall[64];
char circuitinfo[32]; char circuitinfo[32];
int Service = L4->Service;
// CACK sent to CREQ // CACK sent to CREQ
L4->apiSeq = cctSeq++;
strcpy(L4->Direction, "incoming");
if (NodeAPISocket) if (NodeAPISocket)
{ {
L4->lastStatusSentTime = time(NULL);
remotecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, remotecall)] = 0; remotecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, remotecall)] = 0;
// remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0; // remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0;
ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0; ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0;
@ -471,9 +509,15 @@ void IncomingL4ConnectionEvent(TRANSPORTENTRY * L4)
sprintf(circuitinfo, ":%02x%02x", L4->CIRCUITINDEX, L4->CIRCUITID); sprintf(circuitinfo, ":%02x%02x", L4->CIRCUITINDEX, L4->CIRCUITID);
strcat(ourcall, circuitinfo); strcat(ourcall, circuitinfo);
if (Service == -1)
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", "
"\"remote\": \"%s\", \"local\": \"%s\"}",
NODECALLLOPPED, L4->apiSeq, remotecall, ourcall);
else
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", " udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"incoming\", "
"\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\"}", "\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\"}",
NODECALLLOPPED, UDPSeq++, L4->Service, remotecall, ourcall); NODECALLLOPPED, L4->apiSeq, Service, remotecall, ourcall);
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest)); sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
@ -488,11 +532,18 @@ void OutgoingL4ConnectionEvent(TRANSPORTENTRY * L4)
char remotecall[64]; char remotecall[64];
char ourcall[64]; char ourcall[64];
char circuitinfo[32]; char circuitinfo[32];
int Service = L4->Service;
// CACK received // CACK received
strcpy(L4->Direction, "outgoing");
L4->apiSeq = cctSeq++;
if (NodeAPISocket) if (NodeAPISocket)
{ {
L4->lastStatusSentTime = time(NULL);
remotecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, remotecall)] = 0; remotecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, remotecall)] = 0;
// remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0; // remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0;
ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0; ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0;
@ -503,9 +554,14 @@ void OutgoingL4ConnectionEvent(TRANSPORTENTRY * L4)
sprintf(circuitinfo, ":%02x%02x", L4->CIRCUITID, L4->CIRCUITINDEX); sprintf(circuitinfo, ":%02x%02x", L4->CIRCUITID, L4->CIRCUITINDEX);
strcat(ourcall, circuitinfo); strcat(ourcall, circuitinfo);
if (Service == -1)
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", "
"\"remote\": \"%s\", \"local\": \"%s\"}",
NODECALLLOPPED, L4->apiSeq, remotecall, ourcall);
else
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", " udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitUpEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\", "
"\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\"}", "\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\"}",
NODECALLLOPPED, UDPSeq++, L4->Service, remotecall, ourcall); NODECALLLOPPED, L4->apiSeq, Service, remotecall, ourcall);
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest)); sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
@ -563,7 +619,7 @@ void L4DisconnectEvent(TRANSPORTENTRY * L4, char * Direction, char * Reason)
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"%s\"," udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitDownEvent\", \"node\": \"%s\", \"id\": %d, \"direction\": \"%s\","
"\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d, \"reason\": \"%s\"}", "\"service\": %d, \"remote\": \"%s\", \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d, \"reason\": \"%s\"}",
NODECALLLOPPED, UDPSeq++, Direction, 0, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count, Reason); NODECALLLOPPED, L4->apiSeq, Direction, 0, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count, Reason);
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest)); sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
@ -579,11 +635,16 @@ void L4StatusSeport(TRANSPORTENTRY * L4)
char nodecall[16]; char nodecall[16];
char circuitinfo[32]; char circuitinfo[32];
int Count; int Count;
time_t Now = time(NULL);
int Service = L4->Service;
// CACK received
// Regular Status reports
if (NodeAPISocket) if (NodeAPISocket)
{ {
L4->lastStatusSentTime = Now;
nodecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, nodecall)] = 0; nodecall[ConvFromAX25(L4->L4TARGET.DEST->DEST_CALL, nodecall)] = 0;
remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0; remotecall[ConvFromAX25(L4->L4USER, remotecall)] = 0;
ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0; ourcall[ConvFromAX25(L4->L4MYCALL, ourcall)] = 0;
@ -600,9 +661,14 @@ void L4StatusSeport(TRANSPORTENTRY * L4)
else else
Count = CountFramesQueuedOnSession(L4); Count = CountFramesQueuedOnSession(L4);
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"outgoing\"," if (Service == -1)
"\"service\": %d, \"remote\": %s, \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d}", udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"%s\","
NODECALLLOPPED, UDPSeq++, 0, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count); "\"upForSecs\": %d,\"remote\": \"%s\", \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d}",
NODECALLLOPPED, L4->apiSeq, L4->Direction, Now - L4->ConnectTime, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count);
else
udplen = sprintf(UDPMsg, "{\"@type\": \"CircuitStatus\", \"node\": \"%s\", \"id\": %d, \"direction\": \"%s\","
"\"upForSecs\": %d, \"service\": %d, \"remote\": \"%s\", \"local\": \"%s\", \"segsSent\": %d, \"segsRcvd\": %d, \"segsResent\": %d, \"segsQueued\": %d}",
NODECALLLOPPED, L4->apiSeq, L4->Direction, Now - L4->ConnectTime, Service, remotecall, ourcall,L4->segsSent, L4->segsRcvd, L4->segsResent, Count);
// Debugprintf(UDPMsg); // Debugprintf(UDPMsg);
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest)); sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
@ -633,7 +699,42 @@ char * PIDtoText(int PID)
return "?"; return "?";
} }
void APIL2Trace(struct _MESSAGE * Message, char Dirn) void dumpDuffPacket(char * call, char * Buffer, int Len)
{
// log to syslog in base64
char * Base64;
Base64 = byte_base64_encode(Buffer, Len);
Debugprintf("Trace Error %s %s", call, Base64);
free(Base64);
}
int checkCall(char * call, unsigned char * Buffer, int Len)
{
char c;
int i;
// Validate source and dest calls - if duff, dump packet
for (i = 0; i < strlen(call); i++)
{
c = call[i];
if (isalnum(c) || c == '-' || c == '@')
continue;
dumpDuffPacket(call, Buffer, Len);
return 0;
}
return 1;
}
void APIL2Trace(struct _MESSAGE * Message, char * Dirn)
{ {
char UDPMsg[2048]; char UDPMsg[2048];
int udplen; int udplen;
@ -649,6 +750,12 @@ void APIL2Trace(struct _MESSAGE * Message, char Dirn)
int UFlag = 0; int UFlag = 0;
int NS; int NS;
int NR; int NR;
struct PORTCONTROL * PORT = GetPortTableEntryFromPortNum(Message->PORT);
time_t Now = time(NULL);
if (PORT == 0)
return;
if ((Message->ORIGIN[6] & 1) == 0) // Digis if ((Message->ORIGIN[6] & 1) == 0) // Digis
return; return;
@ -656,12 +763,19 @@ void APIL2Trace(struct _MESSAGE * Message, char Dirn)
destcall[ConvFromAX25(Message->DEST, destcall)] = 0; destcall[ConvFromAX25(Message->DEST, destcall)] = 0;
srcecall[ConvFromAX25(Message->ORIGIN, srcecall)] = 0; srcecall[ConvFromAX25(Message->ORIGIN, srcecall)] = 0;
// See if any Digis // Validate source and dest calls - if duff, dump packet
if (!checkCall(destcall,(char *) Message, Message->LENGTH))
return;
if (!checkCall(srcecall, (char *) Message, Message->LENGTH))
return;
// see if any Digis
if ((Message->ORIGIN[6] & 1) == 0) // Digis - ignore for now if ((Message->ORIGIN[6] & 1) == 0) // Digis - ignore for now
return; return;
if ((Message->DEST[6] & 0x80) == 0 && (Message->ORIGIN[6] & 0x80) == 0) if ((Message->DEST[6] & 0x80) == 0 && (Message->ORIGIN[6] & 0x80) == 0)
strcpy(CR, "V1"); strcpy(CR, "V1");
else if ((Message->DEST[6] & 0x80)) else if ((Message->DEST[6] & 0x80))
@ -784,9 +898,9 @@ void APIL2Trace(struct _MESSAGE * Message, char Dirn)
// Common to all frame types // Common to all frame types
udplen = snprintf(UDPMsg, 2048, udplen = snprintf(UDPMsg, 2048,
"{\"@type\": \"L2Trace\", \"reportFrom\": \"%s\", \"port\": \"%d\", \"srce\": \"%s\", \"dest\": \"%s\", \"ctrl\": %d," "{\"@type\": \"L2Trace\", \"serial\": %d, \"time\": %d, \"dirn\": \"%s\", \"isRF\": %s, \"reportFrom\": \"%s\", \"port\": \"%d\", \"srce\": \"%s\", \"dest\": \"%s\", \"ctrl\": %d,"
"\"l2type\": \"%s\", \"modulo\": 8, \"cr\": \"%s\"", "\"l2Type\": \"%s\", \"modulo\": 8, \"cr\": \"%s\"",
NODECALLLOPPED, Message->PORT, srcecall, destcall, Message->CTL, Type, CR); UDPSeq++, (int)Now, Dirn, (PORT->isRF)?"true":"false", NODECALLLOPPED, Message->PORT, srcecall, destcall, Message->CTL, Type, CR);
if (UIFlag) if (UIFlag)
{ {
@ -830,9 +944,9 @@ void APIL2Trace(struct _MESSAGE * Message, char Dirn)
// supervisory // supervisory
if (PF[0]) if (PF[0])
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"pf\": \"%s\", \"rseq\": %d, \"tseq\": %d", PF, NR, NS); udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"pf\": \"%s\", \"rseq\": %d", PF, NR);
else else
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"rseq\": %d, \"tseq\": %d", NR, NS); udplen += snprintf(&UDPMsg[udplen], 2048 - udplen, ", \"rseq\": %d", NR);
} }
@ -844,6 +958,48 @@ void APIL2Trace(struct _MESSAGE * Message, char Dirn)
} }
//"@type" = @L3Trace, reportFrom, time, dirn,
void NetromTCPTrace(struct _MESSAGE * Message, char * Dirn)
{
char UDPMsg[2048];
int udplen;
time_t Now = time(NULL);
int iLen = Message->LENGTH - (15 + MSGHDDRLEN);
int isRF = 0;
udplen = snprintf(UDPMsg, 2048,
"{\"@type\": \"L3Trace\", \"serial\": %d, \"time\": %d, \"dirn\": \"%s\", \"isRF\": %s, \"reportFrom\": \"%s\", \"port\": %d",
UDPSeq++, (int)Now, Dirn, (isRF)?"true":"false", NODECALLLOPPED, Message->PORT);
udplen += snprintf(&UDPMsg[udplen], 2048 - udplen,
", \"ilen\": %d, \"pid\": %d, \"ptcl\": \"%s\"",
iLen, Message->PID, PIDtoText(Message->PID));
if (Message->PID == NETROM_PID)
{
int n = decodeNETROMIFrame(Message->L2DATA, iLen, &UDPMsg[udplen], 2048 - udplen);
if (n == 0)
return; // Can't decode so don't trace anything;
udplen += n;
}
UDPMsg[udplen++] = '}';
UDPMsg[udplen] = 0;
// Debugprintf(UDPMsg);
sendto(NodeAPISocket, UDPMsg, udplen, 0, (struct sockaddr *)&UDPreportdest, sizeof(UDPreportdest));
}
int decodeNETROMUIMsg(unsigned char * Msg, int iLen, char * Buffer, int BufferLen) int decodeNETROMUIMsg(unsigned char * Msg, int iLen, char * Buffer, int BufferLen)
{ {
int Len = 0; int Len = 0;
@ -870,7 +1026,7 @@ int decodeNETROMUIMsg(unsigned char * Msg, int iLen, char * Buffer, int BufferLe
Msg += 7; // to first field Msg += 7; // to first field
Len = snprintf(Buffer, BufferLen, ", \"l3Type\": \"Routing info\", \"type\": \"NODES\", \"nodes\": ["); Len = snprintf(Buffer, BufferLen, ", \"l3Type\": \"Routing info\", \"type\": \"NODES\", \"fromAlias\": \"%s\", \"nodes\": [", Alias);
iLen -= 7; //Header, mnemonic and signature length iLen -= 7; //Header, mnemonic and signature length
@ -921,6 +1077,13 @@ int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferL
destcall[ConvFromAX25(L3MSG->L3DEST, destcall)] = 0; destcall[ConvFromAX25(L3MSG->L3DEST, destcall)] = 0;
srcecall[ConvFromAX25(L3MSG->L3SRCE, srcecall)] = 0; srcecall[ConvFromAX25(L3MSG->L3SRCE, srcecall)] = 0;
if (!checkCall(destcall, Msg, iLen))
return 0;
if (!checkCall(srcecall, Msg, iLen))
return 0;
if (strcmp(destcall, "KEEPLI") == 0) if (strcmp(destcall, "KEEPLI") == 0)
return 0; return 0;
@ -955,6 +1118,14 @@ int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferL
srcUser[ConvFromAX25(&L3MSG->L4DATA[1], srcUser)] = 0; srcUser[ConvFromAX25(&L3MSG->L4DATA[1], srcUser)] = 0;
srcNode[ConvFromAX25(&L3MSG->L4DATA[8], srcNode)] = 0; srcNode[ConvFromAX25(&L3MSG->L4DATA[8], srcNode)] = 0;
if (!checkCall(srcUser, Msg, iLen))
return 0;
if (!checkCall(srcNode, Msg, iLen))
return 0;
if (netromx) if (netromx)
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN REQX\", \"fromCct\": %d, \"srcUser\": \"%s\", \"srcNode\": \"%s\", \"window\": %d, \"service\": %d", Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN REQX\", \"fromCct\": %d, \"srcUser\": \"%s\", \"srcNode\": \"%s\", \"window\": %d, \"service\": %d",
(L3MSG->L4INDEX << 8) | L3MSG->L4ID, srcUser, srcNode, L3MSG->L4DATA[0], service); (L3MSG->L4INDEX << 8) | L3MSG->L4ID, srcUser, srcNode, L3MSG->L4DATA[0], service);
@ -969,7 +1140,7 @@ int decodeNETROMIFrame(unsigned char * Msg, int iLen, char * Buffer, int BufferL
// Can be ACK or NACK depending on Choke flag // Can be ACK or NACK depending on Choke flag
if (L3MSG->L4FLAGS & L4BUSY) if (L3MSG->L4FLAGS & L4BUSY)
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN NACK\", \"toCct\": %d", Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN NAK\", \"toCct\": %d",
(L3MSG->L4INDEX << 8) | L3MSG->L4ID); (L3MSG->L4INDEX << 8) | L3MSG->L4ID);
else else
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN ACK\", \"toCct\": %d, \"fromCct\": %d, \"accWin\": %d", Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"CONN ACK\", \"toCct\": %d, \"fromCct\": %d, \"accWin\": %d",
@ -1073,7 +1244,7 @@ int decodeRecordRoute(L3MESSAGE * L3, int iLen, char * Buffer, int BufferLen)
Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"NRR Request\", \"nrrId\": %d, \"nrrRoute\": \"%s\"", Len += snprintf(&Buffer[Len], BufferLen - Len, ", \"l4Type\": \"NRR Request\", \"nrrId\": %d, \"nrrRoute\": \"%s\"",
(L3->L4TXNO << 8) | L3->L4RXNO, callList); (L3->L4TXNO << 8) | L3->L4RXNO, callList);
Debugprintf(Buffer); // Debugprintf(Buffer);
return Len; return Len;
} }

View file

@ -50,6 +50,19 @@ BEGIN
LTEXT "Enable IGate",IDC_STATIC,5,2,49,10 LTEXT "Enable IGate",IDC_STATIC,5,2,49,10
END END
CLOSING DIALOG DISCARDABLE 300, 300, 200, 50
STYLE DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU |
WS_THICKFRAME
CAPTION "BPQ32 Close All"
CLASS "CLOSING"
FONT 8, "Fixedsys"
BEGIN
LTEXT "Closing Links - Please wait....",IDC_BACKGROUND,22,20,337,273
END
CONFIG DIALOGEX 249, 200, 160, 118 CONFIG DIALOGEX 249, 200, 160, 118
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_CAPTION
EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE

View file

@ -2346,6 +2346,9 @@ VOID SFRAME(struct _LINKTABLE * LINK, struct PORTCONTROL * PORT, UCHAR CTL, UCHA
LINK->L2TIMER = ONEMINUTE; // (RE)SET TIMER LINK->L2TIMER = ONEMINUTE; // (RE)SET TIMER
LINK->framesResent++;
PORT = LINK->LINKPORT; PORT = LINK->LINKPORT;
if (PORT) if (PORT)
@ -2452,6 +2455,20 @@ treatasRR:
LINK->L2FLAGS &= ~POLLSENT; // CLEAR I(P) or RR(P) SET LINK->L2FLAGS &= ~POLLSENT; // CLEAR I(P) or RR(P) SET
// ?? is this the place to do RTT?
if (LINK->lastPSent)
{
int RTT = GetTickCount() - LINK->lastPSent;
if (LINK->RTT)
LINK->RTT = ((LINK->RTT * 90) / 100) + RTT /10; // Smooth - 90% of old + 10% of new
else
LINK->RTT = RTT;
LINK->lastPSent = 0;
}
if ((CTL & 0xf) == RNR) if ((CTL & 0xf) == RNR)
{ {
// Dont Clear timer on receipt of RNR(F), spec says should poll for clearing of busy, // Dont Clear timer on receipt of RNR(F), spec says should poll for clearing of busy,
@ -2927,6 +2944,8 @@ VOID RESETNS(struct _LINKTABLE * LINK, UCHAR NS)
{ {
int Resent = (LINK->LINKNS - NS) & 7; // FRAMES TO RESEND int Resent = (LINK->LINKNS - NS) & 7; // FRAMES TO RESEND
LINK->framesResent += Resent;
LINK->LINKNS = NS; // RESET N(S) LINK->LINKNS = NS; // RESET N(S)
if (LINK->LINKTYPE == 3) // mode-Node if (LINK->LINKTYPE == 3) // mode-Node
@ -3150,6 +3169,11 @@ VOID SDETX(struct _LINKTABLE * LINK)
LINK->LASTFRAMESENT = time(NULL); LINK->LASTFRAMESENT = time(NULL);
LINK->LASTSENTQCOUNT = COUNT_AT_L2(LINK); LINK->LASTSENTQCOUNT = COUNT_AT_L2(LINK);
if (LINK->LASTSENTQCOUNT > LINK->maxQueued)
LINK->maxQueued = LINK->LASTSENTQCOUNT;
if (LINK->LASTSENTQCOUNT > LINK->intervalMaxQueued)
LINK->intervalMaxQueued = LINK->LASTSENTQCOUNT;
if (LINK->AllowCompress && Msg->LENGTH > 20 && LINK->TX_Q && Msg->PID == 240) // if short and no more not worth trying compression if (LINK->AllowCompress && Msg->LENGTH > 20 && LINK->TX_Q && Msg->PID == 240) // if short and no more not worth trying compression
{ {
@ -3352,6 +3376,7 @@ VOID SDETX(struct _LINKTABLE * LINK)
// FLAG BUFFER TO CAUSE TIMER TO BE RESET AFTER SEND (or ACK if ACKMODE) // FLAG BUFFER TO CAUSE TIMER TO BE RESET AFTER SEND (or ACK if ACKMODE)
Buffer->Linkptr = LINK; Buffer->Linkptr = LINK;
LINK->lastPSent = GetTickCount();
} }
} }

View file

@ -236,7 +236,7 @@ BOOL ACTIVATE_DEST(struct DEST_LIST * DEST)
return L2SETUPCROSSLINK(ROUTE); return L2SETUPCROSSLINK(ROUTE);
} }
// We umst be waiting for link to come up // We must be waiting for link to come up
return TRUE; return TRUE;
@ -627,9 +627,6 @@ VOID PROCROUTES(struct DEST_LIST * DEST, struct ROUTE * ROUTE, int Qual)
if (Index == 0) if (Index == 0)
{ {
// THIS IS A REFRESH OF BEST - IF THIS ISNT ACTIVE ROUTE, MAKE IT ACTIVE // THIS IS A REFRESH OF BEST - IF THIS ISNT ACTIVE ROUTE, MAKE IT ACTIVE
if (DEST->DEST_ROUTE > 1) // LEAVE IT IF NOT SELECTED OR ALREADY USING BEST
DEST->DEST_ROUTE = 1;
} }
goto UpdatateThisEntry; goto UpdatateThisEntry;
@ -728,6 +725,8 @@ SORTROUTES:
goto SORTROUTES; // 1 AND 2 MAY NOW BE WRONG! goto SORTROUTES; // 1 AND 2 MAY NOW BE WRONG!
} }
DEST->DEST_ROUTE = 0; // OForce re-evaluation.
} }
int COUNTNODES(struct ROUTE * ROUTE) int COUNTNODES(struct ROUTE * ROUTE)
@ -1042,7 +1041,8 @@ VOID L3TimerProc()
LINK = LINKS; LINK = LINKS;
i = MAXLINKS; i = MAXLINKS;
while (i--);
while (i--)
{ {
if (LINK->LINKTYPE == 3) // Only if Internode if (LINK->LINKTYPE == 3) // Only if Internode
{ {
@ -1310,6 +1310,9 @@ VOID REMOVENODE(dest_list * DEST)
while (DEST->DEST_Q) while (DEST->DEST_Q)
ReleaseBuffer(Q_REM(&DEST->DEST_Q)); ReleaseBuffer(Q_REM(&DEST->DEST_Q));
if (DEST->DEST_STATE & 0x80) // LOCKED DESTINATION
return;
// MAY NEED TO CHECK FOR L4 CIRCUITS USING DEST, BUT PROBABLY NOT, // MAY NEED TO CHECK FOR L4 CIRCUITS USING DEST, BUT PROBABLY NOT,
// AS THEY SHOULD HAVE TIMED OUT LONG AGO // AS THEY SHOULD HAVE TIMED OUT LONG AGO

View file

@ -73,6 +73,7 @@ void OutgoingL4ConnectionEvent(TRANSPORTENTRY * L4);
void IncomingL4ConnectionEvent(TRANSPORTENTRY * L4); void IncomingL4ConnectionEvent(TRANSPORTENTRY * L4);
void L4DisconnectEvent(TRANSPORTENTRY * L4, char * Direction, char * Reason); void L4DisconnectEvent(TRANSPORTENTRY * L4, char * Direction, char * Reason);
VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame); VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame);
void L4StatusSeport(TRANSPORTENTRY * L4);
static UINT APPLMASK; static UINT APPLMASK;
@ -89,6 +90,8 @@ extern int L2Compress;
extern int L2CompMaxframe; extern int L2CompMaxframe;
extern int L2CompPaclen; extern int L2CompPaclen;
int sessionStatusInterval = 300; // 5 mins
// L4 Flags Values // L4 Flags Values
#define DISCPENDING 8 // SEND DISC WHEN ALL DATA ACK'ED #define DISCPENDING 8 // SEND DISC WHEN ALL DATA ACK'ED
@ -1128,6 +1131,7 @@ VOID L4TimerProc()
TRANSPORTENTRY * L4 = L4TABLE; TRANSPORTENTRY * L4 = L4TABLE;
TRANSPORTENTRY * Partner; TRANSPORTENTRY * Partner;
int MaxLinks = MAXLINKS; int MaxLinks = MAXLINKS;
time_t Now = time(NULL);
while (n--) while (n--)
{ {
@ -1137,6 +1141,12 @@ VOID L4TimerProc()
continue; continue;
} }
// Check for Status report time
if (L4->lastStatusSentTime && (Now - L4->lastStatusSentTime) > sessionStatusInterval)
L4StatusSeport(L4);
// CHECK FOR L4BUSY SET AND NO LONGER BUSY // CHECK FOR L4BUSY SET AND NO LONGER BUSY
if (L4->NAKBITS & L4BUSY) if (L4->NAKBITS & L4BUSY)
@ -1601,6 +1611,7 @@ VOID CONNECTREQUEST(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, UINT Appl
int Index; int Index;
char APPLCMD[13] = ""; char APPLCMD[13] = "";
if (APPL)
memcpy(APPLCMD, APPL->APPLCMD, 13); memcpy(APPLCMD, APPL->APPLCMD, 13);
memcpy(BPQPARAMS, &L4T1, 2); // SET DEFAULT T1 IN CASE NOT FROM ANOTHER BPQ NODE memcpy(BPQPARAMS, &L4T1, 2); // SET DEFAULT T1 IN CASE NOT FROM ANOTHER BPQ NODE
@ -1674,6 +1685,8 @@ VOID CONNECTREQUEST(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, UINT Appl
{ {
// At the moment I only handle connects to appls. May support other node commands later. // At the moment I only handle connects to appls. May support other node commands later.
memcpy(APPLCMD, CMD->String, 13);
if (n < APPL1 + NumberofAppls) if (n < APPL1 + NumberofAppls)
goto doAPPLConnect; goto doAPPLConnect;
} }
@ -1916,19 +1929,34 @@ void L3SWAPADDRESSES(L3MESSAGEBUFFER * L3MSG)
void SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG) void SendConNAK(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
{ {
struct TNCINFO * TNC;
L3MSG->L4FLAGS = L4CACK | L4BUSY; // REJECT L3MSG->L4FLAGS = L4CACK | L4BUSY; // REJECT
L3MSG->L4DATA[0] = 0; // WINDOW L3MSG->L4DATA[0] = 0; // WINDOW
L3SWAPADDRESSES(L3MSG); L3SWAPADDRESSES(L3MSG);
L3MSG->L3TTL = L3LIVES; L3MSG->L3TTL = L3LIVES;
TNC = LINK->LINKPORT->TNC;
if (LINK->NEIGHBOUR && LINK->NEIGHBOUR->TCPPort)
{
TCPNETROMSend(LINK->NEIGHBOUR, L3MSG);
ReleaseBuffer(L3MSG);
}
else if (TNC && TNC->NetRomMode)
SendVARANetromMsg(TNC, L3MSG);
else
C_Q_ADD(&LINK->TX_Q, L3MSG); C_Q_ADD(&LINK->TX_Q, L3MSG);
} }
VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG) VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
{ {
// Paula's extension // Paula's extension
struct TNCINFO * TNC;
L3MSG->L4RXNO = L3MSG->L4ID; L3MSG->L4RXNO = L3MSG->L4ID;
L3MSG->L4TXNO = L3MSG->L4INDEX; L3MSG->L4TXNO = L3MSG->L4INDEX;
@ -1938,7 +1966,19 @@ VOID SendL4RESET(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG)
L3MSG->L3TTL = L3LIVES; L3MSG->L3TTL = L3LIVES;
L3MSG->LENGTH = (int)(&L3MSG->L4DATA[0] - (UCHAR *)L3MSG); L3MSG->LENGTH = (int)(&L3MSG->L4DATA[0] - (UCHAR *)L3MSG);
TNC = LINK->LINKPORT->TNC;
if (LINK->NEIGHBOUR && LINK->NEIGHBOUR->TCPPort)
{
TCPNETROMSend(LINK->NEIGHBOUR, L3MSG);
ReleaseBuffer(L3MSG);
}
else if (TNC && TNC->NetRomMode)
SendVARANetromMsg(TNC, L3MSG);
else
C_Q_ADD(&LINK->TX_Q, L3MSG); C_Q_ADD(&LINK->TX_Q, L3MSG);
} }
@ -2028,7 +2068,7 @@ TryAgain:
while (n--) while (n--)
{ {
if (DEST->DEST_COUNT == 0 && DEST->DEST_RTT == 0) // Not used and not INP3 if (DEST->DEST_COUNT == 0 && DEST->DEST_RTT == 0 && (DEST->DEST_STATE & 0x80) == 0) // Not used and not INP3 and not Appl
{ {
if (DEST->NRROUTE[0].ROUT_QUALITY < WorstQual) if (DEST->NRROUTE[0].ROUT_QUALITY < WorstQual)
{ {
@ -2258,6 +2298,14 @@ VOID FRAMEFORUS(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG, int ApplMask,
return; return;
} }
// if connect to service don't send connected to node messsage as service will send own message
// if (L4->Service)
// {
// ReleaseBuffer(L3MSG);
// return;
// }
Msg = (PDATAMESSAGE)L3MSG; // reuse input buffer Msg = (PDATAMESSAGE)L3MSG; // reuse input buffer
Msg->PID = 0xf0; Msg->PID = 0xf0;

View file

@ -85,8 +85,7 @@ VOID GetPGConfig();
void SendBBSDataToPktMap(); void SendBBSDataToPktMap();
void CloseAllLinks(); void CloseAllLinks();
void hookNodeClosing(char * Reason); void hookNodeClosing(char * Reason);
void NETROMTCPResolve();
extern uint64_t INP3timeLoadedMS;
BOOL IncludesMail = FALSE; BOOL IncludesMail = FALSE;
BOOL IncludesChat = FALSE; BOOL IncludesChat = FALSE;
@ -860,8 +859,6 @@ int main(int argc, char * argv[])
if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO)) if (!isatty(STDOUT_FILENO) || !isatty(STDIN_FILENO))
Redirected = 1; Redirected = 1;
INP3timeLoadedMS = GetTickCount();
#endif #endif
printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring); printf("G8BPQ AX25 Packet Switch System Version %s %s\n", TextVerstring, Datestring);
@ -1015,6 +1012,8 @@ int main(int argc, char * argv[])
return (0); return (0);
} }
NETROMTCPResolve();
for (i=0;PWTEXT[i] > 0x20;i++); //Scan for cr or null for (i=0;PWTEXT[i] > 0x20;i++); //Scan for cr or null
PWLen=i; PWLen=i;
@ -1547,6 +1546,8 @@ int main(int argc, char * argv[])
Start(); Start();
NETROMTCPResolve();
INITIALISEPORTS(); INITIALISEPORTS();
SetApplPorts(); SetApplPorts();

View file

@ -2105,7 +2105,6 @@ int CreateSMTPMessage(SocketConn * sockptr, int i, char * MsgTitle, time_t Date,
else else
strcpy(B2To, Msg->to); strcpy(B2To, Msg->to);
Msg->B2Flags = B2Msg | Attachments; Msg->B2Flags = B2Msg | Attachments;
if (Msg->type == 'P') if (Msg->type == 'P')

View file

@ -59,6 +59,9 @@ BOOL FindNeighbour(UCHAR * Call, int Port, struct ROUTE ** REQROUTE);
VOID NETROMMSG(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG); VOID NETROMMSG(struct _LINKTABLE * LINK, L3MESSAGEBUFFER * L3MSG);
int BPQTRACE(MESSAGE * Msg, BOOL TOAPRS); int BPQTRACE(MESSAGE * Msg, BOOL TOAPRS);
VOID L3LINKCLOSED(struct _LINKTABLE * LINK, int Reason); VOID L3LINKCLOSED(struct _LINKTABLE * LINK, int Reason);
void NetromTCPTrace(struct _MESSAGE * Message, char * Dirn);
extern SOCKET NodeAPISocket;
struct NRTCPMsg struct NRTCPMsg
{ {
@ -107,7 +110,7 @@ struct ConnectionInfo * AllocateNRTCPRec()
sockptr->SocketActive = TRUE; sockptr->SocketActive = TRUE;
sockptr->ConnectTime = sockptr->LastSendTime = time(NULL); sockptr->ConnectTime = sockptr->LastSendTime = time(NULL);
Debugprintf("NRTCP Allocated %d", i); // Debugprintf("NRTCP Allocated %d", i);
return sockptr; return sockptr;
} }
} }
@ -210,8 +213,11 @@ int NETROMOpenConnection(struct ROUTE * Route)
{ {
struct NRTCPSTRUCT * Info; struct NRTCPSTRUCT * Info;
struct ConnectionInfo * sockptr; struct ConnectionInfo * sockptr;
char farCall[10];
Debugprintf("Opening NRTCP Connection"); farCall[ConvFromAX25(Route->NEIGHBOUR_CALL, farCall)] = 0;
// Debugprintf("Opening NRTCP Connection to %s", farCall);
if (Route->TCPSession) if (Route->TCPSession)
{ {
@ -232,7 +238,7 @@ int NETROMOpenConnection(struct ROUTE * Route)
return 0; return 0;
Info = Route->TCPSession = NRTCPInfo[sockptr->Number]; Info = Route->TCPSession = NRTCPInfo[sockptr->Number];
memcpy(Info->Call, MYNETROMCALL, 10); memcpy(Info->Call, farCall, 10);
Route->NEIGHBOUR_LINK = Info->LINK; Route->NEIGHBOUR_LINK = Info->LINK;
Info->Route = Route; Info->Route = Route;
@ -244,6 +250,45 @@ int NETROMOpenConnection(struct ROUTE * Route)
} }
void NETROMTCPResolve()
{
struct ROUTE * Route = NEIGHBOURS;
int n = MAXNEIGHBOURS;
struct addrinfo hints, *res = 0;
char PortString[20];
int err;
while (n--)
{
if (Route->TCPAddress)
{
// try to resolve host
sprintf(PortString, "%d", Route->TCPPort);
memset(&hints, 0, sizeof hints);
hints.ai_family = AF_UNSPEC; // use IPv4 or IPv6, whichever
hints.ai_socktype = SOCK_STREAM;
getaddrinfo(Route->TCPHost, PortString, &hints, &res);
err = WSAGetLastError();
if (res)
{
Route->TCPAddress->ai_family = res->ai_family;
Route->TCPAddress->ai_socktype = res->ai_socktype;
Route->TCPAddress->ai_protocol = res->ai_protocol;
Route->TCPAddress->ai_addrlen = res->ai_addrlen;
memcpy(Route->TCPAddress->ai_addr, res->ai_addr, sizeof(struct sockaddr));
freeaddrinfo(res);
}
}
Route++;
}
}
int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr) int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr)
{ {
int err; int err;
@ -253,34 +298,22 @@ int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr)
struct sockaddr_in sinx; struct sockaddr_in sinx;
int addrlen=sizeof(sinx); int addrlen=sizeof(sinx);
char PortString[20]; char PortString[20];
struct addrinfo hints, *res = 0, *saveres; struct addrinfo * res = Route->TCPAddress;
int Port = Route->TCPPort; int Port = Route->TCPPort;
sprintf(PortString, "%d", Port); sprintf(PortString, "%d", Port);
// get host info, make socket, and connect it // get host info, make socket, and connect it
memset(&hints, 0, sizeof hints); if (res->ai_family == 0)
hints.ai_family = AF_UNSPEC; // use IPv4 or IPv6, whichever
hints.ai_socktype = SOCK_STREAM;
getaddrinfo(Route->TCPHost, PortString, &hints, &res);
if (!res)
{ {
err = WSAGetLastError(); // err = WSAGetLastError();
Debugprintf("Resolve HostName %s Failed - Error %d", Route->TCPHost, err); // Debugprintf("Resolve HostName %s Failed - Error %d", Route->TCPHost, err);
return FALSE; // Resolve failed return FALSE; // Resolve failed
} }
// Step thorough the list of hosts
saveres = res; // Save for free
sock = sockptr->socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol); sock = sockptr->socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
if (sock == INVALID_SOCKET) if (sock == INVALID_SOCKET)
{ {
Debugprintf, ("Netrom over TCP Create Socket Failed"); Debugprintf, ("Netrom over TCP Create Socket Failed");
@ -299,14 +332,10 @@ int NETROMTCPConnect(struct ROUTE * Route, struct ConnectionInfo * sockptr)
// //
sockptr->Connected = TRUE; sockptr->Connected = TRUE;
freeaddrinfo(saveres);
return TRUE; return TRUE;
} }
else else
{ {
freeaddrinfo(saveres);
err=WSAGetLastError(); err=WSAGetLastError();
if (err == 10035 || err == 115 || err == 36) //EWOULDBLOCK if (err == 10035 || err == 115 || err == 36) //EWOULDBLOCK
@ -337,14 +366,14 @@ void NETROMConnectionAccepted(struct ConnectionInfo * sockptr)
// Not sure we can do much here until first message arrives with callsign // Not sure we can do much here until first message arrives with callsign
sockptr->Connected = TRUE; sockptr->Connected = TRUE;
Debugprintf("NRTCP Connection Accepted"); // Debugprintf("NRTCP Connection Accepted");
} }
void NETROMConnected(struct ConnectionInfo * sockptr, SOCKET sock, struct NRTCPSTRUCT * Info) void NETROMConnected(struct ConnectionInfo * sockptr, SOCKET sock, struct NRTCPSTRUCT * Info)
{ {
// Connection Complete // Connection Complete
Debugprintf("NRTCP Connected"); // Debugprintf("NRTCP Connected");
sockptr->Connecting = FALSE; sockptr->Connecting = FALSE;
sockptr->Connected = TRUE; sockptr->Connected = TRUE;
@ -399,6 +428,8 @@ checkLen:
// This must be an incoming connection as Call is set before calling so need to find route record and set things up. // This must be an incoming connection as Call is set before calling so need to find route record and set things up.
// Debugprintf("New NRTCP Connection from %s", Msg->Call);
memcpy(Info->Call, Msg->Call, 10); memcpy(Info->Call, Msg->Call, 10);
ConvToAX25(Msg->Call, axCall); ConvToAX25(Msg->Call, axCall);
@ -407,8 +438,9 @@ checkLen:
{ {
Info->Route = Route; Info->Route = Route;
Route->NEIGHBOUR_LINK = Info->LINK; Route->NEIGHBOUR_LINK = Info->LINK;
Route->NEIGHBOUR_PORT = portNo;
Info->LINK->NEIGHBOUR = Route; Info->LINK->NEIGHBOUR = Route;
Info->LINK->LINKPORT = GetPortTableEntryFromPortNum(Route->NEIGHBOUR_PORT); Info->LINK->LINKPORT = GetPortTableEntryFromPortNum(portNo);
Route->TCPSession = Info; Route->TCPSession = Info;
Info->LINK->L2STATE = 5; Info->LINK->L2STATE = 5;
@ -416,13 +448,26 @@ checkLen:
SendRTTMsg(Info->Route); SendRTTMsg(Info->Route);
} }
else else
goto seeifMore; // Should we kill connection? {
Debugprintf("Neighbour %s port %d not found - closing connection", Msg->Call, portNo);
closesocket(sockptr->socket);
sockptr->SocketActive = FALSE;
memset(sockptr, 0, sizeof(struct ConnectionInfo));
Info->Call[0] = 0;
return 0;
}
} }
if (memcmp(Info->Call, Msg->Call, 10) != 0) if (memcmp(Info->Call, Msg->Call, 10) != 0)
{ {
// something wrong - maybe connection reused Debugprintf("NRTCP Mismatch - closing connection");
closesocket(sockptr->socket);
sockptr->SocketActive = FALSE;
memset(sockptr, 0, sizeof(struct ConnectionInfo));
Info->Call[0] = 0;
return 0;
} }
// Format as if come from an ax.25 link // Format as if come from an ax.25 link
@ -434,7 +479,7 @@ checkLen:
L3Msg->LENGTH = (Msg->Length - 12) + MSGHDDRLEN; L3Msg->LENGTH = (Msg->Length - 12) + MSGHDDRLEN;
L3Msg->Next = 0; L3Msg->Next = 0;
L3Msg->Port = 0; L3Msg->Port = portNo;
L3Msg->L3PID = NETROM_PID; L3Msg->L3PID = NETROM_PID;
memcpy(&L3Msg->L3SRCE, Msg->Packet, Msg->Length - 13); memcpy(&L3Msg->L3SRCE, Msg->Packet, Msg->Length - 13);
@ -458,6 +503,10 @@ checkLen:
time(&Buffer->Timestamp); time(&Buffer->Timestamp);
BPQTRACE(Buffer, FALSE); BPQTRACE(Buffer, FALSE);
if(NodeAPISocket)
NetromTCPTrace(Buffer, "rcvd");
ReleaseBuffer(Buffer); ReleaseBuffer(Buffer);
} }
@ -502,7 +551,7 @@ VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
{ {
Buffer->CHAIN = 0; Buffer->CHAIN = 0;
Buffer->CTL = 0; Buffer->CTL = 0;
Buffer->PORT = Route->NEIGHBOUR_PORT | 128; // TX Flag Buffer->PORT = Route->NEIGHBOUR_PORT;
ConvToAX25(Route->TCPSession->Call, Buffer->DEST); ConvToAX25(Route->TCPSession->Call, Buffer->DEST);
ConvToAX25(MYNETROMCALL, Buffer->ORIGIN); ConvToAX25(MYNETROMCALL, Buffer->ORIGIN);
@ -513,7 +562,13 @@ VOID TCPNETROMSend(struct ROUTE * Route, struct _L3MESSAGEBUFFER * Frame)
Buffer->LENGTH = DataLen + 15 + MSGHDDRLEN; Buffer->LENGTH = DataLen + 15 + MSGHDDRLEN;
time(&Buffer->Timestamp); time(&Buffer->Timestamp);
if(NodeAPISocket)
NetromTCPTrace(Buffer, "sent");
Buffer->PORT = Route->NEIGHBOUR_PORT | 128; // TX Flag
BPQTRACE(Buffer, FALSE); BPQTRACE(Buffer, FALSE);
ReleaseBuffer(Buffer); ReleaseBuffer(Buffer);
} }
@ -539,9 +594,11 @@ void NETROMConnectionLost(struct ConnectionInfo * sockptr)
if (sockptr->Connecting) if (sockptr->Connecting)
L3LINKCLOSED(Info->LINK, SETUPFAILED); L3LINKCLOSED(Info->LINK, SETUPFAILED);
if (Route)
Route->TCPSession = 0; Route->TCPSession = 0;
Info->Call[0] = 0; Info->Call[0] = 0;
Info->LINK->L2STATE = 0;
} }
sockptr->SocketActive = FALSE; sockptr->SocketActive = FALSE;

View file

@ -3874,11 +3874,13 @@ MsgLoop:
LFPtr=memchr(MsgPtr, 10, InputLen); LFPtr=memchr(MsgPtr, 10, InputLen);
if (LFPtr == 0) if (LFPtr == 0)
{
if (CRPtr) if (CRPtr)
{ {
LFPtr = ++CRPtr; LFPtr = ++CRPtr;
InputLen++; InputLen++;
} }
}
if (LFPtr == 0) if (LFPtr == 0)
{ {
// Check Paclen // Check Paclen
@ -4571,6 +4573,7 @@ MsgLoop:
if (P8 == 1) if (P8 == 1)
SendPortsForMonitor(sock, sockptr->UserPointer->Secure); SendPortsForMonitor(sock, sockptr->UserPointer->Secure);
sockptr->InputLen = 0; sockptr->InputLen = 0;
return 0; return 0;
} }

3
VARA.c
View file

@ -423,10 +423,11 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
{ {
TNC->Busy--; TNC->Busy--;
if (TNC->Busy == 0) if (TNC->Busy == 0)
SetWindowText(TNC->xIDC_CHANSTATE, "Clear"); { SetWindowText(TNC->xIDC_CHANSTATE, "Clear");
strcpy(TNC->WEB_CHANSTATE, "Clear"); strcpy(TNC->WEB_CHANSTATE, "Clear");
} }
} }
}
if (TNC->BusyDelay) if (TNC->BusyDelay)
{ {

View file

@ -10,8 +10,8 @@
#endif #endif
#define KVers 6,0,25,8 #define KVers 6,0,25,12
#define KVerstring "6.0.25.8\0" #define KVerstring "6.0.25.12\0"
#ifdef CKernel #ifdef CKernel

View file

@ -618,10 +618,12 @@ static size_t ExtProc(int fn, int port, PDATAMESSAGE buff)
{ {
TNC->Busy--; TNC->Busy--;
if (TNC->Busy == 0) if (TNC->Busy == 0)
{
SetWindowText(TNC->xIDC_CHANSTATE, "Clear"); SetWindowText(TNC->xIDC_CHANSTATE, "Clear");
strcpy(TNC->WEB_CHANSTATE, "Clear"); strcpy(TNC->WEB_CHANSTATE, "Clear");
} }
} }
}
if (TNC->ConnectCmd && TNC->BusyDelay) if (TNC->ConnectCmd && TNC->BusyDelay)
{ {

View file

@ -184,7 +184,13 @@ typedef struct _TRANSPORTENTRY
int NRRID; int NRRID;
time_t NRRTime; time_t NRRTime;
time_t ConnectTime;
char Direction[16]; // In or Out
int Service; // For Paula's Connnect to Service int Service; // For Paula's Connnect to Service
int apiSeq; // for OARC event reporting
time_t lastStatusSentTime;
} TRANSPORTENTRY; } TRANSPORTENTRY;
@ -251,6 +257,7 @@ typedef struct ROUTE
char * TCPHost; // For NETROM over TCP char * TCPHost; // For NETROM over TCP
int TCPPort; int TCPPort;
struct NRTCPSTRUCT * TCPSession; struct NRTCPSTRUCT * TCPSession;
struct addrinfo * TCPAddress; // Resolved Address
} *PROUTE; } *PROUTE;
@ -736,6 +743,7 @@ typedef struct PORTCONTROL
UCHAR * BUSY; // % Active (Normally DCD active or TX) UCHAR * BUSY; // % Active (Normally DCD active or TX)
int Hardware; // TNC H_TYPE. Copied here for access from application context int Hardware; // TNC H_TYPE. Copied here for access from application context
int isRF; // For API reporting. -1 is unspecified
} PORTCONTROLX, *PPORTCONTROL; } PORTCONTROLX, *PPORTCONTROL;
@ -977,6 +985,15 @@ typedef struct _LINKTABLE
int framesRXed; int framesRXed;
int framesTXed; int framesTXed;
int framesResent; int framesResent;
time_t LastStatusTime;
int LastStatusbytesRXed;
int LastStatusbytesTXed;
int maxQueued;
int intervalMaxQueued;
uint64_t lastPSent; // Time last I frame with P bit sent in mS (for RTT Measurements)
int RTT;
// Now support compressing L2 Sessions. // Now support compressing L2 Sessions.
// We collect as much data as possible before compressing and re-packetizing // We collect as much data as possible before compressing and re-packetizing
@ -994,6 +1011,7 @@ typedef struct _LINKTABLE
char ApplName[16]; char ApplName[16];
time_t lastStatusSentTime; time_t lastStatusSentTime;
int apiSeq; // for OARC event reporting
} LINKTABLE; } LINKTABLE;

View file

@ -444,7 +444,7 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
From[ConvFromAX25(call, &From[1]) + 1] = 0; From[ConvFromAX25(call, &From[1]) + 1] = 0;
if (strstr(CantReplyList, From) == 0) if (strstr(CantReplyList, From) == 0)
{ {
if (strlen(CantReplyList) < 500); if (strlen(CantReplyList) < 500)
strcat(CantReplyList, From); strcat(CantReplyList, From);
Debugprintf("AXIP Packet from %s dropped - can't reply", &From[1]); Debugprintf("AXIP Packet from %s dropped - can't reply", &From[1]);
} }
@ -557,7 +557,7 @@ static size_t ExtProc(int fn, int port, PMESSAGE buff)
From[ConvFromAX25(call, &From[1]) + 1] = 0; From[ConvFromAX25(call, &From[1]) + 1] = 0;
if (strstr(CantReplyList, From) == 0) if (strstr(CantReplyList, From) == 0)
{ {
if (strlen(CantReplyList) < 500); if (strlen(CantReplyList) < 500)
strcat(CantReplyList, From); strcat(CantReplyList, From);
Debugprintf("AXIP Packet from %s dropped - can't reply", &From[1]); Debugprintf("AXIP Packet from %s dropped - can't reply", &From[1]);
} }

77
cMain.c
View file

@ -38,6 +38,7 @@ along with LinBPQ/BPQ32. If not, see http://www.gnu.org/licenses
#include "cheaders.h" #include "cheaders.h"
#include "tncinfo.h" #include "tncinfo.h"
#include "mqtt.h" #include "mqtt.h"
#include "kiss.h"
VOID L2Routine(struct PORTCONTROL * PORT, PMESSAGE Buffer); VOID L2Routine(struct PORTCONTROL * PORT, PMESSAGE Buffer);
VOID ProcessIframe(struct _LINKTABLE * LINK, PDATAMESSAGE Buffer); VOID ProcessIframe(struct _LINKTABLE * LINK, PDATAMESSAGE Buffer);
@ -57,7 +58,7 @@ VOID L2SENDCOMMAND(struct _LINKTABLE * LINK, int CMD);
void WritePacketLogThread(void * param); void WritePacketLogThread(void * param);
void hookNodeStarted(); void hookNodeStarted();
void hookNodeRunning(); void hookNodeRunning();
void APIL2Trace(struct _MESSAGE * Message, char Dirn); void APIL2Trace(struct _MESSAGE * Message, char * Dirn);
#include "configstructs.h" #include "configstructs.h"
@ -1017,6 +1018,7 @@ BOOL Start()
PORT->INP3ONLY = PortRec->INP3ONLY; PORT->INP3ONLY = PortRec->INP3ONLY;
PORT->ALLOWINP3 = PortRec->AllowINP3; PORT->ALLOWINP3 = PortRec->AllowINP3;
PORT->ENABLEINP3 = PortRec->EnableINP3; PORT->ENABLEINP3 = PortRec->EnableINP3;
PORT->isRF = PortRec->isRF;
PORT->PORTWINDOW = (UCHAR)PortRec->MAXFRAME; PORT->PORTWINDOW = (UCHAR)PortRec->MAXFRAME;
@ -1416,6 +1418,9 @@ BOOL Start()
{ {
ROUTE->TCPHost = Rcfg->tcphost; ROUTE->TCPHost = Rcfg->tcphost;
ROUTE->TCPPort = Rcfg->tcpport; ROUTE->TCPPort = Rcfg->tcpport;
ROUTE->TCPAddress = (struct addrinfo *)zalloc(sizeof(struct addrinfo));
ROUTE->TCPAddress->ai_addr = (struct sockaddr *) zalloc(sizeof(struct sockaddr));
} }
Rcfg++; Rcfg++;
@ -2028,7 +2033,7 @@ VOID ReadNodes()
ptr = strtok_s(NULL, seps, &Context); // INP3 ptr = strtok_s(NULL, seps, &Context); // INP3
if (ptr == NULL) continue; if (ptr == NULL) continue;
if (ROUTE->NEIGHBOUR_FLAG == 0 || ROUTE->OtherendLocked == 0); // Not LOCKED ROUTE if (ROUTE->NEIGHBOUR_FLAG == 0 || ROUTE->OtherendLocked == 0) // Not LOCKED ROUTE
ROUTE->OtherendsRouteQual = atoi(ptr); ROUTE->OtherendsRouteQual = atoi(ptr);
ptr = strtok_s(NULL, seps, &Context); // INP3 ptr = strtok_s(NULL, seps, &Context); // INP3
@ -2279,7 +2284,7 @@ VOID TIMERINTERRUPT()
Message = (struct _MESSAGE *)Buffer; Message = (struct _MESSAGE *)Buffer;
if(NodeAPISocket) if(NodeAPISocket)
APIL2Trace(Message, 'T'); APIL2Trace(Message, "sent");
Message->PORT |= 0x80; // Set TX Bit Message->PORT |= 0x80; // Set TX Bit
@ -2394,7 +2399,7 @@ L2Packet:
MQTTKISSRX(Buffer); MQTTKISSRX(Buffer);
if(NodeAPISocket &&PORT->PROTOCOL == 0) if(NodeAPISocket &&PORT->PROTOCOL == 0)
APIL2Trace(Message, 'R'); APIL2Trace(Message, "rcvd");
// Bridge if requested // Bridge if requested
@ -2765,6 +2770,7 @@ VOID INITIALISEPORTS()
{ {
char INITMSG[80]; char INITMSG[80];
struct PORTCONTROL * PORT = PORTTABLE; struct PORTCONTROL * PORT = PORTTABLE;
struct PORTCONTROL * SAVEPORT;
while (PORT) while (PORT)
{ {
@ -2772,7 +2778,68 @@ VOID INITIALISEPORTS()
WritetoConsoleLocal(INITMSG); WritetoConsoleLocal(INITMSG);
PORT->PORTINITCODE(PORT); 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;
} }
} }

View file

@ -25,6 +25,8 @@ Stuff to make compiling on WINDOWS and LINUX easier
#ifdef WIN32 #ifdef WIN32
#include <windows.h>
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
#define pthread_t uint32_t #define pthread_t uint32_t
@ -41,6 +43,7 @@ int pthread_equal(pthread_t T1, pthread_t T2)
#include <syslog.h> #include <syslog.h>
#include <stdarg.h> #include <stdarg.h>
#include <unistd.h> #include <unistd.h>
#include <stdint.h>
#define BOOL int #define BOOL int
@ -188,3 +191,27 @@ void closesocket(int sock)
} }
#endif #endif
#ifdef WIN32
uint32_t GetTickCountINP3()
{
// Returns system uptime in 10 mS, lower 20 bits only
return (GetTickCount() / 10) & 0xfffff;
}
#else
uint64_t GetTickCount();
uint32_t GetTickCountINP3()
{
uint64_t Ticks = GetTickCount();
// Returns system uptime in 10 mS, lower 20 bits only
return (Ticks / 10) & 0xfffff;
}
#endif

View file

@ -24,6 +24,7 @@ Stuff to make compiling on WINDOWS and LINUX easier
#define strtoll _strtoi64 #define strtoll _strtoi64
#ifdef _WIN64 #ifdef _WIN64
#include "stdint.h" #include "stdint.h"
#else #else
@ -219,7 +220,7 @@ typedef struct tagRECT
#endif #endif
uint32_t GetTickCountINP3();
#ifdef LINBPQ #ifdef LINBPQ

View file

@ -379,7 +379,8 @@ static char *pkeywords[] =
"BCALL", "DIGIMASK", "NOKEEPALIVES", "COMPORT", "DRIVER", "WL2KREPORT", "UIONLY", "BCALL", "DIGIMASK", "NOKEEPALIVES", "COMPORT", "DRIVER", "WL2KREPORT", "UIONLY",
"UDPPORT", "IPADDR", "I2CBUS", "I2CDEVICE", "UDPTXPORT", "UDPRXPORT", "NONORMALIZE", "UDPPORT", "IPADDR", "I2CBUS", "I2CDEVICE", "UDPTXPORT", "UDPRXPORT", "NONORMALIZE",
"IGNOREUNLOCKEDROUTES", "INP3ONLY", "TCPPORT", "RIGPORT", "PERMITTEDAPPLS", "HIDE", "IGNOREUNLOCKEDROUTES", "INP3ONLY", "TCPPORT", "RIGPORT", "PERMITTEDAPPLS", "HIDE",
"SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort", "ALLOWINP3", "ENABLEINP3"}; /* parameter keywords */ "SMARTID", "KISSCOMMAND", "SendtoM0LTEMap", "PortFreq", "M0LTEMapInfo", "QTSMPort",
"ALLOWINP3", "ENABLEINP3", "isRF"}; /* parameter keywords */
static void * poffset[] = static void * poffset[] =
{ {
@ -393,7 +394,8 @@ static void * poffset[] =
&xxp.BCALL, &xxp.DIGIMASK, &xxp.DefaultNoKeepAlives, &xxp.IOADDR, &xxp.DLLNAME, &xxp.WL2K, &xxp.UIONLY, &xxp.BCALL, &xxp.DIGIMASK, &xxp.DefaultNoKeepAlives, &xxp.IOADDR, &xxp.DLLNAME, &xxp.WL2K, &xxp.UIONLY,
&xxp.IOADDR, &xxp.IPADDR, &xxp.INTLEVEL, &xxp.IOADDR, &xxp.IOADDR, &xxp.ListenPort, &xxp.NoNormalize, &xxp.IOADDR, &xxp.IPADDR, &xxp.INTLEVEL, &xxp.IOADDR, &xxp.IOADDR, &xxp.ListenPort, &xxp.NoNormalize,
&xxp.IGNOREUNLOCKED, &xxp.INP3ONLY, &xxp.TCPPORT, &xxp.RIGPORT, &xxp.PERMITTEDAPPLS, &xxp.Hide, &xxp.IGNOREUNLOCKED, &xxp.INP3ONLY, &xxp.TCPPORT, &xxp.RIGPORT, &xxp.PERMITTEDAPPLS, &xxp.Hide,
&xxp.SmartID, &xxp.KissParams, &xxp.SendtoM0LTEMap, &xxp.PortFreq, &xxp.M0LTEMapInfo, &xxp.QtSMPort, &xxp.AllowINP3, &xxp.EnableINP3}; /* offset for corresponding data in config file */ &xxp.SmartID, &xxp.KissParams, &xxp.SendtoM0LTEMap, &xxp.PortFreq, &xxp.M0LTEMapInfo, &xxp.QtSMPort,
&xxp.AllowINP3, &xxp.EnableINP3, &xxp.isRF}; /* offset for corresponding data in config file */
static int proutine[] = static int proutine[] =
{ {
@ -407,7 +409,8 @@ static int proutine[] =
0, 1, 2, 18, 15, 16, 2, 0, 1, 2, 18, 15, 16, 2,
1, 17, 1, 1, 1, 1, 2, 1, 17, 1, 1, 1, 1, 2,
2, 2, 1, 1, 19, 2, 2, 2, 1, 1, 19, 2,
1, 20, 1, 21, 22, 1, 1, 1}; /* routine to process parameter */ 1, 20, 1, 21, 22, 1,
1, 1, 1}; /* routine to process parameter */
int PPARAMLIM = sizeof(proutine)/sizeof(int); int PPARAMLIM = sizeof(proutine)/sizeof(int);
@ -635,6 +638,8 @@ BOOL ProcessConfig()
paramok[93]=1; // ONLYVer2point0 paramok[93]=1; // ONLYVer2point0
paramok[94]=1; // DEBUGINP3 paramok[94]=1; // DEBUGINP3
paramok[95]=1; // EnableOARCAPI paramok[95]=1; // EnableOARCAPI
paramok[96]=1; // OARCAPI
for (i=0; i < PARAMLIM; i++) for (i=0; i < PARAMLIM; i++)
{ {
@ -1818,6 +1823,7 @@ int ports(int i)
} }
xxp.SendtoM0LTEMap = 1; // Default to enabled xxp.SendtoM0LTEMap = 1; // Default to enabled
xxp.isRF = -1; // Default to undefined
while (endport == 0 && !feof(fp1)) while (endport == 0 && !feof(fp1))
{ {

View file

@ -83,6 +83,7 @@ struct PORTCONFIG
int QtSMPort; int QtSMPort;
int AllowINP3; int AllowINP3;
int EnableINP3; int EnableINP3;
short isRF;
}; };
struct ROUTECONFIG struct ROUTECONFIG

11
debian/NEWS vendored Normal file
View file

@ -0,0 +1,11 @@
linbpq (6.0.24.22-2) unstable; urgency=medium
This is quite a big update, with config moving from /opt/oarc/bpq/bpq32.cfg to
/etc/bpq32.cfg. The system shall do this automatically for you, however
computers and their programmers are not perfect.
I strongly recommend at this point backing up your entire
/opt/oarc/bpq/ directory (cp -r /opt/oarc/bpq/ ~/bpq-backup/) before
proceeding with the upgrade
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 13:30:06 +0000

23
debian/README.Debian vendored Normal file
View file

@ -0,0 +1,23 @@
README for linbpq on Debian
===========================
Please see https://wiki.oarc.uk/packet:linbpq-apt-installation for this guide
# Set config
Copy the config, edit it & set permissions.
The permissions are so linbpq web interface can edit the config.
sudo mv /usr/share/doc/linbpq/examples/bpq32.cfg /etc/bpq32.cfg
sudo nano /etc/bpq32.cfg
sudo chown :linbpq /etc/bpq32.cfg
sudo chmod 644 /etc/bpq32.cfg
# Start linbpq
sudo systemctl start linbpq
# Access your node
It shall be available by accessing http://localhost:8008 in the browser or telnet localhost 8010
-- Dave Hibberd <hibby@debian.org> Tue, 26 Mar 2024 00:53:42 +0000

50
debian/bpq32.cfg vendored Normal file
View file

@ -0,0 +1,50 @@
SIMPLE
NODECALL=MB7NAA
NODEALIAS=AANODE
LOCATOR=AA00aa
PASSWORD=xxxxxxxx
AUTOSAVE=1
NODESINTERVAL=10
MINQUAL=10
CTEXT:
Thanks for connecting.
Type ? for help.
***
PORT
PORTNUM=1
ID=VHF
TYPE=ASYNC
PROTOCOL=KISS
KISSOPTIONS=ACKMODE
COMPORT=/dev/ttyACM0
SPEED=57600
FRACK=4000
PACLEN=150
DIGIFLAG=0
QUALITY=192
MINQUAL=20
ENDPORT
PORT
PORTNUM=9
ID=Telnet
DRIVER=Telnet
CONFIG
LOGGING=1
CMS=1
DisconnectOnClose=1
SECURETELNET=1
TCPPORT=8010
FBBPORT=8011
HTTPPORT=8008
LOGINPROMPT=user:
PASSWORDPROMPT=password:
MAXSESSIONS=10
CTEXT=Thanks for connecting\n Enter ? for list of commands\n\n
USER=username,xxxxxxxx,m0aaa,,SYSOP
ENDPORT
LINCHAT
APPLICATION 2,CHAT,,MB7NAA-9,AACHAT,255

342
debian/changelog vendored Normal file
View file

@ -0,0 +1,342 @@
linbpq (6.0.25.12+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.25.12+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Sat, 22 Nov 2025 15:11:09 +0000
linbpq (6.0.25.11+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.25.11+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Tue, 11 Nov 2025 21:52:58 +0000
linbpq (6.0.25.9+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.25.9+repack
* Refresh patches
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Sun, 09 Nov 2025 22:45:07 +0000
linbpq (6.0.25.8+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* Build on latest gcc standards
* New upstream version 6.0.25.8+repack
* Refresh patches with gbp pq!
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Fri, 24 Oct 2025 00:45:16 +0100
linbpq (6.0.25.06+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.25.06+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Fri, 10 Oct 2025 23:42:04 +0100
linbpq (6.0.25.1+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.25.1+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Sat, 20 Sep 2025 15:43:32 +0100
linbpq (6.0.24.82+repack-1~hibbian13+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.82+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Sun, 17 Aug 2025 22:36:49 +0100
linbpq (6.0.24.78+repack-1~hibbian~TRIXIE+1) trixie-hibbian-unstable; urgency=medium
* New Upstream
* New files excluded
- No binaries in this release at all maybe!
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Thu, 31 Jul 2025 01:31:38 +0100
linbpq (6.0.24.77+repack-1~hibbian~TRIXIE+1) trixie-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.77+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Tue, 22 Jul 2025 21:46:13 +0100
linbpq (6.0.24.75+repack-1~hibbian~TRIXIE+2) trixie-hibbian-unstable; urgency=medium
* First trixie release
* Drop hard-dep on hibbian-archive-keyring
-- Dave Hibberd <hibby@debian.org> Wed, 16 Jul 2025 19:10:33 +0100
linbpq (6.0.24.75+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream version 6.0.25.75+repack
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Tue, 15 Jul 2025 01:10:43 +0100
linbpq (6.0.24.71+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.67+repack
* New upstream version 6.0.24.69+repack
* New upstream version 6.0.24.69.1+repack
* New upstream version 6.0.24.71+repack
* Okay that's a lot of updates.
* Refreshed d/p/makefile to reflect new CFLAG
* MINI_BUILDD_OPTION: auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Wed, 21 May 2025 21:45:59 +0100
linbpq (6.0.24.66+repack-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
* Update postinst script to be a little quieter
* MINI_BUILDD_OPTION:
auto-ports=trixie-packetrepo-unstable,bookworm-packetrepo-unstable,bullseye-packetrepo-unstable,noble-packetrepo-unstable,jammy-packetrepo-unstable
-- Dave Hibberd <hibby@debian.org> Tue, 11 Mar 2025 00:51:35 +0000
linbpq (6.0.24.66+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream version 6.0.24.66+repack
-- Dave Hibberd <hibby@debian.org> Tue, 04 Mar 2025 22:50:09 +0000
linbpq (6.0.24.65+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
-- Dave Hibberd <hibby@debian.org> Tue, 25 Feb 2025 09:33:24 +0000
linbpq (6.0.24.59a+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
* Little tweaks to makefile patch to account for new -rdynamic
-- Dave Hibberd <hibby@debian.org> Mon, 03 Feb 2025 22:32:11 +0000
linbpq (6.0.24.56+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
-- Dave Hibberd <hibby@debian.org> Mon, 06 Jan 2025 21:37:44 +0000
linbpq (6.0.24.55+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
* d/rules
- Increased hardening
-- Dave Hibberd <hibby@debian.org> Sun, 05 Jan 2025 23:35:06 +0000
linbpq (6.0.24.54+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream
* Drop AGW Patch
* Drop Spelling Patch
* Drop Dynamic Links patch
-- Dave Hibberd <hibby@debian.org> Tue, 17 Dec 2024 16:46:05 +0000
linbpq (6.0.24.53+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream
- Patches refreshed
- dropped some edits in ftbfs-gcc14
- dropped d/patches/headers.patch
-- Dave Hibberd <hibby@debian.org> Tue, 03 Dec 2024 00:57:57 +0000
linbpq (6.0.24.52+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream
- Patches happy
-- Dave Hibberd <hibby@debian.org> Sat, 30 Nov 2024 21:47:17 +0000
linbpq (6.0.24.51.1+repack-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
* Iron out an issue with time...
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 19:57:28 +0000
linbpq (6.0.24.51.1+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import after bug report
* Roll back some ftbfs-gcc14 edits
* Remove some more lib headers
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 19:30:22 +0000
linbpq (6.0.24.51+repack-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import
- Patches refreshed
* Upstream is now repacked to include less files
* Big build system review, now using Debian CFLAGS and LDFLAGS
- Hardening enabled, mostly
- A debug symbols package is now available
* Oh yeah, everything is now dynamic linking
- libpng
- libpaho-mqtt
- libjansson
- libminiupnpc
-- Dave Hibberd <hibby@debian.org> Fri, 29 Nov 2024 13:08:38 +0000
linbpq (6.0.24.50-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import
* Files excluded at origtargz generation time for cleanliness
-- Dave Hibberd <hibby@debian.org> Tue, 12 Nov 2024 21:56:38 +0000
linbpq (6.0.24.49-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New Upstream import
* Patches refreshed
* Add mqtt requirements
-- Dave Hibberd <hibby@debian.org> Tue, 05 Nov 2024 21:52:29 +0000
linbpq (6.0.24.45-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* New upstream import
* Patches refreshed
-- Dave Hibberd <hibby@debian.org> Fri, 11 Oct 2024 15:48:41 +0100
linbpq (6.0.24.42-1~hibbian+3) bookworm-hibbian-unstable; urgency=medium
* 32bit build error
- Patch updated to fix hopefully
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 12:21:57 +0100
linbpq (6.0.24.42-1~hibbian+2) bookworm-hibbian-unstable; urgency=medium
* Forgot to fix the ninotnc-smt issue, fixed now
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 12:05:54 +0100
linbpq (6.0.24.42-1~hibbian+1) bookworm-hibbian-unstable; urgency=medium
* Install config to /etc
* New upstream update
* Patches refreshed
* Debian hardening enabled
- 2 new patches created that touch almost every file
- Considered experimental.
- gcc14 builds for Debian Trixie!
-- Dave Hibberd <hibby@debian.org> Fri, 30 Aug 2024 10:15:11 +0100
linbpq (6.0.24.40-1) unstable; urgency=medium
* Fresh upstream release
- Patches refreshed
* Secure by default patch
-- Dave Hibberd <hibby@debian.org> Sun, 07 Jul 2024 16:09:28 +0100
linbpq (6.0.24.38-1) unstable; urgency=medium
* New Upstream
* Tweak config file per recommendation from 2M0MQN to make first start simple
* Bump standards to 4.7.0.0
-- Dave Hibberd <hibby@debian.org> Sun, 09 Jun 2024 22:38:40 +0100
linbpq (6.0.24.34-2) unstable; urgency=medium
* Fix config permissions bug as reported by Alex 2E1PKY
-- Dave Hibberd <hibby@debian.org> Mon, 08 Apr 2024 22:27:02 +0100
linbpq (6.0.24.34-1) unstable; urgency=medium
* Upstream bump
-- Dave Hibberd <hibby@debian.org> Sat, 06 Apr 2024 02:15:28 +0100
linbpq (6.0.24.33-1) unstable; urgency=medium
* Upstream bump
* Moved config file to examples
* Updated service to fail on no config
* Added helpful README.Debian
-- Dave Hibberd <hibby@debian.org> Tue, 26 Mar 2024 20:24:08 +0000
linbpq (6.0.24.30-1) unstable; urgency=medium
* Upstream bump
-- Dave Hibberd <hibby@debian.org> Fri, 23 Feb 2024 23:24:46 +0000
linbpq (6.0.24.29-1) unstable; urgency=medium
* Upstream bump
* Added my new details
* Tidied up some packaging errors
-- Dave Hibberd <hibby@debian.org> Tue, 13 Feb 2024 00:06:33 +0000
linbpq (6.0.24.27-2) unstable; urgency=medium
* Permissions fix for web-config-editor users
-- Dave Hibberd <d@vehibberd.com> Thu, 18 Jan 2024 10:31:56 +0000
linbpq (6.0.24.27-1) unstable; urgency=medium
* New Upstream Release
-- Dave Hibberd <d@vehibberd.com> Tue, 16 Jan 2024 20:51:43 +0000
linbpq (6.0.24.25-1) unstable; urgency=medium
* New Upstream Release
-- Dave Hibberd <d@vehibberd.com> Thu, 28 Dec 2023 10:44:47 +0000
linbpq (6.0.24.22-2) unstable; urgency=medium
* Moved config file home, caused chaos
-- Dave Hibberd <d@vehibberd.com> Sat, 16 Dec 2023 14:40:20 +0000
linbpq (6.0.24.22-1) unstable; urgency=medium
* New Upstream Release
-- Dave Hibberd <d@vehibberd.com> Fri, 08 Dec 2023 12:29:40 +0000
linbpq (6.0.24.16-1) unstable; urgency=medium
* New Upstream release
-- Dave Hibberd <d@vehibberd.com> Tue, 31 Oct 2023 22:50:01 +0000
linbpq (6.0.24.15-2) unstable; urgency=medium
* debian/conffiles introduced to stop linbpq overwriting config files
- Thanks to Mark 2M0IIG for raising concern about this bug!
-- Dave Hibberd <d@vehibberd.com> Sun, 15 Oct 2023 21:45:24 +0100
linbpq (6.0.24.15-1) unstable; urgency=medium
* New upstream release
-- Dave Hibberd <d@vehibberd.com> Tue, 10 Oct 2023 22:19:48 +0100
linbpq (6.0.24.2-1) unstable; urgency=medium
* Initial release.
-- Dave Hibberd <d@vehibberd.com> Mon, 28 Aug 2023 23:20:45 +0100

20
debian/control vendored Normal file
View file

@ -0,0 +1,20 @@
Source: linbpq
Section: hamradio
Priority: optional
Maintainer: Dave Hibberd <hibby@debian.org>
Standards-Version: 4.7.2
Vcs-Browser: https://git.hibbian.org/Hibbian/linbpq
Vcs-Git: https://git.hibbian.org/Hibbian/linbpq.git
Homepage: https://www.cantab.net/users/john.wiseman/Documents/
Build-Depends: debhelper-compat (= 13)
Build-Depends-Arch: libssl-dev, libminiupnpc-dev, libpcap-dev, libconfig-dev, zlib1g-dev, libpaho-mqtt-dev, libjansson-dev, libpng-dev
Rules-Requires-Root: no
Package: linbpq
Architecture: linux-any
Depends: ${shlibs:Depends}, ${misc:Depends}, adduser
Description: Packet node and ax25 stack
LINBPQ is a Linux version of the BPQ32 Node, BBS and Chat Server components.
It is actively developed by John G8BPQ and contains a complete, independent
implementation of ax.25 and net/rom as well as BBS and Chat applications and
can be used either as a packet switch or as a full featured node.

37
debian/copyright vendored Normal file
View file

@ -0,0 +1,37 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: linBPQ
Upstream-Contact: John Wiseman G8BPQ <john.wiseman@cantab.net>
Source: https://www.cantab.net/users/john.wiseman/Documents/
Files-Excluded: *.vcproj* *.bak *.lib *.dll *.wav *.asm *.vcxproj* *.pdb *.exe
.gitignore XAprs zlib.h zconf.h MQTT* pcap.h miniupnpc.h upnpdev.h
igd_desc_parse.h upnpcommands.h upnperrors.h miniupnpctypes.h
*.svn-base *.db *.obj
Files: *
Copyright: 1990-2025 John Wiseman G8BPQ <john.wiseman@cantab.net>
License: GPL-3
Files: debian/*
Copyright: 2016-2025 Dave Hibberd <d@vehibberd.com>
License: GPL-3
Files: debian/linbpq.service
Copyright: 2024-2025 Tom Fanning M0LTE
License: GPL-3
License: GPL-3
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
The GPL License which applies to this package can be found on your Debian
system at /usr/share/common-licenses/GPL-3.

2
debian/dirs vendored Normal file
View file

@ -0,0 +1,2 @@
usr/sbin
opt/oarc/bpq

3
debian/gbp.conf vendored Normal file
View file

@ -0,0 +1,3 @@
[DEFAULT]
debian-branch = hibbian/latest
upstream-branch = upstream/latest

6
debian/gitlab-ci.yml vendored Normal file
View file

@ -0,0 +1,6 @@
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
reprotest:
extends: .test-reprotest-diffoscope

1
debian/install vendored Normal file
View file

@ -0,0 +1 @@
debian/bpq32.cfg etc/

1
debian/linbpq.examples vendored Normal file
View file

@ -0,0 +1 @@
debian/bpq32.cfg

14
debian/linbpq.service vendored Normal file
View file

@ -0,0 +1,14 @@
[Unit]
Description=Linbpq systemd service file
After=network.target
ConditionPathExists=/etc/bpq32.cfg
[Service]
ExecStart=/usr/sbin/linbpq -c /etc -d /opt/oarc/bpq -l /opt/oarc/bpq
WorkingDirectory=/opt/oarc/bpq
Restart=always
User=linbpq
Group=linbpq
[Install]
WantedBy=multi-user.target

11
debian/lintian-overrides vendored Normal file
View file

@ -0,0 +1,11 @@
# weirdness from oarc packaging
linbpq: dir-or-file-in-opt [opt/oarc/]
linbpq: dir-or-file-in-opt [opt/oarc/bpq/]
# i know!
linbpq: no-manual-page [usr/sbin/linbpq]
# Directory is populated on first run
linbpq: package-contains-empty-directory [opt/oarc/bpq/]
# Code convenience
linbpq: spelling-error-in-binary Dont Don't [usr/sbin/linbpq]
linbpq: spelling-error-in-binary Paramters Parameters [usr/sbin/linbpq]
linbpq: spelling-error-in-binary lon long [usr/sbin/linbpq]

57
debian/patches/makefile vendored Normal file
View file

@ -0,0 +1,57 @@
From: Dave Hibberd <hibby@debian.org>
Date: Sat, 20 Sep 2025 15:42:15 +0100
Subject: makefile
---
makefile | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/makefile b/makefile
index 26403e5..0f15cc0 100644
--- a/makefile
+++ b/makefile
@@ -2,8 +2,7 @@
# To exclude i2c support run make noi2c
-OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pngwutil.o\
- pngread.o pngwrite.o png.o pngerror.o pngget.o pngmem.o APRSIconData.o AISCommon.o\
+OBJS = APRSIconData.o AISCommon.o\
upnp.o APRSStdPages.o HSMODEM.o WinRPR.o KISSHF.o TNCEmulators.o bpqhdlc.o SerialPort.o\
adif.o WebMail.o utf8Routines.o VARA.o LzFind.o Alloc.o LzmaDec.o LzmaEnc.o LzmaLib.o \
Multicast.o ARDOP.o IPCode.o FLDigi.o linether.o CMSAuth.o APRSCode.o BPQtoAGW.o KAMPactor.o\
@@ -17,12 +16,12 @@ OBJS = pngwtran.o pngrtran.o pngset.o pngrio.o pngwio.o pngtrans.o pngrutil.o pn
# Configuration:
-#Default to Linux
- CC = gcc
- LDFLAGS = -Xlinker -Map=output.map -lrt
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
+CFLAGS+=$(shell dpkg-buildflags --get CPPFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
-all: CFLAGS = -DLINBPQ -MMD -g -fcommon -fasynchronous-unwind-tables $(EXTRA_CFLAGS)
-all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lm -lz -lpthread -lconfig -lpcap
+all: CFLAGS += -DLINBPQ -MMD -g -rdynamic -fcommon -fasynchronous-unwind-tables
+all: LIBS = -lpaho-mqtt3a -ljansson -lminiupnpc -lrt -lm -lz -lpthread -lconfig -lpcap -lpng
all: linbpq
#other OS
@@ -74,12 +73,11 @@ noi2c: linbpq
linbpq: $(OBJS)
- cc $(OBJS) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
- sudo setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" linbpq
+ $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) $(LIBS) -o linbpq
-include *.d
-clean :
- rm *.d
- rm linbpq $(OBJS)
+install:
+ install -b -m 755 -D -d debian/linbpq/usr/sbin
+ install -b -m 755 -p linbpq debian/linbpq/usr/sbin

2
debian/patches/series vendored Normal file
View file

@ -0,0 +1,2 @@
spelling-fixes.patch
makefile

21
debian/patches/spelling-fixes.patch vendored Normal file
View file

@ -0,0 +1,21 @@
From: Dave Hibberd <hibby@debian.org>
Date: Sat, 20 Sep 2025 15:42:15 +0100
Subject: spelling-fixes
---
UZ7HODrv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/UZ7HODrv.c b/UZ7HODrv.c
index 2adfe12..75e40ee 100644
--- a/UZ7HODrv.c
+++ b/UZ7HODrv.c
@@ -387,7 +387,7 @@ int UZ7HOSetFreq(int port, struct TNCINFO * TNC, struct AGWINFO * AGW, PDATAMESS
if (AGW->CenterFreq == 0)
{
- buffptr->Len = sprintf((UCHAR *)&buffptr->Data[0], "UZ7HO} Invalid Modem Freqency\r");
+ buffptr->Len = sprintf((UCHAR *)&buffptr->Data[0], "UZ7HO} Invalid Modem Frequency\r");
return 1;
}

47
debian/postinst vendored Normal file
View file

@ -0,0 +1,47 @@
#!/bin/sh
set -e
if [ "$1" = configure ]; then
# if ! getent group linbpq >/dev/null; then
# addgroup --system --force-badname linbpq || true
# fi
echo "Creating/updating linbpq user account..."
adduser --system --group --home /opt/oarc/bpq \
--gecos "linbpq system user" --shell /bin/false \
--quiet --disabled-password linbpq || {
# adduser failed. Why?
if getent passwd linbpq >/dev/null ; then
echo "Non-system user linbpq found. I will not overwrite a non-system" >&2
echo "user. Remove the user and reinstall linbpq." >&2
exit 1
fi
# unknown adduser error, simply exit
exit 1
}
if ! id -nGz linbpq | grep -qzxF 'dialout' ; then
adduser linbpq dialout
fi
if ! id -nGz linbpq | grep -qzxF 'plugdev' ; then
adduser linbpq plugdev
fi
chown :linbpq /opt/oarc/bpq
chmod 775 /opt/oarc/bpq
# If we have setcap is installed, set the requirements
# which allows us to install our binaries without the setuid
# bit.
if command -v setcap > /dev/null; then
setcap "CAP_NET_ADMIN=ep CAP_NET_RAW=ep CAP_NET_BIND_SERVICE=ep" /usr/sbin/linbpq
else
echo "Setcap failed on /usr/sbin/linbpq, Features may be limited" >&2
fi
else
echo "Setcap is not installed, Features may be limited" >&2
fi
#DEBHELPER#

14
debian/preinst vendored Normal file
View file

@ -0,0 +1,14 @@
#!/bin/sh
set -e
confile="/etc/bpq32.cfg"
node="/opt/oarc/bpq/bpq32.cfg"
if [ -L $confile ]; then
rm $confile
cp $node $confile
mv $node $node.bak
fi
#DEBHELPER#

6
debian/rules vendored Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
%:
dh $@

1
debian/source/format vendored Normal file
View file

@ -0,0 +1 @@
3.0 (quilt)

0
debian/source/include-binaries vendored Normal file
View file

0
debian/source/lintian-overrides vendored Normal file
View file

3
debian/watch vendored Normal file
View file

@ -0,0 +1,3 @@
version=4
opts="pgpmode=none,dversionmangle=s/\+repack//,repacksuffix=+repack,repack,compression=xz" \
http://127.0.0.1:8000/linbpq-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))

View file

@ -354,6 +354,7 @@ png_write_compressed_data_out(png_structp png_ptr, compression_state *comp)
comp->output_ptr=NULL; comp->output_ptr=NULL;
/* write anything left in zbuf */ /* write anything left in zbuf */
if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size) if (png_ptr->zstream.avail_out < (png_uint_32)png_ptr->zbuf_size)
png_write_chunk_data(png_ptr, png_ptr->zbuf, png_write_chunk_data(png_ptr, png_ptr->zbuf,
png_ptr->zbuf_size - png_ptr->zstream.avail_out); png_ptr->zbuf_size - png_ptr->zstream.avail_out);