xref: /netbsd-src/usr.sbin/mopd/common/mopdef.h (revision 5e4c038a45edbc7d63b7c2daa76e29f88b64a4e3)
1 /*	$NetBSD: mopdef.h,v 1.3 2001/01/16 02:50:31 cgd Exp $	*/
2 
3 /*
4  * Copyright (c) 1993-95 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  * 3. All advertising materials mentioning features or use of this software
15  *    must display the following acknowledgement:
16  *	This product includes software developed by Mats O Jansson.
17  * 4. The name of the author may not be used to endorse or promote products
18  *    derived from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  *	$NetBSD: mopdef.h,v 1.3 2001/01/16 02:50:31 cgd Exp $
32  *
33  */
34 
35 #ifndef _MOPDEF_H_
36 #define _MOPDEF_H_
37 
38 #define MOP_K_PROTO_DL          0x6001  /* MOP Load/Dump Protocol */
39 #define MOP_K_PROTO_RC          0x6002  /* MOP Remote Console Protocol */
40 #define MOP_K_PROTO_LP          0x9000  /* MOP Loopback Protocol */
41 
42 #define MOP_K_PROTO_802_DL	{ 0x08, 0x00, 0x2b, 0x60, 0x01 }
43 #define MOP_K_PROTO_802_RC	{ 0x08, 0x00, 0x2b, 0x60, 0x02 }
44 #define MOP_K_PROTO_802_LP	{ 0x08, 0x00, 0x2b, 0x90, 0x00 }
45 
46 #define MOP_K_PROTO_802_DSAP	0xaa
47 #define MOP_K_PROTO_802_SSAP	0xaa
48 #define MOP_K_PROTO_802_CNTL	0x03
49 
50 #define TRANS_ETHER		1	/* Packet in Ethernet format */
51 #define TRANS_8023		2	/* Packet in 802.3 format */
52 #define TRANS_AND		0x1000	/* Both Ethernet and 802.3 */
53 
54 /* The following constants are defined in module MOPDEF.SDL in MOM */
55 
56 #define MOP_K_CODE_MIN          0
57 #define MOP_K_CODE_MLT          0       /* Memory Load with transfer address */
58 #define MOP_K_CODE_DCM          1       /* Dump Complete */
59 #define MOP_K_CODE_MLD          2       /* Memory Load */
60 #define MOP_K_CODE_ASV          3       /* Assistance volunteer (NI only */
61 #define MOP_K_CODE_RMD          4       /* Request memory dump */
62 #define MOP_K_CODE_RID          5       /* Request ID */
63 #define MOP_K_CODE_BOT          6       /* Boot */
64 #define MOP_K_CODE_SID          7       /* System ID */
65 #define MOP_K_CODE_RPR          8       /* Request program */
66 #define MOP_K_CODE_RQC          9       /* Request Counters */
67 #define MOP_K_CODE_RML          10      /* Request memory load */
68 #define MOP_K_CODE_CNT          11      /* Counters */
69 #define MOP_K_CODE_RDS          12      /* Request Dump Service */
70 #define MOP_K_CODE_MMR          12      /* MOP Mode Running */
71 #define MOP_K_CODE_RVC          13      /* Reserve Console */
72 #define MOP_K_CODE_MDD          14      /* Memory dump data */
73 #define MOP_K_CODE_RLC          15      /* Release Console */
74 #define MOP_K_CODE_CCP          17      /* Console Command and Poll */
75 #define MOP_K_CODE_CRA          19      /* Console Response and Acknnowledge */
76 #define MOP_K_CODE_PLT          20      /* Parameter load with transfer address*/
77 #define MOP_K_CODE_ALD          24      /* Active loop data */
78 #define MOP_K_CODE_PLD          26      /* Passive looped data */
79 #define MOP_K_CODE_MAX          26
80 
81 #define MOP_K_PGTY_MIN          0
82 #define MOP_K_PGTY_SECLDR       0       /* Secondary Loader */
83 #define MOP_K_PGTY_TERLDR       1       /* Tertiary Loader */
84 #define MOP_K_PGTY_OPRSYS       2       /* Operating System */
85 #define MOP_K_PGTY_MGNTFL       3       /* Management File */
86 #define MOP_K_PGTY_MAX          3
87 
88 #define MOP_K_BPTY_MIN          0
89 #define MOP_K_BPTY_SYS          0       /* System Processor */
90 #define MOP_K_BPTY_COM          1       /* Communication Processor */
91 #define MOP_K_BPTY_MAX          1
92 
93 #define MOP_K_RML_ERROR_MIN     0
94 #define MOP_K_RML_ERROR_NONE    0       /* None */
95 #define MOP_K_RML_ERROR_NO_LOAD 1       /* Image data not properly loaded */
96 #define MOP_K_RML_ERROR_MAX     1
97 
98 #define MOP_K_PLTP_MIN          0
99 #define MOP_K_PLTP_END          0       /* End Mark */
100 #define MOP_K_PLTP_TSN          1       /* Target System Name */
101 #define MOP_K_PLTP_TSA          2       /* Target System Address */
102 #define MOP_K_PLTP_HSN          3       /* Host System Name */
103 #define MOP_K_PLTP_HSA          4       /* Host System Address */
104 #define MOP_K_PLTP_HST          5       /* Host System Time */
105 #define MOP_K_PLTP_MAX          5
106 
107 #define MOP_K_BOT_CNTL_MIN      0
108 #define MOP_K_BOT_CNTL_SERVER   0       /* Boot-Server */
109 #define MOP_K_BOT_CNTL_DEVICE   1       /* Boot-Device */
110 #define MOP_K_BOT_CNTL_MAX      1
111 
112 #define MOP_K_INFO_VER          1       /* Maintenance Version */
113 #define MOP_K_INFO_MFCT         2       /* Maintenance Functions */
114 #define MOP_K_INFO_CNU          3       /* Console User */
115 #define MOP_K_INFO_RTM          4       /* Reservation Timer */
116 #define MOP_K_INFO_CSZ          5       /* Console Command Size */
117 #define MOP_K_INFO_RSZ          6       /* Console Response Size */
118 #define MOP_K_INFO_HWA          7       /* Hardware Address */
119 #define MOP_K_INFO_TIME         8       /* System Time */
120 #define MOP_K_INFO_SOFD         100     /* Communication Device */
121 #define MOP_K_INFO_SFID         200     /* Software ID */
122 #define MOP_K_INFO_PRTY         300     /* System Processor */
123 #define MOP_K_INFO_DLTY         400     /* Data Link Type */
124 #define MOP_K_INFO_DLBSZ        401     /* Data Link Buffer Size */
125 
126 #define MOP_K_DLTY_MIN          1
127 #define MOP_K_DLTY_NI           1       /* Ethernet */
128 #define MOP_K_DLTY_DDCMP        2       /* DDCMP */
129 #define MOP_K_DLTY_LAPB         3       /* LAPB (frame level of X.25) */
130 #define MOP_K_DLTY_MAX          3
131 
132 #define MOP_K_PRTY_MIN          0
133 #define MOP_K_PRTY_11           1       /* PDP-11 (UNIBUS) */
134 #define MOP_K_PRTY_CMSV         2       /* Communication Server */
135 #define MOP_K_PRTY_PRO          3       /* Professional */
136 #define MOP_K_PRTY_SCO          4       /* Scorpio */
137 #define MOP_K_PRTY_AMB          5       /* Amber */
138 #define MOP_K_PRTY_BRI          6       /* XLII Bridge */
139 #define MOP_K_PRTY_MAX          6
140 
141 #define MOP_K_SFID_FORM_MIN     -2
142 #define MOP_K_SFID_FORM_MAINT   -2      /* Maintenance System */
143 #define MOP_K_SFID_FORM_OPRSYS  -1      /* Standard Operating System */
144 #define MOP_K_SFID_FORM_NONE    0       /* None */
145 #define MOP_K_SFID_FORM_MAX     0
146 
147 #define MOP_K_SFID_CUST         'CP'    /* Customer product */
148 #define MOP_K_SFID_DEC          'DP'    /* DEC product */
149 #define MOP_K_SFID_DELIM_ID     '#'     /* Delimiter identifier */
150 
151 #define MOP_K_DLBSZ_DEFAULT     262     /* Buffersize */
152 
153 #define MOP_K_NILOOP_REPLY      1       /* Response */
154 #define MOP_K_NILOOP_FORWARD    2       /* Forward Data */
155 
156 #define MOP_DL_MULTICAST	{ 0xab, 0x00, 0x00, 0x01, 0x00, 0x00 }
157 #define MOP_RC_MULTICAST	{ 0xab, 0x00, 0x00, 0x02, 0x00, 0x00 }
158 #define MOP_LP_MULTICAST	{ 0xcf, 0x00, 0x00, 0x00, 0x00, 0x00 }
159 
160 #define MOP_K_RPR_FORMAT_V3	1	/* Format Version of RPR */
161 #define MOP_K_RPR_FORMAT	4	/* Format Version of RPR */
162 
163 #define IHD_C_MINCODE		-1	/* Low bound of ALIAS value */
164 #define IHD_C_NATIVE		-1	/* Native mode image */
165 #define IHD_C_RSX		0	/* RSX image produced by TKB */
166 #define IHD_C_BPA		1	/* BASIC plus analog */
167 #define IHD_C_ALIAS		2	/* Last 126 bytes contains ASCIC of image to activate */
168 #define IHD_C_CLI		3	/* Image is CLI, run LOGINOUT */
169 #define IHD_C_PMAX		4	/* PMAX system image */
170 #define IHD_C_ALPHA		5	/* ALPHA system image */
171 #define IHD_C_MAXCODE		5	/* High bound of ALIAS value */
172 
173 #define IHD_W_SIZE		0
174 #define IHD_W_ACTIVOFF		2
175 #define IHD_B_HDRBLKCNT		16
176 #define IHD_W_ALIAS		510
177 #define	ISD_W_PAGCNT		2
178 #define ISD_V_VPN		4
179 #define ISD_M_VPN		0x1fffff
180 #define IHA_L_TFRADR1		0
181 #define EISD_L_SECSIZE		12
182 #define EIHD_L_ISDOFF		12
183 #define EIHD_L_HDRBLKCNT	76
184 
185 #define L_BSA			0x08	/* RSX base address */
186 #define L_BLDZ			0x0e	/* RSX image size (* 64) */
187 #define L_BXFR			0xe8	/* RSX transfer address */
188 #define L_BBLK			0xf0	/* RSX header block count */
189 
190 #ifndef MOPDEF_SUPRESS_EXTERN
191 extern char dl_mcst[];
192 extern char rc_mcst[];
193 extern char dl_802_proto[];
194 extern char rc_802_proto[];
195 extern char lp_802_proto[];
196 #endif	/* MOPDEF_SUPRESS_EXTERN */
197 
198 #endif /* _MOPDEF_H_ */
199