Debian Bug report logs - #54864
[PATCH] X.25 support

Package: net-tools; Maintainer for net-tools is net-tools Team <pkg-net-tools-maintainers@lists.alioth.debian.org>; Source for net-tools is src:net-tools.

Reported by: "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>

Date: Wed, 12 Jan 2000 12:18:02 UTC

Severity: normal

Done: Bernd Eckenfels <ecki@lina.inka.de>

Bug is archived. No further changes may be made.

Forwarded to philb@gnu.org

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#54864; Package netbase. Full text and rfc822 format available.

Acknowledgement sent to "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>:
New Bug report received and forwarded. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>
To: submit@bugs.debian.org
Subject: [PATCH] X.25 support
Date: Wed, 12 Jan 2000 13:09:42 +0100
Package: netbase
Version: 3.16-8

Here is a patch to add X.25 support to route.

diff --unidirectional-new-file -r -u ../netbase-3.16/debian/changelog ./debian/changelog
--- ../netbase-3.16/debian/changelog	Tue Jan 11 20:39:08 2000
+++ ./debian/changelog	Wed Jan 12 11:27:27 2000
@@ -1,3 +1,12 @@
+netbase (3.16-8.1) unstable; urgency=low
+
+  * Added X.25 support following the patch-net-tools-x25 included with xtod
+    (ftp://ftp.com1.fr/xot/).
+  * Updated net-tools configuration (enabled X25, DECnet, IRDA).
+  * Clean out net-tools' config.status on clean.
+
+ -- J.H.M. Dassen (Ray) <jdassen@cistron.nl>  Wed, 12 Jan 2000 11:27:14 +0100
+
 netbase (3.16-8) unstable; urgency=low
 
   * iputils/ping6.c: Did local defines of clear_bit, set_bit and test_bit,
diff --unidirectional-new-file -r -u ../netbase-3.16/debian/rules ./debian/rules
--- ../netbase-3.16/debian/rules	Tue Jan 11 20:39:08 2000
+++ ./debian/rules	Wed Jan 12 11:24:07 2000
@@ -71,6 +71,7 @@
 	@for i in $(SUBDIRS); do \
 	  ( cd ./$$i && echo -e "\nMaking clean in \`$$i':\n" && make clean ) || exit 1; \
 	done
+	-rm -f net-tools/config.status
 
 	dh_clean
 
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/config.h ./net-tools/config.h
--- ../netbase-3.16/net-tools/config.h	Tue Jan 11 20:39:08 2000
+++ ./net-tools/config.h	Wed Jan 12 11:24:15 2000
@@ -11,15 +11,12 @@
 
 /* 
  * 
- * I18N
+ * Internationalization
  * 
- * (Internationalization)
- * 
- * In this BETA Release the I18N (NLS) is enabled and now based
- * on GNU gettext, only a brazilian portuguese catalog (translation)
- * is present, but others are *highly* welcome!
- * 
- * (answer 'n' if you have no system with GNU gettext support)
+ * The net-tools package has currently been translated to French,
+ * German and Brazilian Portugese.  Other translations are, of
+ * course, welcome.  Answer `n' here if you have no support for
+ * internationalization on your system.
  * 
  */
 #define I18N 1
@@ -37,7 +34,9 @@
 #define HAVE_AFAX25 1
 #define HAVE_AFNETROM 1
 #define HAVE_AFROSE 1
+#define HAVE_AFX25 1
 #define HAVE_AFECONET 1
+#define HAVE_AFDECnet 1
 
 /* 
  * 
@@ -53,12 +52,14 @@
 #define HAVE_HWAX25 1
 #define HAVE_HWROSE 1
 #define HAVE_HWNETROM 1
+#define HAVE_HWX25 1
 #define HAVE_HWFR 1
 #define HAVE_HWSIT 1
 #define HAVE_HWFDDI 1
 #define HAVE_HWHIPPI 1
 #define HAVE_HWASH 1
 #define HAVE_HWHDLCLAPB 1
+#define HAVE_HWIRDA 1
 
 /* 
  * 
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/config.in ./net-tools/config.in
--- ../netbase-3.16/net-tools/config.in	Wed Apr 21 19:48:53 1999
+++ ./net-tools/config.in	Wed Jan 12 10:31:09 2000
@@ -55,6 +55,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 y
 bool 'Econet protocol family' HAVE_AFECONET n
 bool 'DECnet protocol family' HAVE_AFDECnet n
 *
@@ -70,6 +71,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 y
 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 --unidirectional-new-file -r -u ../netbase-3.16/net-tools/config.make ./net-tools/config.make
--- ../netbase-3.16/net-tools/config.make	Tue Jan 11 20:39:08 2000
+++ ./net-tools/config.make	Wed Jan 12 11:24:15 2000
@@ -7,7 +7,9 @@
 HAVE_AFAX25=1
 HAVE_AFNETROM=1
 HAVE_AFROSE=1
+HAVE_AFX25=1
 HAVE_AFECONET=1
+HAVE_AFDECnet=1
 HAVE_HWETHER=1
 HAVE_HWARC=1
 HAVE_HWSLIP=1
@@ -17,11 +19,13 @@
 HAVE_HWAX25=1
 HAVE_HWROSE=1
 HAVE_HWNETROM=1
+HAVE_HWX25=1
 HAVE_HWFR=1
 HAVE_HWSIT=1
 HAVE_HWFDDI=1
 HAVE_HWHIPPI=1
 HAVE_HWASH=1
 HAVE_HWHDLCLAPB=1
+HAVE_HWIRDA=1
 HAVE_FW_MASQUERADE=1
 HAVE_IP_TOOLS=1
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/include/sockets.h ./net-tools/include/sockets.h
--- ../netbase-3.16/net-tools/include/sockets.h	Wed Apr 21 19:48:54 1999
+++ ./net-tools/include/sockets.h	Tue Jan 11 17:29:09 2000
@@ -1,4 +1,4 @@
-extern int skfd, ipx_sock, ax25_sock, rose_sock, inet_sock, inet6_sock,
+extern int skfd, ipx_sock, ax25_sock, rose_sock, x25_sock, inet_sock, inet6_sock,
  ddp_sock, ec_sock;
 
 extern int sockets_open(int family);
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/Makefile ./net-tools/lib/Makefile
--- ../netbase-3.16/net-tools/lib/Makefile	Tue Jan 11 20:39:08 2000
+++ ./net-tools/lib/Makefile	Tue Jan 11 17:59:19 2000
@@ -16,10 +16,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 hippi.o hdlclapb.o irda.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 hippi.o hdlclapb.o irda.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 proc.o util.o nstrcmp.o interface.o sockets.o util-ank.o
 
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/af.c ./net-tools/lib/af.c
--- ../netbase-3.16/net-tools/lib/af.c	Wed Apr 21 19:48:48 1999
+++ ./net-tools/lib/af.c	Tue Jan 11 17:34:32 2000
@@ -35,6 +35,7 @@
 int flag_inet = 0;
 int flag_inet6 = 0;
 int flag_econet = 0;
+int flag_x25 = 0;
 
 
 struct aftrans_t {
@@ -80,6 +81,9 @@
 	"econet", "ec", &flag_econet
     },
     {
+	"x25", "x25", &flag_x25
+    },
+    {
 	0, 0, 0
     }
 };
@@ -95,6 +99,7 @@
 extern struct aftype ipx_aftype;
 extern struct aftype ddp_aftype;
 extern struct aftype ec_aftype;
+extern struct aftype x25_aftype;
 extern struct aftype rose_aftype;
 
 static short sVafinit = 0;
@@ -128,6 +133,9 @@
 #if HAVE_AFECONET
     &ec_aftype,
 #endif
+#if HAVE_AFX25
+    &x25_aftype,
+#endif
     &unspec_aftype,
     NULL
 };
@@ -158,6 +166,9 @@
 #endif
 #if HAVE_AFECONET
     ec_aftype.title = _("Econet");
+#endif
+#if HAVE_AFX25
+    x25_aftype.title = _("CCITT X.25");
 #endif
 #if HAVE_AFROSE
     rose_aftype.title = _("AMPR ROSE");
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/getroute.c ./net-tools/lib/getroute.c
--- ../netbase-3.16/net-tools/lib/getroute.c	Wed Apr 21 19:48:48 1999
+++ ./net-tools/lib/getroute.c	Tue Jan 11 17:14:06 2000
@@ -46,6 +46,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)
 {
@@ -66,6 +67,9 @@
 #endif
 #if HAVE_AFATALK
     ddp_aftype.rprint = DDP_rprint;
+#endif
+#if HAVE_AFX25
+    x25_aftype.rprint = X25_rprint;
 #endif
 }
 
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/hw.c ./net-tools/lib/hw.c
--- ../netbase-3.16/net-tools/lib/hw.c	Wed Apr 21 19:48:48 1999
+++ ./net-tools/lib/hw.c	Tue Jan 11 17:39:27 2000
@@ -47,6 +47,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;
@@ -124,6 +125,9 @@
 #if HAVE_HWIRDA
     &irda_hwtype,
 #endif
+#if HAVE_HWX25
+    &x25_hwtype,
+#endif
     &unspec_hwtype,
     NULL
 };
@@ -161,6 +165,9 @@
 #endif
 #if HAVE_HWNETROM
     netrom_hwtype.title = _("AMPR NET/ROM");
+#endif
+#if HAVE_HWX25
+    x25_hwtype.title = _("generic X.25");
 #endif
 #if HAVE_HWTUNNEL
     tunnel_hwtype.title = _("IPIP Tunnel");
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/net-features.h ./net-tools/lib/net-features.h
--- ../netbase-3.16/net-tools/lib/net-features.h	Wed Apr 21 19:48:49 1999
+++ ./net-tools/lib/net-features.h	Tue Jan 11 17:16:52 2000
@@ -159,6 +159,12 @@
 "-"
 #endif
 "NETROM "
+#if HAVE_AFX25
+"+"
+#else
+"-"
+#endif
+"X25 "
 #if HAVE_AFATALK
 "+"
 #else
@@ -233,6 +239,13 @@
 "-"
 #endif
 "NETROM "
+
+#if HAVE_HWX25
+"+"
+#else
+"-"
+#endif
+"X25 "
 
 #if HAVE_HWFR
 "+"
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/net-support.h ./net-tools/lib/net-support.h
--- ../netbase-3.16/net-tools/lib/net-support.h	Wed Apr 21 19:48:49 1999
+++ ./net-tools/lib/net-support.h	Tue Jan 11 17:39:09 2000
@@ -108,6 +108,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);
@@ -115,6 +116,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);
 
 extern int aftrans_opt(const char *arg);
 extern void aftrans_def(char *tool, char *argv0, char *dflt);
@@ -126,6 +128,7 @@
 extern int flag_ax25;
 extern int flag_ddp;
 extern int flag_netrom;
+extern int flag_x25;
 extern int flag_inet;
 extern int flag_inet6;
 
@@ -133,6 +136,7 @@
 
 #define AFTRANS_OPTS \
 	{"ax25",	0,	0,	1}, \
+	{"x25",		0,	0,	1}, \
 	{"ip",		0,	0,	1}, \
 	{"ipx",         0,	0,	1}, \
 	{"appletalk",	0,	0,	1}, \
@@ -142,7 +146,7 @@
 	{"ddp",		0,	0,	1}, \
 	{"unix",	0,	0,	1}, \
 	{"tcpip",	0,	0,	1}
-#define AFTRANS_CNT 10
+#define AFTRANS_CNT 11
 
 #define EINTERN(file, text) fprintf(stderr, \
 	"%s: Internal Error `%s'.\n",file,text);
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/pathnames.h ./net-tools/lib/pathnames.h
--- ../netbase-3.16/net-tools/lib/pathnames.h	Wed Apr 21 19:48:49 1999
+++ ./net-tools/lib/pathnames.h	Tue Jan 11 18:28:07 2000
@@ -42,6 +42,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"
 #define _PATH_PROCNET_DEV_MCAST		"/proc/net/dev_mcast"
 
 /* pathname for the netlink device */
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/setroute.c ./net-tools/lib/setroute.c
--- ../netbase-3.16/net-tools/lib/setroute.c	Wed Apr 21 19:48:49 1999
+++ ./net-tools/lib/setroute.c	Tue Jan 11 17:19:06 2000
@@ -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)
 {
@@ -54,6 +55,9 @@
 #endif
 #if HAVE_AFIPX
     ipx_aftype.rinput = IPX_rinput;
+#endif
+#if HAVE_AFX25
+    ipx_aftype.rinput = X25_rinput;
 #endif
 #if 0
 #if HAVE_AFAX25
diff --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/x25.c ./net-tools/lib/x25.c
--- ../netbase-3.16/net-tools/lib/x25.c	Thu Jan  1 01:00:00 1970
+++ ./net-tools/lib/x25.c	Tue Jan 11 17:43:38 2000
@@ -0,0 +1,173 @@
+/*
+ * 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
+#if 0
+#include "net-locale.h"
+#endif
+#include "intl.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( _("[NONE SET]"));
+  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, _("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, _("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( _("[NONE SET]"));
+  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 --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/x25_gr.c ./net-tools/lib/x25_gr.c
--- ../netbase-3.16/net-tools/lib/x25_gr.c	Thu Jan  1 01:00:00 1970
+++ ./net-tools/lib/x25_gr.c	Tue Jan 11 18:02:14 2000
@@ -0,0 +1,88 @@
+/*
+ * 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
+#if 0
+#include "net-locale.h"
+#endif
+#include "intl.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( _("X.25 not configured in this system.\n")); /* xxx */
+		return 1;
+	}
+	printf( _("Kernel X.25 routing table\n")); /* xxx */
+	printf( _("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 --unidirectional-new-file -r -u ../netbase-3.16/net-tools/lib/x25_sr.c ./net-tools/lib/x25_sr.c
--- ../netbase-3.16/net-tools/lib/x25_sr.c	Thu Jan  1 01:00:00 1970
+++ ./net-tools/lib/x25_sr.c	Tue Jan 11 17:44:15 2000
@@ -0,0 +1,150 @@
+/*
+ * 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
+#if 0
+#include "net-locale.h"
+#endif
+#include "intl.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, _("route: bogus netmask %d\n"), rt.sigdigits);
+		return(E_OPTERR);
+	}
+
+	if (rt.sigdigits > strlen(rt.address.x25_addr)) {
+		fprintf(stderr, _("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 --unidirectional-new-file -r -u ../netbase-3.16/net-tools/netstat.c ./net-tools/netstat.c
--- ../netbase-3.16/net-tools/netstat.c	Wed Apr 21 19:48:53 1999
+++ ./net-tools/netstat.c	Tue Jan 11 17:48:35 2000
@@ -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
  *980411 {1.34} Arnaldo Carvalho        i18n: catgets -> gnu gettext, substitution
  *                                      of sprintf for snprintf
  *10/1998	Andi Kleen              Use new interface primitives.
@@ -594,6 +595,57 @@
     }    /* IPV4 */
 }
 
+#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( _("Active X.25 sockets\n"));
+       /* IMHO, Vr/Vs is not very usefull --SF */
+       printf( _("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 int igmp_info(void)
 {
     INFO_GUTS6(_PATH_PROCNET_IGMP, _PATH_PROCNET_IGMP6, "AF INET (igmp)",
@@ -1580,7 +1632,7 @@
         flag_inet = flag_inet6 = 1;
 
     flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
-	+ flag_ax25 + flag_netrom + flag_igmp;
+	+ flag_ax25 + flag_netrom + flag_x25 + flag_igmp;
 
     if (flag_mas) {
 #if HAVE_FW_MASQUERADE && HAVE_AFINET
@@ -1746,6 +1798,16 @@
 	    }
 #endif
 	}
+	if(!flag_arg || flag_x25) {
+#if HAVE_AFX25
+		/* FIXME */
+		i = x25_info();
+      		if(i) {  return(i); }
+#endif
+	}
+      if (flag_arg)
+       { i=1; ENOSUPP("netstat","AF X25"); }
+
 	if (!flag_cnt || i)
 	    break;
 	sleep(1);
-- 
"My golden rule of computing is reboot your system every morning."
	Jon C.A. DeKeles, Technical Director, ZDNet AnchorDesk
	in http://www.zdnet.com/anchordesk/story/story_4100.html


Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#54864; Package netbase. Full text and rfc822 format available.

Acknowledgement sent to "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #10 received at 54864@bugs.debian.org (full text, mbox):

From: "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>
To: 54864@bugs.debian.org
Subject: More work needed
Date: Tue, 18 Jan 2000 20:27:33 +0100
Don't use this patch just yet (it horribly broke my machine); I'm still
working on it.

Ray
-- 
"a infinite number of monkeys typing into GNU emacs would never
make a good program"
	.../linux/Documentation/CodingStyle


Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#54864; Package netbase. Full text and rfc822 format available.

Acknowledgement sent to J.H.M.Dassen (Ray) <jdassen@cistron.nl>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #15 received at 54864@bugs.debian.org (full text, mbox):

From: J.H.M.Dassen (Ray) <jdassen@cistron.nl>
To: 54864@bugs.debian.org
Subject: Updated patch
Date: Wed, 19 Jan 2000 09:49:52 +0100
This version of the patch doesn't crash systems, and works fine for me.

diff -r -u netbase-3.16/debian/changelog netbase-3.16-8.1/debian/changelog
--- netbase-3.16/debian/changelog	Tue Jan 11 20:39:08 2000
+++ netbase-3.16-8.1/debian/changelog	Tue Jan 18 20:22:08 2000
@@ -1,3 +1,12 @@
+netbase (3.16-8.1) unstable; urgency=low
+
+  * Added X.25 support following the patch-net-tools-x25 included with xtod
+    (ftp://ftp.com1.fr/xot/).
+  * Updated net-tools configuration (enabled X25, DECnet, IRDA).
+  * Clean out net-tools' config.status on clean.
+
+ -- J.H.M. Dassen (Ray) <jdassen@cistron.nl>  Tue, 18 Jan 2000 20:22:01 +0100
+
 netbase (3.16-8) unstable; urgency=low
 
   * iputils/ping6.c: Did local defines of clear_bit, set_bit and test_bit,
diff -r -u netbase-3.16/debian/rules netbase-3.16-8.1/debian/rules
--- netbase-3.16/debian/rules	Tue Jan 11 20:39:08 2000
+++ netbase-3.16-8.1/debian/rules	Wed Jan 12 11:24:07 2000
@@ -71,6 +71,7 @@
 	@for i in $(SUBDIRS); do \
 	  ( cd ./$$i && echo -e "\nMaking clean in \`$$i':\n" && make clean ) || exit 1; \
 	done
+	-rm -f net-tools/config.status
 
 	dh_clean
 
Binary files netbase-3.16/ipautofw/ipautofw and netbase-3.16-8.1/ipautofw/ipautofw differ
diff -r -u netbase-3.16/net-tools/config.h netbase-3.16-8.1/net-tools/config.h
--- netbase-3.16/net-tools/config.h	Tue Jan 11 20:39:08 2000
+++ netbase-3.16-8.1/net-tools/config.h	Wed Jan 12 11:24:15 2000
@@ -11,15 +11,12 @@
 
 /* 
  * 
- * I18N
+ * Internationalization
  * 
- * (Internationalization)
- * 
- * In this BETA Release the I18N (NLS) is enabled and now based
- * on GNU gettext, only a brazilian portuguese catalog (translation)
- * is present, but others are *highly* welcome!
- * 
- * (answer 'n' if you have no system with GNU gettext support)
+ * The net-tools package has currently been translated to French,
+ * German and Brazilian Portugese.  Other translations are, of
+ * course, welcome.  Answer `n' here if you have no support for
+ * internationalization on your system.
  * 
  */
 #define I18N 1
@@ -37,7 +34,9 @@
 #define HAVE_AFAX25 1
 #define HAVE_AFNETROM 1
 #define HAVE_AFROSE 1
+#define HAVE_AFX25 1
 #define HAVE_AFECONET 1
+#define HAVE_AFDECnet 1
 
 /* 
  * 
@@ -53,12 +52,14 @@
 #define HAVE_HWAX25 1
 #define HAVE_HWROSE 1
 #define HAVE_HWNETROM 1
+#define HAVE_HWX25 1
 #define HAVE_HWFR 1
 #define HAVE_HWSIT 1
 #define HAVE_HWFDDI 1
 #define HAVE_HWHIPPI 1
 #define HAVE_HWASH 1
 #define HAVE_HWHDLCLAPB 1
+#define HAVE_HWIRDA 1
 
 /* 
  * 
diff -r -u netbase-3.16/net-tools/config.in netbase-3.16-8.1/net-tools/config.in
--- netbase-3.16/net-tools/config.in	Wed Apr 21 19:48:53 1999
+++ netbase-3.16-8.1/net-tools/config.in	Wed Jan 12 10:31:09 2000
@@ -55,6 +55,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 y
 bool 'Econet protocol family' HAVE_AFECONET n
 bool 'DECnet protocol family' HAVE_AFDECnet n
 *
@@ -70,6 +71,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 y
 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 -r -u netbase-3.16/net-tools/config.make netbase-3.16-8.1/net-tools/config.make
--- netbase-3.16/net-tools/config.make	Tue Jan 11 20:39:08 2000
+++ netbase-3.16-8.1/net-tools/config.make	Wed Jan 12 11:24:15 2000
@@ -7,7 +7,9 @@
 HAVE_AFAX25=1
 HAVE_AFNETROM=1
 HAVE_AFROSE=1
+HAVE_AFX25=1
 HAVE_AFECONET=1
+HAVE_AFDECnet=1
 HAVE_HWETHER=1
 HAVE_HWARC=1
 HAVE_HWSLIP=1
@@ -17,11 +19,13 @@
 HAVE_HWAX25=1
 HAVE_HWROSE=1
 HAVE_HWNETROM=1
+HAVE_HWX25=1
 HAVE_HWFR=1
 HAVE_HWSIT=1
 HAVE_HWFDDI=1
 HAVE_HWHIPPI=1
 HAVE_HWASH=1
 HAVE_HWHDLCLAPB=1
+HAVE_HWIRDA=1
 HAVE_FW_MASQUERADE=1
 HAVE_IP_TOOLS=1
diff -r -u netbase-3.16/net-tools/include/sockets.h netbase-3.16-8.1/net-tools/include/sockets.h
--- netbase-3.16/net-tools/include/sockets.h	Wed Apr 21 19:48:54 1999
+++ netbase-3.16-8.1/net-tools/include/sockets.h	Tue Jan 11 17:29:09 2000
@@ -1,4 +1,4 @@
-extern int skfd, ipx_sock, ax25_sock, rose_sock, inet_sock, inet6_sock,
+extern int skfd, ipx_sock, ax25_sock, rose_sock, x25_sock, inet_sock, inet6_sock,
  ddp_sock, ec_sock;
 
 extern int sockets_open(int family);
diff -r -u netbase-3.16/net-tools/lib/Makefile netbase-3.16-8.1/net-tools/lib/Makefile
--- netbase-3.16/net-tools/lib/Makefile	Tue Jan 11 20:39:08 2000
+++ netbase-3.16-8.1/net-tools/lib/Makefile	Tue Jan 11 17:59:19 2000
@@ -16,10 +16,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 hippi.o hdlclapb.o irda.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 hippi.o hdlclapb.o irda.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 proc.o util.o nstrcmp.o interface.o sockets.o util-ank.o
 
diff -r -u netbase-3.16/net-tools/lib/af.c netbase-3.16-8.1/net-tools/lib/af.c
--- netbase-3.16/net-tools/lib/af.c	Wed Apr 21 19:48:48 1999
+++ netbase-3.16-8.1/net-tools/lib/af.c	Tue Jan 11 17:34:32 2000
@@ -35,6 +35,7 @@
 int flag_inet = 0;
 int flag_inet6 = 0;
 int flag_econet = 0;
+int flag_x25 = 0;
 
 
 struct aftrans_t {
@@ -80,6 +81,9 @@
 	"econet", "ec", &flag_econet
     },
     {
+	"x25", "x25", &flag_x25
+    },
+    {
 	0, 0, 0
     }
 };
@@ -95,6 +99,7 @@
 extern struct aftype ipx_aftype;
 extern struct aftype ddp_aftype;
 extern struct aftype ec_aftype;
+extern struct aftype x25_aftype;
 extern struct aftype rose_aftype;
 
 static short sVafinit = 0;
@@ -128,6 +133,9 @@
 #if HAVE_AFECONET
     &ec_aftype,
 #endif
+#if HAVE_AFX25
+    &x25_aftype,
+#endif
     &unspec_aftype,
     NULL
 };
@@ -158,6 +166,9 @@
 #endif
 #if HAVE_AFECONET
     ec_aftype.title = _("Econet");
+#endif
+#if HAVE_AFX25
+    x25_aftype.title = _("CCITT X.25");
 #endif
 #if HAVE_AFROSE
     rose_aftype.title = _("AMPR ROSE");
diff -r -u netbase-3.16/net-tools/lib/getroute.c netbase-3.16-8.1/net-tools/lib/getroute.c
--- netbase-3.16/net-tools/lib/getroute.c	Wed Apr 21 19:48:48 1999
+++ netbase-3.16-8.1/net-tools/lib/getroute.c	Tue Jan 11 17:14:06 2000
@@ -46,6 +46,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)
 {
@@ -66,6 +67,9 @@
 #endif
 #if HAVE_AFATALK
     ddp_aftype.rprint = DDP_rprint;
+#endif
+#if HAVE_AFX25
+    x25_aftype.rprint = X25_rprint;
 #endif
 }
 
diff -r -u netbase-3.16/net-tools/lib/hw.c netbase-3.16-8.1/net-tools/lib/hw.c
--- netbase-3.16/net-tools/lib/hw.c	Wed Apr 21 19:48:48 1999
+++ netbase-3.16-8.1/net-tools/lib/hw.c	Tue Jan 11 17:39:27 2000
@@ -47,6 +47,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;
@@ -124,6 +125,9 @@
 #if HAVE_HWIRDA
     &irda_hwtype,
 #endif
+#if HAVE_HWX25
+    &x25_hwtype,
+#endif
     &unspec_hwtype,
     NULL
 };
@@ -161,6 +165,9 @@
 #endif
 #if HAVE_HWNETROM
     netrom_hwtype.title = _("AMPR NET/ROM");
+#endif
+#if HAVE_HWX25
+    x25_hwtype.title = _("generic X.25");
 #endif
 #if HAVE_HWTUNNEL
     tunnel_hwtype.title = _("IPIP Tunnel");
diff -r -u netbase-3.16/net-tools/lib/net-features.h netbase-3.16-8.1/net-tools/lib/net-features.h
--- netbase-3.16/net-tools/lib/net-features.h	Wed Apr 21 19:48:49 1999
+++ netbase-3.16-8.1/net-tools/lib/net-features.h	Tue Jan 11 17:16:52 2000
@@ -159,6 +159,12 @@
 "-"
 #endif
 "NETROM "
+#if HAVE_AFX25
+"+"
+#else
+"-"
+#endif
+"X25 "
 #if HAVE_AFATALK
 "+"
 #else
@@ -233,6 +239,13 @@
 "-"
 #endif
 "NETROM "
+
+#if HAVE_HWX25
+"+"
+#else
+"-"
+#endif
+"X25 "
 
 #if HAVE_HWFR
 "+"
diff -r -u netbase-3.16/net-tools/lib/net-support.h netbase-3.16-8.1/net-tools/lib/net-support.h
--- netbase-3.16/net-tools/lib/net-support.h	Wed Apr 21 19:48:49 1999
+++ netbase-3.16-8.1/net-tools/lib/net-support.h	Tue Jan 11 17:39:09 2000
@@ -108,6 +108,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);
@@ -115,6 +116,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);
 
 extern int aftrans_opt(const char *arg);
 extern void aftrans_def(char *tool, char *argv0, char *dflt);
@@ -126,6 +128,7 @@
 extern int flag_ax25;
 extern int flag_ddp;
 extern int flag_netrom;
+extern int flag_x25;
 extern int flag_inet;
 extern int flag_inet6;
 
@@ -133,6 +136,7 @@
 
 #define AFTRANS_OPTS \
 	{"ax25",	0,	0,	1}, \
+	{"x25",		0,	0,	1}, \
 	{"ip",		0,	0,	1}, \
 	{"ipx",         0,	0,	1}, \
 	{"appletalk",	0,	0,	1}, \
@@ -142,7 +146,7 @@
 	{"ddp",		0,	0,	1}, \
 	{"unix",	0,	0,	1}, \
 	{"tcpip",	0,	0,	1}
-#define AFTRANS_CNT 10
+#define AFTRANS_CNT 11
 
 #define EINTERN(file, text) fprintf(stderr, \
 	"%s: Internal Error `%s'.\n",file,text);
diff -r -u netbase-3.16/net-tools/lib/pathnames.h netbase-3.16-8.1/net-tools/lib/pathnames.h
--- netbase-3.16/net-tools/lib/pathnames.h	Wed Apr 21 19:48:49 1999
+++ netbase-3.16-8.1/net-tools/lib/pathnames.h	Tue Jan 11 18:28:07 2000
@@ -42,6 +42,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"
 #define _PATH_PROCNET_DEV_MCAST		"/proc/net/dev_mcast"
 
 /* pathname for the netlink device */
diff -r -u netbase-3.16/net-tools/lib/setroute.c netbase-3.16-8.1/net-tools/lib/setroute.c
--- netbase-3.16/net-tools/lib/setroute.c	Wed Apr 21 19:48:49 1999
+++ netbase-3.16-8.1/net-tools/lib/setroute.c	Tue Jan 11 17:19:06 2000
@@ -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)
 {
@@ -54,6 +55,9 @@
 #endif
 #if HAVE_AFIPX
     ipx_aftype.rinput = IPX_rinput;
+#endif
+#if HAVE_AFX25
+    ipx_aftype.rinput = X25_rinput;
 #endif
 #if 0
 #if HAVE_AFAX25
diff -r -u netbase-3.16/net-tools/lib/sockets.c netbase-3.16-8.1/net-tools/lib/sockets.c
--- netbase-3.16/net-tools/lib/sockets.c	Wed Apr 21 19:48:52 1999
+++ netbase-3.16-8.1/net-tools/lib/sockets.c	Tue Jan 18 19:24:03 2000
@@ -51,6 +51,10 @@
 	if (af->af == AF_NETROM)
 	    type = SOCK_SEQPACKET;
 #endif
+#if HAVE_AFX25
+	if (af->af == AF_X25)
+	    type = SOCK_SEQPACKET;
+#endif
 	af->fd = socket(af->af, type, 0);
 	if (af->fd >= 0)
 	    sfd = af->fd;
diff -r -u netbase-3.16/net-tools/netstat.c netbase-3.16-8.1/net-tools/netstat.c
--- netbase-3.16/net-tools/netstat.c	Wed Apr 21 19:48:53 1999
+++ netbase-3.16-8.1/net-tools/netstat.c	Tue Jan 11 17:48:35 2000
@@ -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
  *980411 {1.34} Arnaldo Carvalho        i18n: catgets -> gnu gettext, substitution
  *                                      of sprintf for snprintf
  *10/1998	Andi Kleen              Use new interface primitives.
@@ -594,6 +595,57 @@
     }    /* IPV4 */
 }
 
+#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( _("Active X.25 sockets\n"));
+       /* IMHO, Vr/Vs is not very usefull --SF */
+       printf( _("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 int igmp_info(void)
 {
     INFO_GUTS6(_PATH_PROCNET_IGMP, _PATH_PROCNET_IGMP6, "AF INET (igmp)",
@@ -1580,7 +1632,7 @@
         flag_inet = flag_inet6 = 1;
 
     flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx
-	+ flag_ax25 + flag_netrom + flag_igmp;
+	+ flag_ax25 + flag_netrom + flag_x25 + flag_igmp;
 
     if (flag_mas) {
 #if HAVE_FW_MASQUERADE && HAVE_AFINET
@@ -1746,6 +1798,16 @@
 	    }
 #endif
 	}
+	if(!flag_arg || flag_x25) {
+#if HAVE_AFX25
+		/* FIXME */
+		i = x25_info();
+      		if(i) {  return(i); }
+#endif
+	}
+      if (flag_arg)
+       { i=1; ENOSUPP("netstat","AF X25"); }
+
 	if (!flag_cnt || i)
 	    break;
 	sleep(1);
-- 
"But if you look carefully at their [Microsoft's] encryption algorithm, they
simply XOR the password with 'susageP', Pegasus spelled backwards. Pegasus
is the code name of Windows CE. This is so pathetic it's staggering." 
	Bruce Schneier in http://www.counterpane.com/crypto-gram-9911.html 


Noted your statement that Bug has been forwarded to philb@gnu.org. Request was from Anthony Towns <aj@azure.humbug.org.au> to control@bugs.debian.org. Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Anthony Towns <ajt@debian.org>:
Bug#54864; Package netbase. Full text and rfc822 format available.

Acknowledgement sent to "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>:
Extra info received and forwarded to list. Copy sent to Anthony Towns <ajt@debian.org>. Full text and rfc822 format available.

Message #22 received at 54864@bugs.debian.org (full text, mbox):

From: "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>
To: 54864@bugs.debian.org
Subject: Updated patch
Date: Wed, 17 May 2000 19:19:44 +0200
[Message part 1 (text/plain, inline)]
I'm currently taking up the X.25 support with Phil directly; here's the
patch I've recently submitted to him.

Ray
-- 
Ziff Davis is so obviously biased to Microsoft in almost everything they
publish, that they might as well change their company name to MS-PRAVDA. 
	Darryl Householder commenting on extreme PC Week FUD
	(http://linuxtoday.com/story.php3?sn=21049&showcomments=flat)
[diff (text/plain, attachment)]

Bug reassigned from package `netbase' to `net-tools'. Request was from Anthony Towns <aj@azure.humbug.org.au> to control@bugs.debian.org. Full text and rfc822 format available.

Bug reassigned from package `net-tools' to `net-tools'. Request was from Anthony Towns <aj@azure.humbug.org.au> to control@bugs.debian.org. Full text and rfc822 format available.

Bug reassigned from package `net-tools' to `net-tools'. Request was from Anthony Towns <aj@azure.humbug.org.au> to control@bugs.debian.org. Full text and rfc822 format available.

Bug reassigned from package `net-tools' to `net-tools'. Request was from Anthony Towns <aj@azure.humbug.org.au> to control@bugs.debian.org. Full text and rfc822 format available.

Reply sent to Bernd Eckenfels <ecki@lina.inka.de>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to "J.H.M. Dassen (Ray)" <jdassen@cistron.nl>:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #35 received at 54864-done@bugs.debian.org (full text, mbox):

From: Bernd Eckenfels <ecki@lina.inka.de>
To: 54864-done@bugs.debian.org
Subject: included in 1.57-1
Date: Tue, 19 Dec 2000 02:18:01 +0100
this is included in 1.57-1



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 05:33:12 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.