2 * lib/hw.c This file contains the top-level part of the hardware
3 * support functions module for the NET-2 base distribution.
5 * Version: lib/hw.c 1.20 (1998-01-25)
7 * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de>
9 * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
10 * Copyright 1993 MicroWalt Corporation
12 * This program is free software; you can redistribute it
13 * and/or modify it under the terms of the GNU General
14 * Public License as published by the Free Software
15 * Foundation; either version 2 of the License, or (at
16 * your option) any later version.
18 #include <sys/types.h>
19 #include <sys/socket.h>
27 #include "net-support.h"
28 #include "pathnames.h"
30 #include "net-locale.h"
33 extern struct hwtype unspec_hwtype;
34 extern struct hwtype loop_hwtype;
36 extern struct hwtype slip_hwtype;
37 extern struct hwtype cslip_hwtype;
38 extern struct hwtype slip6_hwtype;
39 extern struct hwtype cslip6_hwtype;
40 extern struct hwtype adaptive_hwtype;
42 extern struct hwtype ether_hwtype;
43 extern struct hwtype fddi_hwtype;
44 extern struct hwtype tr_hwtype;
46 extern struct hwtype ax25_hwtype;
47 extern struct hwtype rose_hwtype;
48 extern struct hwtype netrom_hwtype;
49 extern struct hwtype tunnel_hwtype;
51 extern struct hwtype ash_hwtype;
53 extern struct hwtype ppp_hwtype;
55 extern struct hwtype arcnet_hwtype;
57 extern struct hwtype dlci_hwtype;
58 extern struct hwtype frad_hwtype;
60 extern struct hwtype sit_hwtype;
62 static struct hwtype *hwtypes[] = {
114 static short sVhwinit = 0;
118 loop_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_loop, "Local Loopback");
119 unspec_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_unspec, "UNSPEC");
121 slip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip, "Serial Line IP");
122 cslip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip, "VJ Serial Line IP");
123 slip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip6, "6-bit Serial Line IP");
124 cslip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip6, "VJ 6-bit Serial Line IP");
125 adaptive_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_adaptive, "Adaptive Serial Line IP");
128 ether_hwtype.title = NLS_CATSAVE (catfd, etherSet, ether_ether, "Ethernet");
131 ash_hwtype.title = NLS_CATSAVE (catfd, ashSet, ash_hw, "64Mbps Ash");
134 fddi_hwtype.title = NLS_CATSAVE (catfd, fddiSet, fddi_fddi, "Fiber Distributed Data Interface");
137 ax25_hwtype.title = NLS_CATSAVE (catfd, ax25Set, ax25_hw, "AMPR AX.25");
140 rose_hwtype.title = NLS_CATSAVE (catfd, roseSet, rose_hw, "AMPR ROSE");
143 netrom_hwtype.title = NLS_CATSAVE (catfd, netromSet, netrom_hw, "AMPR NET/ROM");
146 tunnel_hwtype.title = NLS_CATSAVE (catfd, tunnelSet, tunnel_hw, "IPIP Tunnel");
149 ppp_hwtype.title = NLS_CATSAVE (catfd, pppSet, ppp_ppp, "Point-to-Point Protocol");
152 arcnet_hwtype.title = NLS_CATSAVE (catfd, arcnetSet, arcnet_arcnet, "1.5Mbps ARCnet");
155 dlci_hwtype.title = NLS_CATSAVE(catfd, dlciSet, dlci_hw, "Frame Relay DLCI");
156 frad_hwtype.title = NLS_CATSAVE(catfd, fradSet, frad_hw, "Frame Relay Access Device");
159 sit_hwtype.title = NLS_CATSAVE(catfd, sitSet, sit_hw, "IPv6-in-IPv4");
164 /* Check our hardware type table for this type. */
166 get_hwtype(const char *name)
174 while (*hwp != NULL) {
175 if (!strcmp((*hwp)->name, name)) return(*hwp);
182 /* Check our hardware type table for this type. */
184 get_hwntype(int type)
192 while (*hwp != NULL) {
193 if ((*hwp)->type == type) return(*hwp);