aprsc/src
Heikki Hannikainen 79b6c3eb0f v2.1.13 2022-11-02 01:09:12 +02:00
..
debian debian: Add dependencies for libsctp 2022-10-23 19:32:34 +03:00
gfx status: Add new, smaller version of logo, with 2x retina version 2016-08-02 20:27:42 +03:00
m4
rpm rpm: Add /opt/aprsc/sbin/aprsc-prepare-chroot.sh 2020-09-06 22:02:21 +03:00
tools coverity: update for new tools version 2016-08-13 16:15:25 +03:00
web status: Indicate SCTP connections and listeners in status web 2022-10-23 19:32:34 +03:00
.gitignore gitignore: aprsc.exe as a build product 2013-03-03 22:14:26 +02:00
LICENSE
Makefile.in tls: Rename ssl.c to tls.c 2022-10-25 02:03:24 +03:00
README.sources README.sources: + sctp.c, ssl.c 2022-10-23 19:32:34 +03:00
VERSION v2.1.13 2022-11-02 01:09:12 +02:00
ac-hdrs.h.in autoconf: check for setenv/putenv 2013-04-19 18:28:52 +03:00
accept.c coverity: Fix format string bugs in logging 2022-11-01 23:35:57 +02:00
accept.h Issue #24 fixed: Display server-side default filters on status page for clients 2013-12-18 23:43:59 +02:00
acl.c Fix a couple of small memory leaks, which may happen in error cases when loading configuration 2016-08-13 16:30:55 +03:00
acl.h
aclocal.m4
apparmor.aprsc Fix live upgrade on newer distros, apparmor must allow read to /opt/aprsc/usr/lib/** 2019-08-13 13:20:55 +00:00
aprsc-prepare-chroot.sh Initial implementation of systemd service file, with chroot support, single instance only 2020-09-06 09:55:45 +03:00
aprsc.8.in
aprsc.c coverity: Fix format string bugs in logging 2022-11-01 23:35:57 +02:00
aprsc.conf
aprsc_munin
cJSON.c Bumping cJSON to 1.3.1 2017-02-27 09:28:20 +02:00
cJSON.h Bumping cJSON to 1.3.1 2017-02-27 09:28:20 +02:00
cellmalloc.c cellmalloc: Do not allocate new cell blocks if CELLBLOCKS_MAX is reached 2022-05-08 00:12:19 +03:00
cellmalloc.h
cfgfile.c cfgfile: do_char config parsing for single-character options 2016-07-26 15:31:38 +03:00
cfgfile.h cfgfile: do_char config parsing for single-character options 2016-07-26 15:31:38 +03:00
client_heard.c client_heard: Limit per-client heard list to 2000 entries 2020-09-07 22:18:28 +03:00
client_heard.h
clientlist.c
clientlist.h
config.c coverity: Fix format string bugs in logging 2022-11-01 23:35:57 +02:00
config.h tls: Rename ssl.c to tls.c 2022-10-25 02:03:24 +03:00
configure configure: Build with TLS enabled by default 2022-11-01 20:25:15 +02:00
configure.ac configure: Build with TLS enabled by default 2022-11-01 20:25:15 +02:00
counterdata.c counterdata: Fix time base to real time when exporting JSON graph data 2013-02-25 22:08:16 +02:00
counterdata.h
dupecheck.c dupecheck: Remove unused variables 2022-11-01 23:35:57 +02:00
dupecheck.h Skip maintaining filter wx and entrycall tables if no filtered listeners enabled 2020-09-06 15:01:42 +03:00
errno_aprsc.c Rename errno.[ch] to errno_aprsc.[ch] to reduce confusion with system errno.h 2017-03-17 09:23:08 +02:00
errno_aprsc.h Rename errno.[ch] to errno_aprsc.[ch] to reduce confusion with system errno.h 2017-03-17 09:23:08 +02:00
filter.c coverity: Fix some uninitialized variables 2022-11-01 23:35:57 +02:00
filter.h Skip maintaining filter wx and entrycall tables if no filtered listeners enabled 2020-09-06 15:01:42 +03:00
gai_strerror.c
getnameinfo.c
historydb.c historydb: Fix valgrind builds 2021-09-01 21:15:14 +00:00
historydb.h historydb: Do not store a copy of the packet. Save a lot of memory. 2020-09-07 21:42:30 +03:00
hlog.c hlog_write: Deal with very long log lines. 2016-05-09 00:24:52 +03:00
hlog.h Logging: Only use file logging by default on windows 2013-03-03 20:01:01 +02:00
hmalloc.c
hmalloc.h
http.c coverity: Fix some uninitialized variables 2022-11-01 23:35:57 +02:00
http.h
incoming.c incoming: Remove a few unnecessary initializations 2022-10-31 19:05:43 +02:00
incoming.h New config option DisallowLoginCall to reject logins by glob match 2015-09-06 11:51:36 +03:00
inet_ntop.c
inet_pton.c
install-sh
keyhash.c keyhash: Removed duplicate const keyword (silence compiler warning: clang) 2013-12-22 01:05:42 +02:00
keyhash.h
login.c coverity: Fix format string bugs in logging 2022-11-01 23:35:57 +02:00
login.h UDP submit, packet rejections: log them as UDP submit instead of HTTP POST rejections 2015-09-06 12:39:18 +03:00
messaging.c Add coverity warning squelching for perfectly safe random() calls 2016-08-15 20:07:23 +03:00
messaging.h
netdb6.h
netlib.c
netlib.h
outgoing.c coverity: Fix format string bugs in logging 2022-11-01 23:35:57 +02:00
outgoing.h
parse_aprs.c Allow t/w filter to match stations with an overlay character on their symbol 2015-08-30 20:24:03 +03:00
parse_aprs.h
parse_qc.c More accurate debug log message for qAZ 2016-07-26 16:15:31 +03:00
parse_qc.h
passcode.c
passcode.h
random.c urandom_alphanumeric: Better distribution when using random() 2022-02-09 23:37:09 +02:00
random.h Move random string generation to random.c 2022-02-09 23:34:48 +02:00
rwlock.c
rwlock.h
sctp.c accounting: Optimize CPU use of tx/rx accounting counters 2022-10-31 19:04:01 +02:00
sctp.h SCTP: Subscribe to more socket notifications. Log incoming address 2013-04-30 19:14:20 +03:00
status.c coverity: Fix format string bugs in logging 2022-11-01 23:35:57 +02:00
status.h Fix new time handling to get uptime right, and convert client 2013-02-21 00:29:29 +02:00
tls.c tls: Make it build with openssl < 1.1 2022-11-02 00:35:01 +02:00
tls.h tls: Rename ssl.c to tls.c 2022-10-25 02:03:24 +03:00
uplink.c uplink: Fix building on older GCC 2022-11-01 23:08:03 +00:00
uplink.h
version.c version: Use 'tls' in features string instead of 'ssl' 2022-11-01 08:49:52 +02:00
version.h Moved version number to a single file (VERSION) to ease up 2013-06-26 07:53:29 +03:00
version_branch.h
worker.c coverity: Fix format string bugs in logging 2022-11-01 23:35:57 +02:00
worker.h accounting: Optimize CPU use of tx/rx accounting counters 2022-10-31 19:04:01 +02:00
xpoll.c
xpoll.h

README.sources

This file attempts to describe the contents of the aprsc
source tree. When adding files, please describe them here. Thanks!

aprsc.c
	Contains a command line parser, the main signal handler, and
	a small main loop, which only calls time() to update a global
	"now" variable (to reduce the amount of system calls). At startup
	it reads the configuration and starts up the accept thread,
	which in turns starts worker threads. It can also trigger
	reconfiguring and log reopening on when signals are received,
	and start a graceful shutdown.

accept.c
	Contains the accept thread, which listens on the configured TCP/UDP
	sockets, accepts (or denies) new connections, and passes them
	to the worker thread with least existing connections. When
	a lot of connections arrive quickly, multiple connections
	are transferred to a worker in a single transaction to reduce
	lock congestion.

worker.c
worker.h
	Contains the body of the worker thread. worker.h defines most
	of the interesting data structures and is a good place to
	start digging.
	
	Worker threads process incoming and outgoing data. There are 1..n
	workers, where N is 1 to 4 (more really doesn't make sense at this
	point, and 1 is probably good too). Incoming data is parsed,
	preprocessed, and passed on to the dupecheck thread which
	marks duplicate packets as such. Dupecheck returns the packets to
	the workers which then pass on them to the right clients.

ssl.c
	SSL/TLS encryption and authentication code for APRS-IS sockets.

sctp.c
	SCTP protocol support.  sctp(7) says: "Like TCP, SCTP provides
	reliable, connection oriented data delivery with congestion control. 
	Unlike TCP, SCTP also provides message boundary preservation,
	ordered and unordered message delivery, multi-streaming and
	multi-homing."

login.c
	Contains a login_handler() function which is called by the
	worker thread to process an incoming "user" command from
	a new client.

uplink.c
	The uplink management thread takes care of connecting to
	remote upstream servers as needed. It also contains the handlers
	necessary for logging in to a server. After a successful connect()
	the connection is passed to a worker thread, but the login
	handshake incoming data handlers for the login phase can be found
	in uplink.c.

incoming.c
	Contains the incoming_handler() function which is called
	by the worker thread to process incoming APRS-IS data
	line by line. Decodes basic IS packet format and calls
	the Q construct processor and the APRS decoder.

outgoing.c
	Checks which outgoing packets should be sent to each client by
	calling filter functions, and does the actual sending.

filter.c
	APRS-IS filter used by the outgoing packet processing.
	It tells if the packet should be sent out on given client socket,
	depending on the user's preferences.

parse_aprs.c
	A simple APRS parser for aprsc. Translated from Ham::APRS::FAP
	perl module (by OH2KKU). Only needs to get lat/lng out of the
	packet, and classify the type of the packet, other features would
	be unnecessary in this application, and slow down the parser.
	Called by incoming.c.

parse_qc.c
	Parses and possibly generates a new Q construct, or modifies
	an existing one. Called by incoming.c.

messaging.c
	Contains utility functions for processing received APRS text
	messages and generating new messages.

clientlist.c
	Clientlist contains a list of connected clients, along with their
	verification status. It is updated when clients connect or disconnect,
	and lookups are made more often by the Q construct algorithm.
	
	This list is maintained so that the login handler can find duplicate
	verified logins, and that the Q construct handler can lookup
	verified logins without locking and walking the other worker thread's
	client list.

client_heard.c
	The client's heard list contains a list of stations heard by
	a given client. It's used for message routing by the
	message destination callsign.
	
	The module also maintains a list of callsigns which have transmitted
	messages to a given client. The list is used to pass courtesy
	positions to the client.
	
	The heard list is only called by the worker thread operating
	on that client socket, so it shouldn't need any locking at all.

config.c
	Code to read (and reread) configuration using the services
	provided by cfgfile.c. Validates configuration and takes
	it into use. Contains global configuration variables.

http.c
	HTTP server implemented using libevent2. Runs in a single thread,
	event-driven, provides access to the status page and HTTP
	position uploads.

--- Libraries ---

The following source code files have rather clean APIs, are not specific to
to the aprsc project, and are usablein other projects as such.

netlib.c
	A few network socket utility functions.

xpoll.c
	A wrapper for different select/poll/epoll implementations.
	Currently only contains support for poll(). Should maybe
	support select() for ancient systems. The following platform-
	specific APIs would provide improved performance: epoll()
	on Linux 2.6, kqueue on new *BSD, /dev/poll on new Solaris
	releases. Written for the aprsc project by Heikki Hannikainen,
	OH7LZB.

passcode.c
	aprs_passcode() function to calculate the checksum used as the
	"password" int the APRS-IS login command. Released to the
	open source APRS community by Steve Dimse, K4HG, on April 11,
	2000. Obtained from the aprsd sources, which are GPL.

acl.c
	Access list code for limiting server access based on IP address.

hlog.c
	A logging library written by Heikki Hannikainen, OH7LZB,
	for some old project. Supports logging to syslog, stderr,
	and a log file, with configurable log levels and rotation
	(reopen on SIGHUP).
	
hmalloc.c
	malloc/realloc/free/strdup wrappers with error checking.
	Please use these in this project. Written by Hessu, OH7LZB.

cfgfile.c
	A configuration file parser written by Tomi Manninen, OH2BNS,
	originally for the node(1) program in the ax25-utils package.

keyhash.c
	Various attempts at keyhashing.
	Contains algorithms:
	  - FNV-1a
	  - CRC32
	Currently using FNV-1a

rwlock.c
	A schoolbook pthread rwlock implementation for systems
	lacking one (Solaris 2.6 to name one).
	From the book "Programming with POSIX Threads", by
	David R. Butenhof. Appears in modified and GPL'ed form in at
	least the Bacula sources.

inet_ntop.c, inet_pton.c, getnameinfo.c, gai_strerror.c:
	Backup instances of IPv4/IPv6 agnostic resolver library just
	in case the operating system does not have it.
	(From ZMailer by Matti Aarnio, OH2MQK)