aprsc/src
Heikki Hannikainen d49d7bfeb0 Fix potential NULL pointer dereference when checking config 2016-08-13 16:15:43 +03:00
..
debian debian init: Insert -n parameter by default, make instance-specific parameters optional in /etc/default/aprsc 2013-12-28 21:45:31 +02:00
gfx status: Add new, smaller version of logo, with 2x retina version 2016-08-02 20:27:42 +03:00
m4
rpm rpm init file: adjust whitespace 2013-04-17 11:14:56 +03:00
tools coverity: update for new tools version 2016-08-13 16:15:25 +03:00
web aprsc.js: Move language config to beginning of aprsc.js for easier editing 2016-08-13 15:21:40 +03:00
.gitignore gitignore: aprsc.exe as a build product 2013-03-03 22:14:26 +02:00
LICENSE
Makefile.in Add links to translation document 2016-08-13 15:42:48 +03:00
README.sources
VERSION v2.0.20 2016-06-01 23:57:59 +03:00
ac-hdrs.h.in autoconf: check for setenv/putenv 2013-04-19 18:28:52 +03:00
accept.c status: Calculate rates on port listeners 2016-08-02 09:39:40 +03: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
acl.h
aclocal.m4
apparmor.aprsc apparmor: Relax log / data file paths a bit to enable multiple instances 2013-12-28 16:31:26 +02:00
aprsc.8.in
aprsc.c call-home: reduce log level to debug for failed dns lookups 2013-06-24 22:56:19 +03:00
aprsc.conf
aprsc_munin munin plugin: Pull peer serverIDs to peer traffic graph 2012-11-23 10:16:51 +02:00
cJSON.c
cJSON.h
cellmalloc.c Make cellmalloc compile with current clang: replace inline with static 2013-12-22 01:04:07 +02: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 timekeeping: Use clock_gettime CLOCK_MONOTONIC when available 2013-02-19 18:09:15 +02:00
client_heard.h
clientlist.c
clientlist.h
config.c Fix potential NULL pointer dereference when checking config 2016-08-13 16:15:43 +03:00
config.h Config parsing: q_protocol_id config for other non-APRS networks 2016-07-26 15:33:33 +03:00
configure autoconf: check for setenv/putenv 2013-04-19 18:28:52 +03:00
configure.ac autoconf: check for setenv/putenv 2013-04-19 18:28:52 +03: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 timekeeping: Use clock_gettime CLOCK_MONOTONIC when available 2013-02-19 18:09:15 +02:00
dupecheck.h
errno.c ssl: Validate uplink's certificate too 2013-03-07 23:25:01 +02:00
errno.h ssl: Validate uplink's certificate too 2013-03-07 23:25:01 +02:00
filter.c Fix a parsing bug with long repeated filters 2016-06-01 23:56:34 +03:00
filter.h
gai_strerror.c
getnameinfo.c
historydb.c Silence a compiler warning (extra ()) 2013-12-22 01:01:15 +02:00
historydb.h historydb: Check for file i/o errors when dumping db (live upgrade) 2013-03-14 18:30:38 +02: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 http: Free old language list when reconfiguring 2016-08-13 16:09:52 +03:00
http.h
incoming.c incoming/worker: New error code q_disallow_protocol for invalid Q protocol IDs 2016-07-26 15:36:23 +03: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 UDP submit, packet rejections: log them as UDP submit instead of HTTP POST rejections 2015-09-06 12:39:18 +03: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
messaging.h
netdb6.h
netlib.c
netlib.h
outgoing.c outgoing packets: account SCTP right 2013-04-26 18:14:15 +03: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
rwlock.c
rwlock.h
sctp.c Fix SCTP compiling on freebsd, really. 2013-08-08 20:02:13 +03:00
sctp.h SCTP: Subscribe to more socket notifications. Log incoming address 2013-04-30 19:14:20 +03:00
ssl.c Disable NGX_SSL_SSLv3 2015-09-06 14:30:42 +03:00
ssl.h Added a handler_client_writable handler, reduced conditionals 2013-04-13 15:09:21 +03:00
status.c Export q_protocol_id in status.json 2016-07-26 22:11:41 +03:00
status.h Fix new time handling to get uptime right, and convert client 2013-02-21 00:29:29 +02:00
uplink.c Move client sockopt setting to worker.c, set the same TCP socket options for 2013-04-30 19:13:45 +03:00
uplink.h
version.c Moved version number to a single file (VERSION) to ease up 2013-06-26 07:53:29 +03: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 status: Fix corepeer summaries by giving an unique dummy negative fd number 2016-08-02 10:34:21 +03:00
worker.h incoming/worker: New error code q_disallow_protocol for invalid Q protocol IDs 2016-07-26 15:36:23 +03:00
xpoll.c coverity: xpoll epoll: Check fcntl return value, log error as necessary 2013-02-02 19:40:04 +02:00
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.

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)