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

📄 ethernet_internal.h

📁 ixp2400的一个小程序
💻 H
字号:
/*  Copyright (C) 2002-2003 Intel Corporation, All Rights Reserved.
//  Permission is hereby granted to merge this program code with 
//  other program material to create a derivative work.  This 
//  derivative work may be distributed in compiled object form only.
//  Any other publication of this program, in any form, without the 
//  explicit permission of the copyright holder is prohibited.
//
//  Send questions and comments to erik.j.johnson@intel.com, 
//  aaron.kunze@intel.com

//-------------------------------------------------------------------
// ethernet_internal.h - Chapter 6
// This file defines the control block structure for the Ethernet
// microblocks
*/

#ifndef ETHERNET_INTERNAL_H
#define ETHERNET_INTERNAL_H

/* The number of entries in the top level hash array.  This
// number must be a power of 2.
*/
#define ARP_TABLE_ARRAY_SIZE	256

/* This is the ARP table entry format.  A hash table
// containing these entries is used to map destination
// IP addresses to Ethernet Destination MAC addresses.
*/
typedef struct _ethernet_arp_table_entry
{
	unsigned int ethernet_address_hi32;
	unsigned int ethernet_address_lo16 : 16;
	unsigned int pad				   : 8;
	unsigned int valid				   : 8;
} ethernet_arp_table_entry;

/* This structure contains the single MAC address of the
// device, along with a pointer to the hash table used
// for ARP.
*/
typedef struct
{
	unsigned int device_addr_hi32;
	unsigned int device_addr_lo16	: 16;
	unsigned int pad				: 16;
	ethernet_arp_table_entry	
	     arp_table_array[ARP_TABLE_ARRAY_SIZE];
} ethernet_control_block;

/* If we are using hardware, the ETHERNET_DATA symbol
// is an imported variable.  In the simulator, it is
// a #define in the compile options
*/
#ifdef HARDWARE
#define ETHERNET_SYMBOL_NAME	"ETHERNET_DATA"

#ifdef MICRO_C
int ETHERNET_DATA = 
			LoadTimeConstant(ETHERNET_SYMBOL_NAME);
#endif
#endif /* HARDWARE */

/* For now, the communication ID for packets going from
// the microblock to the core is set to 64.  When
// this path is actually implemented, it needs to be
// unique system-wide.  This is the exception ID used
// in the microblock and the communication ID in the
// core component
*/
#define ETHERNET_EXCEPTION_ID	64


#endif /*ETHERNET_INTERNAL_H*/

⌨️ 快捷键说明

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