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.13 (1996-04-13)
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
13 *960413 {1.13} Mike Mclagan : DLCI/FRAD support
15 * This program is free software; you can redistribute it
16 * and/or modify it under the terms of the GNU General
17 * Public License as published by the Free Software
18 * Foundation; either version 2 of the License, or (at
19 * your option) any later version.
21 #include <sys/types.h>
22 #include <sys/socket.h>
30 #include "net-support.h"
31 #include "pathnames.h"
33 #include "net-locale.h"
36 extern struct hwtype unspec_hwtype;
37 extern struct hwtype loop_hwtype;
39 extern struct hwtype slip_hwtype;
40 extern struct hwtype cslip_hwtype;
41 extern struct hwtype slip6_hwtype;
42 extern struct hwtype cslip6_hwtype;
43 extern struct hwtype adaptive_hwtype;
45 extern struct hwtype ether_hwtype;
46 extern struct hwtype tr_hwtype;
48 extern struct hwtype ax25_hwtype;
49 extern struct hwtype netrom_hwtype;
50 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[] = {
108 static short sVhwinit = 0;
112 loop_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_loop, "Local Loopback");
114 slip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip, "Serial Line IP");
115 cslip_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip, "VJ Serial Line IP");
116 slip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_slip6, "6-bit Serial Line IP");
117 cslip6_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_cslip6, "VJ 6-bit Serial Line IP");
118 adaptive_hwtype.title = NLS_CATSAVE (catfd, slipSet, slip_adaptive, "Adaptive Serial Line IP");
120 unspec_hwtype.title = NLS_CATSAVE (catfd, loopbackSet, loopback_unspec, "UNSPEC");
122 ether_hwtype.title = NLS_CATSAVE (catfd, etherSet, ether_ether, "Ethernet");
125 ash_hwtype.title = NLS_CATSAVE (catfd, ashSet, ash_hw, "64Mbps ASH");
128 ax25_hwtype.title = NLS_CATSAVE (catfd, ax25Set, ax25_hw, "AMPR AX.25");
131 netrom_hwtype.title = NLS_CATSAVE (catfd, netromSet, netrom_hw, "AMPR NET/ROM");
134 tunnel_hwtype.title = NLS_CATSAVE (catfd, tunnelSet, tunnel_hw, "IPIP Tunnel");
137 ppp_hwtype.title = NLS_CATSAVE (catfd, pppSet, ppp_ppp, "Point-to-Point Protocol");
140 arcnet_hwtype.title = NLS_CATSAVE (catfd, arcnetSet, arcnet_arcnet, "1.5Mbps ARCnet");
143 dlci_hwtype.title = NLS_CATSAVE(catfd, dlciSet, dlci_hw, "Frame Relay DLCI");
144 frad_hwtype.title = NLS_CATSAVE(catfd, fradSet, frad_hw, "Frame Relay Access Device");
147 sit_hwtype.title = NLS_CATSAVE(catfd, sitSet, sit_hw, "IPv6-in-IPv4");
152 /* Check our hardware type table for this type. */
154 get_hwtype(const char *name)
162 while (*hwp != NULL) {
163 if (!strcmp((*hwp)->name, name)) return(*hwp);
170 /* Check our hardware type table for this type. */
172 get_hwntype(int type)
180 while (*hwp != NULL) {
181 if ((*hwp)->type == type) return(*hwp);