diff options
Diffstat (limited to 'lib/hw.c')
-rw-r--r-- | lib/hw.c | 217 |
1 files changed, 109 insertions, 108 deletions
@@ -1,21 +1,21 @@ /* - * lib/hw.c This file contains the top-level part of the hardware - * support functions module for the NET-2 base distribution. + * lib/hw.c This file contains the top-level part of the hardware + * support functions module. * - * Version: lib/hw.c 1.21 (1998-07-01) + * Version: $Id: hw.c,v 1.8 1998/11/15 20:10:13 freitag Exp $ * - * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de> + * Maintainer: Bernd 'eckes' Eckenfels, <net-tools@lina.inka.de> * - * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> - * Copyright 1993 MicroWalt Corporation + * Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org> + * Copyright 1993 MicroWalt Corporation * *980701 {1.21} Arnaldo C. Melo GNU gettext instead of catgets * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General - * Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at - * your option) any later version. + * This program is free software; you can redistribute it + * and/or modify it under the terms of the GNU General + * Public License as published by the Free Software + * Foundation; either version 2 of the License, or (at + * your option) any later version. */ #include <sys/types.h> #include <sys/socket.h> @@ -30,186 +30,187 @@ #include "pathnames.h" #include "intl.h" -extern struct hwtype unspec_hwtype; -extern struct hwtype loop_hwtype; +extern struct hwtype unspec_hwtype; +extern struct hwtype loop_hwtype; -extern struct hwtype slip_hwtype; -extern struct hwtype cslip_hwtype; -extern struct hwtype slip6_hwtype; -extern struct hwtype cslip6_hwtype; -extern struct hwtype adaptive_hwtype; +extern struct hwtype slip_hwtype; +extern struct hwtype cslip_hwtype; +extern struct hwtype slip6_hwtype; +extern struct hwtype cslip6_hwtype; +extern struct hwtype adaptive_hwtype; -extern struct hwtype ether_hwtype; -extern struct hwtype fddi_hwtype; -extern struct hwtype hippi_hwtype; -extern struct hwtype tr_hwtype; +extern struct hwtype ether_hwtype; +extern struct hwtype fddi_hwtype; +extern struct hwtype hippi_hwtype; +extern struct hwtype tr_hwtype; -extern struct hwtype ax25_hwtype; -extern struct hwtype rose_hwtype; -extern struct hwtype netrom_hwtype; -extern struct hwtype tunnel_hwtype; +extern struct hwtype ax25_hwtype; +extern struct hwtype rose_hwtype; +extern struct hwtype netrom_hwtype; +extern struct hwtype tunnel_hwtype; -extern struct hwtype ash_hwtype; +extern struct hwtype ash_hwtype; -extern struct hwtype ppp_hwtype; +extern struct hwtype ppp_hwtype; -extern struct hwtype arcnet_hwtype; +extern struct hwtype arcnet_hwtype; -extern struct hwtype dlci_hwtype; -extern struct hwtype frad_hwtype; +extern struct hwtype dlci_hwtype; +extern struct hwtype frad_hwtype; -extern struct hwtype hdlc_hwtype; -extern struct hwtype lapb_hwtype; +extern struct hwtype hdlc_hwtype; +extern struct hwtype lapb_hwtype; -extern struct hwtype sit_hwtype; +extern struct hwtype sit_hwtype; -static struct hwtype *hwtypes[] = { +static struct hwtype *hwtypes[] = +{ - &loop_hwtype, + &loop_hwtype, #if HAVE_HWSLIP - &slip_hwtype, - &cslip_hwtype, - &slip6_hwtype, - &cslip6_hwtype, - &adaptive_hwtype, + &slip_hwtype, + &cslip_hwtype, + &slip6_hwtype, + &cslip6_hwtype, + &adaptive_hwtype, #endif #if HAVE_HWASH - &ash_hwtype, + &ash_hwtype, #endif #if HAVE_HWETHER - ðer_hwtype, + ðer_hwtype, #endif #if HAVE_HWTR - &tr_hwtype, + &tr_hwtype, #endif #if HAVE_HWAX25 - &ax25_hwtype, + &ax25_hwtype, #endif #if HAVE_HWNETROM - &netrom_hwtype, + &netrom_hwtype, #endif #if HAVE_HWTUNNEL - &tunnel_hwtype, + &tunnel_hwtype, #endif #if HAVE_HWPPP - &ppp_hwtype, -#endif + &ppp_hwtype, +#endif #if HAVE_HWHDLCLAPB - &hdlc_hwtype, - &lapb_hwtype, + &hdlc_hwtype, + &lapb_hwtype, #endif #if HAVE_HWARC - &arcnet_hwtype, -#endif + &arcnet_hwtype, +#endif #if HAVE_HWFR - &dlci_hwtype, - &frad_hwtype, + &dlci_hwtype, + &frad_hwtype, #endif #if HAVE_HWSIT - &sit_hwtype, + &sit_hwtype, #endif #if HAVE_HWROSE - &rose_hwtype, + &rose_hwtype, #endif #if HAVE_HWFDDI - &fddi_hwtype, + &fddi_hwtype, #endif #if HAVE_HWHIPPI - &hippi_hwtype, + &hippi_hwtype, #endif - &unspec_hwtype, - NULL + &unspec_hwtype, + NULL }; static short sVhwinit = 0; -void hwinit () +void hwinit() { - loop_hwtype.title = _("Local Loopback"); - unspec_hwtype.title = _("UNSPEC"); + loop_hwtype.title = _("Local Loopback"); + unspec_hwtype.title = _("UNSPEC"); #if HAVE_HWSLIP - slip_hwtype.title = _("Serial Line IP"); - cslip_hwtype.title = _("VJ Serial Line IP"); - slip6_hwtype.title = _("6-bit Serial Line IP"); - cslip6_hwtype.title = _("VJ 6-bit Serial Line IP"); - adaptive_hwtype.title = _("Adaptive Serial Line IP"); + slip_hwtype.title = _("Serial Line IP"); + cslip_hwtype.title = _("VJ Serial Line IP"); + slip6_hwtype.title = _("6-bit Serial Line IP"); + cslip6_hwtype.title = _("VJ 6-bit Serial Line IP"); + adaptive_hwtype.title = _("Adaptive Serial Line IP"); #endif #if HAVE_HWETHER - ether_hwtype.title = _("Ethernet"); + ether_hwtype.title = _("Ethernet"); #endif #if HAVE_HWASH - ash_hwtype.title = _("Ash"); + ash_hwtype.title = _("Ash"); #endif #if HAVE_HWFDDI - fddi_hwtype.title = _("Fiber Distributed Data Interface"); + fddi_hwtype.title = _("Fiber Distributed Data Interface"); #endif #if HAVE_HWHIPPI - hippi_hwtype.title = _("HIPPI"); + hippi_hwtype.title = _("HIPPI"); #endif #if HAVE_HWAX25 - ax25_hwtype.title = _("AMPR AX.25"); + ax25_hwtype.title = _("AMPR AX.25"); #endif #if HAVE_HWROSE - rose_hwtype.title = _("AMPR ROSE"); + rose_hwtype.title = _("AMPR ROSE"); #endif #if HAVE_HWNETROM - netrom_hwtype.title = _("AMPR NET/ROM"); + netrom_hwtype.title = _("AMPR NET/ROM"); #endif #if HAVE_HWTUNNEL - tunnel_hwtype.title = _("IPIP Tunnel"); + tunnel_hwtype.title = _("IPIP Tunnel"); #endif #if HAVE_HWPPP - ppp_hwtype.title = _("Point-to-Point Protocol"); -#endif + ppp_hwtype.title = _("Point-to-Point Protocol"); +#endif #if HAVE_HWHDLCLAPB - hdlc_hwtype.title = _("(Cisco)-HDLC"); - lapb_hwtype.title = _("LAPB"); + hdlc_hwtype.title = _("(Cisco)-HDLC"); + lapb_hwtype.title = _("LAPB"); #endif #if HAVE_HWARC - arcnet_hwtype.title = _("1.5Mbps ARCnet"); + arcnet_hwtype.title = _("1.5Mbps ARCnet"); #endif #if HAVE_HWFR - dlci_hwtype.title = _("Frame Relay DLCI"); - frad_hwtype.title = _("Frame Relay Access Device"); + dlci_hwtype.title = _("Frame Relay DLCI"); + frad_hwtype.title = _("Frame Relay Access Device"); #endif #if HAVE_HWSIT - sit_hwtype.title = _("IPv6-in-IPv4"); + sit_hwtype.title = _("IPv6-in-IPv4"); #endif - sVhwinit = 1; + sVhwinit = 1; } /* Check our hardware type table for this type. */ -struct hwtype * -get_hwtype(const char *name) +struct hwtype *get_hwtype(const char *name) { - struct hwtype **hwp; - - if (!sVhwinit) - hwinit(); - - hwp = hwtypes; - while (*hwp != NULL) { - if (!strcmp((*hwp)->name, name)) return(*hwp); + struct hwtype **hwp; + + if (!sVhwinit) + hwinit(); + + hwp = hwtypes; + while (*hwp != NULL) { + if (!strcmp((*hwp)->name, name)) + return (*hwp); hwp++; - } - return(NULL); + } + return (NULL); } /* Check our hardware type table for this type. */ -struct hwtype * -get_hwntype(int type) +struct hwtype *get_hwntype(int type) { - struct hwtype **hwp; + struct hwtype **hwp; - if (!sVhwinit) - hwinit(); + if (!sVhwinit) + hwinit(); - hwp = hwtypes; - while (*hwp != NULL) { - if ((*hwp)->type == type) return(*hwp); + hwp = hwtypes; + while (*hwp != NULL) { + if ((*hwp)->type == type) + return (*hwp); hwp++; - } - return(NULL); + } + return (NULL); } |