⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pxe.h

📁 this is aes algorithm
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * Copyright (c) 2000 Alfred Perlstein <alfred@freebsd.org> * All rights reserved. * Copyright (c) 2000 Paul Saab <ps@freebsd.org> * All rights reserved. * Copyright (c) 2000 John Baldwin <jhb@freebsd.org> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD: src/sys/boot/i386/libi386/pxe.h,v 1.6 2002/09/23 18:54:26 alfred Exp $ *//* * The typedefs and structures declared in this file * clearly violate style(9), the reason for this is to conform to the * typedefs/structure-names used in the Intel literature to avoid confusion. * * It's for your own good. :) *//* It seems that intel didn't think about ABI, * either that or 16bit ABI != 32bit ABI (which seems reasonable) * I have to thank Intel for the hair loss I incurred trying to figure * out why PXE was mis-reading structures I was passing it (at least * from my point of view) * * Solution: use gcc's '__packed' to correctly align * structures passed into PXE * Question: does this really work for PXE's expected ABI? *//*#define	PACKED		__packed*/#define PACKED		__attribute__((__packed__))#define	S_SIZE(s)	s, sizeof(s) - 1#define	IP_STR		"%d.%d.%d.%d"#define	IP_ARGS(ip)					\	(int)(ip >> 24) & 0xff, (int)(ip >> 16) & 0xff, \	(int)(ip >> 8) & 0xff, (int)ip & 0xff#define	MAC_STR		"%02x:%02x:%02x:%02x:%02x:%02x"#define	MAC_ARGS(mac)					\	mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] #define	PXENFSROOTPATH	"/pxeroot"typedef struct {	uint16_t		offset;	uint16_t		segment;} SEGOFF16_t;typedef struct {	uint16_t		Seg_Addr;	uint32_t		Phy_Addr;	uint16_t		Seg_Size;} SEGDESC_t;typedef	uint16_t		SEGSEL_t;typedef	uint16_t		PXENV_STATUS_t;typedef	uint32_t		IP4_t;typedef	uint32_t		ADDR32_t;typedef	uint16_t		UDP_PORT_t;#define	MAC_ADDR_LEN		16typedef	uint8_t			MAC_ADDR[MAC_ADDR_LEN];/* PXENV+ */typedef struct {	uint8_t		Signature[6];	/* 'PXENV+' */	uint16_t	Version;	/* MSB = major, LSB = minor */	uint8_t		Length;		/* structure length */	uint8_t		Checksum;	/* checksum pad */	SEGOFF16_t	RMEntry;	/* SEG:OFF to PXE entry point */	/* don't use PMOffset and PMSelector (from the 2.1 PXE manual) */	uint32_t	PMOffset;	/* Protected mode entry */	SEGSEL_t	PMSelector;	/* Protected mode selector */	SEGSEL_t	StackSeg;	/* Stack segment address */	uint16_t	StackSize;	/* Stack segment size (bytes) */	SEGSEL_t	BC_CodeSeg;	/* BC Code segment address */	uint16_t	BC_CodeSize;	/* BC Code segment size (bytes) */	SEGSEL_t	BC_DataSeg;	/* BC Data segment address */	uint16_t	BC_DataSize;	/* BC Data segment size (bytes) */	SEGSEL_t	UNDIDataSeg;	/* UNDI Data segment address */	uint16_t	UNDIDataSize;	/* UNDI Data segment size (bytes) */	SEGSEL_t	UNDICodeSeg;	/* UNDI Code segment address */	uint16_t	UNDICodeSize;	/* UNDI Code segment size (bytes) */	SEGOFF16_t	PXEPtr;		/* SEG:OFF to !PXE struct, 					   only present when Version > 2.1 */} PACKED pxenv_t;/* !PXE */typedef struct {	uint8_t		Signature[4];	uint8_t		StructLength;	uint8_t		StructCksum;	uint8_t		StructRev;	uint8_t		reserved_1;	SEGOFF16_t	UNDIROMID;	SEGOFF16_t	BaseROMID;	SEGOFF16_t	EntryPointSP;	SEGOFF16_t	EntryPointESP;	SEGOFF16_t	StatusCallout;	uint8_t		reserved_2;	uint8_t		SegDescCn;	SEGSEL_t	FirstSelector;	SEGDESC_t	Stack;	SEGDESC_t	UNDIData;	SEGDESC_t	UNDICode;	SEGDESC_t	UNDICodeWrite;	SEGDESC_t	BC_Data;	SEGDESC_t	BC_Code;	SEGDESC_t	BC_CodeWrite;} PACKED pxe_t;#define	PXENV_START_UNDI		0x0000typedef struct {	PXENV_STATUS_t	Status;	uint16_t	ax;	uint16_t	bx;	uint16_t	dx;	uint16_t	di;	uint16_t	es;} PACKED t_PXENV_START_UNDI;#define	PXENV_UNDI_STARTUP		0x0001typedef struct {	PXENV_STATUS_t	Status;} PACKED t_PXENV_UNDI_STARTUP;#define	PXENV_UNDI_CLEANUP		0x0002typedef struct {	PXENV_STATUS_t	Status;} PACKED t_PXENV_UNDI_CLEANUP;#define	PXENV_UNDI_INITIALIZE		0x0003typedef struct {	PXENV_STATUS_t	Status;	ADDR32_t	ProtocolIni;	/* Phys addr of a copy of the driver module */	uint8_t		reserved[8];} PACKED t_PXENV_UNDI_INITALIZE;#define	MAXNUM_MCADDR		8typedef struct {	PXENV_STATUS_t	Status;	uint16_t	MCastAddrCount;	MAC_ADDR	McastAddr[MAXNUM_MCADDR];} PACKED t_PXENV_UNDI_MCAST_ADDRESS;#define	PXENV_UNDI_RESET_ADAPTER	0x0004		typedef struct {	PXENV_STATUS_t	Status;	t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;} PACKED t_PXENV_UNDI_RESET;#define	PXENV_UNDI_SHUTDOWN		0x0005typedef struct {	PXENV_STATUS_t	Status;} PACKED t_PXENV_UNDI_SHUTDOWN;#define	PXENV_UNDI_OPEN			0x0006typedef struct {	PXENV_STATUS_t	Status;	uint16_t	OpenFlag;	uint16_t	PktFilter;#	define FLTR_DIRECTED	0x0001#	define FLTR_BRDCST	0x0002#	define FLTR_PRMSCS	0x0003#	define FLTR_SRC_RTG	0x0004	t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;} PACKED t_PXENV_UNDI_OPEN;#define	PXENV_UNDI_CLOSE		0x0007typedef struct {	PXENV_STATUS_t	Status;} PACKED t_PXENV_UNDI_CLOSE;#define	PXENV_UNDI_TRANSMIT		0x0008typedef struct {	PXENV_STATUS_t	Status;	uint8_t		Protocol;#	define P_UNKNOWN	0#	define P_IP		1#	define P_ARP		2#	define P_RARP		3	uint8_t		XmitFlag;#	define XMT_DESTADDR	0x0000#	define XMT_BROADCAST	0x0001	SEGOFF16_t	DestAddr;	SEGOFF16_t	TBD;	uint32_t	Reserved[2];} PACKED t_PXENV_UNDI_TRANSMIT;#define	MAX_DATA_BLKS		8typedef struct {	uint16_t	ImmedLength;	SEGOFF16_t	Xmit;	uint16_t	DataBlkCount;	struct	DataBlk {		uint8_t		TDPtrType;		uint8_t		TDRsvdByte;		uint16_t	TDDataLen;		SEGOFF16_t	TDDataPtr;	} DataBlock[MAX_DATA_BLKS];} PACKED t_PXENV_UNDI_TBD;#define	PXENV_UNDI_SET_MCAST_ADDRESS	0x0009typedef struct {	PXENV_STATUS_t	Status;	t_PXENV_UNDI_MCAST_ADDRESS R_Mcast_Buf;} PACKED t_PXENV_UNDI_SET_MCAST_ADDR;#define	PXENV_UNDI_SET_STATION_ADDRESS	0x000Atypedef struct {	PXENV_STATUS_t	Status;	MAC_ADDR	StationAddress;		/* Temp MAC addres to use */} PACKED t_PXENV_UNDI_SET_STATION_ADDR;#define	PXENV_UNDI_SET_PACKET_FILTER	0x000Btypedef struct {	PXENV_STATUS_t	Status;	uint8_t		filter;			/* see UNDI_OPEN (0x0006) */} PACKED t_PXENV_UNDI_SET_PACKET_FILTER;#define	PXENV_UNDI_GET_INFORMATION	0x000Ctypedef struct {	PXENV_STATUS_t	Status;	uint16_t	BaseIo;			/* Adapter base I/O address */	uint16_t	IntNumber;		/* Adapter IRQ number */	uint16_t	MaxTranUnit;		/* Adapter maximum transmit unit */	uint16_t	HwType;			/* Type of protocol at the hardware addr */#	define ETHER_TYPE	1#	define EXP_ETHER_TYPE	2#	define IEEE_TYPE	6#	define ARCNET_TYPE	7	uint16_t	HwAddrLen;		/* Length of hardware address */	MAC_ADDR	CurrentNodeAddress;	/* Current hardware address */	MAC_ADDR	PermNodeAddress;	/* Permanent hardware address */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -