mars_nwe-0.97.pl03

This commit is contained in:
Mario Fetka
2011-11-13 00:38:56 +01:00
parent 55682d7171
commit da30e32a01
53 changed files with 3233 additions and 1225 deletions

View File

@@ -0,0 +1,7 @@
This is the kernel-ipx patch for the 1.2.13 kernel.
If you have problems with mars_nwe or if you want to
speed up mars_nwe with kernel 1.2.13 you should apply
this patch to kernel 1.2.13
Martin

View File

@@ -1,4 +1,6 @@
The kernelpatch kpatch1.3.72 you can use directly for kernels 1.3.72 .. ???
The kernelpatch kpatch1.3.72 you can use directly for kernels 1.3.72 .. 1.3.77
The kernelpatch kpatch1.3.78 you can use directly for kernels 1.3.78,79 .. ??
but it should be easy to apply this patch to all kernels.
By older kernels 'sk->protinfo.af_ipx.' must become 'sk->' .
After applying this patch please rebuild mars_nwe (make clean)

View File

@@ -1,8 +1,8 @@
/* config.h: 14-Mar-96 */
/* config.h: 03-May-96 */
/* some of this config is needed by make, others by cc */
#define DO_DEBUG 1 /* Compile in debug code */
#define DO_TESTING 0
#define DO_TESTING 0 /* only for the next choose */
#if DO_TESTING
# define FILENAME_NW_INI "./nw.ini" /* full name of ini (conf) file */
# define PATHNAME_PROGS "." /* path location of progs */
@@ -14,30 +14,44 @@
# define PATHNAME_BINDERY "/etc" /* path location of bindery */
# define FUNC_17_02_IS_DEBUG 0
#endif
#define PATHNAME_PIDFILES "/var/run" /* path location of 'pidfiles' */
/* next for utmp/wtmp updates */
#define FILENAME_UTMP UTMP_FILE
/* can be set NULL if you don't want utmp/wtmp updates */
#define FILENAME_WTMP WTMP_FILE
/* can be set NULL if you don't want wtmp updates */
#define NETWORK_SERIAL_NMBR 0x44444444L /* Serial Number 4 Byte */
#define NETWORK_APPL_NMBR 0x2222 /* Applikation Number 2 Byte */
#define MAX_CONNECTIONS 5 /* max. Number of Connections */
#define MAX_CONNECTIONS 5 /* max. Number of Connections */
/* must be < 256 !!! */
#define MAX_NW_VOLS 10 /* max. Volumes */
#define IPX_DATA_GR_546 1 /* allow ipx packets > 546+30 Byte */
#define WITH_NAME_SPACE_CALLS 0 /* Namespace Calls are only minimal */
#define IPX_DATA_GR_546 1 /* allow ipx packets > 546+30 Byte */
/* <-----------------------------------------------------------> */
#define MAX_NW_VOLS 10 /* max. Volumes */
#define MAX_FILE_HANDLES_CONN 80 /* max. open files /connection */
/* <--------------- new namespace services call --------------> */
#define WITH_NAME_SPACE_CALLS 1 /* Namespace Calls are only minimal */
/* supported till now. */
/* to enable testing of them this */
/* entry must be changed to '1' and */
/* entry '6' in ini file must be set */
/* to > '0', too. */
#define MAX_DIR_BASE_ENTRIES 50 /* max. cached base entries/connection */
/* <-----------------------------------------------------------> */
#define MAX_NW_SERVERS 40 /* max. count of servers */
/* <--------------- next is for linux only -------------------> */
#define INTERNAL_RIP_SAP 1 /* use internal/own rip/sap routines */
/* -------------------- */
#define MAX_NET_DEVICES 5 /* max. Netdevices, frames */
#define MAX_NW_ROUTES 50 /* max. networks (internal + external) */
/* this is for very special use of mars_nwe to only act as a router */
#define FILE_SERVER_INACTIV 0 /* 1 = don't start ncpserv */
#define MAX_RIP_ENTRIES 50 /* max. rip responses */
/* -------------------- */
#define SHADOW_PWD 0 /* change to '1' for shadow passwds */

122
examples/kpatch1.2.13 Normal file
View File

@@ -0,0 +1,122 @@
Index: include/linux/ipx.h
--- linux.org/include/linux/ipx.h Mon Feb 6 19:25:22 1995
+++ linux/include/linux/ipx.h Fri Mar 22 00:58:02 1996
@@ -74,5 +74,6 @@
#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE+1)
#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE+2)
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE+3)
#endif
Index: net/inet/ipx.c
--- linux.org/net/inet/ipx.c Tue Apr 18 21:13:26 1995
+++ linux/net/inet/ipx.c Fri Mar 22 01:25:25 1996
@@ -341,6 +341,20 @@
struct sk_buff *skb1 = NULL, *skb2 = NULL;
int ipx_offset;
+ if (intrfc == ipx_primary_net
+ && ntohs(ipx->ipx_dest.sock) == 0x451
+ && *((char*)(ipx+1)) == 0x22
+ && *((char*)(ipx+1)+1) == 0x22) {
+ int connection = (int) *((char*)(ipx+1)+3);
+ /* 255 connections are enough ;) */
+ if (connection) {
+ for (sock1=intrfc->if_sklist;
+ (sock1 != NULL) &&
+ (sock1->ipx_ncp_conn != connection);
+ sock1=sock1->next);;
+ }
+ }
+ if (sock1 == NULL)
sock1 = ipxitf_find_socket(intrfc, ipx->ipx_dest.sock);
/*
@@ -859,6 +873,7 @@
ipxif=ipxitf_find_using_phys(dev, ipx_map_frame_type(sipx->sipx_type));
if(ipxif==NULL)
return -EADDRNOTAVAIL;
+ sipx->sipx_family=AF_IPX;
sipx->sipx_network=ipxif->if_netnum;
memcpy(sipx->sipx_node, ipxif->if_node, sizeof(sipx->sipx_node));
memcpy_tofs(arg,&ifr,sizeof(ifr));
@@ -909,7 +924,8 @@
return -EAGAIN;
rt->ir_next=ipx_routes;
ipx_routes=rt;
- }
+ } else if (intrfc == ipx_internal_net)
+ return(-EEXIST); /* fix for mars_nwe: 11-Jan-96 */
rt->ir_net = network;
rt->ir_intrfc = intrfc;
@@ -983,6 +999,7 @@
int size;
int ipx_offset;
ipx_route *rt = NULL;
+ int snr;
/* Find the appropriate interface on which to send packet */
if ((usipx->sipx_network == 0L) && (ipx_primary_net != NULL)) {
@@ -1017,9 +1034,14 @@
ipx->ipx_tctrl=0;
ipx->ipx_type=usipx->sipx_type;
skb->h.raw = (unsigned char *)ipx;
-
+ if ((snr=ntohs(sk->ipx_port)) == 0x453 || snr == 0x452) {
+ /* RIP/SAP speicial handling for mars_nwe: 11-Jan-96 */
+ ipx->ipx_source.net = intrfc->if_netnum;
+ memcpy(ipx->ipx_source.node, intrfc->if_node, IPX_NODE_LEN);
+ } else {
ipx->ipx_source.net = sk->ipx_intrfc->if_netnum;
memcpy(ipx->ipx_source.node, sk->ipx_intrfc->if_node, IPX_NODE_LEN);
+ }
ipx->ipx_source.sock = sk->ipx_port;
ipx->ipx_dest.net=usipx->sipx_network;
memcpy(ipx->ipx_dest.node,usipx->sipx_node,IPX_NODE_LEN);
@@ -1335,6 +1357,7 @@
return err;
put_fs_long(sizeof(int),(unsigned long *)optlen);
err=verify_area(VERIFY_WRITE,optval,sizeof(int));
+ if (err) return err;
put_fs_long(val,(unsigned long *)optval);
return(0);
}
@@ -1397,6 +1420,8 @@
sk->debug=0;
sk->ipx_intrfc = NULL;
memset(&sk->ipx_dest_addr,'\0',sizeof(sk->ipx_dest_addr));
+ sk->ipx_ncp_conn = 0; /* no ncp socket yet */
+
sk->ipx_port = 0;
sk->mtu=IPX_MTU;
@@ -1835,6 +1860,16 @@
if(err) return err;
return(ipxcfg_get_config_data((void *)arg));
}
+ case SIOCIPXNCPCONN:
+ {
+ if (!suser()) return(-EPERM);
+ err = verify_area(VERIFY_READ, (void *)arg,
+ sizeof(unsigned short));
+ if (err) return err;
+ sk->ipx_ncp_conn = get_fs_word(arg);
+ return 0;
+ }
+
case SIOCGSTAMP:
if (sk)
{
Index: net/inet/sock.h
Prereq: 1.0.4
--- linux.org/net/inet/sock.h Fri Mar 22 01:11:28 1996
+++ linux/net/inet/sock.h Fri Mar 22 01:12:26 1996
@@ -146,6 +146,7 @@
ipx_interface *ipx_intrfc;
unsigned short ipx_port;
unsigned short ipx_type;
+ unsigned short ipx_ncp_conn;
#endif
#ifdef CONFIG_AX25
/* Really we want to add a per protocol private area */

74
examples/kpatch1.3.78 Normal file
View File

@@ -0,0 +1,74 @@
diff -rub linux.org/include/linux/ipx.h linux/include/linux/ipx.h
--- linux.org/include/linux/ipx.h Wed Mar 27 18:43:19 1996
+++ linux/include/linux/ipx.h Thu Mar 28 11:15:31 1996
@@ -74,5 +74,6 @@
#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE+1)
#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE+2)
+#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE+3)
#endif
diff -rub linux.org/include/net/sock.h linux/include/net/sock.h
--- linux.org/include/net/sock.h Wed Mar 27 23:05:18 1996
+++ linux/include/net/sock.h Thu Mar 28 11:15:31 1996
@@ -112,6 +112,10 @@
* know the connection this socket belongs to.
*/
struct ncp_server *ncp_server;
+/*
+ * To handle special NCP-Sockets for mars_nwe
+ */
+ unsigned short ipx_ncp_conn;
};
#endif
diff -rub linux.org/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
--- linux.org/net/ipx/af_ipx.c Wed Mar 27 17:50:39 1996
+++ linux/net/ipx/af_ipx.c Thu Mar 28 11:15:31 1996
@@ -448,6 +448,20 @@
ipx_socket *sock1 = NULL, *sock2 = NULL;
struct sk_buff *skb1 = NULL, *skb2 = NULL;
+ if (intrfc == ipx_primary_net
+ && ntohs(ipx->ipx_dest.sock) == 0x451
+ && *((char*)(ipx+1)) == 0x22
+ && *((char*)(ipx+1)+1) == 0x22) {
+ int connection = (int) *((char*)(ipx+1)+3);
+ /* 255 connections are enough ;) */
+ if (connection) {
+ for (sock1=intrfc->if_sklist;
+ (sock1 != NULL) &&
+ (sock1->protinfo.af_ipx.ipx_ncp_conn != connection);
+ sock1=sock1->next);;
+ }
+ }
+ if (sock1 == NULL)
sock1 = ipxitf_find_socket(intrfc, ipx->ipx_dest.sock);
/*
@@ -1639,6 +1653,7 @@
sizeof(sk->protinfo.af_ipx.dest_addr));
sk->protinfo.af_ipx.port = 0;
sk->protinfo.af_ipx.ncp_server = 0;
+ sk->protinfo.af_ipx.ipx_ncp_conn = 0; /* no ncp socket yet */
sk->mtu=IPX_MTU;
if(sock!=NULL)
@@ -2142,6 +2157,17 @@
if(err) return err;
return(ipxcfg_get_config_data((void *)arg));
}
+
+ case SIOCIPXNCPCONN:
+ {
+ if (!suser()) return(-EPERM);
+ err = verify_area(VERIFY_READ, (void *)arg,
+ sizeof(unsigned short));
+ if (err) return err;
+ sk->protinfo.af_ipx.ipx_ncp_conn = get_fs_word(arg);
+ return 0;
+ }
+
case SIOCGSTAMP:
if (sk)
{

View File

@@ -1,5 +1,5 @@
#!/bin/sh
# mk.li 10-Feb-96 ###
# mk.li 27-Apr-96 ###
# please edit this file !
mk()
@@ -11,7 +11,7 @@ mk()
if [ ! -d $OBJDIR ] ; then mkdir $OBJDIR; fi
cd $OBJDIR;
fi
$MAKE -f $V_VPATH/makefile.unx $@ 2>&1 | tee $ERRFILE;
if $MAKE -f $V_VPATH/makefile.unx $@ 2>&1;then true;else kill -HUP $MK_PPID;fi | tee $ERRFILE
if [ $V_VPATH = '..' ] ; then
cd ..;
fi
@@ -20,6 +20,9 @@ mk()
TOLOWER='tr "[A-Z]" "[a-z]"'
UNX=`uname -s | $TOLOWER`
MK_PPID=$$
export MK_PPID
trap 'echo "Error: Try again :)" && exit 1' 1
case $UNX in
linux)

View File

@@ -1,27 +1,42 @@
# (C)opyright 1993, 1996, Martin Stover, Softwareentwicklung, Marburg
# last change: 08-Mar-96
# last change: 28-Apr-96
# MAR.S NW-Server Emulator
# Einfache Konfiguration, alles ab # ist Kommentar.
# Jeder Eintrag beginnt mit einer Zahl und dann folgt der Inhalt.
# simple configuration, all after # is ignored.
# every entry begins with a number and then the meet follows.
####################################
# entry 1 VOLUMES (max. volumes depend on your config.h)
# Volumename Volumepath Options (k=lowercase,p=pipe,m=removable)
1 SYS /u3/SYS/ # SYS 1
# SYS, der Name darf auch anders lauten, muss
# eingerichtet sein mit den folgenden Verzeichnissen:
# LOGIN, PUBLIC, SYSTEM, MAIL.
# SYS, may be named diffent but must be setup and must
# contains the following Directories: LOGIN, PUBLIC, SYSTEM, MAIL
####################################
# Die folgenden Volumes sind optional.
# the following volumes are optional.
#1 HOME ~ k # Users HOME directory
#.............^^^
# such a 'path' (~) stands for users home dir
# this is an automatic changed volume.
#1 SYS1 /u3/SYS1/ # SYS 2 upshift
#1 TMP /tmp/ k # TMP downshift
#1 CD /cdrom km # CDROM downshift/removable
#1 PIPES /u3/pipes kp # pipecommands
# Falls lowercase nicht gesetzt ist, werden GROSSBUCHSTABEN erwartet.
# If lowercase is not set then all filenames are upshift.
# SYS, der Name darf auch anders lauten, muss
# eingerichtet sein mit den folgenden Verzeichnissen:
# LOGIN, PUBLIC, SYSTEM, MAIL.
# SYS, may be named diffent but must be setup and must
# contains the following Directories: LOGIN, PUBLIC, SYSTEM, MAIL
# all flags for volumes:
# 'k' all is downshift
# 'm' volume is moveable (cdrom)
# 'o' volume has only one filesystem/device/namespace
# this is for filesystems with high inode > 0xFFFFFFF.
# because for namespace services mars_nwe normally use the
# first 4 bit of 32 bit inode for distinguish
# between several devices/namespaces for one volume.
# 'p' 'PIPE' filesystem. All files are pipe commands.
# see 'doc/PIPE-FS'
######################################
# Eintrag 2 fuer den Servername.
# falls nicht gesetzt, wird hostname (in GROSSBUCHSTABEN) verwendet.
@@ -31,19 +46,32 @@
######################################
# next entry for configure mars_nwe to use the internal net
# If you have mars_nwe V > 0.96pl5 and a kernel >= 1.3.60
# or the small ipx-kpatch from the examples dir you can use
# or the small ipx-kpatch from the examples dir you should use
# internal net and routing.
# INTERNAL NET [NODE]
#3 0x999999 1 # Node default 1
# NOTE: the internal NET Number must be UNIQUE
# in your IPX-environment. !
# INTERNAL NET [NODE] (default 1)
3 0xABCDEF99 1 # Net Number must be unique.
######################################
# entry 4: # for DEVICE(S)
# if your ipx is allready up, then entry 4 must be removed.
# NETWORK NUMBER, DEVICE, Frame-Typ TICS (default 1)
# NOTE for people with other IPX/NCP servers on the net:
# Your network numbers, frames must be the same as at your
# other servers on the same net.
# You also may choose a network number = '0', device = '*'
# and frame = 'auto' for autosetup of devices.
#
# NETWORK NUMBER, DEVICE, Frame-Typ TICKS (default 1)
4 0x10 eth0 802.3 1
4 0x0 * AUTO 1 # autosetup all devices
# ^^^^...........^^^....^^^^^^^
# NOTE: autosetup can only be choosen if you have other
# IXP/NCP servers on the same net which are setup correctly.
######
#4 0x22 eth0 ethernet_ii 1
#4 0x33 eth0 802.2 1
#4 0x55 isdn2 ethernet_ii 7
# Frames=ethernet_ii, 802.2, 802.3, SNAP (default 802.3)
#4 0x66 tr0 token 1
# Frames=ethernet_ii, 802.2, 802.3, snap, token, auto, (default 802.3),
5 0 # don't = 0, do = 1, save ipx-routes after server is down.
######################################
# some clients are running better, if the server tells
@@ -106,9 +134,10 @@
103 0 # debug NWCONN
104 0 # debug (start) NWCLIENT
105 0 # debug NWBIND
106 1 # debug NWROUTED
#############################
200 1 # 0 = no logfile and dont daemonize nwserv
# # 1 = daemonize nwserv and use logfile
200 1 # 0 = no logfile and dont daemonize nwserv/nwrouted
# # 1 = daemonize nwserv/nwrouted and use logfile
201 /tmp/nw.log # logfilename
202 1 # 1=creat new logfile, 0=append to logfile
#############################
@@ -116,11 +145,11 @@
# # after a down command
211 60 # 10 .. 600 (default 60) broadcasts every x seconds
#############################
300 0 # > 0 print routing info to file every x broadcasts. ( normally minutes )
300 1 # > 0 print routing info to file every x broadcasts. ( normally minutes )
301 /tmp/nw.routes # filename.
302 1 # creat new filename=1, append to file=0
302 1 # creat new routing info file=1, append to this file=0
#############################
310 7 # send wdog's only to device net < x tics.
310 7 # send wdog's only to device net < x ticks.
# 0 = allways send wdogs. < 0 = never send wdogs
##############################
# station file for special handling of stations.

View File

@@ -1,4 +1,5 @@
#!/bin/sh
### !!!!!!! this is only for kernel 1.3.56 !!!!!!!!
ACT_DIR=`pwd`
PATCHFILE=kpatch1.3.56
LINUXDIR=/usr/src/linux