xref: /freebsd/libexec/rbootd/rmp.h (revision 43581d7b6617959e4452094d9330ef020034a6c9)
1*8a16b7a1SPedro F. Giffuni /*-
2*8a16b7a1SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*8a16b7a1SPedro F. Giffuni  *
40559b331SSteve Price  * Copyright (c) 1988, 1992 The University of Utah and the Center
50559b331SSteve Price  *	for Software Science (CSS).
60559b331SSteve Price  * Copyright (c) 1992, 1993
70559b331SSteve Price  *	The Regents of the University of California.  All rights reserved.
80559b331SSteve Price  *
90559b331SSteve Price  * This code is derived from software contributed to Berkeley by
100559b331SSteve Price  * the Center for Software Science of the University of Utah Computer
110559b331SSteve Price  * Science Department.  CSS requests users of this software to return
120559b331SSteve Price  * to css-dist@cs.utah.edu any improvements that they make and grant
130559b331SSteve Price  * CSS redistribution rights.
140559b331SSteve Price  *
150559b331SSteve Price  * Redistribution and use in source and binary forms, with or without
160559b331SSteve Price  * modification, are permitted provided that the following conditions
170559b331SSteve Price  * are met:
180559b331SSteve Price  * 1. Redistributions of source code must retain the above copyright
190559b331SSteve Price  *    notice, this list of conditions and the following disclaimer.
200559b331SSteve Price  * 2. Redistributions in binary form must reproduce the above copyright
210559b331SSteve Price  *    notice, this list of conditions and the following disclaimer in the
220559b331SSteve Price  *    documentation and/or other materials provided with the distribution.
235efaea4cSChristian Brueffer  * 3. Neither the name of the University nor the names of its contributors
240559b331SSteve Price  *    may be used to endorse or promote products derived from this software
250559b331SSteve Price  *    without specific prior written permission.
260559b331SSteve Price  *
270559b331SSteve Price  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
280559b331SSteve Price  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
290559b331SSteve Price  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
300559b331SSteve Price  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
310559b331SSteve Price  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
320559b331SSteve Price  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
330559b331SSteve Price  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
340559b331SSteve Price  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
350559b331SSteve Price  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
360559b331SSteve Price  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
370559b331SSteve Price  * SUCH DAMAGE.
380559b331SSteve Price  *
390559b331SSteve Price  * From: Utah Hdr: rmp.h 3.1 92/07/06
400559b331SSteve Price  * Author: Jeff Forys, University of Utah CSS
410559b331SSteve Price  */
420559b331SSteve Price 
430559b331SSteve Price /*
440559b331SSteve Price  *  Define MIN/MAX sizes of RMP (ethernet) packet.
450559b331SSteve Price  *  For ease of computation, the 4 octet CRC field is not included.
460559b331SSteve Price  *
470559b331SSteve Price  *  MCLBYTES is for bpfwrite(); it is adamant about using a cluster.
480559b331SSteve Price  */
490559b331SSteve Price 
500559b331SSteve Price #define	RMP_MAX_PACKET	MIN(1514,MCLBYTES)
510559b331SSteve Price #define	RMP_MIN_PACKET	60
520559b331SSteve Price 
530559b331SSteve Price /*
540559b331SSteve Price  *  Define RMP/Ethernet Multicast address (9:0:9:0:0:4) and its length.
550559b331SSteve Price  */
560559b331SSteve Price #define	RMP_ADDR	{ 0x9, 0x0, 0x9, 0x0, 0x0, 0x4 }
570559b331SSteve Price #define	RMP_ADDRLEN	6
580559b331SSteve Price 
590559b331SSteve Price /*
600559b331SSteve Price  *  Define IEEE802.2 (Logical Link Control) information.
610559b331SSteve Price  */
620559b331SSteve Price #define	IEEE_DSAP_HP	0xF8	/* Destination Service Access Point */
630559b331SSteve Price #define	IEEE_SSAP_HP	0xF8	/* Source Service Access Point */
640559b331SSteve Price #define	IEEE_CNTL_HP	0x0300	/* Type 1 / I format control information */
650559b331SSteve Price 
660559b331SSteve Price #define	HPEXT_DXSAP	0x608	/* HP Destination Service Access Point */
670559b331SSteve Price #define	HPEXT_SXSAP	0x609	/* HP Source Service Access Point */
680559b331SSteve Price 
690559b331SSteve Price /*
700559b331SSteve Price  *  802.3-style "Ethernet" header.
710559b331SSteve Price  */
720559b331SSteve Price 
730559b331SSteve Price struct hp_hdr {
740559b331SSteve Price 	u_int8_t	daddr[RMP_ADDRLEN];
750559b331SSteve Price 	u_int8_t	saddr[RMP_ADDRLEN];
760559b331SSteve Price 	u_int16_t	len;
770559b331SSteve Price };
780559b331SSteve Price 
790559b331SSteve Price /*
800559b331SSteve Price  * HP uses 802.2 LLC with their own local extensions.  This struct makes
810559b331SSteve Price  * sense out of this data (encapsulated in the above 802.3 packet).
820559b331SSteve Price  */
830559b331SSteve Price 
840559b331SSteve Price struct hp_llc {
850559b331SSteve Price 	u_int8_t	dsap;		/* 802.2 DSAP */
860559b331SSteve Price 	u_int8_t	ssap;		/* 802.2 SSAP */
870559b331SSteve Price 	u_int16_t	cntrl;		/* 802.2 control field */
880559b331SSteve Price 	u_int16_t	filler;		/* HP filler (must be zero) */
890559b331SSteve Price 	u_int16_t	dxsap;		/* HP extended DSAP */
900559b331SSteve Price 	u_int16_t	sxsap;		/* HP extended SSAP */
910559b331SSteve Price };
92