Commit Graph

107 Commits

Author SHA1 Message Date
Heikki Hannikainen 4622369bb7 coverity: Fix a small logging bug (only log app name/ver if it's present)
Removed a lot of #ifdefs by using static username/version/addr vars always.
2013-02-03 19:06:43 +02:00
Heikki Hannikainen ed37f32189 Classify clients only when they have logged in. Use classification
presence to determine if packets should be sent in outgoing.c, which
saves one more condition check for login status for every packet.
2013-02-01 07:33:04 +02:00
Heikki Hannikainen 033d40288f worker: Only raise an alert about internal packet drops if more than
24 packets were dropped within 24 hours.
2013-01-16 14:20:45 +02:00
Heikki Hannikainen 809691aa3d Slightly optimize the most frequently called function, heard_find()
Moved repeated key hash calculation out to the filter preprocess
phase. Moved heard list expiration to be done once per 2 minutes,
instead of every time. 32 hash buckets instead of 16. Less function
arguments.
2012-11-15 22:05:14 +02:00
Heikki Hannikainen 2c07863b25 Account TCPXX unverified packets separately (disallow_unverified_path) 2012-11-12 22:57:13 +02:00
Heikki Hannikainen 45d807d20f Implemented "quirks mode" for buggy unmaintained blacklisted clients.
Initially contains only HR-IXPWIND / Haute Networks HauteWIND.
It transmits LF NUL for line termination instead of CR LF. Enabled
quirks mode for the client, and made it strip spaces and NULs
from beginning of packets.
2012-11-12 22:17:12 +02:00
Heikki Hannikainen 0e7ea413b3 Q construct drops: Account them separately for better drop reason reporting 2012-11-01 01:08:07 +02:00
Heikki Hannikainen 2e6fe52daf dupecheck/acconting/web: Count duplicate packets per client and listener 2012-10-29 20:34:25 +02:00
Heikki Hannikainen 7ed64ed294 Live upgrade: Put clients in correct state and attach to the right listener 2012-10-19 10:54:40 +03:00
Heikki Hannikainen f45ab9194a Initial set of changes to facilitate live upgrades
Save status to a JSON file, execute self without disconnecting
clients. Initialize in a slightly special way.
2012-10-19 01:08:08 +03:00
Heikki Hannikainen c202e81508 Report more thruthful error message for client/uplink quits 2012-10-14 02:31:48 +03:00
Heikki Hannikainen f5a4298292 outgoing/worker: Classify upstreams/peers in their own list 2012-10-12 02:49:52 +03:00
Heikki Hannikainen 9cb21af856 outgoing/worker: classify read-only clients to their own list 2012-10-12 02:33:46 +03:00
Heikki Hannikainen 18b7dc4320 worker/outgoing: Classify dupeclients in a separate list
so that we don't need to walk through all clients when looking
for dupeclients. Optimisation starting point: will classify
other types of clients in their own lists.
2012-10-12 02:22:07 +03:00
Heikki Hannikainen 905cdfff26 Implemented a global MaxClients setting (default 500).
Limits the total amount of logged-in clients, not counting
peers or uplinks, and UDP clients are only included once for the
TCP/SCTP control connection.
Added check for MaxClients being < FileLimit - 50, so that file
descriptors are reserved for Uplinks and file IO.
2012-10-10 10:10:56 +03:00
Heikki Hannikainen eef48259ce incoming: validate all callsigns in digi path to not contain junk,
allow alphanumeric, '-', and '*' only in the end.
(test case updated, in 11misc-drops.t)
2012-10-08 10:11:49 +03:00
Heikki Hannikainen 32c3b4443e incoming: Validate source and destination callsigns better
by checking for invalid control characters, not just length
(using the common "valid Q construct entry" check)
2012-10-08 09:27:56 +03:00
Heikki Hannikainen ca96f895e0 Drop general queries (?APRS?), since they cause reply floods.
Commit includes test case within the misc-drops test.
2012-10-01 00:12:28 +03:00
Heikki Hannikainen 8d57b7d901 Web: Implemented a popup to show RX packet error classifications
with nice description strings.
Added some comments in the C source code, too.
2012-09-30 13:57:23 +03:00
Heikki Hannikainen 7893cdcfb1 Collect dropped input packet reason code counters for clients,
listeners and protocols, and put the counter arrays in the status
JSON.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@858 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-09-15 07:56:29 +00:00
Heikki Hannikainen 40e3233bce Uplink: Fix bug where a new client connecting happening very, very quickly
after new uplink connection could cause the uplink socket to be lost and
uplink not being logged in & processed.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@825 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-09-06 16:13:26 +00:00
Heikki Hannikainen 44908bf1b8 some more static keywords around, and added comments
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@804 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-09-02 09:56:22 +00:00
Heikki Hannikainen 691818cd1b reconfigure: fixes for core peer reconfiguration
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@803 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-09-02 09:31:21 +00:00
Heikki Hannikainen 8f12ab7bfc client_heard: Use a hash table for quicker lookups
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@735 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-28 16:56:51 +00:00
Heikki Hannikainen 7bf0500a50 implemented UDP submit support
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@727 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-28 07:05:32 +00:00
Heikki Hannikainen 452b7f10f8 First baby steps towards udpsubmit sockets
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@724 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-27 20:16:29 +00:00
Heikki Hannikainen 0ee342d056 Do not permit logging in with a callsign which has non-alphanumeric
characters. Sanitize version and filter strings to remove control
characters.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@721 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-27 15:56:25 +00:00
Heikki Hannikainen 6c98fb1c8f Version 0.5.2:
User PTHREAD_MUTEX_RECURSIVE mutex for worker's clients_mutex so that the
mutex will not be unlocked early on Linux.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@643 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-16 13:53:41 +00:00
Heikki Hannikainen dc3fa5d3a5 Removed uplink simulator code
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@630 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-14 15:11:24 +00:00
Heikki Hannikainen f101105413 Removed unused elements from client structure
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@610 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-07 16:25:29 +00:00
Heikki Hannikainen 9a86f86c32 Extra tests and logging tuning to catch old packets
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@607 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-07 07:26:57 +00:00
Heikki Hannikainen e5fbb98be5 Version 0.3.3.
parse_aprs: identify 3rd party packets (although they are dropped
already before this point).


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@597 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-05 08:12:54 +00:00
Heikki Hannikainen 2bdf68caca store 32 characters of app version instead of 16
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@594 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-08-04 13:23:50 +00:00
Heikki Hannikainen ba0b10ebd1 Do not show clients connected to hidden ports in the clist list.
Show "+UDP" in address for clients which have UDP downstream enabled.
Fix UDP port accounting for the listener ports.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@554 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-31 16:54:35 +00:00
Heikki Hannikainen 0d14b61c36 smaller output buffers, and document the reason well
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@546 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-30 22:07:42 +00:00
Heikki Hannikainen 26881bb247 Messaging fix: route messages destined to the logged-in username/callsign,
even before a position packet has been transmitted by that call.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@543 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-30 17:43:06 +00:00
Heikki Hannikainen 1fd38feb99 Fixed UDP received packets accounting
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@535 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-30 10:09:06 +00:00
Heikki Hannikainen 540a73f827 Fix tcp total tx bytes accounting to show the right value
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@533 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-30 08:01:57 +00:00
Heikki Hannikainen 58fd0eb022 FreeBSD support: Store address family in a few places together with the
port number in order to properly support listening separately on both
IPv4 and IPv6 on the same port, and still having working UDP client support.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@517 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-29 15:23:03 +00:00
Heikki Hannikainen ec45f00112 http: incoming packet size limits checked
Prepare for allocating a worker structure for the http thread.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@513 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-29 08:36:45 +00:00
Heikki Hannikainen 884b88640b Implemented working core peer UDP tx/rx. Max 16 peers, fixed with a #define.
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@502 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-26 18:03:03 +00:00
Heikki Hannikainen c0307992ef Working UDP core peer transmit support (receiving doesn't work yet).
Classify incoming packets as coming in from a downstream client,
or an upstream server/core peer. Use the bit to avoid passing data
between upstreams.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@496 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-25 20:04:43 +00:00
Heikki Hannikainen 1be93848c9 Some initial work towards UDP core peergroups
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@495 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-25 06:02:32 +00:00
Heikki Hannikainen 5bdfb2df67 expose tcp/udp bytes and packets counters
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@487 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-07-11 13:55:17 +00:00
Heikki Hannikainen af75c35d06 status json: Don't use a cached version when writing it to a file.
status json: Display worker thread status a bit.

worker: When shutting down, check for incoming queue consistency
and log errors.

pbuf expiration: expire quickly, in about 10 seconds, to survive
heavy load testing. We don't need them since we don't support history
dumps, right?

Enabled a bunch of debug logs for now.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@480 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-06-28 07:17:58 +00:00
Heikki Hannikainen 891b1afe99 Implemented configurable client login timeout, defaults at 30 seconds
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@464 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-06-19 20:33:04 +00:00
Heikki Hannikainen 72081bd142 Export and display accounting data for port listeners.
git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@463 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-06-19 16:20:08 +00:00
Heikki Hannikainen f5f61e22ef Filter preprocessor: Check (with relative efficiency) if packet's path
contains TCPIP*. If it's present, set flag F_HAS_TCPIP, and pass packets
from TCPIP stations to clients having heard that same station before.
Also added a test for this case in 40messaging.t


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@462 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-06-19 15:46:10 +00:00
Heikki Hannikainen 726d6f71ed Use gcc atomic __sync_fetch_and_add operations to increment statistics counters.
Added client counters for rxqdrops (Q algorithm drops), and rxparsefails
(plain APRS-IS packet parsing fails). Put counters in JSON and web stats.
Put historydb stats counters in JSON too.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@451 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-06-13 19:32:45 +00:00
Heikki Hannikainen be455b4470 Rework client states a bit, add a few states.
Do send packets to RW upstream servers (it didn't before).
Status JSON: add upstream server modes to JSON.


git-svn-id: http://repo.ham.fi/svn/aprsc/trunk@423 3ce903b1-3385-4e86-93cd-f9a4a239f7ac
2012-06-07 18:09:03 +00:00