]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
remove hamradio protocols
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 24 Apr 2026 23:22:57 +0000 (16:22 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 27 Apr 2026 18:39:56 +0000 (11:39 -0700)
The ax25, rose, and netrom have been removed upstream.
Drop support for those protocols from iproute2.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Makefile
include/uapi/linux/ax25.h [deleted file]
include/uapi/linux/rose.h [deleted file]
include/utils.h
lib/ax25_ntop.c [deleted file]
lib/ll_addr.c
lib/netrom_ntop.c [deleted file]
lib/rose_ntop.c [deleted file]

index 1bebf08fed4771102eecf03d0e697ebf8a4f86c2..6f5d4765a35aec829ad223ef42b80664d9f22216 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -45,18 +45,9 @@ DEFINES+=-DCONF_USR_DIR=\"$(CONF_USR_DIR)\" \
          -DARPDDIR=\"$(ARPDDIR)\" \
          -DCONF_COLOR=$(CONF_COLOR)
 
-#options for AX.25
-ADDLIB+=ax25_ntop.o
-
-#options for AX.25
-ADDLIB+=rose_ntop.o
-
 #options for mpls
 ADDLIB+=mpls_ntop.o mpls_pton.o
 
-#options for NETROM
-ADDLIB+=netrom_ntop.o
-
 CC := gcc
 HOSTCC ?= $(CC)
 DEFINES += -D_GNU_SOURCE
diff --git a/include/uapi/linux/ax25.h b/include/uapi/linux/ax25.h
deleted file mode 100644 (file)
index b496b9d..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-/*
- * These are the public elements of the Linux kernel AX.25 code. A similar
- * file netrom.h exists for the NET/ROM protocol.
- */
-
-#ifndef        AX25_KERNEL_H
-#define        AX25_KERNEL_H
-
-#include <linux/socket.h>
-
-#define AX25_MTU       256
-#define AX25_MAX_DIGIS  8
-
-#define AX25_WINDOW    1
-#define AX25_T1                2
-#define AX25_N2                3
-#define AX25_T3                4
-#define AX25_T2                5
-#define        AX25_BACKOFF    6
-#define        AX25_EXTSEQ     7
-#define        AX25_PIDINCL    8
-#define AX25_IDLE      9
-#define AX25_PACLEN    10
-#define AX25_IAMDIGI   12
-
-#define AX25_KILL      99
-
-#define SIOCAX25GETUID         (SIOCPROTOPRIVATE+0)
-#define SIOCAX25ADDUID         (SIOCPROTOPRIVATE+1)
-#define SIOCAX25DELUID         (SIOCPROTOPRIVATE+2)
-#define SIOCAX25NOUID          (SIOCPROTOPRIVATE+3)
-#define SIOCAX25OPTRT          (SIOCPROTOPRIVATE+7)
-#define SIOCAX25CTLCON         (SIOCPROTOPRIVATE+8)
-#define SIOCAX25GETINFOOLD     (SIOCPROTOPRIVATE+9)
-#define SIOCAX25ADDFWD         (SIOCPROTOPRIVATE+10)
-#define SIOCAX25DELFWD         (SIOCPROTOPRIVATE+11)
-#define SIOCAX25DEVCTL          (SIOCPROTOPRIVATE+12)
-#define SIOCAX25GETINFO         (SIOCPROTOPRIVATE+13)
-
-#define AX25_SET_RT_IPMODE     2
-
-#define AX25_NOUID_DEFAULT     0
-#define AX25_NOUID_BLOCK       1
-
-typedef struct {
-       char            ax25_call[7];   /* 6 call + SSID (shifted ascii!) */
-} ax25_address;
-
-struct sockaddr_ax25 {
-       __kernel_sa_family_t sax25_family;
-       ax25_address    sax25_call;
-       int             sax25_ndigis;
-       /* Digipeater ax25_address sets follow */
-};
-
-#define sax25_uid      sax25_ndigis
-
-struct full_sockaddr_ax25 {
-       struct sockaddr_ax25 fsa_ax25;
-       ax25_address    fsa_digipeater[AX25_MAX_DIGIS];
-};
-
-struct ax25_routes_struct {
-       ax25_address    port_addr;
-       ax25_address    dest_addr;
-       unsigned char   digi_count;
-       ax25_address    digi_addr[AX25_MAX_DIGIS];
-};
-
-struct ax25_route_opt_struct {
-       ax25_address    port_addr;
-       ax25_address    dest_addr;
-       int             cmd;
-       int             arg;
-};
-
-struct ax25_ctl_struct {
-        ax25_address            port_addr;
-        ax25_address            source_addr;
-        ax25_address            dest_addr;
-        unsigned int            cmd;
-        unsigned long           arg;
-        unsigned char           digi_count;
-        ax25_address            digi_addr[AX25_MAX_DIGIS];
-};
-
-/* this will go away. Please do not export to user land */
-struct ax25_info_struct_deprecated {
-       unsigned int    n2, n2count;
-       unsigned int    t1, t1timer;
-       unsigned int    t2, t2timer;
-       unsigned int    t3, t3timer;
-       unsigned int    idle, idletimer;
-       unsigned int    state;
-       unsigned int    rcv_q, snd_q;
-};
-
-struct ax25_info_struct {
-       unsigned int    n2, n2count;
-       unsigned int    t1, t1timer;
-       unsigned int    t2, t2timer;
-       unsigned int    t3, t3timer;
-       unsigned int    idle, idletimer;
-       unsigned int    state;
-       unsigned int    rcv_q, snd_q;
-       unsigned int    vs, vr, va, vs_max;
-       unsigned int    paclen;
-       unsigned int    window;
-};
-
-struct ax25_fwd_struct {
-       ax25_address    port_from;
-       ax25_address    port_to;
-};
-
-#endif
diff --git a/include/uapi/linux/rose.h b/include/uapi/linux/rose.h
deleted file mode 100644 (file)
index 19aa469..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-/*
- * These are the public elements of the Linux kernel Rose implementation.
- * For kernel AX.25 see the file ax25.h. This file requires ax25.h for the
- * definition of the ax25_address structure.
- */
-
-#ifndef        ROSE_KERNEL_H
-#define        ROSE_KERNEL_H
-
-#include <linux/socket.h>
-#include <linux/ax25.h>
-
-#define ROSE_MTU       251
-
-#define ROSE_MAX_DIGIS 6
-
-#define        ROSE_DEFER      1
-#define ROSE_T1                2
-#define        ROSE_T2         3
-#define        ROSE_T3         4
-#define        ROSE_IDLE       5
-#define        ROSE_QBITINCL   6
-#define        ROSE_HOLDBACK   7
-
-#define        SIOCRSGCAUSE            (SIOCPROTOPRIVATE+0)
-#define        SIOCRSSCAUSE            (SIOCPROTOPRIVATE+1)
-#define        SIOCRSL2CALL            (SIOCPROTOPRIVATE+2)
-#define        SIOCRSSL2CALL           (SIOCPROTOPRIVATE+2)
-#define        SIOCRSACCEPT            (SIOCPROTOPRIVATE+3)
-#define        SIOCRSCLRRT             (SIOCPROTOPRIVATE+4)
-#define        SIOCRSGL2CALL           (SIOCPROTOPRIVATE+5)
-#define        SIOCRSGFACILITIES       (SIOCPROTOPRIVATE+6)
-
-#define        ROSE_DTE_ORIGINATED     0x00
-#define        ROSE_NUMBER_BUSY        0x01
-#define        ROSE_INVALID_FACILITY   0x03
-#define        ROSE_NETWORK_CONGESTION 0x05
-#define        ROSE_OUT_OF_ORDER       0x09
-#define        ROSE_ACCESS_BARRED      0x0B
-#define        ROSE_NOT_OBTAINABLE     0x0D
-#define        ROSE_REMOTE_PROCEDURE   0x11
-#define        ROSE_LOCAL_PROCEDURE    0x13
-#define        ROSE_SHIP_ABSENT        0x39
-
-typedef struct {
-       char            rose_addr[5];
-} rose_address;
-
-struct sockaddr_rose {
-       __kernel_sa_family_t srose_family;
-       rose_address    srose_addr;
-       ax25_address    srose_call;
-       int             srose_ndigis;
-       ax25_address    srose_digi;
-};
-
-struct full_sockaddr_rose {
-       __kernel_sa_family_t srose_family;
-       rose_address    srose_addr;
-       ax25_address    srose_call;
-       unsigned int    srose_ndigis;
-       ax25_address    srose_digis[ROSE_MAX_DIGIS];
-};
-
-struct rose_route_struct {
-       rose_address    address;
-       unsigned short  mask;
-       ax25_address    neighbour;
-       char            device[16];
-       unsigned char   ndigis;
-       ax25_address    digipeaters[AX25_MAX_DIGIS];
-};
-
-struct rose_cause_struct {
-       unsigned char   cause;
-       unsigned char   diagnostic;
-};
-
-struct rose_facilities_struct {
-       rose_address    source_addr,   dest_addr;
-       ax25_address    source_call,   dest_call;
-       unsigned char   source_ndigis, dest_ndigis;
-       ax25_address    source_digis[ROSE_MAX_DIGIS];
-       ax25_address    dest_digis[ROSE_MAX_DIGIS];
-       unsigned int    rand;
-       rose_address    fail_addr;
-       ax25_address    fail_call;
-};
-
-#endif
index b68d6bc4edcf9ca335148f731cd240871b6c809b..e4e318e2978fe34fe17604a9369d240cc3a1dc93 100644 (file)
@@ -199,15 +199,9 @@ int matches(const char *prefix, const char *string);
 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 *ax25_ntop(int af, const void *addr, char *str, socklen_t len);
-
-const char *rose_ntop(int af, const void *addr, char *buf, socklen_t buflen);
-
 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);
 
-const char *netrom_ntop(int af, const void *addr, char *str, socklen_t len);
-
 extern int __iproute2_hz_internal;
 int __get_hz(void);
 
diff --git a/lib/ax25_ntop.c b/lib/ax25_ntop.c
deleted file mode 100644 (file)
index 3a72a43..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-
-#include <errno.h>
-#include <sys/socket.h>
-#include <linux/ax25.h>
-
-#include "utils.h"
-
-const char *ax25_ntop1(const ax25_address *src, char *dst, socklen_t size);
-
-/*
- * AX.25 addresses are based on Amateur radio callsigns followed by an SSID
- * like XXXXXX-SS where the callsign consists of up to 6 ASCII characters
- * which are either letters or digits and the SSID is a decimal number in the
- * range 0..15.
- * Amateur radio callsigns are assigned by a country's relevant authorities
- * and are 3..6 characters though a few countries have assigned callsigns
- * longer than that.  AX.25 is not able to handle such longer callsigns.
- * There are further restrictions on the format of valid callsigns by
- * applicable national and international law.  Linux doesn't need to care and
- * will happily accept anything that consists of 6 ASCII characters in the
- * range of A-Z and 0-9 for a callsign such as the default AX.25 MAC address
- * LINUX-1 and the default broadcast address QST-0.
- * The SSID is just a number and not encoded in ASCII digits.
- *
- * Being based on HDLC AX.25 encodes addresses by shifting them one bit left
- * thus zeroing bit 0, the HDLC extension bit for all but the last bit of
- * a packet's address field but for our purposes here we're not considering
- * the HDLC extension bit that is it will always be zero.
- *
- * Linux' internal representation of AX.25 addresses in Linux is very similar
- * to this on the on-air or on-the-wire format.  The callsign is padded to
- * 6 octets by adding spaces, followed by the SSID octet then all 7 octets
- * are left-shifted by one bit.
- *
- * For example, for the address "LINUX-1" the callsign is LINUX and SSID is 1
- * the internal format is 98:92:9c:aa:b0:40:02.
- */
-
-const char *ax25_ntop1(const ax25_address *src, char *dst, socklen_t size)
-{
-       char c, *s;
-       int n;
-
-       for (n = 0, s = dst; n < 6; n++) {
-               c = (src->ax25_call[n] >> 1) & 0x7f;
-               if (c != ' ')
-                       *s++ = c;
-       }
-
-       *s++ = '-';
-
-       n = ((src->ax25_call[6] >> 1) & 0x0f);
-       if (n > 9) {
-               *s++ = '1';
-               n -= 10;
-       }
-
-       *s++ = n + '0';
-       *s++ = '\0';
-
-       if (*dst == '\0' || *dst == '-') {
-               dst[0] = '*';
-               dst[1] = '\0';
-       }
-
-       return dst;
-}
-
-const char *ax25_ntop(int af, const void *addr, char *buf, socklen_t buflen)
-{
-       switch (af) {
-       case AF_AX25:
-               errno = 0;
-               return ax25_ntop1((ax25_address *)addr, buf, buflen);
-
-       default:
-               errno = EAFNOSUPPORT;
-       }
-
-       return NULL;
-}
index 5e9245915ef3cb788afa7b76b0b7f6a389d55e75..7a9eb3a494f3c73971877dfc13efa937250d5d8e 100644 (file)
@@ -35,12 +35,6 @@ const char *ll_addr_n2a(const unsigned char *addr, int alen, int type,
 
        if (alen == 16 && (type == ARPHRD_TUNNEL6 || type == ARPHRD_IP6GRE))
                return inet_ntop(AF_INET6, addr, buf, blen);
-       if (alen == 7 && type == ARPHRD_AX25)
-               return ax25_ntop(AF_AX25, addr, buf, blen);
-       if (alen == 7 && type == ARPHRD_NETROM)
-               return netrom_ntop(AF_NETROM, addr, buf, blen);
-       if (alen == 5 && type == ARPHRD_ROSE)
-               return rose_ntop(AF_ROSE, addr, buf, blen);
 
        snprintf(buf, blen, "%02x", addr[0]);
        for (i = 1, l = 2; i < alen && l < blen; i++, l += 3)
diff --git a/lib/netrom_ntop.c b/lib/netrom_ntop.c
deleted file mode 100644 (file)
index 3dd6cb0..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#include <sys/socket.h>
-#include <errno.h>
-#include <linux/ax25.h>
-
-#include "utils.h"
-
-const char *ax25_ntop1(const ax25_address *src, char *dst, socklen_t size);
-
-const char *netrom_ntop(int af, const void *addr, char *buf, socklen_t buflen)
-{
-       switch (af) {
-       case AF_NETROM:
-               errno = 0;
-               return ax25_ntop1((ax25_address *)addr, buf, buflen);
-
-       default:
-               errno = EAFNOSUPPORT;
-       }
-
-       return NULL;
-}
diff --git a/lib/rose_ntop.c b/lib/rose_ntop.c
deleted file mode 100644 (file)
index c9ba712..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <string.h>
-#include <errno.h>
-
-#include <linux/netdevice.h>
-#include <linux/if_arp.h>
-#include <linux/sockios.h>
-#include <linux/rose.h>
-
-#include "rt_names.h"
-#include "utils.h"
-
-static const char *rose_ntop1(const rose_address *src, char *dst,
-                             socklen_t size)
-{
-       char *p = dst;
-       int i;
-
-       if (size < 10)
-               return NULL;
-
-       for (i = 0; i < 5; i++) {
-               *p++ = '0' + ((src->rose_addr[i] >> 4) & 0xf);
-               *p++ = '0' + ((src->rose_addr[i]     ) & 0xf);
-       }
-
-       if (size == 10)
-               return dst;
-
-       *p = '\0';
-
-       return dst;
-}
-
-const char *rose_ntop(int af, const void *addr, char *buf, socklen_t buflen)
-{
-       switch (af) {
-       case AF_ROSE:
-               errno = 0;
-               return rose_ntop1((rose_address *)addr, buf, buflen);
-
-       default:
-               errno = EAFNOSUPPORT;
-       }
-
-       return NULL;
-}