]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
drop support for DECnet
authorStephen Hemminger <stephen@networkplumber.org>
Tue, 11 Dec 2018 16:40:09 +0000 (08:40 -0800)
committerDavid Ahern <dsahern@gmail.com>
Thu, 13 Dec 2018 20:50:01 +0000 (12:50 -0800)
DECnet belongs in the history museum of dead protocols along
with Appletalk and IPX.

Linux support has outlived its natural life and the time has
come to remove it from iproute2. Dead code is a source
of bugs and exploits.

If anyone actually has DECnet running on some old distribution
they can just keep to the old version of iproute2.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David Ahern <dsahern@gmail.com>
Makefile
README.decnet [deleted file]
README.lnstat
include/utils.h
ip/ip.c
ip/iproute.c
lib/dnet_ntop.c [deleted file]
lib/dnet_pton.c [deleted file]
lib/utils.c
man/man8/ip-route.8.in
man/man8/ip.8

index 7d62468c6638ec8ea00e2d7241540bc2eaa2ba31..ad96fd541580ae287350349752e3a7d1eb49aa18 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -40,9 +40,6 @@ DEFINES+=-DCONFDIR=\"$(CONFDIR)\" \
          -DNETNS_RUN_DIR=\"$(NETNS_RUN_DIR)\" \
          -DNETNS_ETC_DIR=\"$(NETNS_ETC_DIR)\"
 
-#options for decnet
-ADDLIB+=dnet_ntop.o dnet_pton.o
-
 #options for mpls
 ADDLIB+=mpls_ntop.o mpls_pton.o
 
diff --git a/README.decnet b/README.decnet
deleted file mode 100644 (file)
index 4300f90..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-
-Here are a few quick points about DECnet support...
-
- o iproute2 is the tool of choice for configuring the DECnet support for
-   Linux. For many features, it is the only tool which can be used to
-   configure them.
-
- o No name resolution is available as yet, all addresses must be
-   entered numerically.
-
- o Remember to set the hardware address of the interface using: 
-
-   ip link set ethX address xx:xx:xx:xx:xx:xx
-      (where xx:xx:xx:xx:xx:xx is the MAC address for your DECnet node
-       address)
-
-   if your Ethernet card won't listen to more than one unicast
-   mac address at once. If the Linux DECnet stack doesn't talk to
-   any other DECnet nodes, then check this with tcpdump and if its
-   a problem, change the mac address (but do this _before_ starting
-   any other network protocol on the interface)
-
- o Whilst you can use ip addr add to add more than one DECnet address to an
-   interface, don't expect addresses which are not the same as the
-   kernels node address to work properly with 2.4 kernels. This should
-   be fine with 2.6 kernels as the routing code has been extensively
-   modified and improved.
-
- o The DECnet support is currently self contained. It does not depend on
-   the libdnet library.
-
-Steve Whitehouse <steve@chygwyn.com>
-
index 057925f671b7f5e65bb1309ccfae70530d0a3a55..59134a158c3bd6b91e874c17bdda1c0439781273 100644 (file)
@@ -9,7 +9,7 @@ In addition to routing cache statistics, it supports any kind of statistics
 the linux kernel exports via a file in /proc/net/stat.  In a stock 2.6.9
 kernel, this is 
        per-protocol neighbour cache statistics 
-               (ipv4, ipv6, atm, decnet)
+               (ipv4, ipv6, atm)
        routing cache statistics
                (ipv4)
        connection tracking statistics
index fee7ff2856d4afa59232a92ca51739d2271abb37..92bbe82d3366b175aea90674c40c1b25ce995308 100644 (file)
@@ -194,9 +194,6 @@ int matches(const char *arg, const char *pattern);
 int inet_addr_match(const inet_prefix *a, const inet_prefix *b, int bits);
 int inet_addr_match_rta(const inet_prefix *m, const struct rtattr *rta);
 
-const char *dnet_ntop(int af, const void *addr, char *str, size_t len);
-int dnet_pton(int af, const char *src, void *addr);
-
 const char *mpls_ntop(int af, const void *addr, char *str, size_t len);
 int mpls_pton(int af, const char *src, void *addr, size_t alen);
 
diff --git a/ip/ip.c b/ip/ip.c
index 11dbed72842f8446810202177d9920509ffddcbd..a5bbacb4bb0f589a8305279b66a571c9d1bc1af4 100644 (file)
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -53,7 +53,7 @@ static void usage(void)
 "                   vrf | sr }\n"
 "       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
 "                    -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
-"                    -f[amily] { inet | inet6 | dnet | mpls | bridge | link } |\n"
+"                    -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
 "                    -4 | -6 | -I | -D | -M | -B | -0 |\n"
 "                    -l[oops] { maximum-addr-flush-attempts } | -br[ief] |\n"
 "                    -o[neline] | -t[imestamp] | -ts[hort] | -b[atch] [filename] |\n"
index 26f7cd8915bfaa6fa50ddeb2e0fb8cbbf2147edf..60e46e03cb4931c88543211f7d40b84cfed52dfb 100644 (file)
@@ -83,7 +83,7 @@ static void usage(void)
                "INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...\n"
                "NH := [ encap ENCAPTYPE ENCAPHDR ] [ via [ FAMILY ] ADDRESS ]\n"
                "           [ dev STRING ] [ weight NUMBER ] NHFLAGS\n"
-               "FAMILY := [ inet | inet6 | dnet | mpls | bridge | link ]\n"
+               "FAMILY := [ inet | inet6 | mpls | bridge | link ]\n"
                "OPTIONS := FLAGS [ mtu NUMBER ] [ advmss NUMBER ] [ as [ to ] ADDRESS ]\n"
                "           [ rtt TIME ] [ rttvar TIME ] [ reordering NUMBER ]\n"
                "           [ window NUMBER ] [ cwnd NUMBER ] [ initcwnd NUMBER ]\n"
diff --git a/lib/dnet_ntop.c b/lib/dnet_ntop.c
deleted file mode 100644 (file)
index 17d960e..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#include "utils.h"
-
-static __inline__ u_int16_t dn_ntohs(u_int16_t addr)
-{
-       union {
-               u_int8_t byte[2];
-               u_int16_t word;
-       } u;
-
-       u.word = addr;
-       return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8);
-}
-
-static __inline__ int do_digit(char *str, u_int16_t *addr, u_int16_t scale, size_t *pos, size_t len, int *started)
-{
-       u_int16_t tmp = *addr / scale;
-
-       if (*pos == len)
-               return 1;
-
-       if (((tmp) > 0) || *started || (scale == 1)) {
-               *str = tmp + '0';
-               *started = 1;
-               (*pos)++;
-               *addr -= (tmp * scale);
-       }
-
-       return 0;
-}
-
-
-static const char *dnet_ntop1(const struct dn_naddr *dna, char *str, size_t len)
-{
-       u_int16_t addr, area;
-       size_t pos = 0;
-       int started = 0;
-
-       memcpy(&addr, dna->a_addr, sizeof(addr));
-       addr = dn_ntohs(addr);
-       area = addr >> 10;
-
-       if (dna->a_len != 2)
-               return NULL;
-
-       addr &= 0x03ff;
-
-       if (len == 0)
-               return str;
-
-       if (do_digit(str + pos, &area, 10, &pos, len, &started))
-               return str;
-
-       if (do_digit(str + pos, &area, 1, &pos, len, &started))
-               return str;
-
-       if (pos == len)
-               return str;
-
-       *(str + pos) = '.';
-       pos++;
-       started = 0;
-
-       if (do_digit(str + pos, &addr, 1000, &pos, len, &started))
-               return str;
-
-       if (do_digit(str + pos, &addr, 100, &pos, len, &started))
-               return str;
-
-       if (do_digit(str + pos, &addr, 10, &pos, len, &started))
-               return str;
-
-       if (do_digit(str + pos, &addr, 1, &pos, len, &started))
-               return str;
-
-       if (pos == len)
-               return str;
-
-       *(str + pos) = 0;
-
-       return str;
-}
-
-
-const char *dnet_ntop(int af, const void *addr, char *str, size_t len)
-{
-       switch(af) {
-               case AF_DECnet:
-                       errno = 0;
-                       return dnet_ntop1((struct dn_naddr *)addr, str, len);
-               default:
-                       errno = EAFNOSUPPORT;
-       }
-
-       return NULL;
-}
diff --git a/lib/dnet_pton.c b/lib/dnet_pton.c
deleted file mode 100644 (file)
index 1cf54e5..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-#include <netinet/in.h>
-
-#include "utils.h"
-
-static __inline__ u_int16_t dn_htons(u_int16_t addr)
-{
-        union {
-                u_int8_t byte[2];
-                u_int16_t word;
-        } u;
-
-        u.word = addr;
-        return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8);
-}
-
-
-static int dnet_num(const char *src, u_int16_t * dst)
-{
-       int rv = 0;
-       int tmp;
-       *dst = 0;
-
-       while ((tmp = *src++) != 0) {
-               tmp -= '0';
-               if ((tmp < 0) || (tmp > 9))
-                       return rv;
-
-               rv++;
-               (*dst) *= 10;
-               (*dst) += tmp;
-       }
-
-       return rv;
-}
-
-static int dnet_pton1(const char *src, struct dn_naddr *dna)
-{
-       u_int16_t addr;
-       u_int16_t area = 0;
-       u_int16_t node = 0;
-       int pos;
-
-       pos = dnet_num(src, &area);
-       if ((pos == 0) || (area > 63) || (*(src + pos) != '.'))
-               return 0;
-       pos = dnet_num(src + pos + 1, &node);
-       if ((pos == 0) || (node > 1023))
-               return 0;
-       dna->a_len = 2;
-       addr = dn_htons((area << 10) | node);
-       memcpy(dna->a_addr, &addr, sizeof(addr));
-
-       return 1;
-}
-
-int dnet_pton(int af, const char *src, void *addr)
-{
-       int err;
-
-       switch (af) {
-       case AF_DECnet:
-               errno = 0;
-               err = dnet_pton1(src, (struct dn_naddr *)addr);
-               break;
-       default:
-               errno = EAFNOSUPPORT;
-               err = -1;
-       }
-
-       return err;
-}
index 22bc6c8d3a6f6a578737fd4555c1e14e401e6066..9ebc82746d39360005d5b257098cf264e042c7f7 100644 (file)
@@ -600,18 +600,6 @@ static int __get_addr_1(inet_prefix *addr, const char *name, int family)
                return 0;
        }
 
-       if (family == AF_DECnet) {
-               struct dn_naddr dna;
-
-               addr->family = AF_DECnet;
-               if (dnet_pton(AF_DECnet, name, &dna) <= 0)
-                       return -1;
-               memcpy(addr->data, dna.a_addr, 2);
-               addr->bytelen = 2;
-               addr->bitlen = -1;
-               return 0;
-       }
-
        if (family == AF_MPLS) {
                unsigned int maxlabels;
                int i;
@@ -1000,13 +988,6 @@ const char *rt_addr_n2a_r(int af, int len,
                return inet_ntop(af, addr, buf, buflen);
        case AF_MPLS:
                return mpls_ntop(af, addr, buf, buflen);
-       case AF_DECnet:
-       {
-               struct dn_naddr dna = { 2, { 0, 0, } };
-
-               memcpy(dna.a_addr, addr, 2);
-               return dnet_ntop(af, &dna, buf, buflen);
-       }
        case AF_PACKET:
                return ll_addr_n2a(addr, len, ARPHRD_VOID, buf, buflen);
        case AF_BRIDGE:
@@ -1048,8 +1029,6 @@ int read_family(const char *name)
                family = AF_INET;
        else if (strcmp(name, "inet6") == 0)
                family = AF_INET6;
-       else if (strcmp(name, "dnet") == 0)
-               family = AF_DECnet;
        else if (strcmp(name, "link") == 0)
                family = AF_PACKET;
        else if (strcmp(name, "ipx") == 0)
@@ -1067,8 +1046,6 @@ const char *family_name(int family)
                return "inet";
        if (family == AF_INET6)
                return "inet6";
-       if (family == AF_DECnet)
-               return "dnet";
        if (family == AF_PACKET)
                return "link";
        if (family == AF_IPX)
index a664d848d4cbc7b7bd70f95e2a89e1e6dfe2bab4..9603ac6e02b812cf461125c5780c08964860d9ee 100644 (file)
@@ -107,7 +107,7 @@ replace " } "
 
 .ti -8
 .IR FAMILY " := [ "
-.BR inet " | " inet6 " | " dnet " | " mpls " | " bridge " | " link " ]"
+.BR inet " | " inet6 " | " mpls " | " bridge " | " link " ]"
 
 .ti -8
 .IR OPTIONS " := " FLAGS " [ "
index 16867efbeaf831fc25560d831e5a99d1023d4b53..84ade1104b48a3a6a6b6b8d3c8626d8c5d613fca 100644 (file)
@@ -34,7 +34,7 @@ ip \- show / manipulate routing, network devices, interfaces and tunnels
 \fB\-r\fR[\fIesolve\fR] |
 \fB\-iec\fR |
 \fB\-f\fR[\fIamily\fR] {
-.BR inet " | " inet6 " | " dnet " | " link " } | "
+.BR inet " | " inet6 " | " link " } | "
 \fB-4\fR |
 \fB-6\fR |
 \fB-I\fR |
@@ -94,7 +94,7 @@ Zero (0) means loop until all addresses are removed.
 .TP
 .BR "\-f" , " \-family " <FAMILY>
 Specifies the protocol family to use. The protocol family identifier can be one of
-.BR "inet" , " inet6" , " bridge" ,  " dnet" , " mpls"
+.BR "inet" , " inet6" , " bridge" ,  " mpls"
 or
 .BR link .
 If this option is not present,
@@ -125,11 +125,6 @@ shortcut for
 shortcut for
 .BR "\-family bridge" .
 
-.TP
-.B \-D
-shortcut for
-.BR "\-family decnet" .
-
 .TP
 .B \-M
 shortcut for