diff options
author | glewis <glewis@FreeBSD.org> | 2010-04-04 12:43:04 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2010-04-04 12:43:04 +0800 |
commit | 800eb659354b9e393ecbfb8a75a26e9212bce24b (patch) | |
tree | 7bae98e048090b2dfabec002c799f68a993bc4bd /net | |
parent | 0244ba3e2e4e9c9d922a9bcb74dba95210ddfd74 (diff) | |
download | freebsd-ports-gnome-800eb659354b9e393ecbfb8a75a26e9212bce24b.tar.gz freebsd-ports-gnome-800eb659354b9e393ecbfb8a75a26e9212bce24b.tar.zst freebsd-ports-gnome-800eb659354b9e393ecbfb8a75a26e9212bce24b.zip |
. Split the kernel mudlib out of the main dgd port and into its own
separate port (dgd-kernel) to put it on an equal footing with the
other mudlib port (dgd-lpmud). This also causes less update churn
and reflects the current state of the distributions themselves.
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/dgd-kernel/Makefile | 62 | ||||
-rw-r--r-- | net/dgd-kernel/distinfo | 12 | ||||
-rw-r--r-- | net/dgd-kernel/files/dgd-kernel.sh | 27 | ||||
-rw-r--r-- | net/dgd-kernel/files/patch-kernel.dgd | 18 | ||||
-rw-r--r-- | net/dgd-kernel/files/patch-net | 893 | ||||
-rw-r--r-- | net/dgd-kernel/pkg-descr | 8 | ||||
-rw-r--r-- | net/dgd-kernel/pkg-plist | 61 | ||||
-rw-r--r-- | net/dgd/Makefile | 45 | ||||
-rw-r--r-- | net/dgd/distinfo | 12 | ||||
-rw-r--r-- | net/dgd/files/extrapatch-kernellib-net | 996 | ||||
-rw-r--r-- | net/dgd/files/patch-mud.dgd | 2 | ||||
-rw-r--r-- | net/dgd/pkg-plist | 94 |
13 files changed, 1090 insertions, 1141 deletions
diff --git a/net/Makefile b/net/Makefile index bce3beca11a5..8a3ee88646b7 100644 --- a/net/Makefile +++ b/net/Makefile @@ -111,6 +111,7 @@ SUBDIR += desktop-data-model SUBDIR += despoof SUBDIR += dgd + SUBDIR += dgd-kernel SUBDIR += dgd-lpmud SUBDIR += dgd-net SUBDIR += dhcp6 diff --git a/net/dgd-kernel/Makefile b/net/dgd-kernel/Makefile new file mode 100644 index 000000000000..25b5d82b6256 --- /dev/null +++ b/net/dgd-kernel/Makefile @@ -0,0 +1,62 @@ +# New ports collection makefile for: dgd-kernel +# Date created: 2 April 2010 +# Whom: glewis +# +# $FreeBSD$ +# + +PORTNAME= dgd-kernel +PORTVERSION= 1.3.3 +CATEGORIES= net games +MASTER_SITES= http://ftp.dworkin.nl/kernellib/ \ + http://ftp.dworkin.nl/kernellib/patches/ +DISTNAME= kernellib-${PORTVERSION:S/.3$//} + +PATCHFILES= ${PORTVERSION:S/.3$//}-${PORTVERSION:S/.3$//}.1.gz \ + ${PORTVERSION:S/.3$//}.1-${PORTVERSION:S/.3$//}.2.gz \ + ${PORTVERSION:S/.3$//}.2-${PORTVERSION:S/.3$//}.3.gz + +MAINTAINER= glewis@FreeBSD.org +COMMENT= Kernel mudlib, for use with DGD + +RUN_DEPENDS= ${LOCALBASE}/sbin/dgd:${PORTSDIR}/net/dgd + +DIST_SUBDIR= dgd +WRKSRC= ${WRKDIR} +NO_BUILD= yes +.if !defined(NOPORTDOCS) +PORTDOCS= * +.endif + +post-patch: + cd ${WRKSRC} && ${FIND} . -name '*.orig' -delete + +do-configure: + ${REINPLACE_CMD} -e "s:%%DATADIR%%:${DATADIR}:" \ + ${WRKSRC}/kernellib/doc/kernel/kernel.dgd + +do-install: + @${MKDIR} ${PREFIX}/etc/${PORTNAME} + @${INSTALL_DATA} ${WRKSRC}/kernellib/doc/kernel/kernel.dgd \ + ${PREFIX}/etc/${PORTNAME}/ + @${MKDIR} ${DATADIR}/kernel +.for DIR in include kernel usr + @cd ${WRKSRC}/kernellib && ${COPYTREE_SHARE} ${DIR} ${DATADIR}/kernel +.endfor + @# Install an RC script for dgd-kernel + @${CAT} ${FILESDIR}/dgd-kernel.sh | ${SED} -e "s:%%PREFIX%%:${PREFIX}:" \ + -e "s:%%DATADIR%%:${DATADIR}:" > \ + ${PREFIX}/etc/rc.d/dgd-kernel.sh.sample + @${CHMOD} a+x ${PREFIX}/etc/rc.d/dgd-kernel.sh.sample +.if !defined(NOPORTDOCS) + @${MKDIR} ${DOCSDIR} + @cd ${WRKSRC}/kernellib && ${COPYTREE_SHARE} doc ${DOCSDIR} +.endif + +post-install: + @# Need a temporary directory for certain files + @${MKDIR} ${DATADIR}/tmp + @# Set mudlib ownership + -@${CHOWN} -h -R mud:mud ${DATADIR} + +.include <bsd.port.mk> diff --git a/net/dgd-kernel/distinfo b/net/dgd-kernel/distinfo new file mode 100644 index 000000000000..5f468a889cb2 --- /dev/null +++ b/net/dgd-kernel/distinfo @@ -0,0 +1,12 @@ +MD5 (dgd/kernellib-1.3.tar.gz) = a388b467537dd148d69525e7d31399c1 +SHA256 (dgd/kernellib-1.3.tar.gz) = e78b9e2e6d72206d89b9bb1841bb5e47e5b835df29879acd1eb72cb10d778fe6 +SIZE (dgd/kernellib-1.3.tar.gz) = 44225 +MD5 (dgd/1.3-1.3.1.gz) = baf6781e216271dbd815014ce0ef4359 +SHA256 (dgd/1.3-1.3.1.gz) = 46e8cb08b920845077fcb8e50584d57e7898502a678a9308e8b8f597cac15423 +SIZE (dgd/1.3-1.3.1.gz) = 1793 +MD5 (dgd/1.3.1-1.3.2.gz) = 4c1ed037da31720349c896a0db6bbf03 +SHA256 (dgd/1.3.1-1.3.2.gz) = c676219e389c52f35cb18f9874830ded458c23a43105ab79ba04db53e0866fe3 +SIZE (dgd/1.3.1-1.3.2.gz) = 783 +MD5 (dgd/1.3.2-1.3.3.gz) = 75e60561e961dd0e1526afc56c17cec7 +SHA256 (dgd/1.3.2-1.3.3.gz) = 0f4685909a3bb7b8789e1b8c4bd5ab17c51405ee996cbcbb62d0b066dce6bfc5 +SIZE (dgd/1.3.2-1.3.3.gz) = 1757 diff --git a/net/dgd-kernel/files/dgd-kernel.sh b/net/dgd-kernel/files/dgd-kernel.sh new file mode 100644 index 000000000000..82b9509549d2 --- /dev/null +++ b/net/dgd-kernel/files/dgd-kernel.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# $FreeBSD: /tmp/pcvs/ports/net/dgd-kernel/files/dgd-kernel.sh,v 1.1 2010-04-04 04:43:04 glewis Exp $ + +DGD_CONF=%%PREFIX%%/etc/dgd-kernel/kernel.dgd +DGD_USER=mud +DGD=%%PREFIX%%/sbin/dgd +DGD_LOG=%%DATADIR%%/kernel.log +DGD_PID=/var/run/dgd-kernel.pid + +case "$1" in + start) + if [ -x "${DGD}" ]; then + su ${DGD_USER} -c "${DGD} ${DGD_CONF}" >> "${DGD_LOG}" 2>&1 & + echo $(($!+2)) > "${DGD_PID}" + echo -n ' dgd' + fi + ;; + stop) + kill -TERM `cat "${DGD_PID}"` && rm -f "${DGD_PID}" + ;; + *) + echo "" + echo "Usage: `basename $0` { start | stop }" + echo "" + exit 64 + ;; +esac diff --git a/net/dgd-kernel/files/patch-kernel.dgd b/net/dgd-kernel/files/patch-kernel.dgd new file mode 100644 index 000000000000..e4aa6f263e48 --- /dev/null +++ b/net/dgd-kernel/files/patch-kernel.dgd @@ -0,0 +1,18 @@ +$FreeBSD$ + +--- kernellib/doc/kernel/kernel.dgd.orig 2010-02-20 08:46:29.000000000 -0800 ++++ kernellib/doc/kernel/kernel.dgd 2010-02-20 08:47:38.000000000 -0800 +@@ -1,11 +1,12 @@ + telnet_port = 6047; /* telnet port number */ + binary_port = 6048; /* binary port number */ +-directory = "/home/dworkin/dgd/mud";/* base directory (MUST be absolute) */ ++directory = "%%DATADIR%%/kernel"; /* base directory (MUST be absolute) */ + users = 40; /* max # of users */ + editors = 40; /* max # of editor sessions */ ++ports = 16; /* max number of open ports (for network extensions) */ + ed_tmpfile = "../tmp/ed"; /* proto editor tmpfile */ +-swap_file = "../tmp/swap"; /* swap file */ ++swap_file = "../tmp/dgd-kernel.swap"; /* swap file */ + swap_size = 1024; /* # sectors in swap file */ + cache_size = 50; /* # sectors in swap cache */ + sector_size = 512; /* swap sector size */ diff --git a/net/dgd-kernel/files/patch-net b/net/dgd-kernel/files/patch-net new file mode 100644 index 000000000000..5af8901f4736 --- /dev/null +++ b/net/dgd-kernel/files/patch-net @@ -0,0 +1,893 @@ +$FreeBSD$ + +--- kernellib/include/config.h 2009-05-21 05:59:08.000000000 -0700 ++++ kernellib/include/config.h 2010-04-03 11:19:13.000000000 -0700 +@@ -4,3 +4,10 @@ + # define LIGHTWEIGHT_SUBDIR "/data/" + + # undef SYS_PERSISTENT /* off by default */ ++ ++# ifdef __NETWORK_EXTENSIONS__ ++# define TELNET_PORT 6047 /* default telnet port */ ++# define BINARY_PORT 6048 /* default binary port */ ++# define EMERGENCY_PORT 6049 /* emergency binary port */ ++# endif ++ +--- kernellib/include/kernel/net.h 1969-12-31 16:00:00.000000000 -0800 ++++ kernellib/include/kernel/net.h 2010-04-03 11:19:13.000000000 -0700 +@@ -0,0 +1,8 @@ ++# ifdef __NETWORK_EXTENSIONS__ ++# define LIB_PORT "/kernel/lib/network/port" ++# define PORT_OBJECT "/kernel/obj/port" ++# define PORT_TELNET "/kernel/sys/telnet_port" ++# define PORT_BINARY "/kernel/sys/binary_port" ++# define PORT_EMERGENCY "/kernel/sys/emergency_port" ++# define PORT_UDP "/kernel/obj/udp" ++# endif +--- kernellib/include/kernel/user.h 2009-05-21 04:40:24.000000000 -0700 ++++ kernellib/include/kernel/user.h 2010-04-03 11:19:13.000000000 -0700 +@@ -6,6 +6,10 @@ + # define BINARY_CONN ("/kernel" + CLONABLE_SUBDIR + "binary") + # define API_USER ("/kernel" + INHERITABLE_SUBDIR + "api/user") + ++#ifdef __NETWORK_EXTENSIONS__ ++#define LIB_PORT "/kernel/lib/network/port" ++#endif ++ + # define DEFAULT_USER ("/kernel" + CLONABLE_SUBDIR + "user") + # define DEFAULT_WIZTOOL ("/kernel" + CLONABLE_SUBDIR + "wiztool") + # define DEFAULT_USER_DIR "/kernel/data" +--- kernellib/kernel/lib/auto.c 2010-04-03 19:11:52.000000000 -0700 ++++ kernellib/kernel/lib/auto.c 2010-04-03 11:19:13.000000000 -0700 +@@ -3,6 +3,10 @@ + # include <kernel/rsrc.h> + # include <kernel/access.h> + # include <kernel/user.h> ++# ifdef __NETWORK_EXTENSIONS__ ++# include <kernel/net.h> ++# endif ++ + # include <status.h> + # include <type.h> + # include <trace.h> +@@ -1569,3 +1573,64 @@ + } : error(TLSVAR2); + return result; + } ++ ++# ifdef __NETWORK_EXTENSIONS__ ++/* ++ * NAME: connect() ++ * DESCRIPTION: open an outbound connection ++ */ ++static void connect(string destination, int port,varargs string proto) ++{ ++ object conn; ++ string err; ++ ++ if (previous_program() == LIB_CONN) { ++ if(!proto) proto = "tcp"; ++ ::connect(destination, port,proto); ++ } else { ++ CHECKARG(destination, 1, "connect"); ++ ++ if (creator == "System" && this_object()) { ++ if (function_object("query_conn", this_object()) != LIB_USER) { ++ error("Not a user object"); ++ } ++ conn = clone_object(BINARY_CONN, "System"); ++ call_other(this_object(),"connection",conn); ++ conn->connect(destination, port,proto); ++ if(err) { ++ rlimits (-1; -1) { ++ destruct_object(conn); ++ } ++ error(err); ++ } ++ } ++ } ++} ++ ++static object port_object; ++ ++/* ++ * NAME: open_port() ++ * DESCRIPTION: open a port to listen on ++ */ ++static void open_port(string protocol, varargs int port) ++{ ++ CHECKARG(protocol, 1, "open_port"); ++ ++ if (KERNEL() && this_object()) { ++ ::open_port(protocol, port); ++ } ++} ++ ++/* ++ * NAME: ports() ++ * DESCRIPTION: return list of open ports ++ */ ++static object *ports() ++{ ++ if (creator == "System") { ++ return ::ports(); ++ } ++} ++# endif /* __NETWORK_EXTENSIONS__ */ ++ +--- kernellib/kernel/lib/connection.c 2010-04-03 19:11:52.000000000 -0700 ++++ kernellib/kernel/lib/connection.c 2010-04-03 11:31:52.000000000 -0700 +@@ -6,6 +6,9 @@ + private object user; /* user object */ + private string conntype; /* connection type */ + private int mode; /* connection mode */ ++#ifdef __NETWORK_EXTENSIONS__ ++private int outgoing; ++#endif + private int blocked; /* connection blocked? */ + private string buffer; /* buffered output string */ + +@@ -66,6 +69,13 @@ + int timeout; + string banner; + ++#ifdef __NETWORK_EXTENSIONS__ ++ if(outgoing) { ++ user->login("now"); ++ return; ++ } ++#endif ++ + banner = call_other(userd, "query_" + conntype + "_banner", port, + this_object()); + if (banner) { +@@ -74,7 +84,11 @@ + + timeout = call_other(userd, "query_" + conntype + "_timeout", port, + this_object()); +- if (timeout < 0) { ++ if (timeout < 0 ++#ifdef __NETWORK_EXTENSIONS__ ++ && !outgoing ++#endif ++ ) { + /* disconnect immediately */ + destruct_object(this_object()); + return; +@@ -83,6 +97,11 @@ + if (!user && timeout != 0) { + call_out("timeout", timeout); + } ++# ifdef __NETWORK_EXTENSIONS__ ++ else { ++ set_mode(user->login(nil)); ++ } ++# endif + } + + /* +@@ -136,7 +155,14 @@ + */ + void set_port(int num) + { +- if (previous_object() == userd) { ++#ifdef __NETWORK_EXTENSIONS__ ++ if(num == 0) error("port is 0\n"); ++#endif ++ if (previous_object() == userd ++#ifdef __NETWORK_EXTENSIONS__ ++ || SYSTEM() ++#endif ++ ) { + port = num; + } + } +@@ -194,7 +220,15 @@ + user = call_other(userd, conntype + "_user", port, str); + set_mode(mode = user->login(str)); + } else { ++#ifdef __NETWORK_EXTENSIONS__ ++ mixed m; ++ m = user->receive_message(str); ++ if(m) mode = m; ++ else mode = 0; ++ set_mode(mode); ++#else + set_mode(mode = user->receive_message(str)); ++#endif + } + return mode; + } +@@ -223,6 +257,10 @@ + return TRUE; + } + } ++#ifdef __NETWORK_EXTENSIONS__ ++ } else { ++ error(object_name(previous_object())+" is not allowed to do that"); ++#endif + } + } + +@@ -240,6 +278,7 @@ + } + } + ++#ifndef __NETWORK_EXTENSIONS__ + /* + * NAME: datagram_challenge() + * DESCRIPTION: set the challenge for the datagram channel +@@ -283,3 +322,23 @@ + return (send_datagram(str) == strlen(str)); + } + } ++#else ++/* ++ * NAME: connect() ++ * DESCRIPTION: establish an outbount connection ++ */ ++void connect(string destination, int n,varargs string protocol) ++{ ++ if (previous_program() == AUTO || previous_program() == LIB_USER) { ++ outgoing = 1; ++ user = previous_object(); ++ port = n; ++ ::connect(destination, n, protocol); ++ } ++} ++ ++void receive_error(string str) { ++ DRIVER->message("NETWORK ERROR: "+str+"\n"); ++} ++# endif ++ +--- kernellib/kernel/lib/network/port.c 1969-12-31 16:00:00.000000000 -0800 ++++ kernellib/kernel/lib/network/port.c 2010-04-03 11:19:13.000000000 -0700 +@@ -0,0 +1,68 @@ ++# include <kernel/kernel.h> ++# include <kernel/user.h> ++# include <trace.h> ++# include <type.h> ++ ++private object driver; /* driver object */ ++private object userd; /* user manager object */ ++private string protocol; /* telnet, tcp or udp */ ++ ++/* ++ * NAME: create() ++ * DESCRIPTION: initialize port object ++ */ ++static void create() ++{ ++ driver = find_object(DRIVER); ++ userd = find_object(USERD); ++} ++ ++/* ++ * NAME: open_port() ++ * DESCRIPTION: start listening on a port ++ */ ++static ++void open_port(string prot, varargs int port) ++{ ++ rlimits (-1; -1) { ++/* catch {*/ ++ if (typeof(port)==T_INT && port !=0) { ++ ::open_port(prot, port); ++ } else { ++ ::open_port(prot); ++ } ++ protocol = prot; ++ return; ++/* } : { ++ error(::call_trace()[1][TRACE_FIRSTARG][1]); ++ return; ++ }*/ ++ } ++} ++ ++object ++connection(mixed *tls, string ip, int port) ++{ ++ object conn; ++ ++ switch(protocol) { ++ case "telnet" : conn = clone_object(TELNET_CONN); ++ break; ++ default : conn = clone_object(BINARY_CONN); ++ break; ++ } ++ conn->set_port(port); ++ return conn; ++} ++ ++int ++open(mixed *tls,int port) ++{ ++ return FALSE; ++} ++ ++void ++close(mixed *tls, int force) ++{ ++} ++ +--- kernellib/kernel/obj/binary.c 2010-04-03 19:11:52.000000000 -0700 ++++ kernellib/kernel/obj/binary.c 2010-04-03 11:19:13.000000000 -0700 +@@ -1,5 +1,9 @@ + # include <kernel/kernel.h> + # include <kernel/user.h> ++# ifdef __NETWORK_EXTENSIONS__ ++# include <kernel/net.h> ++# endif ++ + + inherit LIB_CONN; /* basic connection object */ + +@@ -25,9 +29,14 @@ + * NAME: open() + * DESCRIPTION: open the connection + */ +-static void open() ++static int open() + { + ::open(allocate(driver->query_tls_size())); ++# ifdef __NETWORK_EXTENSIONS__ ++ return TRUE; ++# else ++ return FALSE; ++# endif + } + + /* +@@ -162,6 +171,7 @@ + ::message_done(allocate(driver->query_tls_size())); + } + ++#ifndef __NETWORK_EXTENSIONS__ + /* + * NAME: open_datagram() + * DESCRIPTION: open a datagram channel for this connection +@@ -179,3 +189,48 @@ + { + ::receive_datagram(allocate(driver->query_tls_size()), str); + } ++ ++#else ++ ++object udpchannel; /* UDP channel object */ ++ ++/* ++ * NAME: set_udpchannel() ++ * DESCRIPTION: set the UDP channel for this connection ++ */ ++void set_udpchannel(object udp, string host, int port) ++{ ++ if (previous_program() == LIB_PORT) { ++ udpchannel = udp; ++ udp->add_connection(this_object(), host, port); ++ } ++} ++ ++/* ++ * NAME: receive_datagram() ++ * DESCRIPTION: receive a datagram ++ */ ++void receive_datagram(mixed *tls, string str) ++{ ++ if (previous_object() == udpchannel) { ++ object user; ++ ++ user = query_user(); ++ if (user) { ++ user->receive_datagram(str); ++ } ++ } ++} ++ ++/* ++ * NAME: datagram() ++ * DESCRIPTION: send a datagram on the UDP channel ++ */ ++int datagram(string str) ++{ ++ if (previous_object() == query_user() && udpchannel) { ++ return udpchannel->datagram(str); ++ } ++} ++ ++#endif ++ +--- kernellib/kernel/obj/port.c 1969-12-31 16:00:00.000000000 -0800 ++++ kernellib/kernel/obj/port.c 2010-04-03 11:19:13.000000000 -0700 +@@ -0,0 +1,49 @@ ++# include <kernel/kernel.h> ++# include <kernel/user.h> ++# include <kernel/net.h> ++ ++inherit LIB_PORT; ++ ++/* ++ * NAME: create() ++ * DESCRIPTION: initialize port object ++ */ ++static void create(int clone) ++{ ++ if (clone) { ++ ::create(); ++ } ++} ++ ++/* ++ * NAME: listen() ++ * DESCRIPTION: start listening on a port ++ */ ++void listen(string protocol, int port) ++{ ++#ifndef __NETWORK_EXTENSIONS__ ++ if (previous_program() == DRIVER) { ++#else ++ if (previous_program() == DRIVER || previous_program() == USERD) { ++#endif ++ ::open_port(protocol, port); ++ } ++} ++ ++/* ++ * NAME: open_connection() ++ * DESCRIPTION: don't return a user object, select it by first line of input ++ */ ++static object open_connection(string ipaddr, int port) ++{ ++ return nil; ++} ++ ++void open(int port) { ++ ::open(allocate(DRIVER->query_tls_size()),port); ++} ++ ++object connection(string ip, int port) { ++ ::connection(allocate(DRIVER->query_tls_size()),ip,port); ++} ++ +--- kernellib/kernel/sys/binary_port.c 1969-12-31 16:00:00.000000000 -0800 ++++ kernellib/kernel/sys/binary_port.c 2010-04-03 11:19:13.000000000 -0700 +@@ -0,0 +1,47 @@ ++#include <kernel/net.h> ++#include <kernel/user.h> ++#include <kernel/kernel.h> ++ ++inherit LIB_PORT; /* basic port object */ ++ ++object driver; /* driver object */ ++ ++void ++create() ++{ ++ ::create(); ++ driver = find_object(DRIVER); ++ open_port("tcp", BINARY_PORT); ++} ++ ++object ++connection(string ip, int port) ++{ ++ return ::connection(allocate(driver->query_tls_size()), ip, port); ++} ++ ++void ++done() ++{ ++ close_user(); ++} ++ ++/* ++ * NAME: open() ++ * DESCRIPTION: open the connection ++ */ ++static int open(int port) ++{ ++ ::open(allocate(driver->query_tls_size()), port); ++ return FALSE; ++} ++ ++/* ++ * NAME: close() ++ * DESCRIPTION: close the connection ++ */ ++static void close(int force) ++{ ++ ::close(allocate(driver->query_tls_size()), force); ++} ++ +--- kernellib/kernel/sys/driver.c 2010-04-03 19:11:52.000000000 -0700 ++++ kernellib/kernel/sys/driver.c 2010-04-03 11:19:13.000000000 -0700 +@@ -4,6 +4,9 @@ + # include <kernel/access.h> + # include <kernel/user.h> + # include <kernel/tls.h> ++# ifdef __NETWORK_EXTENSIONS__ ++# include <kernel/net.h> ++# endif + # include <status.h> + # include <trace.h> + +@@ -16,8 +19,17 @@ + object initd; /* init manager object */ + object objectd; /* object manager object */ + object errord; /* error manager object */ ++# ifdef __NETWORK_EXTENSIONS__ ++static object port_master; /* port master object */ ++static object telnet; /* default telnet port object */ ++static object binary; /* default binary port object */ ++static object emergency; /* emergency port object */ ++# endif ++ + int tls_size; /* thread local storage size */ + ++ ++ + /* + * NAME: creator() + * DESCRIPTION: get creator of file +@@ -402,6 +414,10 @@ + call_other(accessd = load(ACCESSD), "???"); + call_other(userd = load(USERD), "???"); + call_other(load(DEFAULT_WIZTOOL), "???"); ++# ifdef __NETWORK_EXTENSIONS__ ++ call_other(port_master = load(PORT_OBJECT), "???"); ++ call_other(emergency = load(PORT_EMERGENCY), "???"); ++# endif + + /* initialize other users as resource owners */ + users = (accessd->query_users() - ({ "System" })) | ({ "admin" }); +@@ -426,8 +442,13 @@ + shutdown(); + return; + } ++# ifdef __NETWORK_EXTENSIONS__ ++ } else { ++ call_other(telnet = load(PORT_TELNET),"???"); ++ call_other(binary = load(PORT_BINARY),"???"); ++ rsrcd->rsrc_incr("System", "objects", nil, 2, 1); ++#endif + } +- + message("Initialization complete.\n\n"); + } + +@@ -470,7 +491,19 @@ + initd->reboot(); + } + } +- ++# ifdef __NETWORK_EXTENSIONS__ ++ if (telnet) { ++ telnet->listen("telnet", TELNET_PORT); ++ } ++ if (binary) { ++ binary->listen("tcp", BINARY_PORT); ++ } ++ if(!emergency) { ++ emergency = clone_object(port_master); ++ rsrcd->rsrc_incr("System", "objects", nil, 1, 1); ++ } ++ emergency->listen("tcp", EMERGENCY_PORT); ++# endif + message("State restored.\n\n"); + } + +--- kernellib/kernel/sys/emergency_port.c 1969-12-31 16:00:00.000000000 -0800 ++++ kernellib/kernel/sys/emergency_port.c 2010-04-03 11:19:13.000000000 -0700 +@@ -0,0 +1,47 @@ ++#include <kernel/net.h> ++#include <kernel/user.h> ++#include <kernel/kernel.h> ++ ++inherit LIB_PORT; /* basic port object */ ++ ++object driver; /* driver object */ ++ ++void ++create() ++{ ++ ::create(); ++ driver = find_object(DRIVER); ++ open_port("tcp", EMERGENCY_PORT); ++} ++ ++object ++connection(string ip, int port) ++{ ++ return ::connection(allocate(driver->query_tls_size()), ip, port); ++} ++ ++void ++done() ++{ ++ close_user(); ++} ++ ++/* ++ * NAME: open() ++ * DESCRIPTION: open the connection ++ */ ++static int open(int port) ++{ ++ ::open(allocate(driver->query_tls_size()), port); ++ return FALSE; ++} ++ ++/* ++ * NAME: close() ++ * DESCRIPTION: close the connection ++ */ ++static void close(int force) ++{ ++ ::close(allocate(driver->query_tls_size()), force); ++} ++ +--- kernellib/kernel/sys/telnet_port.c 1969-12-31 16:00:00.000000000 -0800 ++++ kernellib/kernel/sys/telnet_port.c 2010-04-03 11:19:13.000000000 -0700 +@@ -0,0 +1,47 @@ ++#include <kernel/net.h> ++#include <kernel/user.h> ++#include <kernel/kernel.h> ++ ++inherit LIB_PORT; /* basic port object */ ++ ++object driver; /* driver object */ ++ ++void ++create() ++{ ++ ::create(); ++ driver = find_object(DRIVER); ++ open_port("telnet", TELNET_PORT); ++} ++ ++object ++connection(string ip, int port) ++{ ++ return ::connection(allocate(driver->query_tls_size()), ip, port); ++} ++ ++void ++done() ++{ ++ close_user(); ++} ++ ++/* ++ * NAME: open() ++ * DESCRIPTION: open the connection ++ */ ++static int open(int port) ++{ ++ ::open(allocate(driver->query_tls_size()), port); ++ return FALSE; ++} ++ ++/* ++ * NAME: close() ++ * DESCRIPTION: close the connection ++ */ ++static void close(int force) ++{ ++ ::close(allocate(driver->query_tls_size()), force); ++} ++ +--- kernellib/kernel/sys/userd.c 2010-04-03 19:11:52.000000000 -0700 ++++ kernellib/kernel/sys/userd.c 2010-04-03 11:35:13.000000000 -0700 +@@ -1,11 +1,20 @@ + # include <kernel/kernel.h> + # include <kernel/user.h> ++# ifdef __NETWORK_EXTENSIONS__ ++# include <kernel/net.h> ++# define PORT PORT_OBJECT ++# else ++# define PORT DRIVER ++# endif + # include <status.h> + + + object *users; /* user mappings */ + mapping names; /* name : connection object */ + object *connections; /* saved connections */ ++#ifdef __NETWORK_EXTENSIONS__ ++mapping listeners_telnet, listeners_tcp; /* port objects */ ++#endif + mapping telnet, binary; /* port managers */ + + /* +@@ -18,6 +27,9 @@ + if (!find_object(TELNET_CONN)) { compile_object(TELNET_CONN); } + if (!find_object(BINARY_CONN)) { compile_object(BINARY_CONN); } + if (!find_object(DEFAULT_USER)) { compile_object(DEFAULT_USER); } ++# ifdef __NETWORK_EXTENSIONS__ ++ if (!find_object(PORT_OBJECT)) { compile_object(PORT_OBJECT); } ++# endif + + /* initialize user arrays */ + users = ({ }); +@@ -32,7 +44,13 @@ + */ + object telnet_connection(mixed *tls, int port) + { +- if (previous_program() == DRIVER) { ++ if (previous_program() == ++#ifdef __NETWORK_EXTENSIONS__ ++ PORT ++#else ++ DRIVER ++#endif ++ ) { + object conn; + + conn = clone_object(TELNET_CONN); +@@ -47,7 +65,13 @@ + */ + object binary_connection(mixed *tls, int port) + { +- if (previous_program() == DRIVER) { ++ if (previous_program() == ++#ifdef __NETWORK_EXTENSIONS__ ++ PORT ++#else ++ DRIVER ++#endif ++ ) { + object conn; + + conn = clone_object(BINARY_CONN); +@@ -56,6 +80,51 @@ + } + } + ++#ifdef __NETWORK_EXTENSIONS__ ++/* ++ * NAME: ++ * DESCRIPTION: ++ */ ++private void start_telnet_listener(int port) ++{ ++ if(!listeners_telnet) { ++ listeners_telnet = ([ ]); ++ } ++ if(!listeners_tcp) { ++ listeners_tcp = ([ ]); ++ } ++ ++ if(!listeners_telnet[port] && !listeners_tcp[port]) { ++ listeners_telnet[port] = clone_object(PORT_OBJECT); ++ listeners_telnet[port]->listen("telnet",port); ++ } else { ++ error("Port "+port+" is already in use."); ++ } ++} ++ ++/* ++ * NAME: ++ * DESCRIPTION: ++ */ ++private void start_tcp_listener(int port) ++{ ++ if(!listeners_telnet) { ++ listeners_telnet = ([ ]); ++ } ++ ++ if(!listeners_tcp) { ++ listeners_tcp = ([ ]); ++ } ++ ++ if(!listeners_telnet[port] && !listeners_tcp[port]) { ++ listeners_tcp[port] = clone_object(PORT_OBJECT); ++ listeners_tcp[port]->listen("tcp",port); ++ } else { ++ error("Port "+port+" is already in use."); ++ } ++} ++#endif ++ + /* + * NAME: set_telnet_manager() + * DESCRIPTION: set the telnet manager object, which determines what the +@@ -64,7 +133,15 @@ + void set_telnet_manager(int port, object manager) + { + if (SYSTEM()) { ++#ifdef __NETWORK_EXTENSIONS__ ++ if(!port) port = TELNET_PORT; ++#endif + telnet[port] = manager; ++#ifdef __NETWORK_EXTENSIONS__ ++ DRIVER->message("telnet manager for port "+port+ " is now "+ ++ object_name(manager)+"\n"); ++ start_telnet_listener(port); ++#endif + } + } + +@@ -76,11 +153,18 @@ + void set_binary_manager(int port, object manager) + { + if (SYSTEM()) { ++#ifdef __NETWORK_EXTENSIONS__ ++ if(!port) port = BINARY_PORT; ++#endif + binary[port] = manager; ++#ifdef __NETWORK_EXTENSIONS__ ++ DRIVER->message("binary manager for port "+port+ " is now "+ ++ object_name(manager)+"\n"); ++ start_tcp_listener(port); ++#endif + } + } + +- + /* + * NAME: telnet_user() + * DESCRIPTION: select user object for telnet connection, based on line of +@@ -94,6 +178,9 @@ + user = names[str]; + if (!user) { + user = telnet[port]; ++#ifdef __NETWORK_EXTENSIONS__ ++ if(!user) user = binary[port]; ++#endif + if (user) { + user = (object LIB_USER) user->select(str); + } else { +@@ -117,7 +204,14 @@ + user = names[str]; + if (!user) { + user = binary[port]; +- if (user && (str != "admin" || port != 0)) { ++ if(!user) user = telnet[port]; ++ if (user && (str != "admin" || port != ++#ifdef __NETWORK_EXTENSIONS__ ++ EMERGENCY_PORT ++#else ++ 0 ++#endif ++ )) { + user = (object LIB_USER) user->select(str); + } else { + user = clone_object(DEFAULT_USER); +--- kernellib/usr/System/initd.c 1969-12-31 16:00:00.000000000 -0800 ++++ kernellib/usr/System/initd.c 2010-04-03 19:09:58.000000000 -0700 +@@ -0,0 +1,34 @@ ++# include <kernel/kernel.h> ++ ++private void ++load(string filename) ++{ ++ if (!find_object(filename)) { ++ compile_object(filename); ++ } ++} ++ ++static void ++create() ++{ ++#ifdef __NETWORK_EXTENSIONS__ ++ load("/kernel/sys/telnet_port"); ++ load("/kernel/sys/binary_port"); ++#endif ++} ++ ++void ++prepare_reboot() ++{ ++ if (previous_program() == DRIVER) { ++ /* ... */ ++ } ++} ++ ++void ++reboot() ++{ ++ if (previous_program() == DRIVER) { ++ /* ... */ ++ } ++} diff --git a/net/dgd-kernel/pkg-descr b/net/dgd-kernel/pkg-descr new file mode 100644 index 000000000000..edab81571da0 --- /dev/null +++ b/net/dgd-kernel/pkg-descr @@ -0,0 +1,8 @@ +The kernel library was written to solve the technical problems encountered +when writing a DGD mudlib for users who will have programming access. It deals +with resource control, file security and user management, and offers basic +functionality in the form of events. The library is designed to be fully +configurable, and should not have to be modified for use on any system. It +can be used for both persistent and non-persistent systems. + +WWW: http://ftp.dworkin.nl/kernellib/ diff --git a/net/dgd-kernel/pkg-plist b/net/dgd-kernel/pkg-plist new file mode 100644 index 000000000000..33ef34c7ade2 --- /dev/null +++ b/net/dgd-kernel/pkg-plist @@ -0,0 +1,61 @@ +etc/dgd-kernel/kernel.dgd +etc/rc.d/dgd-kernel.sh.sample +%%DATADIR%%/kernel/include/config.h +%%DATADIR%%/kernel/include/kernel/access.h +%%DATADIR%%/kernel/include/kernel/kernel.h +%%DATADIR%%/kernel/include/kernel/net.h +%%DATADIR%%/kernel/include/kernel/objreg.h +%%DATADIR%%/kernel/include/kernel/rsrc.h +%%DATADIR%%/kernel/include/kernel/tls.h +%%DATADIR%%/kernel/include/kernel/user.h +%%DATADIR%%/kernel/include/kernel/version.h +%%DATADIR%%/kernel/include/std.h +%%DATADIR%%/kernel/kernel/lib/api/access.c +%%DATADIR%%/kernel/kernel/lib/api/objreg.c +%%DATADIR%%/kernel/kernel/lib/api/rsrc.c +%%DATADIR%%/kernel/kernel/lib/api/tls.c +%%DATADIR%%/kernel/kernel/lib/api/user.c +%%DATADIR%%/kernel/kernel/lib/auto.c +%%DATADIR%%/kernel/kernel/lib/connection.c +%%DATADIR%%/kernel/kernel/lib/network/port.c +%%DATADIR%%/kernel/kernel/lib/user.c +%%DATADIR%%/kernel/kernel/lib/wiztool.c +%%DATADIR%%/kernel/kernel/obj/binary.c +%%DATADIR%%/kernel/kernel/obj/port.c +%%DATADIR%%/kernel/kernel/obj/rsrc.c +%%DATADIR%%/kernel/kernel/obj/telnet.c +%%DATADIR%%/kernel/kernel/obj/user.c +%%DATADIR%%/kernel/kernel/obj/wiztool.c +%%DATADIR%%/kernel/kernel/sys/accessd.c +%%DATADIR%%/kernel/kernel/sys/binary_port.c +%%DATADIR%%/kernel/kernel/sys/driver.c +%%DATADIR%%/kernel/kernel/sys/emergency_port.c +%%DATADIR%%/kernel/kernel/sys/objregd.c +%%DATADIR%%/kernel/kernel/sys/rsrcd.c +%%DATADIR%%/kernel/kernel/sys/telnet_port.c +%%DATADIR%%/kernel/kernel/sys/userd.c +%%DATADIR%%/kernel/usr/System/initd.c +@unexec rm -f %D/%%DATADIR%%/kernel/kernel/data/* || true +@unexec rm -f %D/%%DATADIR%%/kernel/include/float.h || true +@unexec rm -f %D/%%DATADIR%%/kernel/include/limits.h || true +@unexec rm -f %D/%%DATADIR%%/kernel/include/status.h || true +@unexec rm -f %D/%%DATADIR%%/kernel/include/trace.h || true +@unexec rm -f %D/%%DATADIR%%/kernel/include/type.h || true +@unexec rm -f %D/%%DATADIR%%/kernel.log || true +@unexec rm -f %D/%%DATADIR%%/tmp/dgd-kernel.swap || true +@dirrm %%DATADIR%%/tmp +@dirrm %%DATADIR%%/kernel/usr/admin +@dirrm %%DATADIR%%/kernel/usr/System +@dirrm %%DATADIR%%/kernel/usr +@dirrm %%DATADIR%%/kernel/kernel/sys +@dirrm %%DATADIR%%/kernel/kernel/obj +@dirrm %%DATADIR%%/kernel/kernel/lib/network +@dirrm %%DATADIR%%/kernel/kernel/lib/api +@dirrm %%DATADIR%%/kernel/kernel/lib +@dirrm %%DATADIR%%/kernel/kernel/data +@dirrm %%DATADIR%%/kernel/kernel +@dirrm %%DATADIR%%/kernel/include/kernel +@dirrm %%DATADIR%%/kernel/include +@dirrm %%DATADIR%%/kernel +@dirrm %%DATADIR%% +@dirrm etc/dgd-kernel diff --git a/net/dgd/Makefile b/net/dgd/Makefile index 1595f7fd0d47..2d6e81f57898 100644 --- a/net/dgd/Makefile +++ b/net/dgd/Makefile @@ -7,21 +7,13 @@ PORTNAME= dgd PORTVERSION= 1.4.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= net lang games -MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S|%SUBDIR%|${PORTNAME}-osr|}:1 \ - http://ftp.dworkin.nl/kernellib/:2 \ - http://ftp.dworkin.nl/kernellib/patches/:3 -DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:1 \ - kernellib-${KERNELLIB_VERSION}${EXTRACT_SUFX}:2 \ - ${KERNELLIB_VERSION}-${KERNELLIB_VERSION}.1.gz:3 \ - ${KERNELLIB_VERSION}.1-${KERNELLIB_VERSION}.2.gz:3 \ - ${KERNELLIB_VERSION}.2-${KERNELLIB_VERSION}.3.gz:3 -EXTRACT_ONLY= ${DISTNAME}${EXTRACT_SUFX} \ - kernellib-${KERNELLIB_VERSION}${EXTRACT_SUFX} +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:S|%SUBDIR%|${PORTNAME}-osr|} \ + ${MASTER_SITE_SOURCEFORGE:S|%SUBDIR%|${PORTNAME}-osr/old|} MAINTAINER= glewis@FreeBSD.org -COMMENT= Dworkin's Game Driver +COMMENT= Dworkin\'s Game Driver OPTIONS= NETWORKING "With networking kfuns" off \ DUMP "With dump kfuns" off @@ -33,11 +25,6 @@ ALL_TARGET= install MAKE_JOBS_UNSAFE= yes MAKE_ENV+= EXTRA_DEFINES="$(EXTRA_DEFINES)" -KERNELLIB_VERSION= 1.3 -EXTRA_PATCHES= ${WRKDIR}/${KERNELLIB_VERSION}-${KERNELLIB_VERSION}.1 \ - ${WRKDIR}/${KERNELLIB_VERSION}.1-${KERNELLIB_VERSION}.2 \ - ${WRKDIR}/${KERNELLIB_VERSION}.2-${KERNELLIB_VERSION}.3 - .if !defined(NOPORTDOCS) PORTDOCS= * .endif @@ -47,28 +34,15 @@ PORTDOCS= * EXTRA_DEFINES= .if defined(WITH_NETWORKING) -EXTRA_PATCHES+= ${FILESDIR}/extrapatch-kernellib-net -PLIST_SUB+= NETWORKING="" EXTRA_DEFINES+= -DNETWORK_EXTENSIONS -.else -PLIST_SUB+= NETWORKING="@comment " .endif .if defined(WITH_DUMP) EXTRA_DEFINES+= -DDUMP_FUNCS .endif -post-extract: - @${MV} ${WRKDIR}/kernellib ${WRKDIR}/dgd/ - -pre-patch: - @${GZCAT} ${DISTDIR}/${DIST_SUBDIR}/${KERNELLIB_VERSION}-${KERNELLIB_VERSION}.1.gz > ${WRKDIR}/${KERNELLIB_VERSION}-${KERNELLIB_VERSION}.1 - @${GZCAT} ${DISTDIR}/${DIST_SUBDIR}/${KERNELLIB_VERSION}.1-${KERNELLIB_VERSION}.2.gz > ${WRKDIR}/${KERNELLIB_VERSION}.1-${KERNELLIB_VERSION}.2 - @${GZCAT} ${DISTDIR}/${DIST_SUBDIR}/${KERNELLIB_VERSION}.2-${KERNELLIB_VERSION}.3.gz > ${WRKDIR}/${KERNELLIB_VERSION}.2-${KERNELLIB_VERSION}.3 - post-patch: @${MV} ${WRKSRC}/host/Makefile.bsd ${WRKSRC}/host/Makefile - @${REINPLACE_CMD} -e "s:%%DATADIR%%:${DATADIR}:" ${WRKDIR}/dgd/mud.dgd @cd ${WRKDIR}/dgd/ && ${FIND} . -name '*.orig' -delete do-install: @@ -76,14 +50,11 @@ do-install: ${INSTALL_PROGRAM} ${WRKDIR}/dgd/bin/precomp ${PREFIX}/bin/precomp ${MKDIR} ${PREFIX}/etc/${PORTNAME} ${INSTALL_DATA} ${WRKDIR}/dgd/mud.dgd \ - ${PREFIX}/etc/${PORTNAME}/kernel.dgd - ${MKDIR} ${DATADIR}/kernel - cd ${WRKDIR}/dgd/kernellib && ${FIND} . \ - | ${CPIO} -pdmu -R ${SHAREOWN}:${SHAREGRP} ${DATADIR}/kernel + ${PREFIX}/etc/${PORTNAME}/mud.dgd.sample @# Install an RC script for DGD ${CAT} ${FILESDIR}/dgd.sh | ${SED} -e "s:%%PREFIX%%:${PREFIX}:" \ -e "s:%%DATADIR%%:${DATADIR}:" > \ - ${PREFIX}/etc/rc.d/dgd.sh.sample + ${PREFIX}/etc/rc.d/dgd.sh.sample ${CHMOD} a+x ${PREFIX}/etc/rc.d/dgd.sh.sample .if !defined(NOPORTDOCS) ${MKDIR} ${DOCSDIR} @@ -95,12 +66,8 @@ do-install: .endif post-install: - @# Need a temporary directory for certain files - @${MKDIR} ${DATADIR}/tmp @# Run package installation script @${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGDIR}/pkg-install ${PKGNAME} \ POST-INSTALL - @# Set mudlib ownership - -@${CHOWN} -h -R mud:mud ${DATADIR} .include <bsd.port.post.mk> diff --git a/net/dgd/distinfo b/net/dgd/distinfo index b33b674fcd31..157f25f90f2f 100644 --- a/net/dgd/distinfo +++ b/net/dgd/distinfo @@ -1,15 +1,3 @@ MD5 (dgd/dgd-1.4.1.tar.gz) = 23e14f727f9595faa30abc53ffe6c51d SHA256 (dgd/dgd-1.4.1.tar.gz) = 5ff969c7cfcba32b504a3fb4c70c7b4328f3e3bc7b2c329e5eed69a90d8b3b31 SIZE (dgd/dgd-1.4.1.tar.gz) = 466644 -MD5 (dgd/kernellib-1.3.tar.gz) = a388b467537dd148d69525e7d31399c1 -SHA256 (dgd/kernellib-1.3.tar.gz) = e78b9e2e6d72206d89b9bb1841bb5e47e5b835df29879acd1eb72cb10d778fe6 -SIZE (dgd/kernellib-1.3.tar.gz) = 44225 -MD5 (dgd/1.3-1.3.1.gz) = baf6781e216271dbd815014ce0ef4359 -SHA256 (dgd/1.3-1.3.1.gz) = 46e8cb08b920845077fcb8e50584d57e7898502a678a9308e8b8f597cac15423 -SIZE (dgd/1.3-1.3.1.gz) = 1793 -MD5 (dgd/1.3.1-1.3.2.gz) = 4c1ed037da31720349c896a0db6bbf03 -SHA256 (dgd/1.3.1-1.3.2.gz) = c676219e389c52f35cb18f9874830ded458c23a43105ab79ba04db53e0866fe3 -SIZE (dgd/1.3.1-1.3.2.gz) = 783 -MD5 (dgd/1.3.2-1.3.3.gz) = 75e60561e961dd0e1526afc56c17cec7 -SHA256 (dgd/1.3.2-1.3.3.gz) = 0f4685909a3bb7b8789e1b8c4bd5ab17c51405ee996cbcbb62d0b066dce6bfc5 -SIZE (dgd/1.3.2-1.3.3.gz) = 1757 diff --git a/net/dgd/files/extrapatch-kernellib-net b/net/dgd/files/extrapatch-kernellib-net deleted file mode 100644 index 58e17128908c..000000000000 --- a/net/dgd/files/extrapatch-kernellib-net +++ /dev/null @@ -1,996 +0,0 @@ -*** kernellib/include/config.h Thu May 21 15:10:42 2009 ---- kernellib/include/config.h Thu May 21 15:10:52 2009 -*************** -*** 6,8 **** ---- 6,15 ---- - # undef SYS_PERSISTENT /* off by default */ - - # define CALLOUTRSRC FALSE /* don't have callouts as a resource */ -+ -+ # ifdef SYS_NETWORKING -+ # define TELNET_PORT 6047 /* default telnet port */ -+ # define BINARY_PORT 6048 /* default binary port */ -+ # define EMERGENCY_PORT 6049 /* emergency binary port */ -+ # endif -+ -*** kernellib/include/kernel/kernel.h Thu May 21 15:10:42 2009 ---- kernellib/include/kernel/kernel.h Thu May 21 15:10:52 2009 -*************** -*** 1,4 **** ---- 1,7 ---- - # include <config.h> -+ # ifndef SYS_NETWORKING -+ # define SYS_NETWORKING -+ # endif - - # define DRIVER "/kernel/sys/driver" - # define AUTO ("/kernel" + INHERITABLE_SUBDIR + "auto") -*** kernellib/include/kernel/net.h Thu Jan 1 00:00:00 1970 ---- kernellib/include/kernel/net.h Thu May 21 15:10:52 2009 -*************** -*** 0 **** ---- 1,10 ---- -+ # ifdef SYS_NETWORKING -+ # define LIB_PORT "/kernel/lib/network/port" -+ # define PORT_OBJECT "/kernel/obj/port" -+ # define PORT_TELNET "/kernel/sys/telnet_port" -+ # define PORT_BINARY "/kernel/sys/binary_port" -+ # define PORT_EMERGENCY "/kernel/sys/emergency_port" -+ # define PORT_UDP "/kernel/obj/udp" -+ # else -+ # error networking capabilities required -+ # endif -*** kernellib/include/kernel/user.h Thu May 21 15:10:42 2009 ---- kernellib/include/kernel/user.h Thu May 21 15:10:52 2009 -*************** -*** 6,11 **** ---- 6,15 ---- - # define BINARY_CONN ("/kernel" + CLONABLE_SUBDIR + "binary") - # define API_USER ("/kernel" + INHERITABLE_SUBDIR + "api/user") - -+ #ifdef __NETWORK_EXTENSIONS__ -+ #define LIB_PORT "/kernel/lib/network/port" -+ #endif -+ - # define DEFAULT_USER ("/kernel" + CLONABLE_SUBDIR + "user") - # define DEFAULT_WIZTOOL ("/kernel" + CLONABLE_SUBDIR + "wiztool") - # define DEFAULT_USER_DIR "/kernel/data" -*** kernellib/include/std.h Thu May 21 15:10:42 2009 ---- kernellib/include/std.h Thu May 21 15:10:52 2009 -*************** -*** 1,2 **** ---- 1,8 ---- -+ #ifdef __NETWORK_EXTENSIONS__ -+ #ifndef SYS_NETWORKING -+ #define SYS_NETWORKING -+ #endif -+ #endif -+ - # define TRUE 1 - # define FALSE 0 -*** kernellib/kernel/lib/auto.c Thu May 21 15:10:42 2009 ---- kernellib/kernel/lib/auto.c Thu May 21 15:10:52 2009 -*************** -*** 3,8 **** ---- 3,12 ---- - # include <kernel/rsrc.h> - # include <kernel/access.h> - # include <kernel/user.h> -+ # ifdef SYS_NETWORKING -+ # include <kernel/net.h> -+ # endif -+ - # include <status.h> - # include <type.h> - # include <trace.h> -*************** -*** 1547,1549 **** ---- 1551,1614 ---- - } : error(TLSVAR2); - return result; - } -+ -+ # ifdef SYS_NETWORKING -+ /* -+ * NAME: connect() -+ * DESCRIPTION: open an outbound connection -+ */ -+ static void connect(string destination, int port,varargs string proto) -+ { -+ object conn; -+ string err; -+ -+ if (previous_program() == LIB_CONN) { -+ if(!proto) proto = "tcp"; -+ ::connect(destination, port,proto); -+ } else { -+ CHECKARG(destination, 1, "connect"); -+ -+ if (creator == "System" && this_object()) { -+ if (function_object("query_conn", this_object()) != LIB_USER) { -+ error("Not a user object"); -+ } -+ conn = clone_object(BINARY_CONN, "System"); -+ call_other(this_object(),"connection",conn); -+ conn->connect(destination, port,proto); -+ if(err) { -+ rlimits (-1; -1) { -+ destruct_object(conn); -+ } -+ error(err); -+ } -+ } -+ } -+ } -+ -+ static object port_object; -+ -+ /* -+ * NAME: open_port() -+ * DESCRIPTION: open a port to listen on -+ */ -+ static void open_port(string protocol, varargs int port) -+ { -+ CHECKARG(protocol, 1, "open_port"); -+ -+ if (KERNEL() && this_object()) { -+ ::open_port(protocol, port); -+ } -+ } -+ -+ /* -+ * NAME: ports() -+ * DESCRIPTION: return list of open ports -+ */ -+ static object *ports() -+ { -+ if (creator == "System") { -+ return ::ports(); -+ } -+ } -+ # endif /* SYS_NETWORKING */ -+ -*** kernellib/kernel/lib/connection.c Thu May 21 15:10:42 2009 ---- kernellib/kernel/lib/connection.c Thu May 21 15:10:52 2009 -*************** -*** 6,11 **** ---- 6,12 ---- - private object user; /* user object */ - private string conntype; /* connection type */ - private int mode; /* connection mode */ -+ private int outgoing; - private int blocked; /* connection blocked? */ - private string buffer; /* buffered output string */ - -*************** -*** 66,71 **** ---- 67,77 ---- - int timeout; - string banner; - -+ if(outgoing) { -+ user->login("now"); -+ return; -+ } -+ - banner = call_other(userd, "query_" + conntype + "_banner", port, - this_object()); - if (banner) { -*************** -*** 74,80 **** - - timeout = call_other(userd, "query_" + conntype + "_timeout", port, - this_object()); -! if (timeout < 0) { - /* disconnect immediately */ - destruct_object(this_object()); - return; ---- 80,86 ---- - - timeout = call_other(userd, "query_" + conntype + "_timeout", port, - this_object()); -! if (timeout < 0 && !outgoing) { - /* disconnect immediately */ - destruct_object(this_object()); - return; -*************** -*** 83,88 **** ---- 89,99 ---- - if (!user && timeout != 0) { - call_out("timeout", timeout); - } -+ # ifdef SYS_NETWORKING -+ else { -+ set_mode(user->login(nil)); -+ } -+ # endif - } - - /* -*************** -*** 136,142 **** - */ - void set_port(int num) - { -! if (previous_object() == userd) { - port = num; - } - } ---- 147,154 ---- - */ - void set_port(int num) - { -! if(num == 0) error("port is 0\n"); -! if (previous_object() == userd || SYSTEM()) { - port = num; - } - } -*************** -*** 194,200 **** - user = call_other(userd, conntype + "_user", port, str); - set_mode(mode = user->login(str)); - } else { -! set_mode(mode = user->receive_message(str)); - } - return mode; - } ---- 206,216 ---- - user = call_other(userd, conntype + "_user", port, str); - set_mode(mode = user->login(str)); - } else { -! mixed m; -! m = user->receive_message(str); -! if(m) mode = m; -! else mode = 0; -! set_mode(mode); - } - return mode; - } -*************** -*** 223,228 **** ---- 239,246 ---- - return TRUE; - } - } -+ } else { -+ error(object_name(previous_object())+" is not allowed to do that"); - } - } - -*************** -*** 240,245 **** ---- 258,264 ---- - } - } - -+ #ifndef SYS_NETWORKING - /* - * NAME: datagram_challenge() - * DESCRIPTION: set the challenge for the datagram channel -*************** -*** 283,285 **** ---- 302,324 ---- - return (send_datagram(str) == strlen(str)); - } - } -+ #else -+ /* -+ * NAME: connect() -+ * DESCRIPTION: establish an outbount connection -+ */ -+ void connect(string destination, int n,varargs string protocol) -+ { -+ if (previous_program() == AUTO || previous_program() == LIB_USER) { -+ outgoing = 1; -+ user = previous_object(); -+ port = n; -+ ::connect(destination, n, protocol); -+ } -+ } -+ -+ void receive_error(string str) { -+ DRIVER->message("NETWORK ERROR: "+str+"\n"); -+ } -+ # endif -+ -*** kernellib/kernel/lib/network/port.c Thu Jan 1 00:00:00 1970 ---- kernellib/kernel/lib/network/port.c Thu May 21 15:10:52 2009 -*************** -*** 0 **** ---- 1,68 ---- -+ # include <kernel/kernel.h> -+ # include <kernel/user.h> -+ # include <trace.h> -+ # include <type.h> -+ -+ private object driver; /* driver object */ -+ private object userd; /* user manager object */ -+ private string protocol; /* telnet, tcp or udp */ -+ -+ /* -+ * NAME: create() -+ * DESCRIPTION: initialize port object -+ */ -+ static void create() -+ { -+ driver = find_object(DRIVER); -+ userd = find_object(USERD); -+ } -+ -+ /* -+ * NAME: open_port() -+ * DESCRIPTION: start listening on a port -+ */ -+ static -+ void open_port(string prot, varargs int port) -+ { -+ rlimits (-1; -1) { -+ /* catch {*/ -+ if (typeof(port)==T_INT && port !=0) { -+ ::open_port(prot, port); -+ } else { -+ ::open_port(prot); -+ } -+ protocol = prot; -+ return; -+ /* } : { -+ error(::call_trace()[1][TRACE_FIRSTARG][1]); -+ return; -+ }*/ -+ } -+ } -+ -+ object -+ connection(mixed *tls, string ip, int port) -+ { -+ object conn; -+ -+ switch(protocol) { -+ case "telnet" : conn = clone_object(TELNET_CONN); -+ break; -+ default : conn = clone_object(BINARY_CONN); -+ break; -+ } -+ conn->set_port(port); -+ return conn; -+ } -+ -+ int -+ open(mixed *tls,int port) -+ { -+ return FALSE; -+ } -+ -+ void -+ close(mixed *tls, int force) -+ { -+ } -+ -*** kernellib/kernel/obj/binary.c Thu May 21 15:10:42 2009 ---- kernellib/kernel/obj/binary.c Thu May 21 15:10:52 2009 -*************** -*** 1,5 **** ---- 1,9 ---- - # include <kernel/kernel.h> - # include <kernel/user.h> -+ # ifdef SYS_NETWORKING -+ # include <kernel/net.h> -+ # endif -+ - - inherit LIB_CONN; /* basic connection object */ - -*************** -*** 25,33 **** - * NAME: open() - * DESCRIPTION: open the connection - */ -! static void open() - { - ::open(allocate(driver->query_tls_size())); - } - - /* ---- 29,42 ---- - * NAME: open() - * DESCRIPTION: open the connection - */ -! static int open() - { - ::open(allocate(driver->query_tls_size())); -+ # ifdef SYS_NETWORKING -+ return TRUE; -+ # else -+ return FALSE; -+ # endif - } - - /* -*************** -*** 153,158 **** ---- 162,168 ---- - ::message_done(allocate(driver->query_tls_size())); - } - -+ #ifndef SYS_NETWORKING - /* - * NAME: open_datagram() - * DESCRIPTION: open a datagram channel for this connection -*************** -*** 170,172 **** ---- 180,229 ---- - { - ::receive_datagram(allocate(driver->query_tls_size()), str); - } -+ #endif -+ -+ #ifdef SYS_NETWORKING -+ -+ object udpchannel; /* UDP channel object */ -+ -+ /* -+ * NAME: set_udpchannel() -+ * DESCRIPTION: set the UDP channel for this connection -+ */ -+ void set_udpchannel(object udp, string host, int port) -+ { -+ if (previous_program() == LIB_PORT) { -+ udpchannel = udp; -+ udp->add_connection(this_object(), host, port); -+ } -+ } -+ -+ /* -+ * NAME: receive_datagram() -+ * DESCRIPTION: receive a datagram -+ */ -+ void receive_datagram(mixed *tls, string str) -+ { -+ if (previous_object() == udpchannel) { -+ object user; -+ -+ user = query_user(); -+ if (user) { -+ user->receive_datagram(str); -+ } -+ } -+ } -+ -+ /* -+ * NAME: datagram() -+ * DESCRIPTION: send a datagram on the UDP channel -+ */ -+ int datagram(string str) -+ { -+ if (previous_object() == query_user() && udpchannel) { -+ return udpchannel->datagram(str); -+ } -+ } -+ -+ #endif -+ -*** kernellib/kernel/obj/port.c Thu Jan 1 00:00:00 1970 ---- kernellib/kernel/obj/port.c Thu May 21 15:10:52 2009 -*************** -*** 0 **** ---- 1,49 ---- -+ # include <kernel/kernel.h> -+ # include <kernel/user.h> -+ # include <kernel/net.h> -+ -+ inherit LIB_PORT; -+ -+ /* -+ * NAME: create() -+ * DESCRIPTION: initialize port object -+ */ -+ static void create(int clone) -+ { -+ if (clone) { -+ ::create(); -+ } -+ } -+ -+ /* -+ * NAME: listen() -+ * DESCRIPTION: start listening on a port -+ */ -+ void listen(string protocol, int port) -+ { -+ #ifndef SYS_NETWORKING -+ if (previous_program() == DRIVER) { -+ #else -+ if (previous_program() == DRIVER || previous_program() == USERD) { -+ #endif -+ ::open_port(protocol, port); -+ } -+ } -+ -+ /* -+ * NAME: open_connection() -+ * DESCRIPTION: don't return a user object, select it by first line of input -+ */ -+ static object open_connection(string ipaddr, int port) -+ { -+ return nil; -+ } -+ -+ void open(int port) { -+ ::open(allocate(DRIVER->query_tls_size()),port); -+ } -+ -+ object connection(string ip, int port) { -+ ::connection(allocate(DRIVER->query_tls_size()),ip,port); -+ } -+ -*** kernellib/kernel/sys/binary_port.c Thu Jan 1 00:00:00 1970 ---- kernellib/kernel/sys/binary_port.c Thu May 21 15:10:52 2009 -*************** -*** 0 **** ---- 1,47 ---- -+ #include <kernel/net.h> -+ #include <kernel/user.h> -+ #include <kernel/kernel.h> -+ -+ inherit LIB_PORT; /* basic port object */ -+ -+ object driver; /* driver object */ -+ -+ void -+ create() -+ { -+ ::create(); -+ driver = find_object(DRIVER); -+ open_port("tcp", BINARY_PORT); -+ } -+ -+ object -+ connection(string ip, int port) -+ { -+ return ::connection(allocate(driver->query_tls_size()), ip, port); -+ } -+ -+ void -+ done() -+ { -+ close_user(); -+ } -+ -+ /* -+ * NAME: open() -+ * DESCRIPTION: open the connection -+ */ -+ static int open(int port) -+ { -+ ::open(allocate(driver->query_tls_size()), port); -+ return FALSE; -+ } -+ -+ /* -+ * NAME: close() -+ * DESCRIPTION: close the connection -+ */ -+ static void close(int force) -+ { -+ ::close(allocate(driver->query_tls_size()), force); -+ } -+ -*** kernellib/kernel/sys/driver.c Thu May 21 15:10:42 2009 ---- kernellib/kernel/sys/driver.c Thu May 21 15:10:52 2009 -*************** -*** 4,9 **** ---- 4,15 ---- - # include <kernel/access.h> - # include <kernel/user.h> - # include <kernel/tls.h> -+ # ifdef __NETWORK_EXTENSIONS__ -+ # ifndef SYS_NETWORKING -+ # define SYS_NETWORKING -+ # endif -+ # include <kernel/net.h> -+ # endif - # include <status.h> - # include <trace.h> - -*************** -*** 16,23 **** ---- 22,38 ---- - object initd; /* init manager object */ - object objectd; /* object manager object */ - object errord; /* error manager object */ -+ # ifdef SYS_NETWORKING -+ static object port_master; /* port master object */ -+ static object telnet; /* default telnet port object */ -+ static object binary; /* default binary port object */ -+ static object emergency; /* emergency port object */ -+ # endif -+ - int tls_size; /* thread local storage size */ - -+ -+ - /* - * NAME: creator() - * DESCRIPTION: get creator of file -*************** -*** 408,413 **** ---- 423,432 ---- - call_other(accessd = load(ACCESSD), "???"); - call_other(userd = load(USERD), "???"); - call_other(load(DEFAULT_WIZTOOL), "???"); -+ # ifdef SYS_NETWORKING -+ call_other(port_master = load(PORT_OBJECT), "???"); -+ call_other(emergency = load(PORT_EMERGENCY), "???"); -+ # endif - - /* initialize other users as resource owners */ - users = (accessd->query_users() - ({ "System" })) | ({ "admin" }); -*************** -*** 432,439 **** - shutdown(); - return; - } - } -- - message("Initialization complete.\n\n"); - } - ---- 451,463 ---- - shutdown(); - return; - } -+ # ifdef SYS_NETWORKING -+ } else { -+ call_other(telnet = load(PORT_TELNET),"???"); -+ call_other(binary = load(PORT_BINARY),"???"); -+ rsrcd->rsrc_incr("System", "objects", nil, 2, 1); -+ #endif - } - message("Initialization complete.\n\n"); - } - -*************** -*** 477,483 **** - initd->reboot(); - } - } -! - message("State restored.\n\n"); - } - ---- 501,519 ---- - initd->reboot(); - } - } -! # ifdef SYS_NETWORKING -! if (telnet) { -! telnet->listen("telnet", TELNET_PORT); -! } -! if (binary) { -! binary->listen("tcp", BINARY_PORT); -! } -! if(!emergency) { -! emergency = clone_object(port_master); -! rsrcd->rsrc_incr("System", "objects", nil, 1, 1); -! } -! emergency->listen("tcp", EMERGENCY_PORT); -! # endif - message("State restored.\n\n"); - } - -*** kernellib/kernel/sys/emergency_port.c Thu Jan 1 00:00:00 1970 ---- kernellib/kernel/sys/emergency_port.c Thu May 21 15:10:52 2009 -*************** -*** 0 **** ---- 1,47 ---- -+ #include <kernel/net.h> -+ #include <kernel/user.h> -+ #include <kernel/kernel.h> -+ -+ inherit LIB_PORT; /* basic port object */ -+ -+ object driver; /* driver object */ -+ -+ void -+ create() -+ { -+ ::create(); -+ driver = find_object(DRIVER); -+ open_port("tcp", EMERGENCY_PORT); -+ } -+ -+ object -+ connection(string ip, int port) -+ { -+ return ::connection(allocate(driver->query_tls_size()), ip, port); -+ } -+ -+ void -+ done() -+ { -+ close_user(); -+ } -+ -+ /* -+ * NAME: open() -+ * DESCRIPTION: open the connection -+ */ -+ static int open(int port) -+ { -+ ::open(allocate(driver->query_tls_size()), port); -+ return FALSE; -+ } -+ -+ /* -+ * NAME: close() -+ * DESCRIPTION: close the connection -+ */ -+ static void close(int force) -+ { -+ ::close(allocate(driver->query_tls_size()), force); -+ } -+ -*** kernellib/kernel/sys/telnet_port.c Thu Jan 1 00:00:00 1970 ---- kernellib/kernel/sys/telnet_port.c Thu May 21 15:10:52 2009 -*************** -*** 0 **** ---- 1,47 ---- -+ #include <kernel/net.h> -+ #include <kernel/user.h> -+ #include <kernel/kernel.h> -+ -+ inherit LIB_PORT; /* basic port object */ -+ -+ object driver; /* driver object */ -+ -+ void -+ create() -+ { -+ ::create(); -+ driver = find_object(DRIVER); -+ open_port("telnet", TELNET_PORT); -+ } -+ -+ object -+ connection(string ip, int port) -+ { -+ return ::connection(allocate(driver->query_tls_size()), ip, port); -+ } -+ -+ void -+ done() -+ { -+ close_user(); -+ } -+ -+ /* -+ * NAME: open() -+ * DESCRIPTION: open the connection -+ */ -+ static int open(int port) -+ { -+ ::open(allocate(driver->query_tls_size()), port); -+ return FALSE; -+ } -+ -+ /* -+ * NAME: close() -+ * DESCRIPTION: close the connection -+ */ -+ static void close(int force) -+ { -+ ::close(allocate(driver->query_tls_size()), force); -+ } -+ -*** kernellib/kernel/sys/userd.c Thu May 21 15:10:42 2009 ---- kernellib/kernel/sys/userd.c Thu May 21 15:10:52 2009 -*************** -*** 1,11 **** ---- 1,18 ---- - # include <kernel/kernel.h> - # include <kernel/user.h> -+ # ifdef SYS_NETWORKING -+ # include <kernel/net.h> -+ # define PORT PORT_OBJECT -+ # else -+ # define PORT DRIVER -+ # endif - # include <status.h> - - - object *users; /* user mappings */ - mapping names; /* name : connection object */ - object *connections; /* saved connections */ -+ mapping listeners_telnet, listeners_tcp; /* port objects */ - mapping telnet, binary; /* port managers */ - - /* -*************** -*** 18,23 **** ---- 25,31 ---- - if (!find_object(TELNET_CONN)) { compile_object(TELNET_CONN); } - if (!find_object(BINARY_CONN)) { compile_object(BINARY_CONN); } - if (!find_object(DEFAULT_USER)) { compile_object(DEFAULT_USER); } -+ if (!find_object(PORT_OBJECT)) { compile_object(PORT_OBJECT); } - - /* initialize user arrays */ - users = ({ }); -*************** -*** 32,38 **** - */ - object telnet_connection(mixed *tls, int port) - { -! if (previous_program() == DRIVER) { - object conn; - - conn = clone_object(TELNET_CONN); ---- 40,46 ---- - */ - object telnet_connection(mixed *tls, int port) - { -! if (previous_program() == PORT) { - object conn; - - conn = clone_object(TELNET_CONN); -*************** -*** 47,53 **** - */ - object binary_connection(mixed *tls, int port) - { -! if (previous_program() == DRIVER) { - object conn; - - conn = clone_object(BINARY_CONN); ---- 55,61 ---- - */ - object binary_connection(mixed *tls, int port) - { -! if (previous_program() == PORT) { - object conn; - - conn = clone_object(BINARY_CONN); -*************** -*** 57,62 **** ---- 65,113 ---- - } - - /* -+ * NAME: -+ * DESCRIPTION: -+ */ -+ private void start_telnet_listener(int port) -+ { -+ if(!listeners_telnet) { -+ listeners_telnet = ([ ]); -+ } -+ if(!listeners_tcp) { -+ listeners_tcp = ([ ]); -+ } -+ -+ if(!listeners_telnet[port] && !listeners_tcp[port]) { -+ listeners_telnet[port] = clone_object(PORT_OBJECT); -+ listeners_telnet[port]->listen("telnet",port); -+ } else { -+ error("Port "+port+" is already in use."); -+ } -+ } -+ -+ /* -+ * NAME: -+ * DESCRIPTION: -+ */ -+ private void start_tcp_listener(int port) -+ { -+ if(!listeners_telnet) { -+ listeners_telnet = ([ ]); -+ } -+ -+ if(!listeners_tcp) { -+ listeners_tcp = ([ ]); -+ } -+ -+ if(!listeners_telnet[port] && !listeners_tcp[port]) { -+ listeners_tcp[port] = clone_object(PORT_OBJECT); -+ listeners_tcp[port]->listen("tcp",port); -+ } else { -+ error("Port "+port+" is already in use."); -+ } -+ } -+ -+ /* - * NAME: set_telnet_manager() - * DESCRIPTION: set the telnet manager object, which determines what the - * user object is, based on the first line of input -*************** -*** 67,73 **** ---- 118,128 ---- - void set_telnet_manager(int port, object manager) - { - if (SYSTEM()) { -+ if(!port) port = TELNET_PORT; - telnet[port] = manager; -+ DRIVER->message("telnet manager for port "+port+ " is now "+ -+ object_name(manager)+"\n"); -+ start_telnet_listener(port); - } - } - -*************** -*** 82,88 **** ---- 137,147 ---- - void set_binary_manager(int port, object manager) - { - if (SYSTEM()) { -+ if(!port) port = BINARY_PORT; - binary[port] = manager; -+ DRIVER->message("binary manager for port "+port+ " is now "+ -+ object_name(manager)+"\n"); -+ start_tcp_listener(port); - } - } - -*************** -*** 100,105 **** ---- 159,165 ---- - user = names[str]; - if (!user) { - user = telnet[port]; -+ if(!user) user = binary[port]; - if (user) { - user = (object LIB_USER) user->select(str); - } else { -*************** -*** 123,129 **** - user = names[str]; - if (!user) { - user = binary[port]; -! if (user && (str != "admin" || port != 0)) { - user = (object LIB_USER) user->select(str); - } else { - user = clone_object(DEFAULT_USER); ---- 183,190 ---- - user = names[str]; - if (!user) { - user = binary[port]; -! if(!user) user = telnet[port]; -! if (user && (str != "admin" || port != EMERGENCY_PORT)) { - user = (object LIB_USER) user->select(str); - } else { - user = clone_object(DEFAULT_USER); -*** kernellib/usr/System/initd.c Thu Jan 1 00:00:00 1970 ---- kernellib/usr/System/initd.c Thu May 21 15:10:52 2009 -*************** -*** 0 **** ---- 1,32 ---- -+ # include <kernel/kernel.h> -+ -+ private void -+ load(string filename) -+ { -+ if (!find_object(filename)) { -+ compile_object(filename); -+ } -+ } -+ -+ static void -+ create() -+ { -+ load("/kernel/sys/telnet_port"); -+ load("/kernel/sys/binary_port"); -+ } -+ -+ void -+ prepare_reboot() -+ { -+ if (previous_program() == DRIVER) { -+ /* ... */ -+ } -+ } -+ -+ void -+ reboot() -+ { -+ if (previous_program() == DRIVER) { -+ /* ... */ -+ } -+ } diff --git a/net/dgd/files/patch-mud.dgd b/net/dgd/files/patch-mud.dgd index be48d259f51f..f9807d2b7589 100644 --- a/net/dgd/files/patch-mud.dgd +++ b/net/dgd/files/patch-mud.dgd @@ -6,7 +6,7 @@ $FreeBSD$ telnet_port = 6047; /* telnet port number */ binary_port = 6048; /* binary port number */ -directory = "/home/dworkin/dgd/mud";/* base directory (MUST be absolute) */ -+directory = "%%DATADIR%%/kernel"; /* base directory (MUST be absolute) */ ++directory = "%%DATADIR%%/mud"; /* base directory (MUST be absolute) */ users = 40; /* max # of users */ editors = 40; /* max # of editor sessions */ ports = 16; /* max number of open ports (for network extensions) */ diff --git a/net/dgd/pkg-plist b/net/dgd/pkg-plist index 1b513cb69ab0..0fad98f80021 100644 --- a/net/dgd/pkg-plist +++ b/net/dgd/pkg-plist @@ -1,97 +1,5 @@ bin/precomp -etc/dgd/kernel.dgd +etc/dgd/mud.dgd.sample etc/rc.d/dgd.sh.sample sbin/dgd -%%DATADIR%%/kernel/doc/README.kernel -%%DATADIR%%/kernel/doc/kernel/Changelog -%%DATADIR%%/kernel/doc/kernel/efun/add_event -%%DATADIR%%/kernel/doc/kernel/efun/call_limited -%%DATADIR%%/kernel/doc/kernel/efun/call_other -%%DATADIR%%/kernel/doc/kernel/efun/call_trace -%%DATADIR%%/kernel/doc/kernel/efun/clone_object -%%DATADIR%%/kernel/doc/kernel/efun/compile_object -%%DATADIR%%/kernel/doc/kernel/efun/destruct_object -%%DATADIR%%/kernel/doc/kernel/efun/event -%%DATADIR%%/kernel/doc/kernel/efun/event_except -%%DATADIR%%/kernel/doc/kernel/efun/file_info -%%DATADIR%%/kernel/doc/kernel/efun/find_object -%%DATADIR%%/kernel/doc/kernel/efun/get_dir -%%DATADIR%%/kernel/doc/kernel/efun/new_object -%%DATADIR%%/kernel/doc/kernel/efun/query_events -%%DATADIR%%/kernel/doc/kernel/efun/query_subscribed_event -%%DATADIR%%/kernel/doc/kernel/efun/remove_event -%%DATADIR%%/kernel/doc/kernel/efun/status -%%DATADIR%%/kernel/doc/kernel/efun/subscribe_event -%%DATADIR%%/kernel/doc/kernel/efun/unsubscribe_event -%%DATADIR%%/kernel/doc/kernel/hook/driver -%%DATADIR%%/kernel/doc/kernel/hook/rsrcd -%%DATADIR%%/kernel/doc/kernel/hook/userd -%%DATADIR%%/kernel/doc/kernel/kernel.dgd -%%DATADIR%%/kernel/doc/kernel/lfun/allow_subscribe -%%DATADIR%%/kernel/doc/kernel/lfun/create -%%DATADIR%%/kernel/doc/kernel/lfun/query_owner -%%DATADIR%%/kernel/doc/kernel/overview -%%DATADIR%%/kernel/include/config.h -%%DATADIR%%/kernel/include/kernel/access.h -%%DATADIR%%/kernel/include/kernel/kernel.h -%%NETWORKING%%%%DATADIR%%/kernel/include/kernel/net.h -%%DATADIR%%/kernel/include/kernel/objreg.h -%%DATADIR%%/kernel/include/kernel/rsrc.h -%%DATADIR%%/kernel/include/kernel/tls.h -%%DATADIR%%/kernel/include/kernel/user.h -%%DATADIR%%/kernel/include/kernel/version.h -%%DATADIR%%/kernel/include/std.h -%%DATADIR%%/kernel/kernel/lib/api/access.c -%%DATADIR%%/kernel/kernel/lib/api/objreg.c -%%DATADIR%%/kernel/kernel/lib/api/rsrc.c -%%DATADIR%%/kernel/kernel/lib/api/tls.c -%%DATADIR%%/kernel/kernel/lib/api/user.c -%%DATADIR%%/kernel/kernel/lib/auto.c -%%DATADIR%%/kernel/kernel/lib/connection.c -%%NETWORKING%%%%DATADIR%%/kernel/kernel/lib/network/port.c -%%DATADIR%%/kernel/kernel/lib/user.c -%%DATADIR%%/kernel/kernel/lib/wiztool.c -%%DATADIR%%/kernel/kernel/obj/binary.c -%%NETWORKING%%%%DATADIR%%/kernel/kernel/obj/port.c -%%DATADIR%%/kernel/kernel/obj/rsrc.c -%%DATADIR%%/kernel/kernel/obj/telnet.c -%%DATADIR%%/kernel/kernel/obj/user.c -%%DATADIR%%/kernel/kernel/obj/wiztool.c -%%DATADIR%%/kernel/kernel/sys/accessd.c -%%NETWORKING%%%%DATADIR%%/kernel/kernel/sys/binary_port.c -%%DATADIR%%/kernel/kernel/sys/driver.c -%%NETWORKING%%%%DATADIR%%/kernel/kernel/sys/emergency_port.c -%%DATADIR%%/kernel/kernel/sys/objregd.c -%%DATADIR%%/kernel/kernel/sys/rsrcd.c -%%NETWORKING%%%%DATADIR%%/kernel/kernel/sys/telnet_port.c -%%DATADIR%%/kernel/kernel/sys/userd.c -%%NETWORKING%%%%DATADIR%%/kernel/usr/System/initd.c -@unexec rm -f %D/%%DATADIR%%/kernel/kernel/data/* -@unexec rm -f %D/%%DATADIR%%/kernel/include/float.h -@unexec rm -f %D/%%DATADIR%%/kernel/include/limits.h -@unexec rm -f %D/%%DATADIR%%/kernel/include/status.h -@unexec rm -f %D/%%DATADIR%%/kernel/include/trace.h -@unexec rm -f %D/%%DATADIR%%/kernel/include/type.h -@unexec rm -f %D/%%DATADIR%%/kernel.log -@unexec rm -f %D/%%DATADIR%%/tmp/dgd.swap -@dirrm %%DATADIR%%/tmp -@dirrm %%DATADIR%%/kernel/usr/admin -@dirrm %%DATADIR%%/kernel/usr/System -@dirrm %%DATADIR%%/kernel/usr -@dirrm %%DATADIR%%/kernel/kernel/sys -@dirrm %%DATADIR%%/kernel/kernel/obj -%%NETWORKING%%@dirrm %%DATADIR%%/kernel/kernel/lib/network -@dirrm %%DATADIR%%/kernel/kernel/lib/api -@dirrm %%DATADIR%%/kernel/kernel/lib -@dirrm %%DATADIR%%/kernel/kernel/data -@dirrm %%DATADIR%%/kernel/kernel -@dirrm %%DATADIR%%/kernel/include/kernel -@dirrm %%DATADIR%%/kernel/include -@dirrm %%DATADIR%%/kernel/doc/kernel/lfun -@dirrm %%DATADIR%%/kernel/doc/kernel/hook -@dirrm %%DATADIR%%/kernel/doc/kernel/efun -@dirrm %%DATADIR%%/kernel/doc/kernel -@dirrm %%DATADIR%%/kernel/doc -@dirrm %%DATADIR%%/kernel -@dirrm %%DATADIR%% @dirrm etc/dgd |