New port: cnet - a graphical network simulator.

This commit is contained in:
Jordan K. Hubbard 1998-02-08 20:02:51 +00:00
parent 00b42bba4c
commit b8ec842570
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=9627
7 changed files with 202 additions and 0 deletions

28
net/cnet/Makefile Normal file
View file

@ -0,0 +1,28 @@
# New ports collection makefile for: cnet
# Version required: 1.4
# Date created: Feb 8th, 1988
# Whom: jkh
#
# $Id$
#
DISTNAME= cnet-1.4-3
PKGNAME= cnet-1.4p3
CATEGORIES= net
MASTER_SITES= http://www.cs.uwa.edu.au/pls/cnet/
DEPENDS= ${PORTSDIR}/x11/xview-lib
WRKSRC= ${WRKDIR}/cnet-1.4
ALL_TARGET=
MAN1= cnet.1
pre-build:
cp ${FILESDIR}/Makefile.freebsd ${WRKSRC}/src
mkdir -p ${WRKSRC}/src/freebsd
cp ${FILESDIR}/compile.c ${WRKSRC}/src/freebsd
pre-install:
mkdir -p ${PREFIX}/share/examples/cnet
.include <bsd.port.mk>

1
net/cnet/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (cnet-1.4-3.tar.gz) = 2037adef9bbeb83b0c7f6792cdba5847

View file

@ -0,0 +1,54 @@
#
# The following #defines are for Sun's SunOS, >= SunOS4.1.2
# CC may be either cc or gcc
#
# Uncomment the following line if you wish Tcl/Tk windowing (see config.h)
#
#XINCLUDES =
#XLIBS = -ltcl -ltk -lXpm -lX11 -lm
#
# Uncomment the following line if you wish XView windowing (see config.h)
#
OPENWINHOME = ${X11BASE}
XINCLUDES = -I$(OPENWINHOME)/include
XLIBS = -L$(OPENWINHOME)/lib -lxview -lolgx -lXpm -lX11
#
# Uncomment the following lines if you wish Motif windowing (see config.h)
#
#XINCLUDES = -I$(X11BASE)/include
#XLIBS = -L$(X11BASE)/lib -lXm -lXt -lXpm -lX11
#CC = cc
CC = gcc -Wall -ansi
INCLUDES =
CFLAGS = -O $(INCLUDES) $(XINCLUDES)
#LD = cc
LD = gcc
LIBDIRS = -L/usr/local/lib
LIBS = -lm -lgnuregex
STRIP = strip
BINDIR = /usr/local/bin
MANDIR = /usr/local/man/man1
MANEXT = 1
INCDIR = /usr/local/include
# ---------------------- No user-serviceable code below -----------------
include Makefile.common
kultarr: $(NAME)
chmod 711 $(NAME)
rcp -p $(NAME) kultarr:/usr/kultarr/bin/$(NAME)
rcp -p $(NAME) kultarr:/usr/local/bin/$(NAME)
chmod 644 cnet.h DOC/cnet.man
rcp -p cnet.h kultarr:/usr/local/include/cnet.h
rcp -p DOC/cnet.man kultarr:/usr/local/man/manl/cnet.l

77
net/cnet/files/compile.c Normal file
View file

@ -0,0 +1,77 @@
#include <dlfcn.h>
#include <nlist.h>
static int add_compile_args(ac, av, kflag) int ac; char *av[]; int kflag;
{
av[ac++] = "-fPIC";
av[ac++] = "-I/usr/local/include"; /* XXX GROSS - should use prefix */
return(ac);
}
static int add_link_args(ac, av, kflag) int ac; char *av[]; int kflag;
{
av[ac++] = findenv("CNETLD", CNETLD);
av[ac++] = "cc";
av[ac++] = "-Bshareable";
return(ac);
}
static void data_segments(n, handle, so_filenm)
int n; void *handle; char *so_filenm;
{
extern int nlist _PARAMS((const char *, struct nlist *));
typedef struct _c {
char *so_filenm;
unsigned long length_data;
char *incore_data;
char *original_data;
struct _c *next;
} CACHE;
static CACHE *chd = (CACHE *)NULL;
CACHE *cp = chd;
NODE *np = &NP[n];
struct nlist nls[3];
while(cp != (CACHE *)NULL) {
if(strcmp(cp->so_filenm, so_filenm) == 0)
goto found;
cp = cp->next;
}
nls[0].n_name = "__DYNAMIC";
nls[1].n_name = "_end";
nls[2].n_name = (char *)NULL;
if(nlist(so_filenm, nls) != 0) {
(void)fprintf(stderr,"%s: cannot load symbols from %s\n",
progname,so_filenm);
++nerrors;
return;
}
cp = (CACHE *)malloc(sizeof(CACHE));
cp->so_filenm = strdup(so_filenm);
cp->length_data = (nls[1].n_value - nls[0].n_value);
cp->incore_data = (char *)((long)dlsym(handle,"end") - cp->length_data);
cp->original_data = (char *)malloc(cp->length_data);
(void)memcpy(cp->original_data, cp->incore_data, cp->length_data);
cp->next = chd;
chd = cp;
if(vflag)
(void)fprintf(stderr,"%s dataseg=0x%08lx len(dataseg)=%ld\n",
so_filenm, (long)cp->incore_data, cp->length_data);
found:
np->length_data[0] = cp->length_data;
np->incore_data[0] = cp->incore_data;
np->original_data[0] = cp->original_data;
np->private_data[0] = (char *)malloc(cp->length_data);
(void)memcpy(np->private_data[0], cp->original_data, cp->length_data);
}

1
net/cnet/pkg-comment Normal file
View file

@ -0,0 +1 @@
A networking simulator

3
net/cnet/pkg-descr Normal file
View file

@ -0,0 +1,3 @@
cnet is a networking simulator which enables experimentation with various data-link layer, network layer, routing and transport layer networking protocols.
It has been specifically developed for, and used in, undergraduate computer
networking courses by thousands of students since 1991.

38
net/cnet/pkg-plist Normal file
View file

@ -0,0 +1,38 @@
bin/cnet.so.1
man/man1/cnet.1.gz
include/cnet.h
share/examples/cnet/AUSTRALIA.MAP
share/examples/cnet/CLICK
share/examples/cnet/EXAMPLES
share/examples/cnet/FAST
share/examples/cnet/FLOODING1
share/examples/cnet/FLOODING2
share/examples/cnet/FLOODING3
share/examples/cnet/KEYBOARD
share/examples/cnet/LINKSTATE
share/examples/cnet/Makefile
share/examples/cnet/STOPANDWAIT
share/examples/cnet/T2
share/examples/cnet/TICKTOCK
share/examples/cnet/TOPOLOGY.2a
share/examples/cnet/TOPOLOGY.2b
share/examples/cnet/TOPOLOGY.2c
share/examples/cnet/WORLD
share/examples/cnet/WORLD.MAP
share/examples/cnet/click.c
share/examples/cnet/cnet.h
share/examples/cnet/cnet.tcl
share/examples/cnet/fast.c
share/examples/cnet/flooding.gp
share/examples/cnet/flooding1.c
share/examples/cnet/flooding1.dat
share/examples/cnet/flooding2.c
share/examples/cnet/flooding2.dat
share/examples/cnet/flooding3.c
share/examples/cnet/flooding3.dat
share/examples/cnet/keyboard.c
share/examples/cnet/linkstate.c
share/examples/cnet/protocol.c
share/examples/cnet/stopandwait.c
share/examples/cnet/ticktock.c
@dirrm share/examples/cnet