1 /*        $NetBSD: nma.c,v 1.8 2024/12/03 05:57:02 kalvisd Exp $      */
2 
3 /*
4  * Copyright (c) 1995 Mats O Jansson.  All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #if defined (HAVE_NBTOOL_CONFIG_H)
28 # include "nbtool_config.h"
29 #else
30 # include "port.h"
31 #endif /* defined (HAVE_NBTOOL_CONFIG_H) */
32 #ifndef lint
33 __RCSID("$NetBSD: nma.c,v 1.8 2024/12/03 05:57:02 kalvisd Exp $");
34 #endif
35 
36 #include "os.h"
37 #include "nma.h"
38 #include "nmadef.h"
39 
40 struct commDev {
41           int                 val;
42           const char          *sname;
43           const char          *name;
44 };
45 
46 struct commDev nmaCommDev[] = {
47           { NMA_C_SOFD_DP , "DP ", "DP11-DA" },
48           { NMA_C_SOFD_UNA, "UNA", "DEUNA" },
49           { NMA_C_SOFD_DU , "DU ", "DU11-DA" },
50           { NMA_C_SOFD_CNA, "CNA", "DECNA" },
51           { NMA_C_SOFD_DL , "DL ", "DL11-C, -E, or -WA" },
52           { NMA_C_SOFD_QNA, "QNA", "DEQNA" },
53           { NMA_C_SOFD_DQ , "DQ ", "DQ11-DA" },
54           { NMA_C_SOFD_CI , "CI ", "Computer Interconnect" },
55           { NMA_C_SOFD_DA , "DA ", "DA11-B or -AL" },
56           { NMA_C_SOFD_PCL, "PCL", "PCL11-B" },
57           { NMA_C_SOFD_DUP, "DUP", "DUP11-DA" },
58           { NMA_C_SOFD_LUA, "LUA", "DELUA" },
59           { NMA_C_SOFD_DMC, "DMC", "DMC11-DA/AR, -FA/AR, -MA/AL or -MD/AL" },
60           { NMA_C_SOFD_LNA, "LNA", "MicroServer Lance" },
61           { NMA_C_SOFD_DN , "DN ", "DN11-BA or -AA" },
62           { NMA_C_SOFD_DLV, "DLV", "DLV11-E, -F, -J, MXV11-A or -B" },
63           { NMA_C_SOFD_LCS, "LCS", "DECServer 100" },
64           { NMA_C_SOFD_DMP, "DMP", "DMP11" },
65           { NMA_C_SOFD_AMB, "AMB", "AMBER" },
66           { NMA_C_SOFD_DTE, "DTE", "DTE20" },
67           { NMA_C_SOFD_DBT, "DBT", "DEBET" },
68           { NMA_C_SOFD_DV , "DV ", "DV11-AA/BA" },
69           { NMA_C_SOFD_BNA, "BNA", "DEBNA" },
70           { NMA_C_SOFD_BNT, "BNT", "DEBNT" },
71           { NMA_C_SOFD_DZ , "DZ ", "DZ11-A, -B, -C, -D" },
72           { NMA_C_SOFD_LPC, "LPC", "PCXX" },
73           { NMA_C_SOFD_DSV, "DSV", "DSV11" },
74           { NMA_C_SOFD_CEC, "CEC", "3-COM/IBM-PC" },
75           { NMA_C_SOFD_KDP, "KDP", "KMC11/DUP11-DA" },
76           { NMA_C_SOFD_IEC, "IEC", "Interlan/IBM-PC" },
77           { NMA_C_SOFD_KDZ, "KDZ", "KMC11/DZ11-A, -B, -C, or -D" },
78           { NMA_C_SOFD_UEC, "UEC", "Univation/RAINBOW-100" },
79           { NMA_C_SOFD_KL8, "KL8", "KL8-J" },
80           { NMA_C_SOFD_DS2, "DS2", "DECServer 200" },
81           { NMA_C_SOFD_DMV, "DMV", "DMV11" },
82           { NMA_C_SOFD_DS5, "DS5", "DECServer 500" },
83           { NMA_C_SOFD_DPV, "DPV", "DPV11" },
84           { NMA_C_SOFD_LQA, "LQA", "DELQA" },
85           { NMA_C_SOFD_DMF, "DMF", "DMF32" },
86           { NMA_C_SOFD_SVA, "SVA", "DESVA" },
87           { NMA_C_SOFD_DMR, "DMR", "DMR11-AA, -AB, -AC, or -AE" },
88           { NMA_C_SOFD_MUX, "MUX", "MUXserver" },
89           { NMA_C_SOFD_KMY, "KMY", "KMS11-PX" },
90           { NMA_C_SOFD_DEP, "DEP", "DEPCA PCSG/IBM-PC" },
91           { NMA_C_SOFD_KMX, "KMX", "KMS11-BD/BE" },
92           { NMA_C_SOFD_LTM, "LTM", "LTM Ethernet monitor" },
93           { NMA_C_SOFD_DMB, "DMB", "DMB-32" },
94           { NMA_C_SOFD_DES, "DES", "DESNC" },
95           { NMA_C_SOFD_KCP, "KCP", "KCP" },
96           { NMA_C_SOFD_MX3, "MX3", "MUXServer 300" },
97           { NMA_C_SOFD_SYN, "SYN", "MicroServer" },
98           { NMA_C_SOFD_MEB, "MEB", "DEMEB" },
99           { NMA_C_SOFD_DSB, "DSB", "DSB32" },
100           { NMA_C_SOFD_BAM, "BAM", "DEBAM LANBridge-200" },
101           { NMA_C_SOFD_DST, "DST", "DST-32 TEAMmate" },
102           { NMA_C_SOFD_FAT, "FAT", "DEFAT" },
103           { NMA_C_SOFD_RSM, "RSM", "DERSM - Remote Segment Monitor" },
104           { NMA_C_SOFD_RES, "RES", "DERES - Remote Environmental Sensor" },
105           { NMA_C_SOFD_3C2, "3C2", "3COM Etherlink II (3C503)" },
106           { NMA_C_SOFD_3CM, "3CM", "3COM Etherlink/MC (3C523)" },
107           { NMA_C_SOFD_DS3, "DS3", "DECServer 300" },
108           { NMA_C_SOFD_MF2, "MF2", "Mayfair-2" },
109           { NMA_C_SOFD_MMR, "MMR", "DEMMR" },
110           { NMA_C_SOFD_VIT, "VIT", "Vitalink TransLAN III/IV (NP3A) Bridge " },
111           { NMA_C_SOFD_VT5, "VT5", "Vitalink TransLAN 350 (NPC25) Bridge " },
112           { NMA_C_SOFD_BNI, "BNI", "DEBNI" },
113           { NMA_C_SOFD_MNA, "MNA", "DEMNA" },
114           { NMA_C_SOFD_PMX, "PMX", "PMAX (KN01)" },
115           { NMA_C_SOFD_NI5, "NI5", "Interlan NI5210-8" },
116           { NMA_C_SOFD_NI9, "NI9", "Interlan NI9210" },
117           { NMA_C_SOFD_KMK, "KMK", "KMS11-K" },
118           { NMA_C_SOFD_3CP, "3CP", "3COM Etherlink Plus (3C505) " },
119           { NMA_C_SOFD_DP2, "DP2", "DPNserver-200" },
120           { NMA_C_SOFD_ISA, "ISA", "SGEC" },
121           { NMA_C_SOFD_DIV, "DIV", "DIV-32 DEC WAN controller-100" },
122           { NMA_C_SOFD_QTA, "QTA", "DEQTA" },
123           { NMA_C_SOFD_B15, "B15", "LANbridge-150" },
124           { NMA_C_SOFD_WD8, "WD8", "WD8003 Family" },
125           { NMA_C_SOFD_ILA, "ILA", "BICC ISOLAN 4110-2" },
126           { NMA_C_SOFD_ILM, "ILM", "BICC ISOLAN 4110-3" },
127           { NMA_C_SOFD_APR, "APR", "Apricot Xen-S and Qi" },
128           { NMA_C_SOFD_ASN, "ASN", "AST EtherNode" },
129           { NMA_C_SOFD_ASE, "ASE", "AST Ethernet" },
130           { NMA_C_SOFD_TRW, "TRW", "TRW HC-2001" },
131           { NMA_C_SOFD_EDX, "EDX", "Ethernet-XT/AT" },
132           { NMA_C_SOFD_EDA, "EDA", "Ethernet-AT" },
133           { NMA_C_SOFD_DR2, "DR2", "DECrouter-250" },
134           { NMA_C_SOFD_SCC, "SCC", "DECrouter-250 DUSCC" },
135           { NMA_C_SOFD_DCA, "DCA", "DCA Series 300" },
136           { NMA_C_SOFD_TIA, "TIA", "LANcard/E" },
137           { NMA_C_SOFD_FBN, "FBN", "DEFEB DECbridge-500" },
138           { NMA_C_SOFD_FEB, "FEB", "DEFEB DECbridge-500 FDDI" },
139           { NMA_C_SOFD_FCN, "FCN", "DEFCN DECconcentrator-500" },
140           { NMA_C_SOFD_MFA, "MFA", "DEMFA" },
141           { NMA_C_SOFD_MXE, "MXE", "MIPS workstation family" },
142           { NMA_C_SOFD_CED, "CED", "Cabletron Ethernet Desktop" },
143           { NMA_C_SOFD_C20, "C20", "3Com CS/200" },
144           { NMA_C_SOFD_CS1, "CS1", "3Com CS/1" },
145           { NMA_C_SOFD_C2M, "C2M", "3Com CS/210, CS/2000, CS/2100" },
146           { NMA_C_SOFD_ACA, "ACA", "ACA/32000 system" },
147           { NMA_C_SOFD_GSM, "GSM", "Gandalf StarMaster" },
148           { NMA_C_SOFD_DSF, "DSF", "DSF32" },
149           { NMA_C_SOFD_CS5, "CS5", "3Com CS/50" },
150           { NMA_C_SOFD_XIR, "XIR", "XIRCOM PE10B2" },
151           { NMA_C_SOFD_KFE, "KFE", "KFE52" },
152           { NMA_C_SOFD_RT3, "RT3", "rtVAX-300" },
153           { NMA_C_SOFD_SPI, "SPI", "Spiderport M250" },
154           { NMA_C_SOFD_FOR, "FOR", "LAT gateway" },
155           { NMA_C_SOFD_MER, "MER", "Meridian" },
156           { NMA_C_SOFD_PER, "PER", "Persoft" },
157           { NMA_C_SOFD_STR, "STR", "AT&T StarLan-10" },
158           { NMA_C_SOFD_MPS, "MPS", "MIPSfair" },
159           { NMA_C_SOFD_L20, "L20", "LPS20 print server" },
160           { NMA_C_SOFD_VT2, "VT2", "Vitalink TransLAN 320 Bridge" },
161           { NMA_C_SOFD_DWT, "DWT", "VT-1000" },
162           { NMA_C_SOFD_WGB, "WGB", "DEWGB" },
163           { NMA_C_SOFD_ZEN, "ZEN", "Zenith Z-LAN4000, Z-LAN" },
164           { NMA_C_SOFD_TSS, "TSS", "Thursby Software Systems" },
165           { NMA_C_SOFD_MNE, "MNE", "3MIN (KN02-BA)" },
166           { NMA_C_SOFD_FZA, "FZA", "DEFZA" },
167           { NMA_C_SOFD_90L, "90L", "DS90L" },
168           { NMA_C_SOFD_CIS, "CIS", "Cisco Systems" },
169           { NMA_C_SOFD_STC, "STC", "STRTC" },
170           { NMA_C_SOFD_UBE, "UBE", "Ungermann-Bass PC2030, PC3030" },
171           { NMA_C_SOFD_DW2, "DW2", "DECwindows terminal II" },
172           { NMA_C_SOFD_FUE, "FUE", "Fujitsu Etherstar MB86950" },
173           { NMA_C_SOFD_M38, "M38", "MUXServer 380" },
174           { NMA_C_SOFD_NTI, "NTI", "NTI Group PC Ethernet Card" },
175           { NMA_C_SOFD_RAD, "RAD", "RADLINX LAN Gateway" },
176           { NMA_C_SOFD_INF, "INF", "Infotron Commix" },
177           { NMA_C_SOFD_XMX, "XMX", "Xyplex MAXserver" },
178           { NMA_C_SOFD_NDI, "NDI", "NDIS data link driver for MS/DOS systems" },
179           { NMA_C_SOFD_ND2, "ND2", "NDIS data link driver for OS/2 systems" },
180           { NMA_C_SOFD_TRN, "TRN", "DEC LANcontroller 520" },
181           { NMA_C_SOFD_DEV, "DEV", "Develcon Electronics Ltd. LAT gateway" },
182           { NMA_C_SOFD_ACE, "ACE", "Acer 5220, 5270 adapter" },
183           { NMA_C_SOFD_PNT, "PNT", "ProNet-4/18 #1390" },
184           { NMA_C_SOFD_ISE, "ISE", "Network Integration Server 600" },
185           { NMA_C_SOFD_IST, "IST", "Network Integration Server 600 T1" },
186           { NMA_C_SOFD_ISH, "ISH", "Network Integration Server 64 kb HDLC" },
187           { NMA_C_SOFD_ISF, "ISF", "Network Integration Server 600 FDDI" },
188           { NMA_C_SOFD_DSW, "DSW", "DSW-21" },
189           { NMA_C_SOFD_DW4, "DW4", "DSW-41/42" },
190           { NMA_C_SOFD_TRA, "TRA", "DETRA-AA" },
191           { 0, 0, 0 },
192 };
193 
194 const char *
nmaGetShort(int devno)195 nmaGetShort(int devno)
196 {
197           struct commDev *current;
198 
199           current = nmaCommDev;
200 
201           while (current->sname != NULL) {
202                     if (current->val == devno)
203                               break;
204                     current++;
205           }
206 
207           return(current->sname);
208 }
209 
210 const char *
nmaGetDevice(int devno)211 nmaGetDevice(int devno)
212 {
213           struct commDev *current;
214 
215           current = nmaCommDev;
216 
217           while (current->name != NULL) {
218                     if (current->val == devno)
219                               break;
220                     current++;
221           }
222 
223           return(current->name);
224 }
225