summaryrefslogtreecommitdiff
path: root/networking/interface.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2006-04-14 20:07:33 +0000
committerRob Landley <rob@landley.net>2006-04-14 20:07:33 +0000
commitb0a2d6c19d7d4b42a2b29500d1a7a94e2115b5ea (patch)
tree6435ec1075b8007dff221571a19842a2fba3692b /networking/interface.c
parentda0dcd10509b06ba895c271f1b232cdfaaa6cfc8 (diff)
downloadbusybox-w32-b0a2d6c19d7d4b42a2b29500d1a7a94e2115b5ea.tar.gz
busybox-w32-b0a2d6c19d7d4b42a2b29500d1a7a94e2115b5ea.tar.bz2
busybox-w32-b0a2d6c19d7d4b42a2b29500d1a7a94e2115b5ea.zip
Remove code for protocols we don't properly support. (Most of this could
never be selected via menuconfig anyway.) If somebody wants one of these protocols, ask on the list for us to support it _properly_.
Diffstat (limited to 'networking/interface.c')
-rw-r--r--networking/interface.c345
1 files changed, 0 insertions, 345 deletions
diff --git a/networking/interface.c b/networking/interface.c
index 39fd44cc2..1b6889d20 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -44,12 +44,6 @@
44 * 44 *
45 */ 45 */
46#define HAVE_AFINET 1 46#define HAVE_AFINET 1
47#undef HAVE_AFIPX
48#undef HAVE_AFATALK
49#undef HAVE_AFNETROM
50#undef HAVE_AFX25
51#undef HAVE_AFECONET
52#undef HAVE_AFASH
53 47
54/* 48/*
55 * 49 *
@@ -107,12 +101,6 @@ struct in6_ifreq {
107 101
108#endif /* HAVE_AFINET6 */ 102#endif /* HAVE_AFINET6 */
109 103
110#if HAVE_AFIPX
111#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 1)
112#include <netipx/ipx.h>
113#endif
114#endif
115
116/* Defines for glibc2.0 users. */ 104/* Defines for glibc2.0 users. */
117#ifndef SIOCSIFTXQLEN 105#ifndef SIOCSIFTXQLEN
118#define SIOCSIFTXQLEN 0x8943 106#define SIOCSIFTXQLEN 0x8943
@@ -155,88 +143,29 @@ struct aftype {
155#ifdef KEEP_UNUSED 143#ifdef KEEP_UNUSED
156 144
157static int flag_unx; 145static int flag_unx;
158
159#ifdef HAVE_AFIPX
160static int flag_ipx;
161#endif
162#ifdef HAVE_AFX25
163static int flag_ax25;
164#endif
165#ifdef HAVE_AFATALK
166static int flag_ddp;
167#endif
168#ifdef HAVE_AFNETROM
169static int flag_netrom;
170#endif
171static int flag_inet; 146static int flag_inet;
172 147
173#ifdef HAVE_AFINET6
174static int flag_inet6;
175#endif
176#ifdef HAVE_AFECONET
177static int flag_econet;
178#endif
179#ifdef HAVE_AFX25
180static int flag_x25 = 0;
181#endif
182#ifdef HAVE_AFASH
183static int flag_ash;
184#endif
185
186
187static struct aftrans_t { 148static struct aftrans_t {
188 char *alias; 149 char *alias;
189 char *name; 150 char *name;
190 int *flag; 151 int *flag;
191} aftrans[] = { 152} aftrans[] = {
192 153
193#ifdef HAVE_AFX25
194 {
195 "ax25", "ax25", &flag_ax25},
196#endif
197 { 154 {
198 "ip", "inet", &flag_inet}, 155 "ip", "inet", &flag_inet},
199#ifdef HAVE_AFINET6 156#ifdef HAVE_AFINET6
200 { 157 {
201 "ip6", "inet6", &flag_inet6}, 158 "ip6", "inet6", &flag_inet6},
202#endif 159#endif
203#ifdef HAVE_AFIPX
204 {
205 "ipx", "ipx", &flag_ipx},
206#endif
207#ifdef HAVE_AFATALK
208 {
209 "appletalk", "ddp", &flag_ddp},
210#endif
211#ifdef HAVE_AFNETROM
212 {
213 "netrom", "netrom", &flag_netrom},
214#endif
215 { 160 {
216 "inet", "inet", &flag_inet}, 161 "inet", "inet", &flag_inet},
217#ifdef HAVE_AFINET6 162#ifdef HAVE_AFINET6
218 { 163 {
219 "inet6", "inet6", &flag_inet6}, 164 "inet6", "inet6", &flag_inet6},
220#endif 165#endif
221#ifdef HAVE_AFATALK
222 {
223 "ddp", "ddp", &flag_ddp},
224#endif
225 { 166 {
226 "unix", "unix", &flag_unx}, { 167 "unix", "unix", &flag_unx}, {
227 "tcpip", "inet", &flag_inet}, 168 "tcpip", "inet", &flag_inet},
228#ifdef HAVE_AFECONET
229 {
230 "econet", "ec", &flag_econet},
231#endif
232#ifdef HAVE_AFX25
233 {
234 "x25", "x25", &flag_x25},
235#endif
236#ifdef HAVE_AFASH
237 {
238 "ash", "ash", &flag_ash},
239#endif
240 { 169 {
241 0, 0, 0} 170 0, 0, 0}
242}; 171};
@@ -519,30 +448,6 @@ static struct aftype * const aftypes[] = {
519#if HAVE_AFINET6 448#if HAVE_AFINET6
520 &inet6_aftype, 449 &inet6_aftype,
521#endif 450#endif
522#if HAVE_AFAX25
523 &ax25_aftype,
524#endif
525#if HAVE_AFNETROM
526 &netrom_aftype,
527#endif
528#if HAVE_AFROSE
529 &rose_aftype,
530#endif
531#if HAVE_AFIPX
532 &ipx_aftype,
533#endif
534#if HAVE_AFATALK
535 &ddp_aftype,
536#endif
537#if HAVE_AFECONET
538 &ec_aftype,
539#endif
540#if HAVE_AFASH
541 &ash_aftype,
542#endif
543#if HAVE_AFX25
544 &x25_aftype,
545#endif
546 &unspec_aftype, 451 &unspec_aftype,
547 NULL 452 NULL
548}; 453};
@@ -562,30 +467,6 @@ static void afinit()
562#if HAVE_AFINET6 467#if HAVE_AFINET6
563 inet6_aftype.title = _("IPv6"); 468 inet6_aftype.title = _("IPv6");
564#endif 469#endif
565#if HAVE_AFAX25
566 ax25_aftype.title = _("AMPR AX.25");
567#endif
568#if HAVE_AFNETROM
569 netrom_aftype.title = _("AMPR NET/ROM");
570#endif
571#if HAVE_AFIPX
572 ipx_aftype.title = _("Novell IPX");
573#endif
574#if HAVE_AFATALK
575 ddp_aftype.title = _("Appletalk DDP");
576#endif
577#if HAVE_AFECONET
578 ec_aftype.title = _("Econet");
579#endif
580#if HAVE_AFX25
581 x25_aftype.title = _("CCITT X.25");
582#endif
583#if HAVE_AFROSE
584 rose_aftype.title = _("AMPR ROSE");
585#endif
586#if HAVE_AFASH
587 ash_aftype.title = _("Ash");
588#endif
589 sVafinit = 1; 470 sVafinit = 1;
590} 471}
591 472
@@ -802,20 +683,7 @@ struct interface {
802 struct sockaddr dstaddr; /* P-P IP address */ 683 struct sockaddr dstaddr; /* P-P IP address */
803 struct sockaddr broadaddr; /* IP broadcast address */ 684 struct sockaddr broadaddr; /* IP broadcast address */
804 struct sockaddr netmask; /* IP network mask */ 685 struct sockaddr netmask; /* IP network mask */
805 struct sockaddr ipxaddr_bb; /* IPX network address */
806 struct sockaddr ipxaddr_sn; /* IPX network address */
807 struct sockaddr ipxaddr_e3; /* IPX network address */
808 struct sockaddr ipxaddr_e2; /* IPX network address */
809 struct sockaddr ddpaddr; /* Appletalk DDP address */
810 struct sockaddr ecaddr; /* Econet address */
811 int has_ip; 686 int has_ip;
812 int has_ipx_bb;
813 int has_ipx_sn;
814 int has_ipx_e3;
815 int has_ipx_e2;
816 int has_ax25;
817 int has_ddp;
818 int has_econet;
819 char hwaddr[32]; /* HW address */ 687 char hwaddr[32]; /* HW address */
820 int statistics_valid; 688 int statistics_valid;
821 struct user_net_device_stats stats; /* statistics */ 689 struct user_net_device_stats stats; /* statistics */
@@ -867,14 +735,6 @@ static int sockets_open(int family)
867 if (access(af->flag_file, R_OK)) 735 if (access(af->flag_file, R_OK))
868 continue; 736 continue;
869 } 737 }
870#if HAVE_AFNETROM
871 if (af->af == AF_NETROM)
872 type = SOCK_SEQPACKET;
873#endif
874#if HAVE_AFX25
875 if (af->af == AF_X25)
876 type = SOCK_SEQPACKET;
877#endif
878 af->fd = socket(af->af, type, 0); 738 af->fd = socket(af->af, type, 0);
879 if (af->fd >= 0) 739 if (af->fd >= 0)
880 sfd = af->fd; 740 sfd = af->fd;
@@ -1170,17 +1030,6 @@ static int for_all_interfaces(int (*doit) (struct interface *, void *),
1170 return 0; 1030 return 0;
1171} 1031}
1172 1032
1173/* Support for fetching an IPX address */
1174
1175#if HAVE_AFIPX
1176static int ipx_getaddr(int sock, int ft, struct ifreq *ifr)
1177{
1178 ((struct sockaddr_ipx *) &ifr->ifr_addr)->sipx_type = ft;
1179 return ioctl(sock, SIOCGIFADDR, ifr);
1180}
1181#endif
1182
1183
1184/* Fetch the interface configuration from the kernel. */ 1033/* Fetch the interface configuration from the kernel. */
1185static int if_fetch(struct interface *ife) 1034static int if_fetch(struct interface *ife)
1186{ 1035{
@@ -1283,57 +1132,6 @@ static int if_fetch(struct interface *ife)
1283 } 1132 }
1284#endif 1133#endif
1285 1134
1286#if HAVE_AFATALK
1287 /* DDP address maybe ? */
1288 fd = get_socket_for_af(AF_APPLETALK);
1289 if (fd >= 0) {
1290 strcpy(ifr.ifr_name, ifname);
1291 if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) {
1292 ife->ddpaddr = ifr.ifr_addr;
1293 ife->has_ddp = 1;
1294 }
1295 }
1296#endif
1297
1298#if HAVE_AFIPX
1299 /* Look for IPX addresses with all framing types */
1300 fd = get_socket_for_af(AF_IPX);
1301 if (fd >= 0) {
1302 strcpy(ifr.ifr_name, ifname);
1303 if (!ipx_getaddr(fd, IPX_FRAME_ETHERII, &ifr)) {
1304 ife->has_ipx_bb = 1;
1305 ife->ipxaddr_bb = ifr.ifr_addr;
1306 }
1307 strcpy(ifr.ifr_name, ifname);
1308 if (!ipx_getaddr(fd, IPX_FRAME_SNAP, &ifr)) {
1309 ife->has_ipx_sn = 1;
1310 ife->ipxaddr_sn = ifr.ifr_addr;
1311 }
1312 strcpy(ifr.ifr_name, ifname);
1313 if (!ipx_getaddr(fd, IPX_FRAME_8023, &ifr)) {
1314 ife->has_ipx_e3 = 1;
1315 ife->ipxaddr_e3 = ifr.ifr_addr;
1316 }
1317 strcpy(ifr.ifr_name, ifname);
1318 if (!ipx_getaddr(fd, IPX_FRAME_8022, &ifr)) {
1319 ife->has_ipx_e2 = 1;
1320 ife->ipxaddr_e2 = ifr.ifr_addr;
1321 }
1322 }
1323#endif
1324
1325#if HAVE_AFECONET
1326 /* Econet address maybe? */
1327 fd = get_socket_for_af(AF_ECONET);
1328 if (fd >= 0) {
1329 strcpy(ifr.ifr_name, ifname);
1330 if (ioctl(fd, SIOCGIFADDR, &ifr) == 0) {
1331 ife->ecaddr = ifr.ifr_addr;
1332 ife->has_econet = 1;
1333 }
1334 }
1335#endif
1336
1337 return 0; 1135 return 0;
1338} 1136}
1339 1137
@@ -1521,62 +1319,15 @@ static const struct hwtype * const hwtypes[] = {
1521#if HAVE_HWSTRIP 1319#if HAVE_HWSTRIP
1522 &strip_hwtype, 1320 &strip_hwtype,
1523#endif 1321#endif
1524#if HAVE_HWASH
1525 &ash_hwtype,
1526#endif
1527#if HAVE_HWETHER 1322#if HAVE_HWETHER
1528 &ether_hwtype, 1323 &ether_hwtype,
1529#endif 1324#endif
1530#if HAVE_HWTR
1531 &tr_hwtype,
1532#ifdef ARPHRD_IEEE802_TR
1533 &tr_hwtype1,
1534#endif
1535#endif
1536#if HAVE_HWAX25
1537 &ax25_hwtype,
1538#endif
1539#if HAVE_HWNETROM
1540 &netrom_hwtype,
1541#endif
1542#if HAVE_HWROSE
1543 &rose_hwtype,
1544#endif
1545#if HAVE_HWTUNNEL 1325#if HAVE_HWTUNNEL
1546 &tunnel_hwtype, 1326 &tunnel_hwtype,
1547#endif 1327#endif
1548#if HAVE_HWPPP 1328#if HAVE_HWPPP
1549 &ppp_hwtype, 1329 &ppp_hwtype,
1550#endif 1330#endif
1551#if HAVE_HWHDLCLAPB
1552 &hdlc_hwtype,
1553 &lapb_hwtype,
1554#endif
1555#if HAVE_HWARC
1556 &arcnet_hwtype,
1557#endif
1558#if HAVE_HWFR
1559 &dlci_hwtype,
1560 &frad_hwtype,
1561#endif
1562#if HAVE_HWSIT
1563 &sit_hwtype,
1564#endif
1565#if HAVE_HWFDDI
1566 &fddi_hwtype,
1567#endif
1568#if HAVE_HWHIPPI
1569 &hippi_hwtype,
1570#endif
1571#if HAVE_HWIRDA
1572 &irda_hwtype,
1573#endif
1574#if HAVE_HWEC
1575 &ec_hwtype,
1576#endif
1577#if HAVE_HWX25
1578 &x25_hwtype,
1579#endif
1580 &unspec_hwtype, 1331 &unspec_hwtype,
1581 NULL 1332 NULL
1582}; 1333};
@@ -1598,59 +1349,12 @@ static void hwinit()
1598#if HAVE_HWETHER 1349#if HAVE_HWETHER
1599 ether_hwtype.title = _("Ethernet"); 1350 ether_hwtype.title = _("Ethernet");
1600#endif 1351#endif
1601#if HAVE_HWASH
1602 ash_hwtype.title = _("Ash");
1603#endif
1604#if HAVE_HWFDDI
1605 fddi_hwtype.title = _("Fiber Distributed Data Interface");
1606#endif
1607#if HAVE_HWHIPPI
1608 hippi_hwtype.title = _("HIPPI");
1609#endif
1610#if HAVE_HWAX25
1611 ax25_hwtype.title = _("AMPR AX.25");
1612#endif
1613#if HAVE_HWROSE
1614 rose_hwtype.title = _("AMPR ROSE");
1615#endif
1616#if HAVE_HWNETROM
1617 netrom_hwtype.title = _("AMPR NET/ROM");
1618#endif
1619#if HAVE_HWX25
1620 x25_hwtype.title = _("generic X.25");
1621#endif
1622#if HAVE_HWTUNNEL 1352#if HAVE_HWTUNNEL
1623 tunnel_hwtype.title = _("IPIP Tunnel"); 1353 tunnel_hwtype.title = _("IPIP Tunnel");
1624#endif 1354#endif
1625#if HAVE_HWPPP 1355#if HAVE_HWPPP
1626 ppp_hwtype.title = _("Point-to-Point Protocol"); 1356 ppp_hwtype.title = _("Point-to-Point Protocol");
1627#endif 1357#endif
1628#if HAVE_HWHDLCLAPB
1629 hdlc_hwtype.title = _("(Cisco)-HDLC");
1630 lapb_hwtype.title = _("LAPB");
1631#endif
1632#if HAVE_HWARC
1633 arcnet_hwtype.title = _("ARCnet");
1634#endif
1635#if HAVE_HWFR
1636 dlci_hwtype.title = _("Frame Relay DLCI");
1637 frad_hwtype.title = _("Frame Relay Access Device");
1638#endif
1639#if HAVE_HWSIT
1640 sit_hwtype.title = _("IPv6-in-IPv4");
1641#endif
1642#if HAVE_HWIRDA
1643 irda_hwtype.title = _("IrLAP");
1644#endif
1645#if HAVE_HWTR
1646 tr_hwtype.title = _("16/4 Mbps Token Ring");
1647#ifdef ARPHRD_IEEE802_TR
1648 tr_hwtype1.title = _("16/4 Mbps Token Ring (New)");
1649#endif
1650#endif
1651#if HAVE_HWEC
1652 ec_hwtype.title = _("Econet");
1653#endif
1654 sVhwinit = 1; 1358 sVhwinit = 1;
1655} 1359}
1656#endif /* KEEP_UNUSED */ 1360#endif /* KEEP_UNUSED */
@@ -1797,15 +1501,6 @@ static void ife_print(struct interface *ptr)
1797 int hf; 1501 int hf;
1798 int can_compress = 0; 1502 int can_compress = 0;
1799 1503
1800#if HAVE_AFIPX
1801 static struct aftype *ipxtype = NULL;
1802#endif
1803#if HAVE_AFECONET
1804 static struct aftype *ectype = NULL;
1805#endif
1806#if HAVE_AFATALK
1807 static struct aftype *ddptype = NULL;
1808#endif
1809#if HAVE_AFINET6 1504#if HAVE_AFINET6
1810 FILE *f; 1505 FILE *f;
1811 char addr6[40], devname[20]; 1506 char addr6[40], devname[20];
@@ -1918,46 +1613,6 @@ static void ife_print(struct interface *ptr)
1918 } 1613 }
1919#endif 1614#endif
1920 1615
1921#if HAVE_AFIPX
1922 if (ipxtype == NULL)
1923 ipxtype = get_afntype(AF_IPX);
1924
1925 if (ipxtype != NULL) {
1926 if (ptr->has_ipx_bb)
1927 printf(_(" IPX/Ethernet II addr:%s\n"),
1928 ipxtype->sprint(&ptr->ipxaddr_bb, 1));
1929 if (ptr->has_ipx_sn)
1930 printf(_(" IPX/Ethernet SNAP addr:%s\n"),
1931 ipxtype->sprint(&ptr->ipxaddr_sn, 1));
1932 if (ptr->has_ipx_e2)
1933 printf(_(" IPX/Ethernet 802.2 addr:%s\n"),
1934 ipxtype->sprint(&ptr->ipxaddr_e2, 1));
1935 if (ptr->has_ipx_e3)
1936 printf(_(" IPX/Ethernet 802.3 addr:%s\n"),
1937 ipxtype->sprint(&ptr->ipxaddr_e3, 1));
1938 }
1939#endif
1940
1941#if HAVE_AFATALK
1942 if (ddptype == NULL)
1943 ddptype = get_afntype(AF_APPLETALK);
1944 if (ddptype != NULL) {
1945 if (ptr->has_ddp)
1946 printf(_(" EtherTalk Phase 2 addr:%s\n"),
1947 ddptype->sprint(&ptr->ddpaddr, 1));
1948 }
1949#endif
1950
1951#if HAVE_AFECONET
1952 if (ectype == NULL)
1953 ectype = get_afntype(AF_ECONET);
1954 if (ectype != NULL) {
1955 if (ptr->has_econet)
1956 printf(_(" econet addr:%s\n"),
1957 ectype->sprint(&ptr->ecaddr, 1));
1958 }
1959#endif
1960
1961 printf(" "); 1616 printf(" ");
1962 /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */ 1617 /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */
1963 1618