Imported Upstream version 2.5.1

This commit is contained in:
Dave Hibberd 2016-04-01 16:06:32 +01:00
parent 0ed015b5b0
commit 5752427e73
28 changed files with 716 additions and 165 deletions

View File

@ -695,39 +695,6 @@ Fortunatey I maintain monthly backups and restored from that. For me this
meant minimum recreations of work lost. As for URONode, I only lost the
suggestion by VE1JOT and other clean ups.
---
see CHANGES.1 for prior changes, or CHANGES.3 for the latest changes.
Known NON-Critical Bugs:
Status memory/swap reporting fix
Wish-list:
Who file sorter
pactor - requested by sv1uy
-----------
Original Development Information (aka Disclaimer):
URONode was developed on an IBM eSeries 330 eServer with dual 1.2GHz CPUs
The OS is Debian Linux 4 using kernel 2.4.27, libax25 v0.0.11,
ax25-tools v0.0.8 and ax25-apps v0.0.6. This software comes with
absolutely NO guarantees so crash n burn at your own risk. We all may
be surprised and find out that it actually DOES something useful!
URONode may not run 100% depending on environmental conditions specific
to your system.
URONode is GLPv2 code, and tested by it's main author on the following
platforms: Raspberry Pi ver. B, Debian 7.7 on a Core-i3, Ubuntu 12.0.4LTS
on a Core-i3, Fedora ver. 19
------------
Comments/suggestions? email: n1uro@n1uro.ampr.org
Gripes??? cat gripes > /dev/null Smile just kidding!
This version will get you going for now. I'll post any changes to:
ftp://ftp.n1uro.net/packet
Join our support mail list graciously donated by TAPR!
http://www.tapr.org/mailman/listinfo/uronode
73 de Brian N1URO

224
CHANGES.3 Normal file
View File

@ -0,0 +1,224 @@
27/03/2016 - v2.5 YO2LOJ reports 2 warnings with regards to system.c and
the date/time stamp function. While I do not get one, I also do not get
one with his supplied patch... so I included it. The patch affects the
differences between 32 and 64 bit OS timestamps. Now the OS bit
shouldn't matter. Thanks Marius! (That's why we have ya on the team)
Ported the calibrate tool from F1OAT to the URONode suite. I could have
rewritten the whole thing from scratch but why the need to reinvent the
wheel? There was some recoding I had to do so that it'd compile under
URONode but that was somewhat minor. Usage is the same:
calibrate -t [ms] interface.
This port is similar in theory to what I did with Craig Small's axdigi package.
Cleaned up routines in Makefile. I'll probably have several and
hopefully they will go unnoticed. One critical thing I did notice and
I'm surprised no one reported this was if flexnet wasn't selected, and
one ran a "make install" or "make upgrade" - it would exit as soon as it
tried to install a non-existant binary (FlexD). This left the axdigi
module to go un-installed/upgraded. This is a very important module to
install as it allows for interface to multi-interface digipeating.
Anyway, I got off my butt and fixed this amongst other things.
Fixed the way the system handled parsing of the info file that carried
the stats for Memory and Swap usage: /proc/meminfo. In some cases, the
node couldn't properly parse the swap statistics in the "Status"
command. Now, regardless of which kernel is being used, the proper stats
will be parsed and the percentage arithmetic will be properly applied to
show final percentage used. An example of the output:
Memory: Available Used Free perc. Used
------------------ ---------- ---------- ---------- ----------
Physical: 4048024 kB 3206552 kB 841472 kB 79 %
Swap: 1881084 kB 0 kB 1881084 kB 0 %
I really don't know why this was such a difficult thing for me to fix
but I got it after months of pondering. This fixes a known non-critial
bug :D After fixing this bug however I created another one that would
cause a divide-by-zero segfault. Someone asked me to configure a box
remotely for them and they didn't add a swap partition at all! Now if
there's none or it's simply not activated, the node's 'STatus' report
will reflect such. Thanks to the NY EOC folks for creating this error so
I could find this bug before relase xD
Fixing texts in gateway.c and mheard.c where it still referenced the
word "port(s)" instead of "interface(s)" as it should. Also cleaned up
some minor error reporting. Also made some changes in how some aborts
are displayed, and also invalid callsign error reporting. For example,
an aborted connect will now show:
c n1uro-3
UNIVLE:N1URO-5} link setup (ax2)...
UNIVLE:N1URO-5} Connection aborted.
The same as with an aborted telnet session.
Pings now will show: ping www.comcast.com
ICMP Echo request sent to: 68.87.29.59
UNIVLE:N1URO-5} Ping aborted.
and a connect attempt that doesn't exist in any tables or links:
c g4apl
UNIVLE:N1URO-5} G4APL not found, please retry your entry.
I'm sure I'll figure out some more as time goes on. Always a little something
to do :)
One thing I noticed was an error in the Ping routine. The "Maximum size"
of a ping was preset to 248 bytes. On an ax25 link, this doesn't even
leave room for the IP headers, nevermind the ax25 headers! In thinking
this over, and not knowing if the IP path would be over vanilla ax25 OR
perhaps via NetRom, I decided to make the Maximum content per ping at
128 bytes. This should also be just large enough to allow ALL ascii
characters a chance to be included in 1 ping frame. Ex:
n1uro-15@n1uro.ampr.org:/uronode$ ping k1yon 129
Maximum size is 128
n1uro-15@n1uro.ampr.org:/uronode$ ping k1yon 128
ICMP Echo request sent to: 44.88.4.1
ICMP Echo reply received from: 44.88.4.1
Ping completed in: 151ms (ttl=63)
n1uro-15@n1uro.ampr.org:/uronode$
While at it, I made changes to the online help file for ping and to
uronode.8 man page.
Also I noticed while working on a new site for EastNet, I somehow omitted an
install line in the Makefile for flexd.8. This not only is fixed but I also
expanded a bit on the limited text that was inside.
Cleaned up a text display bug in the Status report. Swap: was not right
column justified with the rest of the memory stats. This was handled in
command.c
Added a routine in configure to check for "make" as I've seen new
installs where make is not installed but gcc is. Needless to say you
can't "make" a binary if "make" does not exist ;->
Also added a notification in flexd where when started to inform you that
the poll cycle has started. You may see it connect to test the existance
of an ax25 socket for the remote end when you first start flexd. This
starts the timer for your poll sequence in flexd.conf.
While I was at it (and with a decent nudge from Tomasz SP2L) I did some
further digging and found (with the aid of Thomas DL9SAU) that the
getsockopt routine itself was showing failure because the socket wasn't
initially established prior to the polling loop. In adjusting it's
settings this appears to help relieve the initial error getsockopt() was
showing upon start of flexd. Now flexd should login to the remote
immediately upon start and pull down the desti table of the remote node.
Thanks Thomas and Tomasz :)
In digging through the flexd source some more, and enjoying the fact
that the configs can be changed "on the fly" without having to restart
the system in most cases, or disrupt activity that's in session on or
through the node, I added a call to update the destinations upon a
"killall -HUP flexd". This allows the node sysop to change the flex-gate
they wish to poll without having to stop and restart flexd, and grab an
immediate destinations list. Remember to do the following:
- add the route in uronode.routes
- change the flex gateway in flexd.conf
- killall -HUP flexd
... and your new config and destination will instantly be live. Also, you can
-HUP your flexd to force an update as well.
Fixed a non-critical bug in axdigi where killing the daemon would NOT
clear the pidfile in /var/run. Always a stale pidfile was left over, and
as a quick fix I had the daemon delete the pidfile through a system call upon
start. A hack but worked. NOW, the daemon will remove the pidfile upon
exit as it should.
Wrote a set of SystemD files since xinetd/inet will soon be eliminated in
favor of SystemD. I've tested the files on both a Pi running Raspbian
wheezy and on my Fedora testbed. Important Note:
IF you spawn your incoming telnet connects with SystemD, it's very possible
that SystemD *will* convert your incoming IPv4 to internal IPv6 sockets.
You may handle this by forcing IPv4 in your SystemD uronode.socket file.
While as of this version URONode will handle *incoming* IPv6, I haven't
written any outbound routines for IPv6. To my knowledge, there's no need
for it and I don't know if we'll ever have such a need on ham-based
networks for IPv6. URONode *is* the first packet node however, to support
IPv6... a historical milestone I do believe.
While I was testing SystemD and finally realizing that the above IPv6
conversions were true, I created a menu system for IPv6 to make it a lot
cleaner than it already was... actually it had none. Since it's also
spawned by SystemD, I made that the prompt for IPv6...
SystemD - n1uro@fedora.n1uro.ampr.org:
I was going to dupe the IPv4 prompt but decided it should have it's own
to follow with the scope of how I maintain this project. So far everything
in regards to both SystemD and IPv6 seem to be working fine.
31/03/2016 - v2.5.1 (Maintenance release)
Added better error handling output to FlexD and axDigi. Now they tell you
when they've properly received your -HUP, your -TERM or your start. This
should help you all in better debugging your backend engines (FlexD, axDigi,
etc.)
Added a -b flag to the installer routines by suggestion of Marius YO2LOJ
so one with an existing install won't have their files totally overwritten
however they'll be backed up with a *~ flag instead during "make install".
The preferred method for upgrading an existing node as always is by using
"make upgrade" which only copies over the files required for that version.
Once in a while a new field will be added or one deleted from the file
uronode.conf, or one of the others and I've noticed sysops don't pay
any attention to the new field requirements (ex: RoseId is the latest
add). Compare the fields in files before just copying them back over!
Gus I0OJJ and our own Bob VE3TOK reported strangeness in certain ALIAS
commands. I tried like heck to reproduce it here and on machines I take
care of. I knew where the issue layed but not fully being able to get
it to reproduce was a royal "b". After sending Bob code to test, he
was able to get positive results and checked it in for me.
While at it Bob increased the buffer for the reader within FlexD. Seems
Xnet may require a larger buffer than FlexNet for some reason? Bob also
checked that in. Thanks Bob.
----------- Note on SystemD --------
In uronode.socket, you'll notice the line:
ListenStream=0.0.0.0:3694
This tells SystemD to listen on TCP socket 3694 for any IPv4 ONLY incoming
connection. If you wish to filter JUST your amprnet and IPv4 localhost
IPs make a line for each changing 0.0.0.0 to 127.0.0.1 and another for
your amprnet IP. This will by default filter any commercial IP requests
to URONode. If you want SystemD to try IPv6 *first*, don't enter in any
IP schemas and just list the port number. SystemD by default appears to
use IPv6 prior to IPv4.
You can verify the above by running systemctl status uronode.socket:
ystemctl status uronode.socket
● uronode.socket - URONode Server Activation Socket
Loaded: loaded (/usr/lib/systemd/system/uronode.socket; enabled)
Active: active (listening) since Mon 2016-03-07 15:30:39 EST; 6min ago
Listen: 0.0.0.0:3694 (Stream)
Accepted: 3; Connected: 1
----------- Wish-list: -----------
----------------------------------
Original Development Information (aka Disclaimer): URONode was developed
on an IBM eSeries 330 eServer with dual 1.2GHz CPUs The OS is Debian
Linux 4 using kernel 2.4.27, libax25 v0.0.11, ax25-tools v0.0.8 and
ax25-apps v0.0.6. This software comes with absolutely NO guarantees so
crash n burn at your own risk. We all may be surprised and find out that
it actually DOES something useful! URONode may not run 100% depending on
environmental conditions specific to your system.
URONode is GLPv2 code, and tested by it's main author on the following
platforms: Raspberry Pi ver. B, Debian 7.7 on a Core-i3, Ubuntu
12.0.4LTS on a Core-i3, Fedora ver. 21
------------
Comments/suggestions? email: n1uro@n1uro.ampr.org Gripes??? cat gripes >
/dev/null :D just kidding!
This version will get you going for now. I'll post any changes to:
ftp://ftp.n1uro.net/packet and https://uronode.sourceforge.net. You may
also find URONode in your distro's repositories. <dnf/yum or apt-cache>
search uronode
Join our support mail list graciously donated by TAPR!
http://www.tapr.org/mailman/listinfo/uronode
73 de Brian N1URO

View File

@ -1,4 +1,4 @@
all: nodeusers uronode axdigi @FLEXNET@
all: nodeusers uronode axdigi calibrate @FLEXNET@
CC = gcc
LD = gcc
@ -15,43 +15,46 @@ NODE_SRC = node.c cmdparse.c config.c command.c mheard.c axcalluser.c \
NODEUSERS_SRC = nodeusers.c
FLEXD_SRC = flexd.c procinfo.c
DIGI_SRC = axdigi.c
CALIBRATE_SRC = calibrate.c
COMMON_OBJS = $(COMMON_SRC:.c=.o)
NODE_OBJS = $(NODE_SRC:.c=.o)
NODEUSERS_OBJS = $(NODEUSERS_SRC:.c=.o)
FLEXD_OBJS = $(FLEXD_SRC:.c=.o)
DIGI_OBJS = $(DIGI_SRC:.c=.o)
CALIBRATE_OBJS = $(CALIBRATE_SRC:.c=.o)
.c.o:
$(CC) $(CFLAGS) -c $<
install: installbin installman installhelp installconf
install -m 755 -D -d $(VAR_DIR)
install -m 755 -D -d $(VAR_DIR)/node
install -m 644 -p etc/loggedin $(VAR_DIR)/node
install -m 644 -p etc/lastlog $(VAR_DIR)/node
install -m 755 -D -d $(VAR_DIR)/flex
install -m 644 -p etc/gateways $(VAR_DIR)/flex
install -b -m 755 -D -d $(VAR_DIR)
install -b -m 755 -D -d $(VAR_DIR)/node
install -b -m 644 -p etc/loggedin $(VAR_DIR)/node
install -b -m 644 -p etc/lastlog $(VAR_DIR)/node
install -b -m 755 -D -d $(VAR_DIR)/flex
install -b -m 644 -p etc/gateways $(VAR_DIR)/flex
installbin: all
install -m 755 -s -p uronode $(SBIN_DIR)
install -m 755 -s -p nodeusers $(SBIN_DIR)
install -m 755 -s -p axdigi $(SBIN_DIR)
install -m 755 -s -p calibrate $(SBIN_DIR)
@IN@ install -m 755 -s -p flexd $(SBIN_DIR)
installhelp:
install -m 755 -D -d $(VAR_DIR)
install -m 755 -D -d $(VAR_DIR)/node/help
install -m 644 -p etc/help/*.hlp $(VAR_DIR)/node/help
install -b -m 755 -D -d $(VAR_DIR)
install -b -m 755 -D -d $(VAR_DIR)/node/help
install -b -m 644 -p etc/help/*.hlp $(VAR_DIR)/node/help
installconf: installhelp
install -m 755 -D -d $(ETC_DIR)
install -m 600 -p etc/uronode.conf $(ETC_DIR)
install -m 600 -p etc/uronode.perms $(ETC_DIR)
install -m 600 -p etc/uronode.info $(ETC_DIR)
install -m 600 -p etc/uronode.motd $(ETC_DIR)
install -m 600 -p etc/uronode.users $(ETC_DIR)
install -m 600 -p etc/uronode.routes $(ETC_DIR)
install -m 600 -p etc/flexd.conf $(ETC_DIR)
install -b -m 755 -D -d $(ETC_DIR)
install -b -m 600 -p etc/uronode.conf $(ETC_DIR)
install -b -m 600 -p etc/uronode.perms $(ETC_DIR)
install -b -m 600 -p etc/uronode.info $(ETC_DIR)
install -b -m 600 -p etc/uronode.motd $(ETC_DIR)
install -b -m 600 -p etc/uronode.users $(ETC_DIR)
install -b -m 600 -p etc/uronode.routes $(ETC_DIR)
install -b -m 600 -p etc/flexd.conf $(ETC_DIR)
installman:
install -m 755 -D -d $(MAN_DIR)/man1 $(MAN_DIR)/man5 $(MAN_DIR)/man8
@ -60,27 +63,29 @@ installman:
install -m 644 -p man/uronode.perms.5 $(MAN_DIR)/man5
install -m 644 -p man/flexd.conf.5 $(MAN_DIR)/man5
install -m 644 -p man/uronode.8 $(MAN_DIR)/man8
install -m 644 -p man/calibrate.8 $(MAN_DIR)/man8
install -m 644 -p man/axdigi.8 $(MAN_DIR)/man8
install -m 644 -p man/flexd.8 $(MAN_DIR)/man8
upgrade: installman
upgrade: installman installhelp
install -m 755 -p uronode $(SBIN_DIR)
install -m 755 -p nodeusers $(SBIN_DIR)
install -m 755 -p flexd $(SBIN_DIR)
install -m 755 -p calibrate $(SBIN_DIR)
@IN@ install -m 755 -p flexd $(SBIN_DIR)
install -m 755 -p axdigi $(SBIN_DIR)
clean:
rm -f *.o *~ *.bak *.orig make.debug nodeusers uronode flexd axdigi
rm -f *.o *~ *.bak *.orig make.debug nodeusers uronode flexd axdigi calibrate
rm -f etc/*~ etc/*.bak etc/*.orig
rm -f etc/help/*~ etc/help/*.bak etc/help/*.orig
distclean: clean
rm -f .depend Makefile.include config.h
rm -f uronode nodeusers axdigi @FLEXNET@
rm -f uronode nodeusers axdigi calibrate @FLEXNET@
rm -f Makefile make.debug
depend:
$(CC) $(CFLAGS) -M $(COMMON_SRC) $(NODE_SRC) $(NODEUSERS_SRC) $(FLEXD_SRC) > .depend
$(CC) $(CFLAGS) -M $(COMMON_SRC) $(NODE_SRC) $(NODEUSERS_SRC) $(FLEXD_SRC) $(CALIBRATE_SRC) > .depend
uronode: $(COMMON_OBJS) $(NODE_OBJS)
$(LD) $(LDFLAGS) -o uronode $(COMMON_OBJS) $(NODE_OBJS) $(LIBS) $(ZLIB)
@ -91,8 +96,11 @@ nodeusers: $(COMMON_OBJS) $(NODEUSERS_OBJS)
flexd: $(FLEXD_OBJS)
$(LD) $(LDFLAGS) -o flexd $(FLEXD_OBJS) $(LIBS) $(ZLIB)
calibrate: $(CALIBRATE_OBJS)
$(LD) $(LDFLAGS) -o calibrate $(CALIBRATE_OBJS) $(LIBS) $(ZLIB)
axdigi: $(DIGI_OBJS)
$(LD) $(LDFLAGS) -o axdigi $(DIGI_OBJS) $(LIBS)
$(LD) $(LDFLAGS) -o axdigi $(DIGI_OBJS) $(LIBS) $(ZLIB)
ifeq (.depend,$(wildcard .depend))
include .depend

30
README.flexd Normal file
View File

@ -0,0 +1,30 @@
If you find that your flexd isn't properly working, scroll down to line 120
where it says:
char buffer[256], port[14], path[AX25_MAX_DIGIS*10]
and adjust the buffer per your neighbor's screens. The formula is:
2 data frames: 256
3 data frames: 512
4 data frames: 1024
Unfortunately the configure script can't autosense this because in some
cases, flexd doesn't already exist yet. To determine how many frames you're
receiving, use the (ax)listen tool and count the frames after making a manual
connect. Ex:
ax2: fm N1URO-15 to N1URO-1 ctl SABM+
ax2: fm N1URO-1 to N1URO-15 ctl UA-
ax2: fm N1URO-1 to N1URO-15 ctl I00^ pid=F0(Text) len 256
0000 PC/FlexNet V3.3g - Welcome to the N1URO FlexNet-Digi. This node
0040 is located at .Unionville, Hartford County, Connecticut [FN31ns]
0080 . This version of pc/Flexnet.and all related services are hosted
00C0 under the Linux operating system. Enjoy!..Basic commands are:.<
ax2: fm N1URO-1 to N1URO-15 ctl I01^ pid=F0(Text) len 176
0000 A>rea destinations file.<C>onnect <desti>.<D>estinations list..<
0040 H>elp (more detailed command list).<L>inks.list...<M>ailBox (BBS
0080 URO:N1URO-4).<Q>uit this node..<T>alk <call>..=>
Here I made a manual connect from my URONode to my pc/FlexNet node.
After the protocol handshakes there's 2 frames prior to the => prompt.
So using the formula above, my line needs to be 256 for the buffer size.
Hope this may help those with flexd errors.
73 de Brian N1URO

View File

@ -33,6 +33,8 @@
/* below added by N1URO */
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <error.h>
#include <signal.h>
#include <linux/ax25.h>
/* added by N1URO */
@ -51,7 +53,7 @@ void get_interfaces(int skt);
#define E_BIT 0x01 /* Address extension bit */
#define REPEATED 0x80 /* Has-been-repeated bit */
#define MAX_PORTS 16
#define VERSION "0.2"
#define VERSION "0.3"
#define AXDIGI_PID_FILE "/var/run/axdigi.pid"
int port_count = 0;
unsigned char portname[MAX_PORTS][20];
@ -59,20 +61,24 @@ unsigned char portcall[MAX_PORTS][8];
void(*sigterm_defhnd)(int);
static void quit_handler(int sig)
void quit_handler(int sig)
{
unlink(AXDIGI_PID_FILE);
signal(SIGTERM, SIG_IGN);
unlink(AXDIGI_PID_FILE);
// signal(SIGTERM, sigterm_defhnd);
signal(SIGTERM, quit_handler);
fprintf(stderr, "axDigi quitting.\n\r");
signal(SIGTERM, sigterm_defhnd);
raise(SIGTERM);
unlink(AXDIGI_PID_FILE);
system("rm -f /var/run/axdigi.pid");
return;
}
void hup_handler(int sig)
{
signal(SIGHUP, SIG_IGN);
fprintf(stderr, "SIGHUP caught by axDigi.\n\r");
signal(SIGHUP, hup_handler); /* Restore hangup handler */
}
int main(int argc, char *argv[])
{
int skt;
@ -82,26 +88,15 @@ int main(int argc, char *argv[])
int asize;
system("rm -f /var/run/axdigi.pid");
FILE *pidfile;
// signal(SIGALRM, alarm_handler);
// signal(SIGTERM, term_handler);
// signal(SIGPIPE, quit_handler);
// signal(SIGQUIT, quit_handler);
// pidfile = fopen(AXDIGI_PID_FILE, "w");
// fprintf(pidfile, "%d\n", (int)getpid());
// fclose(pidfile);
/* Check our huge range of flags */
if (argc > 1)
{
if (strcmp(argv[1], "-v") == 0 || strcmp(argv[1], "-h") ==0)
{
printf("axdigi version %s. Copyright (C) 1995 Craig Small VK2XLZ\n", VERSION);
printf("modificatiions 2012-present by Brian N1URO\n\n");
printf("modificatiions Copyright (C) 2012-present by Brian N1URO\n\n");
printf("axdigi comes with ABSOLUTELY NO WARRANTY.\n");
printf("This is free software, and you are welcome to redistribute it\n");
printf("under the terms of GNU General Public Licence as published\n");
@ -112,6 +107,7 @@ int main(int argc, char *argv[])
}
/* Routine to daemonize - added by N1URO */
if (!daemon_start(TRUE)) {
fprintf(stderr, "Sorry, axdigi cannot become a daemon\n");
return 1;
@ -126,8 +122,12 @@ if (!daemon_start(TRUE)) {
pidfile = fopen(AXDIGI_PID_FILE, "w");
fprintf(pidfile, "%d\n", (int)getpid());
fprintf(stderr, "axDigi started. \n\r");
fclose(pidfile);
signal(SIGHUP, hup_handler);
sigterm_defhnd = signal(SIGTERM, quit_handler);
get_interfaces(skt);
while(1)
@ -154,7 +154,6 @@ if (!daemon_start(TRUE)) {
} /* while(1) */
close(skt);
// system("rm -f /var/run/axdigi.pid");
}
int recv_packet(unsigned char *buf, int size, unsigned char *port)
@ -299,3 +298,5 @@ void get_interfaces(int skt)
}
} /* for */
}
void(*sigterm_defhnd)(int);

BIN
calibrate

Binary file not shown.

130
calibrate.c Normal file
View File

@ -0,0 +1,130 @@
/*
* calibrate : Modem calibration utility
* Most code is portion of beacon.c of the standard ax25-utils package
* F1OAT 980321
* mods by N1URO 151123
*/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <netax25/axlib.h>
#include <netax25/axconfig.h>
#include <netax25/nrconfig.h>
#include <netax25/rsconfig.h>
#include <netax25/procutils.h>
#include <netax25/mheard.h>
#include <netax25/daemon.h>
#define BUFLEN 256
#define NBFRAMES 100
#define TEMPO 1000
static void Usage(void)
{
fprintf(stderr, "Usage : calibrate [-t ms] interface\n");
exit(1);
}
int main(int argc, char *argv[])
{
struct full_sockaddr_ax25 dest;
struct full_sockaddr_ax25 src;
int i, s, dlen, len, tempo = TEMPO;
char *port;
char *srccall = NULL, *destcall = "CAL";
char buffer[BUFLEN];
fd_set rfds;
struct timeval tv;
if (argc < 2) Usage();
while ((s = getopt(argc, argv, "t:")) != -1) {
switch (s) {
case 't':
tempo = atoi(optarg);
break;
case ':':
fprintf(stderr, "calibrate: option -t needs a duration in ms\n");
return 1;
case '?':
Usage();
return 1;
}
}
if (optind == argc) {
Usage();
return 1;
}
port = argv[optind];
if (ax25_config_load_ports() == 0) {
fprintf(stderr, "calibrate: no AX.25 interfaces defined\n");
return 1;
}
if ((srccall = ax25_config_get_addr(port)) == NULL) {
fprintf(stderr, "calibrate: invalid AX.25 interface setting - %s\n", port);
return 1;
}
if ((dlen = ax25_aton(destcall, &dest)) == -1) {
fprintf(stderr, "calibrate: unable to convert callsign '%s'\n", destcall);
return 1;
}
if ((len = ax25_aton(srccall, &src)) == -1) {
fprintf(stderr, "calibrate: unable to convert callsign '%s'\n", srccall);
return 1;
}
if ((s = socket(AF_AX25, SOCK_DGRAM, 0)) == -1) {
perror("socket");
return 1;
}
if (bind(s, (struct sockaddr *)&src, len) == -1) {
perror("bind");
return 1;
}
printf("Press return to stop calibrate\n");
for (i = 0 ; i < BUFLEN ; i++)
buffer[i] = 0x55;
for (i = 0 ; i < NBFRAMES ; i++) {
/* fd_set rfds;
struct timeval tv;
*/
tv.tv_sec = tempo / 1000;
tv.tv_usec = (tempo % 1000) * 1000;
FD_ZERO(&rfds);
FD_SET(0, &rfds);
if (select(1, &rfds, NULL, NULL, &tv) == 1) break;
buffer[0] = (i / 100) + '0';
buffer[1] = ((i % 100) / 10) + '0';
buffer[2] = (i % 10) + '0';
if (sendto(s, buffer, BUFLEN, 0, (struct sockaddr *)&dest, dlen) == -1) {
perror("sendto");
}
}
close(s);
return 0;
}

View File

@ -96,6 +96,12 @@ void node_prompt(const char *fmt, ...)
if ((User.ul_type == AF_ROSE) && (check_perms(PERM_ANSI, 0L) != -1)) {
axio_printf(NodeIo,"\r\e[01;35m-=>\e[0m \b");
}
if ((User.ul_type ==AF_INET6) && (check_perms(PERM_ANSI, 0L) == -1)) {
axio_printf(NodeIo, "\nSystemD - %s@%s: ",User.call, HostName);
}
if ((User.ul_type ==AF_INET6) && (check_perms(PERM_ANSI, 0L) != -1)) {
axio_printf(NodeIo, "\n\e[01;31mSystemD \e[0m- \e[01;34m%s@\e[0m%s: ",User.call, HostName);
}
/* axio_flush(NodeIo); */
}
@ -784,26 +790,27 @@ int do_status(int argc, char **argv)
axio_printf(NodeIo,"Load average: %.2f, %.2f, %.2f\n", av[0], av[1], av[2]);
axio_printf(NodeIo,"Users: %d node, %d system\n", user_count(), system_user_count());
if (!(mem = meminfo()) || mem[meminfo_main][meminfo_total] == 0) {
// if (!(mem = meminfo()) || meminfo("memtotal") == 0) {
/* cannot normalize mem usage */
axio_printf(NodeIo,"Cannot get memory information!\n");
} else {
ma = mem[meminfo_main][meminfo_total];
mu = (mem[meminfo_main][meminfo_total] - mem[meminfo_free][meminfo_total]);
mf = mem[meminfo_free][meminfo_total];
// axio_printf(NodeIo,"Cannot get memory information!\n");
// } else
if (load_meminfo()) {
ma = meminfo("memtotal");
mu = (meminfo("memtotal") - meminfo("memfree"));
mf = meminfo("memfree");
axio_printf(NodeIo,"Memory: Available Used Free perc. Used\n");
axio_printf(NodeIo,"------------------ ---------- ---------- ---------- ----------\n");
axio_printf(NodeIo,"Physical: %-7d kB %-7d kB %-7d kB %3d %%\n", ma, mu, mf, (mu*100)/ma);
if (!(mem = meminfo()) || mem[meminfo_stotal][meminfo_total] != 0)
{
sa = mem[meminfo_stotal][meminfo_total];
su = (mem[meminfo_stotal][meminfo_total] - mem[meminfo_sfree][meminfo_total]);
sf = mem[meminfo_sfree][meminfo_total];
axio_printf(NodeIo,"Swap: %-7d kB %-7d kB %-7d kB %3d %%\n",sa,su,sf,(su*100)/sa);
if (meminfo("swaptotal") != 0)
{
sa = meminfo("swaptotal");
su = (meminfo("swaptotal") - meminfo("swapfree"));
sf = meminfo("swapfree");
axio_printf(NodeIo," Swap: %-7d kB %-7d kB %-7d kB %3d %%\n",sa,su,sf,(su*100)/sa);
}
else
axio_printf(NodeIo,"Cannot get swap information!\n");
axio_printf(NodeIo,"Cannot get swap information or swap not active!\n");
axio_printf(NodeIo," ");
}
@ -958,6 +965,11 @@ int nuser_list(int argc, char **argv)
sprintf(buf, "\nTelnet (%.9s @ %.16s)",
u.call, u.ul_name);
break;
case AF_INET6:
sprintf(buf, "\nTelnet6 (%.9s @ SystemD)", u.call);
break;
case AF_UNSPEC:
sprintf(buf, "\nHost (%.9s on local)",
u.call);

View File

@ -151,6 +151,7 @@ char *read_perms(struct user *up, unsigned long peer)
break;
continue;
#endif
case AF_INET6:
case AF_INET:
if (!strcmp(argv[1], "*"))
break;
@ -191,7 +192,8 @@ static int do_alias(int argc, char **argv)
return -1;
if ((new = calloc(1, sizeof(struct cmd))) == NULL) {
node_perror("do_alias: malloc", errno);
return -2;
// return -2;
return -1; /* ve3tok 31 Mar,2016 - tnx Brian */
}
new->name = strdup(argv[1]);
while (isupper(new->name[len]))
@ -402,7 +404,7 @@ static int do_roseid(int argc, char **argv)
static int do_prompt(int argc, char **argv)
{
if ((User.ul_type != AF_NETROM) || (User.ul_type != AF_INET)) {
if ((User.ul_type != AF_NETROM) || (User.ul_type != AF_INET) || (User.ul_type != AF_INET6)) {
if (argc < 2) {
return -1;
Prompt = strdup(argv[1]);

26
configure vendored
View File

@ -48,6 +48,25 @@ else
echo "and rerun ./configure to continue."
exit 1
fi
_sleep 1
echo -n "you need make to make URONode: "
MAKE=`which make`
_sleep 2
if [ -e "$MAKE" ]
then
echo -n "saw $MAKE... "
_sleep 1
echo "MAKE found! Congratulations!!"
else
echo "make not found!"
echo " "
echo "You need this utility to make URONode."
echo "Please install make, and rerun this ./configure script."
echo "If you have a copy of make installed, please insure you have"
echo "it in your path and rerun ./configure to continue."
exit 1
fi
echo -n "Your machine architecture is: "
_sleep 1
ARCH=`uname -m`
@ -291,6 +310,13 @@ echo ""
echo "SUCCESS!"
fi
_sleep 1
echo -n "calibrate: "
_sleep 1
if [ -x ./calibrate ]; then
echo "SUCCESS!"
fi
_sleep 1
echo -n "flexd: "
_sleep 1
if [ -x ./flexd ]; then

View File

@ -9,7 +9,8 @@ DESCRIPTION
between the local and remote hosts is shown.
If an optional length is specified the data portion of the
packet is filled with length number of bytes.
packet is filled with length number of bytes up to 128.
EXAMPLE
EXAMPLES
ping aripisa.ampr.org
ping n1uro.ampr.org 128

27
flexd.c
View File

@ -31,6 +31,8 @@
int poll_time=DEFAULT_POLL_TIME;
char flexgate[10]="\0";
char mycall[10]="\0";
char prompt1[1]="\0";
char prompt2[1]="\0";
struct ax_routes *gw;
int s;
void (*sigterm_defhnd)(int);
@ -64,7 +66,7 @@ void read_conf(void)
if(strcasecmp(cp,"pollinterval")==0) { /* set poll interval */
cp=strtok(NULL, " \t\n\r");
if(cp==NULL) {
fprintf(stderr, "flexd config: PollInterval needs an argument\n");
fprintf(stderr, "flexd config: Poll Interval needs an argument\n");
fclose(fp);
fclose(fgt);
exit(1);
@ -109,7 +111,7 @@ void read_conf(void)
}
}
}
fprintf(stderr,"FlexD started.\n\r");
fclose(fgt);
fclose(fp);
}
@ -117,7 +119,7 @@ void read_conf(void)
int download_dest(char *gateway, char *fname)
{
FILE *tmp;
char buffer[256], port[14], path[AX25_MAX_DIGIS*10];
char buffer[512], port[14], path[AX25_MAX_DIGIS*10]; /* Increased buffer to 512 from 256 - ve3tok 31 Mar, 2016 */
char *addr, *commands[10], *dlist[9]; /* Destination + 8 digipeaters */
fd_set read_fd;
int n, addrlen, cmd_send=0, cmd_ack=0, c, k;
@ -223,7 +225,9 @@ int download_dest(char *gateway, char *fname)
break;
}
if (FD_ISSET(s, &read_fd)) {
int ret, retlen;
// int ret, retlen;
int ret = 0;
int retlen = 0;
char *cp;
/* See if we got connected or if this was an error */
@ -231,7 +235,7 @@ int download_dest(char *gateway, char *fname)
if (ret != 0) {
cp = strdup(strerror(ret));
strlwr(cp);
sprintf(buffer, "flexd connect: Failure with %s: %sr\r\n", gateway, cp);
sprintf(buffer, "flexd connect: Failure with %s\r\nError: %s\r\n", gateway, cp);
write(STDOUT_FILENO, buffer, strlen(buffer));
free(cp);
close(s);
@ -270,10 +274,12 @@ int download_dest(char *gateway, char *fname)
if (FD_ISSET(s, &read_fd)) {
if ((n = read(s, buffer, 512)) == -1) break;
// if ((n = read(s, buffer, 256)) == -1) break;
for(c=0;c<n;c++) {
if (buffer[c]=='\r') buffer[c]='\n';
if (buffer[c]=='=' && c<n-1 && buffer[c+1]=='>') {
/* fprintf(stderr, "flex interact: ack[%d]\n", cmd_ack); */
// if (buffer[c]=='%s' && c<n-1 && buffer [c+1]=='%s', prompt1, prompt2) {
// fprintf(stderr, "flex interact: ack[%d]\n", cmd_ack);
cmd_ack++;
}
}
@ -283,7 +289,7 @@ int download_dest(char *gateway, char *fname)
if (cmd_ack!=0) {
if (commands[cmd_send]!=NULL) {
write(s, commands[cmd_send], 2);
/* fprintf(stderr, "flexd interact: send[%d]: %s\n", cmd_send, commands[cmd_send]); */
// fprintf(stderr, "flexd interact: send[%d]: %s\n", cmd_send, commands[cmd_send]);
cmd_send++;
}
cmd_ack=0;
@ -367,7 +373,9 @@ void hup_handler(int sig)
{
signal(SIGHUP, SIG_IGN);
fprintf(stderr, "SIGHUP caught by FlexD, restarting... \n\r");
read_conf();
update_flex();
signal(SIGHUP, hup_handler); /* Restore hangup handler */
}
@ -387,7 +395,7 @@ void quit_handler(int sig)
signal(SIGTERM, SIG_IGN);
unlink(FLEXD_PID_FILE);
fprintf(stderr, "FlexD quitting.\n\r");
signal(SIGTERM, sigterm_defhnd);
raise(SIGTERM);
return;
@ -411,11 +419,9 @@ int main(int argc, char *argv[])
return 1;
}
// signal(SIGTERM, quit_handler);
pidfile = fopen(FLEXD_PID_FILE, "w");
fprintf(pidfile, "%d\n", (int)getpid());
fclose(pidfile);
update_flex();
signal(SIGHUP, hup_handler);
@ -429,4 +435,3 @@ int main(int argc, char *argv[])
return 0;
}

View File

@ -104,6 +104,9 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
salen = strlen(addr[1]);
if ((salen != 6) && (salen != 10))
{
if (User.ul_type == AF_NETROM) {
axio_printf(NodeIo,"%s} ", NodeId);
}
axio_printf(NodeIo,"Invalid ROSE address");
if (User.ul_type == AF_NETROM) {
node_msg("");
@ -208,7 +211,7 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
if (User.ul_type == AF_NETROM) {
axio_printf(NodeIo,"%s} ", NodeId);
}
axio_printf(NodeIo,"Invalid port");
axio_printf(NodeIo,"Invalid interface: %s", addr[0]);
if (User.ul_type == AF_NETROM) {
node_msg("");
}
@ -316,11 +319,11 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
if (User.ul_type == AF_NETROM) {
axio_printf(NodeIo,"%s} ", NodeId);
}
axio_printf(NodeIo,"Permission denied");
axio_printf(NodeIo,"Permission denied.");
if (User.ul_type == AF_NETROM) {
node_msg("");
}
node_log(LOGLVL_GW, "Permission denied: telnet %s", User.dl_name);
node_log(LOGLVL_GW, "Permission denied: telnet %s.", User.dl_name);
close(fd);
return NULL;
}
@ -334,7 +337,10 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
} */
break;
default:
axio_printf(NodeIo,"%s Unsupported address family", NodeId);
if (User.ul_type == AF_NETROM) {
axio_printf(NodeIo,"%s} ", NodeId);
}
axio_printf(NodeIo,"Unsupported protocol.");
if (User.ul_type == AF_NETROM) {
node_msg("");
}
@ -421,7 +427,7 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
if (check_perms(PERM_ANSI, 0L) != -1) {
axio_printf(NodeIo, "\e[05;31m");
}
axio_printf(NodeIo,"Aborted");
axio_printf(NodeIo,"Connection aborted.");
if (check_perms(PERM_ANSI, 0L) != -1) {
axio_printf(NodeIo, "\e[0;m");
}
@ -684,7 +690,7 @@ int do_connect(int argc, char **argv)
if (User.ul_type == AF_NETROM) {
axio_printf(NodeIo,"%s} ", NodeId);
}
axio_printf(NodeIo,"Remote not found, please retry your entry.");
axio_printf(NodeIo,"%s not found, please retry your entry.", argv[1]);
family = AF_UNSPEC;
// free_flex_dst(flx);
// free_ax_routes(ax);
@ -977,11 +983,12 @@ int do_ping(int argc, char **argv)
}
if (argc > 2) {
len = atoi(argv[2]) + sizeof(struct icmphdr);
if (len > 256) {
// if (len > 256) {
if (len > 136) {
if (User.ul_type == AF_NETROM) {
axio_printf(NodeIo,"%s} ", NodeId);
}
axio_printf(NodeIo,"Maximum size is %d", 256 - sizeof(struct icmphdr));
axio_printf(NodeIo,"Maximum ping size is %d", 136 - sizeof(struct icmphdr));
if (User.ul_type == AF_NETROM) {
node_msg("");
}
@ -1118,10 +1125,10 @@ int do_ping(int argc, char **argv)
}
if (User.ul_type == AF_INET) {
if (check_perms(PERM_ANSI, 0L) != -1) {
axio_printf(NodeIo, "\e[05;38m");
axio_printf(NodeIo, "\e[05;31m");
}
}
axio_printf(NodeIo,"Aborted");
axio_printf(NodeIo,"Ping aborted.");
if (User.ul_type == AF_INET) {
if (check_perms(PERM_ANSI, 0L) != -1) {
axio_printf(NodeIo, "\e[0;m");

29
man/calibrate.8 Normal file
View File

@ -0,0 +1,29 @@
.TH CALIBRATE 8 "28 April 1998" Linux "Linux Programmer's Manual"
.SH NAME
calibrate \- URONode user information lookup program
.SH SYNOPSIS
.B calibrate
.SH DESCRIPTION
.LP
.B calibrate \-t ## interface
tool by F1OAT ported for compile and use with URONode to calibrate radios.
.SH OPTIONS
.TP 10
.BI \-t
Time in ms to engage the calibration of an interface (often mislabeled port).
.TP 10
.BI interface
This is the interface you wish to calibrate.
.SH FILES
.LP
.TP 5
.B /etc/ax25/axports
List of ax25 interfaces.
.SH "SEE ALSO"
.BR uronode (8)
.SH AUTHOR
Brian Rogers N1URO <n1uro@n1uro.com>
.br
Stefano Noferi IZ5AWZ <iz5awz@radio-ge.cnuce.cnr.it>
.br
Tomi Manninen OH2BNS <tpmannin@cc.hut.fi>

View File

@ -7,7 +7,10 @@ flexd \- flexnet routing daemon backend for URONode.
.LP
.B Flexd
is a simple flexnet routing daemon back end. The purpose of this daemon is to
import pc/FlexNet destinations into URONode for auto-ax25 routing.
import pc/FlexNet destinations into URONode for auto-ax25 routing. It's
quite normal sometimes for flexd to generate an error upon bootup if it
can't make a connect to the neighbor flex node in flexd.conf. When it
can connect, it will do so automatically.
.SH COMMANDS
There are no commands for flexd. The runtime parameters are in flexd.conf
.SH FILES

View File

@ -136,7 +136,7 @@ reply. If a reply is received the round-trip-time (RTT)
between the local and remote hosts is shown.
.sp
If an optional length is specified the data portion of the
packet is filled with length number of bytes.
packet is filled with length number of bytes up to 128.
.TP 14
.BI Routes
Shows the NET/ROM route table of the local host (eg. the nodes

View File

@ -39,7 +39,7 @@ int do_mheard (int argc,char **argv) {
if(ax25_config_get_dev(argv[1]) == NULL
|| (check_perms(PERM_HIDDEN, 0) == -1
&& is_hidden(argv[1]))) {
axio_printf(NodeIo,"Invalid port: %s",argv[1]);
axio_printf(NodeIo,"Invalid interface: %s", argv[1]);
if(User.ul_type == AF_NETROM)
node_msg("");

14
node.c
View File

@ -69,10 +69,10 @@ static void alarm_handler(int sig)
if ((User.ul_type == AF_AX25) || (User.ul_type == AF_ROSE)) {
node_msg("Inactivity timeout! Disconnecting you... ");
}
if (User.ul_type == AF_INET) {
if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6)) {
node_msg("Inactivity timeout! Disconnecting you...");
}
if (User.ul_type == AF_INET) {
if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6)) {
if (check_perms(PERM_ANSI, 0L) != -1) {
axio_printf(NodeIo,"\e[0;m");
}
@ -219,7 +219,7 @@ int main(int argc, char *argv[])
axio_compr(NodeIo, 1);
}
#endif
if (User.ul_type == AF_INET) {
if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6)) {
axio_tnmode(NodeIo, 1);
axio_tn_do_linemode(NodeIo);
}
@ -261,13 +261,13 @@ int main(int argc, char *argv[])
} else if (strcmp(pw, "*") != 0) {
axio_printf(NodeIo,"*** Password required! If you don't have a password please email\n%s for a password you wish to use.", Email);
axio_printf(NodeIo,"\nPassword: ");
if (User.ul_type == AF_INET) {
if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6)) {
axio_tn_will_echo(NodeIo);
axio_eolmode(NodeIo, EOLMODE_BINARY);
}
axio_flush(NodeIo);
p = axio_getline(NodeIo);
if (User.ul_type == AF_INET) {
if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6)) {
axio_tn_wont_echo(NodeIo);
axio_eolmode(NodeIo, EOLMODE_TEXT);
/* axio_puts("\n",NodeIo); */
@ -295,7 +295,7 @@ int main(int argc, char *argv[])
if (User.ul_type == AF_NETROM) {
/* axio_printf(NodeIo, "%s} Welcome.\n", NodeId); */
} else
if (User.ul_type == AF_INET) {
if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6)) {
if (check_perms(PERM_ANSI, 0L) != -1) {
node_msg("\n\e[01;34m[\e[01;37m%s\e[01;34m]\e[0m\nWelcome %s to the %s packet shell.", VERSION, User.call, HostName);
} else if (check_perms(PERM_ANSI, 0L) == -1) {
@ -389,7 +389,7 @@ int main(int argc, char *argv[])
node_msg("What?\007");
} else if (User.ul_type == AF_ROSE) {
axio_printf(NodeIo,"Que?\007");
} else if (User.ul_type == AF_INET) {
} else if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6)) {
axio_printf(NodeIo, "Huh?\007");
} else {
axio_printf(NodeIo,"Eh?\007");

4
node.h
View File

@ -1,5 +1,5 @@
#define VERSION "URONode v2.4"
#define COMPILING "November 21, 2015"
#define VERSION "URONode v2.5.1"
#define COMPILING "March 31, 2016"
#define STATE_IDLE 0
#define STATE_TRYING 1

View File

@ -47,7 +47,7 @@ static STRUCT_UTMP *utmp_contents;
#define S_IWGRP 020
#endif
static char buf[300];
static char buf[800];
/* This macro opens FILE only if necessary and seeks to 0 so that successive
calls to the functions are more efficient. It also reads the current
@ -110,36 +110,36 @@ int loadavg(double *av1, double *av5, double *av15) {
labels which do not *begin* with digits, though.
*/
#define MAX_ROW 22 /* these are a little liberal for flexibility */
#define MAX_ROW 20 /* these are a little liberal for flexibility */
#define MAX_COL 2
unsigned** meminfo(void) {
static unsigned *row[MAX_ROW + 1]; /* row pointers */
static unsigned num[MAX_ROW * MAX_COL]; /* number storage */
char *p;
int i, j, k, l;
//unsigned** meminfo(void) {
// static unsigned *row[MAX_ROW + 1]; /* row pointers */
// static unsigned num[MAX_ROW * MAX_COL]; /* number storage */
// char *p;
// int i, j, k, l;
FILE_TO_BUF(MEMINFO_FILE)
if (!row[0]) /* init ptrs 1st time through */
for (i=0; i < MAX_ROW; i++) /* std column major order: */
row[i] = num + MAX_COL*i; /* A[i][j] = A + COLS*i + j */
p = buf;
for (i=0; i < MAX_ROW; i++) /* zero unassigned fields */
for (j=0; j < MAX_COL; j++)
row[i][j] = 0;
for (i=0; i < MAX_ROW && *p; i++) { /* loop over rows */
while(*p && !isdigit(*p)) p++; /* skip chars until a digit */
for (j=0; j < MAX_COL && *p; j++) { /* scanf column-by-column */
l = sscanf(p, "%u%n", row[i] + j, &k);
p += k; /* step over used buffer */
if (*p == '\n' || l < 1) /* end of line/buffer */
break;
}
}
// FILE_TO_BUF(MEMINFO_FILE)
// if (!row[0]) /* init ptrs 1st time through */
// for (i=0; i < MAX_ROW; i++) /* std column major order: */
// row[i] = num + MAX_COL*i; /* A[i][j] = A + COLS*i + j */
// p = buf;
// for (i=0; i < MAX_ROW; i++) /* zero unassigned fields */
// for (j=0; j < MAX_COL; j++)
// row[i][j] = 0;
// for (i=0; i < MAX_ROW && *p; i++) { /* loop over rows */
// while(*p && !isdigit(*p)) p++; /* skip chars until a digit */
// for (j=0; j < MAX_COL && *p; j++) { /* scanf column-by-column */
// l = sscanf(p, "%u%n", row[i] + j, &k);
// p += k; /* step over used buffer */
// if (*p == '\n' || l < 1) /* end of line/buffer */
// break;
// }
// }
/* row[i+1] = NULL; terminate the row list, currently unnecessary */
return row; /* NULL return ==> error */
}
// return row; /* NULL return ==> error */
//}
//
int system_user_count(void)
{
int users;
@ -241,3 +241,30 @@ char *xmalloc (n)
p = fixup_null_alloc (n);
return p;
}
int load_meminfo(void)
{
FILE_TO_BUF(MEMINFO_FILE)
return 1;
}
int meminfo(const char *s)
{
char *cp;
int len;
len = strlen(s);
cp = buf;
while (1) {
if (strncasecmp(cp, s, len) == 0) {
cp += len;
if (*cp == ':')
return atoi(++cp);
}
if ((cp = strchr(cp, '\n')) == NULL)
break;
cp++;
}
return -1;
}

View File

@ -1,8 +1,12 @@
#ifndef SYSINFO_H
#define SYSINFO_H
int loadavg(double *av1, double *av5, double *av15);
int uptime (double *uptime_secs, double *idle_secs);
extern int loadavg(double *av1, double *av5, double *av15);
extern int uptime (double *uptime_secs, double *idle_secs);
extern int load_meminfo(void);
// extern int meminfo(const char *s);
/*
unsigned** meminfo(void);
@ -16,11 +20,12 @@ enum meminfo_row { meminfo_main = 0, meminfo_free, meminfo_buffers,
meminfo_nfs_unstab, meminfo_bounce, meminfo_climit,
meminfo_cas, meminfo_vmtotal, meminfo_vmused,
meminfo_vmchunk
};
enum meminfo_col { meminfo_total = 0
};
unsigned read_total_main(void);
*/
#endif /* SYSINFO_H */

View File

@ -124,7 +124,7 @@ void login_close(void)
ut->ut_type=DEAD_PROCESS;
memset(ut->ut_host,0,UT_HOSTSIZE);
memset(ut->ut_user,0,UT_NAMESIZE);
time(&ut->ut_time);
time((time_t *)&ut->ut_time);
/* ut->ut_xtime = (unsigned int)time(NULL); */
pututline(ut);
endutent();
@ -195,7 +195,7 @@ int login_open(struct passwd *pw, char *command)
strcpy(utmpbuf.ut_user, pw->pw_name); /* Username */
strcpy(utmpbuf.ut_host, "local:uronode");
utmpbuf.ut_addr=0x7f000000;
time(&utmpbuf.ut_time); /* Time entry was made */
time((time_t *)&utmpbuf.ut_time); /* Time entry was made */
/* utmpbuf.ut_xtime = (unsigned int)time(NULL); */
setutent();

14
systemd/README.systemd Normal file
View File

@ -0,0 +1,14 @@
To get URONode to answer IP socket requests via SystemD do the following:
- copy the SystemD files into /lib/systemd/system
- run: systemctl enable uronode
- run: systemctl enable ax25
- run: chkconfig uronode on
- run: chkconfig ax25 on
- run: systemctl daemon-reload
- in /etc/xinetd.d/uronode (or node) set disable to yes
(or comment out your line in /etc/inetd.conf)
- run: systemctl restart xinetd
- reboot

13
systemd/ax25.system Normal file
View File

@ -0,0 +1,13 @@
[Unit]
Description=ax25 service
After=network.target syslog.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/ax25 start
ExecReload=/usr/local/bin/ax25 restart
ExecStop =/usr/local/bin/ax25 stop
[Install]
WantedBy=multi-user.target

17
systemd/uronode.service Normal file
View File

@ -0,0 +1,17 @@
[Unit]
Description = URONode Server
Requires = uronode.socket
After=syslog.target network.target
[Service]
Type=oneshot
ExecStartPre=systemctl start uronode.socket
ExecStart=/usr/local/sbin/uronode
ExecStartPost=systemctl restart uronode.socket
StandardInput=socket
Sockets=uronode.socket
[Install]
Also = uronode.socket
WantedBy = multi-user.target
WantedBy = network.target

9
systemd/uronode.socket Normal file
View File

@ -0,0 +1,9 @@
[Unit]
Description=URONode Server Activation Socket
[Socket]
ListenStream=0.0.0.0:3694
Accept=yes
[Install]
WantedBy=sockets.target

15
systemd/uronode@.service Normal file
View File

@ -0,0 +1,15 @@
[Unit]
Description = URONode Server
Requires = uronode.socket
After=syslog.target network.target
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/uronode
StandardInput=socket
Sockets=uronode.socket
[Install]
Also = uronode.socket
WantedBy = multi-user.target
WantedBy = network.target

8
util.c
View File

@ -39,7 +39,7 @@ void node_msg(const char *fmt, ...)
if (User.ul_type == AF_NETROM) {
axio_printf(NodeIo,"%s} ", NodeId);
}
if ((User.ul_type == AF_INET) && (check_perms(PERM_ANSI, 0L) != -1)) {
if ((User.ul_type == AF_INET) || (User.ul_type == AF_INET6) && (check_perms(PERM_ANSI, 0L) != -1)) {
axio_printf(NodeIo,"\n\e[01;31m%s\e[0m@\e[01;34m%s\e[0m:/uronode$ ",User.call, HostName);
}
if ((User.ul_type == AF_INET) && (check_perms(PERM_ANSI, 0L) == -1)) {
@ -48,6 +48,12 @@ void node_msg(const char *fmt, ...)
if (User.ul_type == AF_AX25) {
axio_printf(NodeIo,"%s",Prompt);
}
if ((User.ul_type ==AF_INET6) && (check_perms(PERM_ANSI, 0L) == -1)) {
axio_printf(NodeIo, "\nSystemD - %s@%s: ",User.call, Hostname);
}
if ((User.ul_type ==AF_INET6) && (check_perms(PERM_ANSI, 0L) != -1)) {
axio_printf(NodeIo, "\n\e[01;31mSystemD \e[0m- \e[01;34m%s@\e[0m%s: ",User.call, Hostname);
}
}
*/
void node_perror(char *str, int err)