diff -u --recursive --new-file net-tools.orig/ChangeLog net-tools/ChangeLog
--- net-tools.orig/ChangeLog	Wed Apr 15 14:15:11 1998
+++ net-tools/ChangeLog	Sat Aug 15 22:11:05 1998
@@ -1,3 +1,11 @@
+1998-08-15  Stephane Fillod  <sfillod@charybde.gyptis.frmug.org>
+
+	* ifconfig.c, netstat.c: Add X.25 support.
+
+	* lib/x25.c, lib/x25_gr.c, lib/x25_sr.c: New files.
+	* config.in, lib/Makefile, lib/net-support.h, lib/af.c: support X.25.
+	* sockets.c, lib/hw.c lib/net-features.h, lib/*route.c: Likewise.
+
 1998-04-15  Phil Blundell  <philb@gnu.org>
 
 	* lib/ash.c (pr_ash): Fix typo.
diff -u --recursive --new-file net-tools.orig/config.in net-tools/config.in
--- net-tools.orig/config.in	Sat Apr 11 00:34:37 1998
+++ net-tools/config.in	Sat Aug 15 22:11:05 1998
@@ -61,6 +61,7 @@
 bool 'AX25 (packet radio) protocol family' HAVE_AFAX25 y
 bool 'NET/ROM (packet radio) protocol family' HAVE_AFNETROM y
 bool 'Rose (packet radio) protocol family' HAVE_AFROSE n
+bool 'X.25 (CCITT) protocol family' HAVE_AFX25 n
 bool 'Econet protocol family' HAVE_AFECONET n
 *
 *
@@ -75,6 +76,7 @@
 bool 'AX25 (packet radio) support' HAVE_HWAX25 y
 bool 'Rose (packet radio) support' HAVE_HWROSE n
 bool 'NET/ROM (packet radio) support' HAVE_HWNETROM y
+bool 'X.25 (generic) support' HAVE_HWX25 n
 bool 'DLCI/FRAD (frame relay) support' HAVE_HWFR y
 bool 'SIT (IPv6-in-IPv4) support' HAVE_HWSIT n
 bool 'FDDI (generic) support' HAVE_HWFDDI n
diff -u --recursive --new-file net-tools.orig/ifconfig.c net-tools/ifconfig.c
--- net-tools.orig/ifconfig.c	Thu Apr 16 14:48:56 1998
+++ net-tools/ifconfig.c	Sat Aug 15 22:11:05 1998
@@ -163,6 +163,9 @@
 #if HAVE_AFINET6  
   if (ap->af != AF_INET6) {
 #endif
+#if HAVE_HWX25  
+  if (hw->type != ARPHRD_X25) {
+#endif
     printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_adr,
 		       "          %s addr:%s "), ap->name,
 	   ap->sprint(&ptr->addr, 1));
@@ -176,6 +179,9 @@
     }
     printf(NLS_CATGETS(catfd, ifconfigSet, ifconfig_mask, " Mask:%s\n"),
 	   ap->sprint(&ptr->netmask, 1));
+#if HAVE_HWX25  
+  }
+#endif
 #if HAVE_AFINET6
   }
   if ((f = fopen(_PATH_PROCNET_IFINET6, "r")) != NULL) {
diff -u --recursive --new-file net-tools.orig/lib/Makefile net-tools/lib/Makefile
--- net-tools.orig/lib/Makefile	Sat Apr 11 00:34:41 1998
+++ net-tools/lib/Makefile	Sat Aug 15 22:11:05 1998
@@ -29,10 +29,10 @@
 #
 
 
-HWOBJS	 = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o
-AFOBJS	 = unix.o inet.o inet6.o ax25.o ipx.o ddp.o ipx.o netrom.o af.o rose.o econet.o
-AFGROBJS = inet_gr.o inet6_gr.o ipx_gr.o ddp_gr.o netrom_gr.o ax25_gr.o rose_gr.o getroute.o
-AFSROBJS = inet_sr.o inet6_sr.o netrom_sr.o ipx_sr.o setroute.o
+HWOBJS	 = hw.o loopback.o slip.o ether.o ax25.o ppp.o arcnet.o tr.o tunnel.o frame.o sit.o rose.o ash.o fddi.o x25.o
+AFOBJS	 = unix.o inet.o inet6.o ax25.o ipx.o ddp.o ipx.o netrom.o x25.o af.o rose.o econet.o
+AFGROBJS = inet_gr.o inet6_gr.o ipx_gr.o ddp_gr.o netrom_gr.o ax25_gr.o rose_gr.o x25_gr.o getroute.o
+AFSROBJS = inet_sr.o inet6_sr.o netrom_sr.o ipx_sr.o x25_sr.o setroute.o
 ACTOBJS  = slip_ac.o ppp_ac.o activate.o
 VARIA	 = getargs.o masq_info.o
 NLSMISC  = net-string.o
diff -u --recursive --new-file net-tools.orig/lib/af.c net-tools/lib/af.c
--- net-tools.orig/lib/af.c	Sat Apr 11 00:34:41 1998
+++ net-tools/lib/af.c	Sat Aug 15 22:16:08 1998
@@ -36,6 +36,7 @@
 int flag_inet = 0;
 int flag_inet6 = 0;
 int flag_econet = 0;
+int flag_x25 = 0;
 
 
 struct aftrans_t {
@@ -55,6 +56,7 @@
 	{"unix",	"unix",		&flag_unx},
 	{"tcpip",	"inet",		&flag_inet},
 	{"econet",	"ec",		&flag_econet},
+	{"x25",		"x25",		&flag_x25},
 	{0,		0,		0}
 };
 
@@ -69,6 +71,7 @@
 extern	struct aftype	ipx_aftype;
 extern	struct aftype	ddp_aftype;
 extern	struct aftype	ec_aftype;
+extern	struct aftype	x25_aftype;
 
 static short sVafinit = 0;
 
@@ -97,6 +100,9 @@
 #if HAVE_AFECONET
   &ec_aftype,
 #endif
+#if HAVE_AFX25
+  &x25_aftype,
+#endif
   &unspec_aftype,
   NULL
 };
@@ -127,6 +133,9 @@
 #endif
 #if HAVE_AFCONET
   ec_aftype.title = NLS_CATSAVE (catfd, ecSet, ec_ec, "Econet");
+#endif
+#if HAVE_AFX25
+  x25_aftype.title = NLS_CATSAVE (catfd, x25Set, x25_x25, "CCITT X.25");
 #endif
   sVafinit = 1;
 }
diff -u --recursive --new-file net-tools.orig/lib/getroute.c net-tools/lib/getroute.c
--- net-tools.orig/lib/getroute.c	Sat Jan 31 13:20:35 1998
+++ net-tools/lib/getroute.c	Sat Aug 15 22:11:05 1998
@@ -44,6 +44,7 @@
 extern	struct aftype	netrom_aftype;
 extern	struct aftype	ipx_aftype;
 extern	struct aftype	ddp_aftype;
+extern	struct aftype	x25_aftype;
 
 void
 getroute_init(void)
@@ -65,6 +66,9 @@
 #endif
 #if HAVE_AFATALK
 	ddp_aftype.rprint = DDP_rprint;
+#endif
+#if HAVE_AFX25
+	x25_aftype.rprint = X25_rprint;
 #endif
 }
 
diff -u --recursive --new-file net-tools.orig/lib/hw.c net-tools/lib/hw.c
--- net-tools.orig/lib/hw.c	Thu Feb  5 22:44:56 1998
+++ net-tools/lib/hw.c	Sat Aug 15 22:11:05 1998
@@ -46,6 +46,7 @@
 extern	struct hwtype	ax25_hwtype;
 extern	struct hwtype	rose_hwtype;
 extern  struct hwtype   netrom_hwtype;
+extern	struct hwtype	x25_hwtype;
 extern  struct hwtype   tunnel_hwtype;
 
 extern	struct hwtype	ash_hwtype;
@@ -107,6 +108,9 @@
 #if HAVE_HWFDDI
   &fddi_hwtype,
 #endif
+#if HAVE_HWX25
+  &x25_hwtype,
+#endif
   &unspec_hwtype,
   NULL
 };
@@ -141,6 +145,9 @@
 #endif
 #if HAVE_HWNETROM
   netrom_hwtype.title = NLS_CATSAVE (catfd, netromSet, netrom_hw, "AMPR NET/ROM");
+#endif
+#if HAVE_HWX25
+  x25_hwtype.title = NLS_CATSAVE (catfd, x25Set, x25_hw, "generic X.25");
 #endif
 #if HAVE_HWTUNNEL
   tunnel_hwtype.title = NLS_CATSAVE (catfd, tunnelSet, tunnel_hw, "IPIP Tunnel");
diff -u --recursive --new-file net-tools.orig/lib/net-features.h net-tools/lib/net-features.h
--- net-tools.orig/lib/net-features.h	Sat Jan 31 13:20:38 1998
+++ net-tools/lib/net-features.h	Sat Aug 15 22:11:05 1998
@@ -187,6 +187,12 @@
 	"-"
 #endif
 	"NETROM "
+#if HAVE_AFX25
+	"+"
+#else
+	"-"
+#endif
+	"X25 "
 #if HAVE_AFATALK
 	"+"
 #else
@@ -249,6 +255,13 @@
 	"-"
 #endif
 	"NETROM "
+
+#if HAVE_HWX25
+	"+"
+#else
+	"-"
+#endif
+	"X25 "
 
 #if HAVE_HWFR
 	"+"
diff -u --recursive --new-file net-tools.orig/lib/net-support.h net-tools/lib/net-support.h
--- net-tools.orig/lib/net-support.h	Sat Jan 31 13:20:38 1998
+++ net-tools/lib/net-support.h	Sat Aug 15 22:11:05 1998
@@ -94,6 +94,7 @@
 extern int	IPX_rprint(int options);
 extern int	NETROM_rprint(int options);
 extern int	AX25_rprint(int options);
+extern int	X25_rprint(int options);
 
 extern int	INET_rinput(int action, int flags, char **argv);
 extern int	INET6_rinput(int action, int flags, char **argv);
@@ -101,6 +102,7 @@
 extern int	IPX_rinput(int action, int flags, char **argv);
 extern int	NETROM_rinput(int action, int flags, char **argv);
 extern int	AX25_rinput(int action, int flags, char **argv);
+extern int	X25_rinput(int action, int flags, char **argv);
 
 int	aftrans_opt	(const char *arg);
 void	aftrans_def	(char *tool, char *argv0, char *dflt);
@@ -112,12 +114,14 @@
 extern int flag_ax25;
 extern int flag_ddp;
 extern int flag_netrom;
+extern int flag_x25;
 extern int flag_inet;
 extern int flag_inet6;
 
 extern char afname[];
 
 #define AFTRANS_OPTS \
+	{"x25",		0,	0,	1}, \
 	{"ax25",	0,	0,	1}, \
 	{"ip",		0,	0,	1}, \
 	{"ipx",         0,	0,	1}, \
@@ -127,7 +131,7 @@
 	{"ddp",		0,	0,	1}, \
 	{"unix",	0,	0,	1}, \
 	{"tcpip",	0,	0,	1}
-#define AFTRANS_CNT 9
+#define AFTRANS_CNT 10
 
 #define EINTERN(file, text) fprintf(stderr, \
 	"%s: Internal Error `%s'.\n",file,text);
diff -u --recursive --new-file net-tools.orig/lib/pathnames.h net-tools/lib/pathnames.h
--- net-tools.orig/lib/pathnames.h	Sat Apr 11 00:34:41 1998
+++ net-tools/lib/pathnames.h	Sat Aug 15 22:11:05 1998
@@ -39,6 +39,8 @@
 # define _PATH_PROCNET_RARP		"/proc/net/rarp"
 # define _PATH_ETHERS			"/etc/ethers"
 # define _PATH_PROCNET_ROSE_ROUTE	"/proc/net/rose_routes"
+# define _PATH_PROCNET_X25		"/proc/net/x25"
+# define _PATH_PROCNET_X25_ROUTE	"/proc/net/x25_routes"
 
 /* pathname for the netlink device */
 # define _PATH_DEV_ROUTE	"/dev/route"
diff -u --recursive --new-file net-tools.orig/lib/setroute.c net-tools/lib/setroute.c
--- net-tools.orig/lib/setroute.c	Sat Jan 31 13:20:40 1998
+++ net-tools/lib/setroute.c	Sat Aug 15 22:11:05 1998
@@ -40,6 +40,7 @@
 extern	struct aftype	netrom_aftype;
 extern	struct aftype	ipx_aftype;
 extern	struct aftype	ddp_aftype;
+extern	struct aftype	x25_aftype;
 
 void
 setroute_init(void)
@@ -55,6 +56,9 @@
 #endif
 #if HAVE_AFIPX
 	ipx_aftype.rinput = IPX_rinput;
+#endif
+#if HAVE_AFX25
+	x25_aftype.rinput = X25_rinput;
 #endif
 #if 0
 #if HAVE_AFAX25
diff -u --recursive --new-file net-tools.orig/lib/x25.c net-tools/lib/x25.c
--- net-tools.orig/lib/x25.c	Thu Jan  1 01:00:00 1970
+++ net-tools/lib/x25.c	Fri Aug 21 00:37:49 1998
@@ -0,0 +1,170 @@
+/*
+ * lib/x25.c	This file contains an implementation of the "X.25"
+ *		support functions for the NET-3 base distribution.
+ *
+ * Version:	@(#)x25.c	1.00	08/15/98
+ *
+ * Author:	Stephane Fillod, <sfillod@charybde.gyptis.frmug.org>
+ *		based on ax25.c by:
+ * 		Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
+ *		Copyright 1993 MicroWalt Corporation
+ *
+ *		This program is free software; you can redistribute it
+ *		and/or  modify it under  the terms of  the GNU General
+ *		Public  License as  published  by  the  Free  Software
+ *		Foundation;  either  version 2 of the License, or  (at
+ *		your option) any later version.
+ */
+#include "config.h"
+
+#if HAVE_AFX25 || HAVE_HWX25
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/x25.h>
+#include <net/if_arp.h>		/* ARPHRD_X25 */
+#include <stdlib.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+static char X25_errmsg[128];
+
+
+extern struct aftype x25_aftype;
+
+/* is in net/x25.h, not in the public header file linux/x25.h. Why?*/
+#ifndef X25_ADDR_LEN
+#define X25_ADDR_LEN 16
+#endif
+
+
+static char *
+X25_print(unsigned char *ptr)
+{
+  static char buff[X25_ADDR_LEN+1];
+
+  strncpy(buff, ptr, X25_ADDR_LEN);
+  buff[X25_ADDR_LEN] = '\0';
+  return(buff);
+
+}
+
+
+/* Display an X.25 socket address. */
+static char *
+X25_sprint(struct sockaddr *sap, int numeric)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, x25Set, x25_none, "[NONE SET]", buf, 64));
+  return(X25_print(((struct sockaddr_x25 *)sap)->sx25_addr.x25_addr));
+}
+
+
+/*
+ * return the sigdigits of the address
+ */
+static int
+X25_input(int type, char *bufp, struct sockaddr *sap)
+{
+  unsigned char *ptr;
+  char *p;
+  unsigned int sigdigits;
+
+  sap->sa_family = x25_aftype.af;
+  ptr = ((struct sockaddr_x25 *)sap)->sx25_addr.x25_addr;
+
+
+  /* Address the correct length ? */
+  if (strlen(bufp)>18) {
+        strcpy(X25_errmsg, NLS_CATGETS (catfd, x25Set, x25_debug1, "Address can't exceed eighteen digits with sigdigits"));
+#ifdef DEBUG
+        fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
+#endif
+        errno = EINVAL;
+        return(-1);
+  }
+
+
+  if ((p = strchr(bufp, '/')) != NULL) {
+        *p = '\0';
+        sigdigits = atoi(p + 1);
+  } else {
+        sigdigits = strlen(bufp);
+  }
+
+  if (strlen(bufp) < 1 || strlen(bufp) > 15 || sigdigits > strlen(bufp)) {
+	*p = '/';
+        strcpy(X25_errmsg, NLS_CATGETS (catfd, x25Set, x25_debug2, "Invalid address"));
+#ifdef DEBUG
+        fprintf(stderr, "x25_input(%s): %s !\n", X25_errmsg, orig);
+#endif
+        errno = EINVAL;
+        return(-1);
+  }
+
+  strncpy(ptr, bufp, sigdigits+1);
+
+  /* All done. */
+#ifdef DEBUG
+  fprintf(stderr, "x25_input(%s): ", orig);
+  for (i = 0; i < sizeof(x25_address); i++)
+	fprintf(stderr, "%02X ", sap->sa_data[i] & 0377);
+  fprintf(stderr, "\n");
+#endif
+
+  return sigdigits;
+}
+
+
+/* Display an error message. */
+static void
+X25_herror(char *text)
+{
+  if (text == NULL) fprintf(stderr, "%s\n", X25_errmsg);
+    else fprintf(stderr, "%s: %s\n", text, X25_errmsg);
+}
+
+
+static char *
+X25_hprint(struct sockaddr *sap)
+{
+  static char buf[64];
+
+  if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+    return(NLS_CATBUFF (catfd, x25Set, x25_none, "[NONE SET]", buf, 64));
+  return(X25_print(((struct sockaddr_x25 *)sap)->sx25_addr.x25_addr));
+}
+
+
+static int
+X25_hinput(char *bufp, struct sockaddr *sap)
+{
+  if (X25_input(0, bufp, sap) < 0) return(-1);
+  sap->sa_family = ARPHRD_X25;
+  return(0);
+}
+
+
+struct hwtype x25_hwtype = {
+  "x25",	NULL, /*"CCITT X.25",*/		ARPHRD_X25,	X25_ADDR_LEN,
+  X25_print,	NULL, /* X25_hprint,*/		X25_hinput,	NULL
+};
+
+struct aftype x25_aftype = {
+  "x25",	NULL, /*"CCITT X.25",*/		AF_X25,	X25_ADDR_LEN,
+  X25_print,	X25_sprint,		X25_input,	X25_herror,	
+  NULL/*X25_rprint*/,  NULL/*X25_rinput*/
+};
+
+#endif	/* HAVE_xxX25 */
diff -u --recursive --new-file net-tools.orig/lib/x25_gr.c net-tools/lib/x25_gr.c
--- net-tools.orig/lib/x25_gr.c	Thu Jan  1 01:00:00 1970
+++ net-tools/lib/x25_gr.c	Sat Aug 15 22:11:05 1998
@@ -0,0 +1,86 @@
+/*
+ * lib/x25_gr.c	This file contains an implementation of the "X.25"
+ *		route print support functions.
+ *
+ * Version:	lib/x25_gr.c	1.00	08/15/98
+ *
+ * Author:	Stephane Fillod, <sfillod@charybde.gyptis.frmug.org>
+ * 		based on ax25_gr.c by:
+ *		Bernd Eckenfels, <ecki@lina.inka.de>
+ *		Copyright 1999 Bernd Eckenfels, Germany
+ *		base on Code from Jonathan Naylor <jsn@Cs.Nott.AC.UK>
+ *
+ *		This program is free software; you can redistribute it
+ *		and/or  modify it under  the terms of  the GNU General
+ *		Public  License as  published  by  the  Free  Software
+ *		Foundation;  either  version 2 of the License, or  (at
+ *		your option) any later version.
+ */
+#include "config.h"
+
+#if HAVE_AFX25
+#if 0
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <linux/x25.h>
+#include <linux/if_arp.h>	/* ARPHRD_X25 */
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <termios.h>
+#endif
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+/* is in net/x25.h, not in the public header file linux/x25.h. Why?*/
+#ifndef X25_ADDR_LEN
+#define X25_ADDR_LEN 16
+#endif
+
+int X25_rprint(int options)
+{
+	FILE *f=fopen(_PATH_PROCNET_X25_ROUTE, "r");
+	char buffer[256];
+	char *p;
+	int  digits;
+
+	if(f==NULL)
+	{
+		printf(NLS_CATGETS(catfd, netstatSet, netstat_nox25, "X.25 not configured in this system.\n")); /* xxx */
+		return 1;
+	}
+	printf(NLS_CATGETS(catfd, netstatSet, netstat_x25, "Kernel X.25 routing table\n")); /* xxx */
+	printf(NLS_CATGETS(catfd, netstatSet, netstat_header_x25, 
+				"Destination          Iface\n")); /* xxx */
+	fgets(buffer,256,f);
+	while(fgets(buffer,256,f))
+	{
+		p = strchr(buffer,'\n');
+		if (p)
+			*p=0;
+
+		buffer[24]=0;
+		buffer[35]=0;
+		digits=atoi(buffer+17);
+		if (digits < 0 || digits > 15)
+			digits=15;
+		buffer[digits]=0;
+		if (digits == 0)
+			printf("*                    %-5s\n", buffer+25);
+		else
+			printf("%s/%*d   %-5s\n",
+				buffer,digits-17,digits,buffer+25);
+	}
+	fclose(f);
+	return 0;
+}
+
+#endif	/* HAVE_AFX25 */
diff -u --recursive --new-file net-tools.orig/lib/x25_sr.c net-tools/lib/x25_sr.c
--- net-tools.orig/lib/x25_sr.c	Thu Jan  1 01:00:00 1970
+++ net-tools/lib/x25_sr.c	Sat Aug 15 22:11:05 1998
@@ -0,0 +1,149 @@
+/*
+ * lib/x25_sr.c	This file contains an implementation of the "X.25"
+ *		route change support functions.
+ *
+ * Version:	@(#)x25_sr.c	1.00	08/15/98
+ *
+ * Author:	Stephane Fillod, <sfillod@charybde.gyptis.frmug.org>
+ *		based on inet_sr.c
+ *
+ *		This program is free software; you can redistribute it
+ *		and/or  modify it under  the terms of  the GNU General
+ *		Public  License as  published  by  the  Free  Software
+ *		Foundation;  either  version 2 of the License, or  (at
+ *		your option) any later version.
+ */
+#include "config.h"
+
+#if HAVE_AFX25
+#include <asm/types.h>
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <linux/x25.h>
+#include <ctype.h>
+#include <errno.h>
+#include <netdb.h>
+#include <resolv.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include "version.h"
+#include "net-support.h"
+#include "pathnames.h"
+#define  EXTERN
+#include "net-locale.h"
+
+#include "net-features.h"
+
+extern     struct aftype   x25_aftype;
+
+static int skfd = -1;
+
+
+static int usage(void)
+{
+  fprintf(stderr,"Usage: x25_route [-v] del Target[/mask] [dev] If\n");
+  fprintf(stderr,"       x25_route [-v] add Target[/mask] [dev] If\n");
+  return(E_USAGE);
+}
+
+
+static int X25_setroute(int action, int options, char **args)
+{
+  struct x25_route_struct rt;
+  struct sockaddr_x25 sx25;
+  char target[128];
+  signed int sigdigits;
+
+  if (*args == NULL)
+	return(usage());
+
+  strcpy(target, *args++);
+
+  /* Clean out the x25_route_struct structure. */
+  memset((char *) &rt, 0, sizeof(struct x25_route_struct));
+
+
+  if ((sigdigits = x25_aftype.input(0, target, (struct sockaddr *)&sx25)) < 0) {
+	x25_aftype.herror(target);
+	return (1);
+  }
+  rt.sigdigits=sigdigits;
+
+  /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
+  memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address));
+
+  while (*args) {
+	if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
+		args++;
+		if (!*args)
+			return(usage());
+	} else
+		if (args[1])
+			return(usage());
+	if (rt.device[0])
+		return(usage());
+	strcpy(rt.device, *args);
+	args++;
+  }
+  if (rt.device[0]=='\0')
+	return(usage());
+
+  /* sanity checks.. */
+	if (rt.sigdigits > 15) {
+		fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_netmask2,
+					    "route: bogus netmask %d\n"), rt.sigdigits);
+		return(E_OPTERR);
+	}
+
+	if (rt.sigdigits > strlen(rt.address.x25_addr)) {
+		fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_netmask3,
+					    "route: netmask doesn't match route address\n"));
+		return(E_OPTERR);
+	}
+
+  /* Create a socket to the X25 kernel. */
+  if ((skfd = socket(AF_X25, SOCK_SEQPACKET, 0)) < 0) {
+	perror("socket");
+	return(E_SOCK);
+  }
+  
+  /* Tell the kernel to accept this route. */
+  if (action==RTACTION_DEL) {
+	if (ioctl(skfd, SIOCDELRT, &rt) < 0) {
+		perror("SIOCDELRT");
+		close(skfd);
+		return(E_SOCK);
+	}
+  } else {
+	if (ioctl(skfd, SIOCADDRT, &rt) < 0) {
+		perror("SIOCADDRT");
+		close(skfd);
+		return(E_SOCK);
+	}
+  }
+
+  /* Close the socket. */
+  (void) close(skfd);
+  return(0);
+}
+
+int X25_rinput(int action, int options, char **args)
+{
+  if (action == RTACTION_FLUSH) {
+  	fprintf(stderr,"Flushing `x25' routing table not supported\n");
+  	return(usage());
+  }	
+  if (options & FLAG_CACHE) {
+  	fprintf(stderr,"Modifying `x25' routing cache not supported\n");
+  	return(usage());
+  }	
+  if ((*args == NULL) || (action == RTACTION_HELP))
+	return(usage());
+  
+  return(X25_setroute(action, options, args));
+}
+#endif	/* HAVE_AFX25 */
diff -u --recursive --new-file net-tools.orig/netstat.c net-tools/netstat.c
--- net-tools.orig/netstat.c	Sat Apr 11 00:34:41 1998
+++ net-tools/netstat.c	Sat Aug 15 22:11:05 1998
@@ -43,6 +43,7 @@
  *					(relly needs to be kernel hooked but 
  *					this will do in the meantime)
  *					minor header file misplacement tidy up.
+ *980815 {1.xx} Stephane Fillod:	X.25 support
  *
  *		This program is free software; you can redistribute it
  *		and/or  modify it under  the terms of  the GNU General
@@ -1085,6 +1086,57 @@
 }	
 #endif
 
+#if HAVE_AFX25
+static int x25_info(void)
+{
+ 	FILE *f=fopen(_PATH_PROCNET_X25, "r");
+	char buffer[256],dev[16];
+	int st,vs,vr,sendq,recvq,lci;
+	static char *x25_state[5]=
+ 	{
+		"LISTENING",
+ 		"SABM_SENT",
+ 		"DISC_SENT",
+		"ESTABLISHED",
+		"RECOVERY"
+ 	};
+	if(!(f=fopen(_PATH_PROCNET_X25, "r")))
+	{
+		if (errno != ENOENT) {
+			perror(_PATH_PROCNET_X25);
+			return(-1);
+		}
+		if (flag_arg || flag_ver)
+			ESYSNOT("netstat","AF X25");
+		if (flag_arg)
+			return(1);
+		else
+			return(0);
+  	}
+	printf(NLS_CATGETS(catfd, netstatSet, netstat_x25, "Active X.25 sockets\n"));
+	/* IMHO, Vr/Vs is not very usefull --SF */
+	printf(NLS_CATGETS(catfd, netstatSet, netstat_header_x25, "Dest            Source          Device  LCI  State        Vr/Vs  Send-Q  Recv-Q\n"));
+ 	fgets(buffer,256,f);
+ 	while(fgets(buffer,256,f))
+ 	{
+ 		buffer[10]=0;
+		buffer[20]=0;
+		sscanf(buffer+22,"%s %d %d %d %d %*d %*d %*d %*d %*d %*d %d %d %*d",
+			dev,&lci,&st,&vs,&vr,&sendq,&recvq);
+		if (!(flag_all || lci))
+			continue;
+		printf("%-15s %-15s %-7s %-3d  %-11s  %02d/%02d  %-6d  %-6d\n",
+ 			buffer,buffer+11,
+			dev,
+			lci,
+ 			x25_state[st],
+			vr,vs,sendq,recvq);
+ 	}
+ 	fclose(f);
+ 	return 0;		
+}
+#endif
+
 static void
 ife_print(struct interface *ptr)
 {
@@ -1335,7 +1387,7 @@
     flag_tcp = flag_udp = flag_raw = 1;
   
   flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx 
-    + flag_ax25 + flag_netrom;
+    + flag_ax25 + flag_netrom + flag_x25;
   
   if (flag_nlp) {
 #if HAVE_RT_NETLINK && 0
@@ -1476,6 +1528,16 @@
 #else
       if (flag_arg)
 	{ i=1; ENOSUPP("netstat","AF NETROM"); }
+#endif
+    }
+    
+    if(!flag_arg || flag_x25) {
+#if HAVE_AFX25
+      i = x25_info();
+      if(i) {  NLS_CATCLOSE(catfd)  return(i); }
+#else
+      if (flag_arg)
+	{ i=1; ENOSUPP("netstat","AF X25"); }
 #endif
     }
     
diff -u --recursive --new-file net-tools.orig/route.c net-tools/route.c
--- net-tools.orig/route.c	Sat Apr 11 00:34:22 1998
+++ net-tools/route.c	Sat Aug 15 22:11:05 1998
@@ -84,7 +84,7 @@
 	fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage4,
 				"       route [-v] [-FC] {add|del|flush} ...  Modify routing table for AF.\n\n"));
 	fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage5,
-				"  Address_families: inet,inet6,ddp,ipx,netrom,ax25\n"));
+				"  Address_families: inet,inet6,ddp,ipx,netrom,ax25,x25\n"));
 	fprintf(stderr, NLS_CATGETS(catfd, routeSet, route_usage6,
 				"        specify AF: -A af1,af2..  or  --af1 --af2  or  af_route\n"));
 	NLS_CATCLOSE(catfd)
diff -u --recursive --new-file net-tools.orig/sockets.c net-tools/sockets.c
--- net-tools.orig/sockets.c	Sat Apr 11 00:34:41 1998
+++ net-tools/sockets.c	Sat Aug 15 22:11:05 1998
@@ -16,6 +16,9 @@
 #if HAVE_AFROSE
 int rose_sock = -1;			/* Rose socket			*/
 #endif
+#if HAVE_AFX25
+int x25_sock = -1;			/* X.25 socket			*/
+#endif
 #if HAVE_AFINET
 int inet_sock = -1;			/* INET socket			*/
 #endif
@@ -51,6 +54,10 @@
   rose_sock = socket(AF_ROSE, SOCK_DGRAM, 0);
 #endif
 
+#if HAVE_X25
+  x25_sock = socket(AF_X25, SOCK_SEQPACKET, 0);
+#endif
+
 #if HAVE_AFATALK
   ddp_sock = socket(AF_APPLETALK, SOCK_DGRAM, 0);
 #endif
@@ -81,6 +88,10 @@
 
 #if HAVE_AFROSE 
   if (rose_sock != -1) return rose_sock;
+#endif
+
+#if HAVE_AFX25
+  if (x25_sock != -1) return x25_sock;
 #endif
 
 #if HAVE_AFATALK
diff -u --recursive --new-file net-tools.orig/sockets.h net-tools/sockets.h
--- net-tools.orig/sockets.h	Sat Apr 11 00:34:41 1998
+++ net-tools/sockets.h	Sat Aug 15 22:11:05 1998
@@ -1,3 +1,3 @@
-extern int skfd, ipx_sock, ax25_sock, rose_sock, inet_sock, inet6_sock, ddp_sock, ec_sock;
+extern int skfd, ipx_sock, ax25_sock, rose_sock, x25_sock, inet_sock, inet6_sock, ddp_sock, ec_sock;
 
 extern int sockets_open(void);
