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 hippi_hwtype;
45 extern struct hwtype tr_hwtype;
47 extern struct hwtype ax25_hwtype;
48 extern struct hwtype rose_hwtype;
49 extern struct hwtype netrom_hwtype;
50 extern struct hwtype tunnel_hwtype;
52 extern struct hwtype ash_hwtype;
54 extern struct hwtype ppp_hwtype;
56 extern struct hwtype arcnet_hwtype;
58 extern struct hwtype dlci_hwtype;
59 extern struct hwtype frad_hwtype;
61 extern struct hwtype sit_hwtype;
63 static struct hwtype *hwtypes[] = {
118 static short sVhwinit = 0;
122 loop_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_loop, "Local Loopback");
123 unspec_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_unspec, "UNSPEC");
125 slip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip, "Serial Line IP");
126 cslip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip, "VJ Serial Line IP");
127 slip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip6, "6-bit Serial Line IP");
128 cslip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip6, "VJ 6-bit Serial Line IP");
129 adaptive_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_adaptive, "Adaptive Serial Line IP");
132 ether_hwtype.title = NLS_CATSAVE (catfd, etherSet, ether_ether, "Ethernet");
135 ash_hwtype.title = NLS_CATSAVE (catfd, ashSet, ash_hw, "Ash");
138 fddi_hwtype.title = NLS_CATSAVE (catfd, fddiSet, fddi_fddi, "Fiber Distributed Data Interface");
141 hippi_hwtype.title = NLS_CATSAVE (catfd, hippiSet, hippi_hippi, "HIPPI");
144 ax25_hwtype.title = NLS_CATSAVE (catfd, ax25Set, ax25_hw, "AMPR AX.25");
147 rose_hwtype.title = NLS_CATSAVE (catfd, roseSet, rose_hw, "AMPR ROSE");
150 netrom_hwtype.title = NLS_CATSAVE (catfd, netromSet, netrom_hw, "AMPR NET/ROM");
153 tunnel_hwtype.title = NLS_CATSAVE (catfd, tunnelSet, tunnel_hw, "IPIP Tunnel");
156 ppp_hwtype.title = NLS_CATSAVE (catfd, pppSet, ppp_ppp, "Point-to-Point Protocol");
159 arcnet_hwtype.title = NLS_CATSAVE (catfd, arcnetSet, arcnet_arcnet, "1.5Mbps ARCnet");
162 dlci_hwtype.title = NLS_CATSAVE(catfd, dlciSet, dlci_hw, "Frame Relay DLCI");
163 frad_hwtype.title = NLS_CATSAVE(catfd, fradSet, frad_hw, "Frame Relay Access Device");
166 sit_hwtype.title = NLS_CATSAVE(catfd, sitSet, sit_hw, "IPv6-in-IPv4");
171 /* Check our hardware type table for this type. */
173 get_hwtype(const char *name)
181 while (*hwp != NULL) {
182 if (!strcmp((*hwp)->name, name)) return(*hwp);
189 /* Check our hardware type table for this type. */
191 get_hwntype(int type)
199 while (*hwp != NULL) {
200 if ((*hwp)->type == type) return(*hwp);