slugnet - Multiple user conferencing system: Part 6 of 6
James R. Purdon III
purdon at athena.mit.edu
Fri Dec 21 03:50:44 AEST 1990
The slugnet program is a multiple-user, interactive conferencing
facility. It currently runs under a variety of System V-based and
BSD-based operating systems (although certain functions may not be
possible under some of these operating systems).
Cut here----------------------------------------------------------
#!/bin/sh
# to extract, remove the header and type "sh filename"
if `test ! -s ./Makefile`
then
echo "writing ./Makefile"
cat > ./Makefile << '\End\Of\Shar\'
#
# Makefile for slugnet package
#
# Where the unformatted man pages are
#
MAN = /usr/man/man1
# Where the slugnet binary lives
#
SLUGBIN = /usr/local/bin
#
# Where the slugnet directory lives ( change slugnet.h to match )
#
SLUGDIR = /usr/users/slugnet
#
# who owns slugnet
#
SLUGUID = slugnet
#
# Select OS type
#
# BSD
#
# OS = -DBSD4
#
# SUNOS
#
# OS = -DBSD4 -OSUNOS
#
# System V R2.x (slugnetd probably won't work)
#
# OS = -DSYSV2
#
# System V R3 (with BSD network extensions )
#
# OS = -DSYSV3
#
# System V R3 (with interlan network extensions )
#
# OS = -DSYSV3 -DINTERLAN
# LDFLAGS = -ltcp
# UNICOS
#
# OS = -DSYSV3 -DUNICOS
# LDFLAGS = -lnet
#
# Ultrix
#
OS = -DULTRIX
#
instructions:
@echo "make slugnet Builds local program"
@echo "make slugnetd Builds network server"
@echo "make install Installs slugnet"
@echo "make clean Removes objects"
#
# local program
#
slugnet: clean
@echo "Making slugnet..."
@SLUGBIN=$(SLUGBIN) ;SLUGDIR=$(SLUGDIR) ;SLUGUID=$(SLUGUID) ;\
OS="$(OS)" ;SLUGNET=slugnet ;NETFLG="-DLOCAL" ;\
LDFLAGS=$(LDFLAGS) ;\
export LDFLAGS NETFLG OS SLUGBIN SLUGDIR SLUGUID SLUGNET ;\
make -e -f slugnet.mk slugnet
#
# network server
#
slugnetd: clean
@echo "Making slugnetd..."
@SLUGBIN=$(SLUGBIN) ;SLUGDIR=$(SLUGDIR) ;SLUGUID=$(SLUGUID) ;\
OS="$(OS)" ;SLUGNET=slugnetd ;NETFLG="-DNETWORK" ;\
LDFLAGS=$(LDFLAGS) ;\
export LDFLAGS NETFLG OS SLUGBIN SLUGDIR SLUGUID SLUGNET ;\
make -e -f slugnet.mk slugnetd
clean:
@SLUGBIN=$(SLUGBIN) ;SLUGDIR=$(SLUGDIR) ;SLUGUID=$(SLUGUID) ;\
OS="$(OS)" ;SLUGNET=slugnet ;NETFLG="-DLOCAL" ;\
LDFLAGS=$(LDFLAGS) ;\
export LDFLAGS NETFLG OS SLUGBIN SLUGDIR SLUGUID SLUGNET ;\
make -e -f slugnet.mk clean
install: local network
local:
@SLUGBIN=$(SLUGBIN) ;SLUGDIR=$(SLUGDIR) ;SLUGUID=$(SLUGUID) ;\
OS="$(OS)" ;SLUGNET=slugnet ;NETFLG="-DLOCAL" ;\
LDFLAGS=$(LDFLAGS) ;MAN=$(MAN) ;\
export LDFLAGS MAN NETFLG OS SLUGBIN SLUGDIR SLUGUID SLUGNET ;\
make -e -f slugnet.mk install
network:
@SLUGBIN=$(SLUGBIN) ;SLUGDIR=$(SLUGDIR) ;SLUGUID=$(SLUGUID) ;\
OS="$(OS)" ;SLUGNET=slugnetd ;NETFLG="-DNETWORK" ;\
LDFLAGS=$(LDFLAGS) ;MAN=$(MAN) ;\
export LDFLAGS MAN NETFLG OS SLUGBIN SLUGDIR SLUGUID SLUGNET ;\
make -e -f slugnet.mk install
tar:
@SLUGBIN=$(SLUGBIN) ;SLUGDIR=$(SLUGDIR) ;SLUGUID=$(SLUGUID) ;\
OS="$(OS)" ;SLUGNET=slugnetd ;NETFLG="-DNETWORK" ;\
LDFLAGS=$(LDFLAGS) ;\
export LDFLAGS NETFLG OS SLUGBIN SLUGDIR SLUGUID SLUGNET ;\
make -e -f slugnet.mk slugtar
\End\Of\Shar\
else
echo "will not over write ./Makefile"
fi
chmod 400 ./Makefile
if [ `wc -c ./Makefile | awk '{printf $1}'` -ne 2464 ]
then
echo `wc -c ./Makefile | awk '{print "Got " $1 ", Expected " 2464}'`
fi
if `test ! -s ./Readme`
then
echo "writing ./Readme"
cat > ./Readme << '\End\Of\Shar\'
@(#)Readme 1.2 Contents of the file slugtar and quick start.
File Notes
------------------------------------------------------------------------------
Makefile Makefile for slugnet, slugnetd, and installation.
Readme This file.
call_socket.c Source.
callbyaddr.c "
callbyhost.c "
chgusr.c "
cleanup.c "
clnusr.c "
copyright.h "
establish.c "
find.c "
get_connect.c "
getcfg.c "
getjsn.c "
interlan "
lock.c "
lower.c "
main.c "
net.h "
rdline.c "
receive.c "
repchar.c "
send_file.c "
setjsn.c "
sighang.c "
sigquit.c "
sigstop.c "
sigterm.c "
sigtstp.c "
sigurg.c "
slughlp.dat On line help file.
slugnet.1 man page for slugnet.
slugnet.c Source.
slugnetd.1 man page for slugnetd.
slugnet.doc Slugnet documentation.
slugnet.h Source.
slugnet.mk Prototype makefile, invoked by Makefile.
slugnet.n Original FTN5 source for CDC 180/865 running NOS.
strnicmp.c "
task.c "
transmit.c "
unlock.c "
verify.c "
Quick start.
1. In Makefile, be sure that MAN, SLUGBIN, SLUGDIR, SLUGUID, and OS are
set correctly.
2. make slugnet
3. make slugnetd
4. make install
5. make clean
6. nohup slugnetd >& /dev/null
\End\Of\Shar\
else
echo "will not over write ./Readme"
fi
chmod 400 ./Readme
if [ `wc -c ./Readme | awk '{printf $1}'` -ne 1156 ]
then
echo `wc -c ./Readme | awk '{print "Got " $1 ", Expected " 1156}'`
fi
if `test ! -s ./call_socket.c`
then
echo "writing ./call_socket.c"
cat > ./call_socket.c << '\End\Of\Shar\'
/* @(#)call_socket.c 1.2 */
#ifdef NETWORK
#include "net.h"
/* calls a socket */
int call_socket(hostname, portnum)
char *hostname;
int portnum;
{
struct sockaddr_in sa;
struct hostent *hp;
int a, s;
if ((hp= gethostbyname(hostname)) == NULL) { /* do we know the host's */
errno= ECONNREFUSED; /* address? */
return(0); /* no */
}
bzero(&sa,sizeof(sa));
bcopy(hp->h_addr,(char *)&sa.sin_addr,hp->h_length); /* set address */
sa.sin_family= hp->h_addrtype;
sa.sin_port= htons((u_short)portnum);
if ((s= socket(hp->h_addrtype,SOCK_STREAM,0)) < 0) /* get socket */
return(0);
if (connect(s,&sa,sizeof sa) < 0) /* connect */
return(0);
return(s);
}
#endif NETWORK
\End\Of\Shar\
else
echo "will not over write ./call_socket.c"
fi
chmod 400 ./call_socket.c
if [ `wc -c ./call_socket.c | awk '{printf $1}'` -ne 765 ]
then
echo `wc -c ./call_socket.c | awk '{print "Got " $1 ", Expected " 765}'`
fi
if `test ! -s ./callbyaddr.c`
then
echo "writing ./callbyaddr.c"
cat > ./callbyaddr.c << '\End\Of\Shar\'
/* @(#)callbyaddr.c 1.1 */
#ifdef NETWORK
#include "net.h"
/* calls a socket using the ip address */
int callbyaddr(addr, portnum)
char *addr;
int portnum;
{
struct sockaddr_in sa;
struct hostent *hp;
int a, s;
long adr;
adr = inet_addr( addr );
if ((hp= gethostbyaddr(&adr,strlen(addr),AF_INET)) == NULL) { /* do we know the host's */
errno= ECONNREFUSED; /* address? */
return(0); /* no */
}
bzero(&sa,sizeof(sa));
bcopy(hp->h_addr,(char *)&sa.sin_addr,hp->h_length); /* set address */
sa.sin_family= hp->h_addrtype;
sa.sin_port= htons((u_short)portnum);
if ((s= socket(hp->h_addrtype,SOCK_STREAM,0)) < 0) /* get socket */
return(0);
if (connect(s,&sa,sizeof sa) < 0) /* connect */
return(0);
return(s);
}
#endif NETWORK
\End\Of\Shar\
else
echo "will not over write ./callbyaddr.c"
fi
chmod 400 ./callbyaddr.c
if [ `wc -c ./callbyaddr.c | awk '{printf $1}'` -ne 829 ]
then
echo `wc -c ./callbyaddr.c | awk '{print "Got " $1 ", Expected " 829}'`
fi
if `test ! -s ./callbyhost.c`
then
echo "writing ./callbyhost.c"
cat > ./callbyhost.c << '\End\Of\Shar\'
/* @(#)callbyhost.c 1.1 */
#ifdef NETWORK
#include "net.h"
/* calls a socket using the host name */
int callbyhost(hostname, portnum)
char *hostname;
int portnum;
{
struct sockaddr_in sa;
struct hostent *hp;
int a, s;
if ((hp= gethostbyname(hostname)) == NULL) { /* do we know the host's */
errno= ECONNREFUSED; /* address? */
return(0); /* no */
}
bzero(&sa,sizeof(sa));
bcopy(hp->h_addr,(char *)&sa.sin_addr,hp->h_length); /* set address */
sa.sin_family= hp->h_addrtype;
sa.sin_port= htons((u_short)portnum);
if ((s= socket(hp->h_addrtype,SOCK_STREAM,0)) < 0) /* get socket */
return(0);
if (connect(s,&sa,sizeof sa) < 0) /* connect */
return(0);
return(s);
}
#endif NETWORK
\End\Of\Shar\
else
echo "will not over write ./callbyhost.c"
fi
chmod 400 ./callbyhost.c
if [ `wc -c ./callbyhost.c | awk '{printf $1}'` -ne 782 ]
then
echo `wc -c ./callbyhost.c | awk '{print "Got " $1 ", Expected " 782}'`
fi
echo "Finished archive 6 of 6"
exit
More information about the Alt.sources
mailing list