]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
drop support for IPX
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 15 Nov 2018 19:26:13 +0000 (11:26 -0800)
committerDavid Ahern <dsahern@gmail.com>
Sat, 24 Nov 2018 15:27:56 +0000 (07:27 -0800)
IPX has been depracted then removed from upstream kernels.
Drop support from ip route as well.

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

index b7488addc6f2eb3f2d6cb4a4f4bc0b711dfba56b..7d62468c6638ec8ea00e2d7241540bc2eaa2ba31 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -43,9 +43,6 @@ DEFINES+=-DCONFDIR=\"$(CONFDIR)\" \
 #options for decnet
 ADDLIB+=dnet_ntop.o dnet_pton.o
 
-#options for ipx
-ADDLIB+=ipx_ntop.o ipx_pton.o
-
 #options for mpls
 ADDLIB+=mpls_ntop.o mpls_pton.o
 
index 1630dd0b28540c87fb285c51a9197f246301b630..fee7ff2856d4afa59232a92ca51739d2271abb37 100644 (file)
@@ -116,13 +116,6 @@ struct dn_naddr
         unsigned char a_addr[DN_MAXADDL];
 };
 
-#define IPX_NODE_LEN 6
-
-struct ipx_addr {
-       u_int32_t ipx_net;
-       u_int8_t  ipx_node[IPX_NODE_LEN];
-};
-
 #ifndef AF_MPLS
 # define AF_MPLS 28
 #endif
@@ -204,9 +197,6 @@ 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 *ipx_ntop(int af, const void *addr, char *str, size_t len);
-int ipx_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 c324120f9fc59991ac82bb9420679c9bc972f993..11dbed72842f8446810202177d9920509ffddcbd 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 | ipx | dnet | mpls | bridge | link } |\n"
+"                    -f[amily] { inet | inet6 | dnet | 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"
@@ -225,8 +225,6 @@ int main(int argc, char **argv)
                        preferred_family = AF_INET6;
                } else if (strcmp(opt, "-0") == 0) {
                        preferred_family = AF_PACKET;
-               } else if (strcmp(opt, "-I") == 0) {
-                       preferred_family = AF_IPX;
                } else if (strcmp(opt, "-D") == 0) {
                        preferred_family = AF_DECnet;
                } else if (strcmp(opt, "-M") == 0) {
index b039f35b0ccdfcef5007fb2210ee09995a023851..26f7cd8915bfaa6fa50ddeb2e0fb8cbbf2147edf 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 | ipx | dnet | mpls | bridge | link ]\n"
+               "FAMILY := [ inet | inet6 | dnet | 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/ipx_ntop.c b/lib/ipx_ntop.c
deleted file mode 100644 (file)
index 80b8a34..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include "utils.h"
-
-static __inline__ int do_digit(char *str, u_int32_t addr, u_int32_t scale, size_t *pos, size_t len)
-{
-       u_int32_t tmp = addr >> (scale * 4);
-
-       if (*pos == len)
-               return 1;
-
-       tmp &= 0x0f;
-       if (tmp > 9)
-               *str = tmp + 'A' - 10;
-       else
-               *str = tmp + '0';
-       (*pos)++;
-
-       return 0;
-}
-
-static const char *ipx_ntop1(const struct ipx_addr *addr, char *str, size_t len)
-{
-       int i;
-       size_t pos = 0;
-
-       if (len == 0)
-               return str;
-
-       for(i = 7; i >= 0; i--)
-               if (do_digit(str + pos, ntohl(addr->ipx_net), i, &pos, len))
-                       return str;
-
-       if (pos == len)
-               return str;
-
-       *(str + pos) = '.';
-       pos++;
-
-       for(i = 0; i < 6; i++) {
-               if (do_digit(str + pos, addr->ipx_node[i], 1, &pos, len))
-                       return str;
-               if (do_digit(str + pos, addr->ipx_node[i], 0, &pos, len))
-                       return str;
-       }
-
-       if (pos == len)
-               return str;
-
-       *(str + pos) = 0;
-
-       return str;
-}
-
-
-const char *ipx_ntop(int af, const void *addr, char *str, size_t len)
-{
-       switch(af) {
-               case AF_IPX:
-                       errno = 0;
-                       return ipx_ntop1((struct ipx_addr *)addr, str, len);
-               default:
-                       errno = EAFNOSUPPORT;
-       }
-
-       return NULL;
-}
diff --git a/lib/ipx_pton.c b/lib/ipx_pton.c
deleted file mode 100644 (file)
index a97c1c1..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-#include <errno.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include "utils.h"
-
-static int ipx_getnet(u_int32_t *net, const char *str)
-{
-       int i;
-       u_int32_t tmp;
-
-       for(i = 0; *str && (i < 8); i++) {
-
-               if ((tmp = get_hex(*str)) == -1) {
-                       if (*str == '.')
-                               return 0;
-                       else
-                               return -1;
-               }
-
-               str++;
-               (*net) <<= 4;
-               (*net) |= tmp;
-       }
-
-       if (*str == 0)
-               return 0;
-
-       return -1;
-}
-
-static int ipx_getnode(u_int8_t *node, const char *str)
-{
-       int i;
-       u_int32_t tmp;
-
-       for(i = 0; i < 6; i++) {
-               if ((tmp = get_hex(*str++)) == -1)
-                       return -1;
-               node[i] = (u_int8_t)tmp;
-               node[i] <<= 4;
-               if ((tmp = get_hex(*str++)) == -1)
-                       return -1;
-               node[i] |= (u_int8_t)tmp;
-               if (*str == ':')
-                       str++;
-       }
-
-       return 0;
-}
-
-static int ipx_pton1(const char *src, struct ipx_addr *addr)
-{
-       char *sep = (char *)src;
-       int no_node = 0;
-
-       memset(addr, 0, sizeof(struct ipx_addr));
-
-       while(*sep && (*sep != '.'))
-               sep++;
-
-       if (*sep != '.')
-               no_node = 1;
-
-       if (ipx_getnet(&addr->ipx_net, src))
-               return 0;
-
-       addr->ipx_net = htonl(addr->ipx_net);
-
-       if (no_node)
-               return 1;
-
-       if (ipx_getnode(addr->ipx_node, sep + 1))
-               return 0;
-
-       return 1;
-}
-
-int ipx_pton(int af, const char *src, void *addr)
-{
-       int err;
-
-       switch (af) {
-       case AF_IPX:
-               errno = 0;
-               err = ipx_pton1(src, (struct ipx_addr *)addr);
-               break;
-       default:
-               errno = EAFNOSUPPORT;
-               err = -1;
-       }
-
-       return err;
-}
index 4965a575088079916a2dc6319badfdd6db6f8479..22bc6c8d3a6f6a578737fd4555c1e14e401e6066 100644 (file)
@@ -1000,8 +1000,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_IPX:
-               return ipx_ntop(af, addr, buf, buflen);
        case AF_DECnet:
        {
                struct dn_naddr dna = { 2, { 0, 0, } };
index 11dd4ca7abf68d8e393bd74e3018bb555172f496..e11fba92c76c3b68392836df4a0984c4b58d1fae 100644 (file)
@@ -107,7 +107,7 @@ replace " } "
 
 .ti -8
 .IR FAMILY " := [ "
-.BR inet " | " inet6 " | " ipx " | " dnet " | " mpls " | " bridge " | " link " ]"
+.BR inet " | " inet6 " | " dnet " | " mpls " | " bridge " | " link " ]"
 
 .ti -8
 .IR OPTIONS " := " FLAGS " [ "
index 1d358879ec39c0eb9b1a3e8fc70f10b98e90e14e..16867efbeaf831fc25560d831e5a99d1023d4b53 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 " | " ipx " | " dnet " | " link " } | "
+.BR inet " | " inet6 " | " dnet " | " 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" , " ipx" , " dnet" , " mpls"
+.BR "inet" , " inet6" , " bridge" ,  " dnet" , " mpls"
 or
 .BR link .
 If this option is not present,
@@ -130,11 +130,6 @@ shortcut for
 shortcut for
 .BR "\-family decnet" .
 
-.TP
-.B \-I
-shortcut for
-.BR "\-family ipx" .
-
 .TP
 .B \-M
 shortcut for