From: Ralph Ronnquist Date: Mon, 19 Apr 2021 09:41:58 +0000 (+1000) Subject: lintian fixup for unstable release X-Git-Tag: 1.0~1 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=06f8c61d952140b0f6a82b2993a66420c14c89e1;p=rrq%2Frrqnet.git lintian fixup for unstable release --- diff --git a/Makefile b/Makefile index e589863..946dbbc 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,13 @@ -SBINDIR = $(DESTDIR)/usr/local/sbin +SBINDIR = $(DESTDIR)/usr/sbin ETCDIR = $(DESTDIR)/etc/rrqnet -MAN1DIR = $(DESTDIR)/usr/local/share/man/man1 -MAN8DIR = $(DESTDIR)/usr/local/share/man/man8 +MAN1DIR = $(DESTDIR)/usr/share/man/man1 +MAN8DIR = $(DESTDIR)/usr/share/man/man8 -SBINFILES = rrqnet rrqnet-cron.sh +SBINCFILES = rrqnet +SBINFILES = rrqnet-cron $(SBINCFILES) ETCFILES = set-source-route.sh ifupdown.sh MAN1FILES = -MAN8FILES = rrqnet.8 rrqnet-cron.sh.8 rrqnet-ifupdown.sh.8 +MAN8FILES = rrqnet.8 rrqnet-cron.8 rrqnet-ifupdown.sh.8 HTMLDOC = $(MAN8FILES:%=%.html) .PHONY: ifupdown.sh @@ -30,12 +31,13 @@ rrqnet.E: rrqnet.c htable.c COMPILEOPTS = -g -W -Wall #COMPILEOPTS = -pg -no-pie -g -DGPROF -$(filter-out %.sh,$(SBINFILES)): %: %.c - $(CC) $(COMPILEOPTS) -static -o $@ $^ $(LDFLAGS) +#STATIC = -static +$(filter-out %.sh,$(SBINCFILES)): %: %.c + $(CC) $(COMPILEOPTS) $(STATIC) -o $@ $^ $(LDFLAGS) .PHONY: clean clean: - rm -f $(filter-out %.sh,$(SBINFILES)) + rm -f $(filter-out %.sh,$(SBINCFILES)) # Installation targets diff --git a/debian/changelog b/debian/changelog index 9ccf38b..31a30df 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,8 @@ +rrqnet (1.0) unstable; urgency=medium + + * fixup for unstable release + + -- Ralph Ronnquist Mon, 19 Apr 2021 19:13:58 +1000 rrqnet (0.3.3) experimental; urgency=medium * added dhclient control action(s) diff --git a/debian/control b/debian/control index 522b455..c5b21ad 100644 --- a/debian/control +++ b/debian/control @@ -5,13 +5,13 @@ Maintainer: Ralph Ronnquist Build-Depends: debhelper (>= 9), asciidoc, docbook-xml, libxslt1-dev, xsltproc, docbook-xsl Standards-Version: 3.9.8 -Homepage: -Vcs-Git: https://gitea.devuan.dev/devuan/rrqnet.git +Homepage: https://git.devuan.org/devuan/rrqnet.git +Vcs-Git: https://git.devuan.org/devuan/rrqnet.git Package: rrqnet Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, bash, bridge-utils, coreutils, - daemon, iproute2, lsof, net-tools, util-linux +Depends: ${shlibs:Depends}, ${misc:Depends}, bridge-utils, daemon, iproute2, + lsof, net-tools Description: Packet tunneling over UDP, multiple channels rrqnet is a bi-directional networking plug that channels packets between a UDP port and either or a tap interface or standard diff --git a/debian/rules b/debian/rules index 9ba3ef6..2d33f6a 100755 --- a/debian/rules +++ b/debian/rules @@ -1,27 +1,4 @@ #!/usr/bin/make -f -# See debhelper(7) (uncomment to enable) -# output every command that modifies files on the build system. -#export DH_VERBOSE = 1 - - -# see FEATURE AREAS in dpkg-buildflags(1) -#export DEB_BUILD_MAINT_OPTIONS = hardening=+all - -# see ENVIRONMENT in dpkg-buildflags(1) -# package maintainers to append CFLAGS -#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic -# package maintainers to append LDFLAGS -#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed - %: dh $@ - - -# dh_make generated override targets -# This is example for Cmake (See https://bugs.debian.org/641051 ) -#override_dh_auto_configure: -# dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) - -override_dh_usrlocal: - true diff --git a/rrqnet-cron b/rrqnet-cron new file mode 100755 index 0000000..f92ad74 --- /dev/null +++ b/rrqnet-cron @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Cron-driven bot to start a rrqnet cables or switch unless already up + +RRQNET=/usr/local/sbin/rrqnet + +function start-switch() { + . $1 + exec $RRQNET $VERBOSE -4 $PORT ${VPN[@]} +} + +function start-cable() { + . $1 + ip link show dev $TAP > /dev/null || \ + { ip tuntap add $TAP mode tap ; ip link set dev $TAP up ; } + [ -z "$MAC" ] || ifconfig $TAP | grep -q "ether $MAC" || \ + ifconfig $TAP hw ether $MAC + [ -z "$IP" ] || ip addr show dev $TAP | grep -q $IP || \ + ifconfig $TAP $IP up + [ -z "$BR" ] || brctl show | grep -q $TAP || \ + brctl addif $BR $TAP + exec $RRQNET $VERBOSE -4 ${OPTIONS[@]} -t $TAP $PORT ${VPN[@]} +} + +for CABLE in $* ; do + CONF=/etc/rrqnet/conf.d/$CABLE.conf + eval $(grep ^PORT= $CONF) + lsof -i :$PORT > /dev/null && continue + eval $(grep ^TAP= $CONF) + LOG=/tmp/$CABLE.log + if [ -z "$TAP" ] ; then + ( start-switch $CONF < /dev/null >> $LOG 2>&1 & ) + else + ( start-cable $CONF /dev/null >> $LOG 2>&1 & ) + fi +done diff --git a/rrqnet-cron.8.adoc b/rrqnet-cron.8.adoc new file mode 100644 index 0000000..740f3a4 --- /dev/null +++ b/rrqnet-cron.8.adoc @@ -0,0 +1,111 @@ +rrqnet-cron(8) +============== +:doctype: manpage +:revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} + +NAME +---- +rrqnet-cron - Management script to uphold a *rrqnet* plug. + +SYNOPSIS +-------- +*rrqnet-cron* _vpn_ ... + +DESCRIPTION +----------- + +*rrqnet-cron* is a management script for upholding an *rrqnet* plug +for a nominated VPN confguration. The given _vpn_ (or the several) is +the pathname relative to the configuration root directory and with a ++.conf+ extension added, as in +/etc/rrqnet/conf.d/+*vpn*+.conf+. + +The following is a configuration file example: + +./etc/rrqnet/conf.d/tap0-client.conf +---- +TAP=tap0 +MAC=02:00:00:00:01:00 +BR= +IP=192.168.10.2 +PORT=1500 +OPTIONS=( ) +VPN=( 10.61.4.72:2020=/etc/rrqnet/keys/example.key ) +VERBOSE=-v +---- + + * The `TAP` assignment names the tap interface to use. + * The optional MAC assignment, if provided, tells *rrqnet-cron* to + set the Ethernet address of the tap interface as given. + * The optional `BR` assignment, if provided, tells *rrqnet-cron* + to add the tap interface to the bridge upon start. + * The optional `IP` assignment, if provided, tells *rrqnet-cron* + how to configure the tap interface when it is brought up. If empty, + the tap interface is brought up without confgiured IP address. + * The `PORT` assignment declares which port *rrqnet* should listen + on. It will listen on that port on all interfaces. + * The optional `OPTIONS` is intended for the -B and -T options to + *rrqnet*. + * The `VPN` assignment declares the remotes for *rrqnet*. + * The optional `VERBOSE` assignment, which must be `-v`, `-vv` or + `-vvv` unless empty, defines the verbosity level for *rrqnet*. + +The above example declares an uplink remote at example ivp4 address +`10.61.4.72`, port 2020, and using a transport encryption key. The +remote host at that IP address should have a corresponding +declaration, perhaps as follows: + +./etc/rrqnet/conf.d/tap0-server.conf +---- +TAP=tap0 +IP=192.168.10.1 +PORT=2020 +VPN=( 0.0.0.0/0=/etc/rrqnet/keys/example.key ) +---- + +That "server" declaration allows UDP packets from any host and port, +requiring the them to use the same transport encryption key. The +*rrqnet* "server" plug then works like a switch that forwards packets +between connections as well as to and from the tap. Connections are +identified by the remote MAC addresses, and it's up to the remote ends +to resolve IP addresses to the MAC addresses on the virtual net. + +The +VPN+ variable may have multiple remote declarations, and include +both up-links and down-links, with or without thransport encryption +keys. E.g., +---- +VPN=( 192.168.0.0/16:1400 10.61.4.72:2020=/sec/example.key ) +---- + +A VPN assignment like the above would downlink remotes in IP range ++192.168.0.0/16+, port 1400, without transport key, and uplink to ++10.61.4.72:2020+. + +crontab set up +~~~~~~~~~~~~~~ + +The script *rrqnet-cron* is intended to be set up in *crontab*, by +a line such as the following: +---- +* * * * * /usr/local/sbin/rrqnet-cron tap0-client +---- + +By that *crontab* line, the script will be invoked every minute for +ensuring that the *rrqnet* plug declared by ++/etc/rrqnet/conf.d/tap0-client.conf+ is still running or otherwise +restart it. + +NOTES +----- + +Note that *rrqnet-cron* sources the configuration file and exits +after optionally spawning an *rrqnet* daemon. On may therefore safely +just change the cable set up, and kill *rrqnet* in order apply that +changed set up. + +SEE ALSO +-------- +*rrqnet(8)* - Packet tunneling over UDP, multiple channels + +AUTHOR +------ +Ralph Rönnquist diff --git a/rrqnet-cron.sh b/rrqnet-cron.sh deleted file mode 100755 index f92ad74..0000000 --- a/rrqnet-cron.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -# -# Cron-driven bot to start a rrqnet cables or switch unless already up - -RRQNET=/usr/local/sbin/rrqnet - -function start-switch() { - . $1 - exec $RRQNET $VERBOSE -4 $PORT ${VPN[@]} -} - -function start-cable() { - . $1 - ip link show dev $TAP > /dev/null || \ - { ip tuntap add $TAP mode tap ; ip link set dev $TAP up ; } - [ -z "$MAC" ] || ifconfig $TAP | grep -q "ether $MAC" || \ - ifconfig $TAP hw ether $MAC - [ -z "$IP" ] || ip addr show dev $TAP | grep -q $IP || \ - ifconfig $TAP $IP up - [ -z "$BR" ] || brctl show | grep -q $TAP || \ - brctl addif $BR $TAP - exec $RRQNET $VERBOSE -4 ${OPTIONS[@]} -t $TAP $PORT ${VPN[@]} -} - -for CABLE in $* ; do - CONF=/etc/rrqnet/conf.d/$CABLE.conf - eval $(grep ^PORT= $CONF) - lsof -i :$PORT > /dev/null && continue - eval $(grep ^TAP= $CONF) - LOG=/tmp/$CABLE.log - if [ -z "$TAP" ] ; then - ( start-switch $CONF < /dev/null >> $LOG 2>&1 & ) - else - ( start-cable $CONF /dev/null >> $LOG 2>&1 & ) - fi -done diff --git a/rrqnet-cron.sh.8.adoc b/rrqnet-cron.sh.8.adoc deleted file mode 100644 index d2f208b..0000000 --- a/rrqnet-cron.sh.8.adoc +++ /dev/null @@ -1,111 +0,0 @@ -rrqnet-cron.sh(8) -================= -:doctype: manpage -:revdate: {sys:date "+%Y-%m-%d %H:%M:%S"} - -NAME ----- -rrqnet-cron.sh - Management script to uphold a *rrqnet* plug. - -SYNOPSIS --------- -*rrqnet-cron.sh* _vpn_ ... - -DESCRIPTION ------------ - -*rrqnet-cron.sh* is a management script for upholding an *rrqnet* plug -for a nominated VPN confguration. The given _vpn_ (or the several) is -the pathname relative to the configuration root directory and with a -+.conf+ extension added, as in +/etc/rrqnet/conf.d/+*vpn*+.conf+. - -The following is a configuration file example: - -./etc/rrqnet/conf.d/tap0-client.conf ----- -TAP=tap0 -MAC=02:00:00:00:01:00 -BR= -IP=192.168.10.2 -PORT=1500 -OPTIONS=( ) -VPN=( 10.61.4.72:2020=/etc/rrqnet/keys/example.key ) -VERBOSE=-v ----- - - * The `TAP` assignment names the tap interface to use. - * The optional MAC assignment, if provided, tells *rrqnet-cron.sh* to - set the Ethernet address of the tap interface as given. - * The optional `BR` assignment, if provided, tells *rrqnet-cron.sh* - to add the tap interface to the bridge upon start. - * The optional `IP` assignment, if provided, tells *rrqnet-cron.sh* - how to configure the tap interface when it is brought up. If empty, - the tap interface is brought up without confgiured IP address. - * The `PORT` assignment declares which port *rrqnet* should listen - on. It will listen on that port on all interfaces. - * The optional `OPTIONS` is intended for the -B and -T options to - *rrqnet*. - * The `VPN` assignment declares the remotes for *rrqnet*. - * The optional `VERBOSE` assignment, which must be `-v`, `-vv` or - `-vvv` unless empty, defines the verbosity level for *rrqnet*. - -The above example declares an uplink remote at example ivp4 address -`10.61.4.72`, port 2020, and using a transport encryption key. The -remote host at that IP address should have a corresponding -declaration, perhaps as follows: - -./etc/rrqnet/conf.d/tap0-server.conf ----- -TAP=tap0 -IP=192.168.10.1 -PORT=2020 -VPN=( 0.0.0.0/0=/etc/rrqnet/keys/example.key ) ----- - -That "server" declaration allows UDP packets from any host and port, -requiring the them to use the same transport encryption key. The -*rrqnet* "server" plug then works like a switch that forwards packets -between connections as well as to and from the tap. Connections are -identified by the remote MAC addresses, and it's up to the remote ends -to resolve IP addresses to the MAC addresses on the virtual net. - -The +VPN+ variable may have multiple remote declarations, and include -both up-links and down-links, with or without thransport encryption -keys. E.g., ----- -VPN=( 192.168.0.0/16:1400 10.61.4.72:2020=/sec/example.key ) ----- - -A VPN assignment like the above would downlink remotes in IP range -+192.168.0.0/16+, port 1400, without transport key, and uplink to -+10.61.4.72:2020+. - -crontab set up -~~~~~~~~~~~~~~ - -The script *rrqnet-cron.sh* is intended to be set up in *crontab*, by -a line such as the following: ----- -* * * * * /usr/local/sbin/rrqnet-cron.sh tap0-client ----- - -By that *crontab* line, the script will be invoked every minute for -ensuring that the *rrqnet* plug declared by -+/etc/rrqnet/conf.d/tap0-client.conf+ is still running or otherwise -restart it. - -NOTES ------ - -Note that *rrqnet-cron.sh* sources the configuration file and exits -after optionally spawning an *rrqnet* daemon. On may therefore safely -just change the cable set up, and kill *rrqnet* in order apply that -changed set up. - -SEE ALSO --------- -*rrqnet(8)* - Packet tunneling over UDP, multiple channels - -AUTHOR ------- -Ralph Rönnquist diff --git a/rrqnet.8.adoc b/rrqnet.8.adoc index bc0aafb..c7e1823 100644 --- a/rrqnet.8.adoc +++ b/rrqnet.8.adoc @@ -439,7 +439,7 @@ Using +-t -+ for stdin/stdout packet traffic is compatible with SEE ALSO -------- -*rrqnet-cron.sh(8)* - Management script to uphold a *rrqnet* plug. +*rrqnet-cron(8)* - Management script to uphold a *rrqnet* plug. *vde_plug(1)* - Virtual Distributed Ethernet plug.