From 0fceb64d25ff3d9586549bb43d971c5eef904330 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 7 Jun 1999 10:23:42 +0200 Subject: Import ax25-apps 0.0.1 from tarball --- ax25rtd/Makefile.am | 25 ++ ax25rtd/Makefile.in | 342 ++++++++++++++++++++++++ ax25rtd/README | 268 +++++++++++++++++++ ax25rtd/TODO | 10 + ax25rtd/ax25rtctl.c | 437 ++++++++++++++++++++++++++++++ ax25rtd/ax25rtd.c | 233 ++++++++++++++++ ax25rtd/ax25rtd.conf | 82 ++++++ ax25rtd/ax25rtd.h | 163 ++++++++++++ ax25rtd/cache_ctl.c | 330 +++++++++++++++++++++++ ax25rtd/cache_dump.c | 141 ++++++++++ ax25rtd/config.c | 736 +++++++++++++++++++++++++++++++++++++++++++++++++++ ax25rtd/listener.c | 579 ++++++++++++++++++++++++++++++++++++++++ 12 files changed, 3346 insertions(+) create mode 100644 ax25rtd/Makefile.am create mode 100644 ax25rtd/Makefile.in create mode 100644 ax25rtd/README create mode 100644 ax25rtd/TODO create mode 100644 ax25rtd/ax25rtctl.c create mode 100644 ax25rtd/ax25rtd.c create mode 100644 ax25rtd/ax25rtd.conf create mode 100644 ax25rtd/ax25rtd.h create mode 100644 ax25rtd/cache_ctl.c create mode 100644 ax25rtd/cache_dump.c create mode 100644 ax25rtd/config.c create mode 100644 ax25rtd/listener.c (limited to 'ax25rtd') diff --git a/ax25rtd/Makefile.am b/ax25rtd/Makefile.am new file mode 100644 index 0000000..b804faa --- /dev/null +++ b/ax25rtd/Makefile.am @@ -0,0 +1,25 @@ + +etcfiles = ax25rtd.conf +etcdir = $(sysconfdir)/ax25 + +installconf: + $(mkinstalldirs) $(DESTDIR)$(etcdir) + @list='$(etcfiles)'; for p in $$list; do \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etcdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(etcdir)/$$p; \ + done + +sbin_PROGRAMS = ax25rtd ax25rtctl + +LDADD = $(AX25_LIB) + +EXTRA_DIST = $(etcfiles) + +ax25rtd_SOURCES = \ + ax25rtd.c \ + ax25rtd.h \ + cache_ctl.c \ + cache_dump.c \ + config.c \ + listener.c + diff --git a/ax25rtd/Makefile.in b/ax25rtd/Makefile.in new file mode 100644 index 0000000..8925278 --- /dev/null +++ b/ax25rtd/Makefile.in @@ -0,0 +1,342 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +AWK = @AWK@ +AX25_LIB = @AX25_LIB@ +CC = @CC@ +DLLTOOL = @DLLTOOL@ +LD = @LD@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAKEINFO = @MAKEINFO@ +NCURSES_LIB = @NCURSES_LIB@ +NM = @NM@ +OBJDUMP = @OBJDUMP@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +VERSION = @VERSION@ + +etcfiles = ax25rtd.conf +etcdir = $(sysconfdir)/ax25 + +sbin_PROGRAMS = ax25rtd ax25rtctl + +LDADD = $(AX25_LIB) + +EXTRA_DIST = $(etcfiles) + +ax25rtd_SOURCES = ax25rtd.c ax25rtd.h cache_ctl.c cache_dump.c config.c listener.c + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(sbin_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +ax25rtd_OBJECTS = ax25rtd.o cache_ctl.o cache_dump.o config.o \ +listener.o +ax25rtd_LDADD = $(LDADD) +ax25rtd_DEPENDENCIES = +ax25rtd_LDFLAGS = +ax25rtctl_SOURCES = ax25rtctl.c +ax25rtctl_OBJECTS = ax25rtctl.o +ax25rtctl_LDADD = $(LDADD) +ax25rtctl_DEPENDENCIES = +ax25rtctl_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = README Makefile.am Makefile.in TODO + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(ax25rtd_SOURCES) ax25rtctl.c +OBJECTS = $(ax25rtd_OBJECTS) ax25rtctl.o + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps ax25rtd/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-sbinPROGRAMS: + +clean-sbinPROGRAMS: + -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) + +distclean-sbinPROGRAMS: + +maintainer-clean-sbinPROGRAMS: + +install-sbinPROGRAMS: $(sbin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sbindir) + @list='$(sbin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-sbinPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(sbin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(sbindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +ax25rtd: $(ax25rtd_OBJECTS) $(ax25rtd_DEPENDENCIES) + @rm -f ax25rtd + $(LINK) $(ax25rtd_LDFLAGS) $(ax25rtd_OBJECTS) $(ax25rtd_LDADD) $(LIBS) + +ax25rtctl: $(ax25rtctl_OBJECTS) $(ax25rtctl_DEPENDENCIES) + @rm -f ax25rtctl + $(LINK) $(ax25rtctl_LDFLAGS) $(ax25rtctl_OBJECTS) $(ax25rtctl_LDADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = ax25rtd + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +ax25rtctl.o: ax25rtctl.c ../config.h ../pathnames.h +ax25rtd.o: ax25rtd.c ../pathnames.h ax25rtd.h +cache_ctl.o: cache_ctl.c ax25rtd.h +cache_dump.o: cache_dump.c ax25rtd.h +config.o: config.c ../pathnames.h ax25rtd.h +listener.o: listener.c ../pathnames.h ax25rtd.h + +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-sbinPROGRAMS +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-sbinPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(sbindir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-sbinPROGRAMS mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-sbinPROGRAMS clean-compile clean-libtool clean-tags \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-sbinPROGRAMS distclean-compile \ + distclean-libtool distclean-tags distclean-generic \ + clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-sbinPROGRAMS \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS \ +clean-sbinPROGRAMS maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \ +install-sbinPROGRAMS mostlyclean-compile distclean-compile \ +clean-compile maintainer-clean-compile mostlyclean-libtool \ +distclean-libtool clean-libtool maintainer-clean-libtool tags \ +mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ +distdir info-am info dvi-am dvi check check-am installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +installconf: + $(mkinstalldirs) $(DESTDIR)$(etcdir) + @list='$(etcfiles)'; for p in $$list; do \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etcdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(etcdir)/$$p; \ + done + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/ax25rtd/README b/ax25rtd/README new file mode 100644 index 0000000..a7bf2c4 --- /dev/null +++ b/ax25rtd/README @@ -0,0 +1,268 @@ +***************************************************************** +* Please send all comments and suggestions regarding ax25rtd to * +* Klaus Kudielka (oe1kib@oe1xtu.ampr.org). * +***************************************************************** + +Just a quick small README... +This will hopefully go into the man pages ASAP. + +Ax25routed +---------- + +/usr/sbin/ax25rtd + +This is a daemon that: + +- emulates the ceased "autorouter" of Linux Kernel AX.25 +- sets up ARP entries automagically +- may adjust IP routes and encapsulation mode + (although I really do not recomment to use this feature...) + +The "autorouter" is not really an autorouter. It just listens to the AX.25 +traffic on your ports and uses this information to setup AX.25 routes. This +can be turned on or off by altering the configuration file +/etc/ax25/ax25rtd.conf. + +Ax25routed provides a socket /var/ax25/ax25rtd/control which is used for +runtime maintainance through ax25rtctl or to set up new routes by other +daemons (a Flexnet router, perhaps?) + +On startup ax25rtd reads the configuration file and afterwards preloads +the caches from the files /var/ax25/ax25rtd/ax25_routes and +/var/ax25/ax25rtd/ip_routes. On SIGTERM or ax25rtctl --save it saves the +caches to those files. + +ax25rtd.conf +--------------- + +The file /etc/ax25/ax25rtd.conf is the configuration file for ax25rtd. +The parameters of the options shown here are the default values except the +ones marked with (example) + +ax25-maxroutes 256 +ip-maxroutes 256 + + The maximum size of the three lists / caches. On overflow, + ax25rtd will substitute the oldest entry with the new one. +[1k2] + This marks the beginning of per-port definitions. Note that + you have to use port names as defined in axports(5) here, + anywhere else you may use the port or the device name. + +ax25-learn-routes no + + Set this to "yes", ax25rtd will add the routing information + for every heard frame (with complete digipeater path) to the + kernel AX.25 routing table. Note that ax25rtd's internal cache + will be updated anyway, regardless of this option. + +ax25-learn-only-mine no + + If you set it to "yes", only frames that are sent to (1) the + interface callsign, (2) any of the listeners on this device, or + (3) the callsigns specified by ax25-more-mycalls will be used + to update the internal cache and (depending on + ax25-learn-routes) the kernel routing table. + +ax25-add-path db0ach (example) + + This is useful on DAMA digipeaters. In this case, the DAMA + master has to be used for _every_ AX.25 connection, thus + ax25rtd will add this digipeater(s) to every target we learn + that has no digipeater path (yet). "db0ach" is just an + example here. + +ax25-more-mycalls dl1bke dl1bke-8 (example) + + You can specify more calls as calls here that belong to + this interface... "dl1bke" and "dl1bke-8" are examples. + +ip-learn-routes no + + If set to "yes", ax25rtd will modify the IP routing table if it + receives an IP frame (directed to us). This is dangerous! + + It should not screw up your routing table, though. Ax25rtd + recognizes the netmask of the device and will adjust the route + only if it fits the netmask and the old route points to + one of the devices ax25rtd knows about (hence an AX.25 device). + + The problems begin if you have more than one port and a user + is able to hear your outgoing traffic on at least two of them. + Due to technical reasons ax25rtd adjusts the route _after_ the + kernel has sent the reply to the received TCP frame already. + This has technical reasons. + + If the remote does the same both are switching between the two + ports. + + Don't use this feature unless you know what you are doing. + + It _should_ be safe do enable this on one-port machines, although + I strongly recommend to set a network route instead, i.e.: + + route add -net 44.0.0.0 scc3 + + Note that ax25rtd's internal cache will be updated anyway, + regardless of this option. + +irtt + + If ip-learn-routes is enabled this will assign newly added + routes an initial round trip time (IRTT) for TCP. + is measured in msec, hence + + irtt 10000 + + sets the irtt to 10 seconds. A value of 0 disables this + feature (default). + +ip-adjust-mode no + + If you set this option to "yes" ax25rtd will change the IP + encapsulation mode according to the last received IP frame. + + The problem with this option is that the kernel AX.25 sends + a received IP frame to the IP layer regardless if it was + sent in UI frame encapsulation "mode datagram (dg)" or + in I frame encaps, hence in an AX.25 connection, "mode virtual + connect (vc)". The Linux kernel will respond to this frame + before ax25rtd can adjust the mode. If the remote does the + same... You get the picture. + + Don't use this feature unless you know what you are doing. + +arp-add no + + This option, if set to "yes", changes the ARP table to the + source callsign of the received frame. It should be harmless, + just has the the effect that if it is a new entry, the Linux + ARP code will send one ARP request before ax25rtd has adjust + the ARP table. If there was already an existing ARP entry + for this IP route, one IP datagram will be sent to the old + address. Not really a problem, I hope. + + +Ax25rtctl +--------- + +/usr/sbin/ax25rtctl