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

📄 vmacbstr.h

📁 以太网交换机协议平台stp协议的设计与实现源代码。
💻 H
📖 第 1 页 / 共 2 页
字号:
/*
 * $Log:: /OEM Source Code/Spantree/vmacbstr $
 * 
 * 1     12/04/98 2:36p Release Engineer
 * code cleanup, bug fixes, code style
 * changes, linted, system level test
 * STP v4.3.0
 * 
 * 1     2/06/96 11:06p Ross
 * Adding new version control
*/
/*	$Modname: vmacbstr.h$  $version: 2.33$      $date: 04/17/95$   */
/*
* 	$lgb$
2.0 01/05/92 ross
2.1 01/25/92 ross changed prototype for send_packet, added port_number to tx_completion call
2.2 04/22/92 ross
2.3 07/30/92 ross
2.4 07/30/92 ross
2.5 08/05/92 ross
2.6 08/21/92 ross
2.7 08/22/92 ross Added support for multiple instances of stp_class
2.8 08/22/92 ross made as many functions as possible static
2.9 11/20/92 ross tabs around USHORT were fixed (cosmetic).
2.10 11/23/92 ross changed ETHERNET_ADDRESS to MAC_ADDRESS to appear more generic (cosmetic)
2.11 01/15/93 ross
2.12 01/18/93 ross delete redundant aging_time in stp_class, still in this_bridge.
2.13 01/20/93 ross changed NUMBER_OF_SPANNING_TREE_PORTS to NUMBER_OF_SPANNING_TREE_PORTS + 1 courtesy of MW.
2.14 01/29/93 ross added dlci to PORT_STATUS.
2.15 01/29/93 ross added prototype for store_dlci.
2.16 01/29/93 ross changed constants in macbrrx.c and macbrdb.c to better match snmp, fixed frame relay bug.
2.17 01/30/93 ross delete references to frame relay.
2.18 01/30/93 ross delete references to stp dlci
2.19 03/29/93 ross added more snmp stuff
2.20 07/16/93 ross added some mib statistics
2.21 07/23/93 ross added mtu size to port class.
2.22 10/11/93 ross update for changes in LSL, bug in frame relay receive.
2.23 10/28/93 ross changes for ethernet to token ring bridging/translation
2.24 12/29/93 ross big endian fix.  Courtesy of Rick.
2.25 02/02/94 ross took out frame relay header and fixed big endian problems.  Courtesy of Rick.
2.26 03/07/94 ross removed external references to mac_address, function used instead.
2.27 05/09/94 ross added changes for configuring forwarding state for SRT
2.28 06/15/94 ross cosmetic changes and snmp access routines.
2.29 07/21/94 ross fixed path cost bug, from ushort to ulong.  Courtesy of Sanjeev.
2.30 08/19/94 ross added BIG_ENDIAN to topology change structure.
2.31 08/25/94 ross added support for BYTE_ENUM and USHORT_ENUM
2.32 03/31/95 ross Changes for new rwutils library.
2.33 04/17/95 ross removed pragma.  Courtesy of Hung.
* 	$lge$
*/
/************************************************************************/
/*	Copyright (C) 1989-1998 RouterWare, Inc. 										*/
/*	Unpublished - rights reserved under the Copyright Laws of the			*/
/*	United States.  Use, duplication, or disclosure by the 					*/
/*	Government is subject to restrictions as set forth in 					*/
/*	subparagraph (c)(1)(ii) of the Rights in Technical Data and 			*/
/*	Computer Software clause at 252.227-7013.										*/
/*	RouterWare, Inc., 3961 MacArthur Blvd. Suite 212, Newport Beach Ca   */
/************************************************************************/
typedef	struct	TIMER
{
	enum	TIMER_COMMAND	active;
	ULONG						value;
} TIMER;

typedef	_struct	BRIDGE_IDENTIFIER
{
	USHORT		priority;
	MAC_ADDRESS	address;
} _pack BRIDGE_IDENTIFIER;

typedef	_struct	PORT_IDENTIFIER
{
	BYTE				priority;
	BYTE				number;
} _pack PORT_IDENTIFIER;

typedef	struct	BRIDGE_CONFIGURATION_FLAGS
{
#if !defined (BIG_ENDIAN)
	unsigned	char topology_change:1;
	unsigned	char not_used:6;
	unsigned	char topology_change_acknowledgement:1;
#else
	unsigned	char topology_change_acknowledgement:1;
	unsigned	char not_used:6;
	unsigned	char topology_change:1;
#endif
} BRIDGE_CONFIGURATION_FLAGS;

typedef	_struct	BRIDGE_CONFIGURATION_BPDU
{
	MAC_HEADER						mac_header; 												/* 14 bytes | 14,0xe  01-80-c2-00-00-00,source,0x3c*/

	LLC_HEADER						LLC_header; 												/* 3 bytes  | 17,0x11 |	1 42 42 03*/
	
	USHORT							protocol_ID; 									 			/* 2 bytes  | 19,0x12 |	3 00 00*/

	BYTE								protocol_version_ID;										/* 1 byte   | 20,0x14 |	4 00*/

	BYTE_ENUM (BPDU_TYPE)		type; /* CONFIGURATION  */								/* 1 byte   | 21,0x15 |	5 00*/

	BRIDGE_CONFIGURATION_FLAGS	flags;														/* 1 byte   | 22,0x16 |	6 00*/

	BRIDGE_IDENTIFIER				root_id; 													/* 8 bytes  | 30,0x1e |	7 80 00, lowest ethernet address*/
	ULONG								root_path_cost;											/* 4 bytes  | 34,0x23 |	15 00 00 00 00*/

	BRIDGE_IDENTIFIER				bridge_id;													/* 8 bytes  | 42,0x2s |	19 80 00, lowest ethernet address*/

	PORT_IDENTIFIER				port_id; 													/* 2 bytes  | 44,0x2c |	27 80 02 or 01*/

	USHORT							message_age;												/* 2 byte   | 46,0x2e |	29 00 00*/
	USHORT							max_age;  													/* 2 byte   | 48,0x30 |	31 14 00*/
	USHORT							hello_time; 												/* 2 byte   | 50,0x32 |	33 02 00*/
	USHORT							forward_delay;												/* 2 byte   | 52,0x34 |	35 0f 00*/

} _pack BRIDGE_CONFIGURATION_BPDU;


typedef	_struct	BRIDGE_TOPOLOGY_CHANGE_NOTIFICATION
{
	MAC_HEADER						mac_header; 												/* 14 bytes | 14,0xe */

	LLC_HEADER						LLC_header; 												/* 3 bytes  | 17,0x11 |	1*/
	
	USHORT							protocol_ID; 									 			/* 2 bytes  | 19,0x12 |	3*/

	BYTE								protocol_version_ID;										/* 1 byte   | 20,0x14 |	4*/

	BYTE_ENUM (BPDU_TYPE)		type; /* TOPOLOGY_CHANGE */ 							/* 1 byte   | 21,0x15 |	5*/

} _pack BRIDGE_TOPOLOGY_CHANGE_NOTIFICATION;

#if !defined (TURN_OFF_ALIGNMENT)
	/* #pragma align 16 */
#endif

typedef	struct	THIS_BRIDGE
{
	BRIDGE_IDENTIFIER	root_id;				/* value of bridge assumed to be the root (maybe me) */
	ULONG					root_path_cost;	/* cost of the path to the root from this bridge (me) */
	PORT_IDENTIFIER	root_port_id;		/* port which offers the lower cost path to the root i.e. designated_cost + path_cost */

	ULONG					max_age;				/* maximum age of protocol info before it is discarded */
	ULONG					hello_time;			/* time interval between the tx of config BPDUs by a bridge attempting or is the root */
	ULONG					forward_delay;		/* time between states or the value used to age out entries when topology is changing */

	BRIDGE_IDENTIFIER	bridge_id;					/* my id */

	ULONG					bridge_max_age;			/* my max age, when I'm the root */
	ULONG					bridge_hello_time;		/* my hello time, when I'm the root */
	ULONG					bridge_forward_delay;	/* my forward delay when I'm the root */

	enum	BOOLEAN		topology_change_detected;	/* topology change detected or sent to the me, if not the root then I send periodic (hello time) tcn BPDU towards the root */
	enum	BOOLEAN		topology_change;				/* records the value of the topology change flag in config BPDUs to be tx, ageing timer = forward delay when TRUE */
	ULONG					topology_change_time;		/* length of time the tcns are sent if I'm the root = bridge_max_age + bridge_forward_delay */
	ULONG					hold_time;						/* config BPDUs are space apart at least hold_time */
/* management members */
	char					name[32];
	ULONG					time_up;
	ULONG					number_of_topology_changes;
	ULONG					timer_topology_tick;
	ULONG					number_of_frames_received_while_database_is_full;
	ULONG					aging_time_for_fd;
} THIS_BRIDGE;

typedef	struct	STP_PORT_CLASS
{
	PORT_IDENTIFIER	port_id; 						/* my port priority and number  */

	enum PORT_STATE	state;							/* state i.e. FORWARDING */
	BYTE_ENUM (BOOLEAN)	token_ring;
	BYTE_ENUM (BOOLEAN)	wan_port;
	MAC_ADDRESS			mac_address;

	ULONG					path_cost;						/* when the Root Port, the (my port's) portion of the total path cost to the Root */

	BRIDGE_IDENTIFIER	designated_root_id;			/* the root bridge, used in tx config BPDUs */
	ULONG					designated_root_path_cost;	/* cost of the path to the root offered by the designated port (maybe my port) */
	BRIDGE_IDENTIFIER	designated_bridge_id;		/* the designated bridge priority and address, (maybe me) */
	PORT_IDENTIFIER	designated_port_id; 			/* the designated port priority and number, (maybe me) */

	BYTE_ENUM (BOOLEAN)		topology_change_acknowledgement;	/* value of the next tx config BPDU flag, for reply to tcn */
	BYTE_ENUM (BOOLEAN)		configuration_pending;				/* when hold timer expires, tx config BPDU */

	TIMER					message_age;					/* timer to measure the age of rxed protocol info, timeout is max_age */
	TIMER					forward_delay;					/* monitors the time spent in listening and learning states */
	TIMER					hold_time;						/* ensures that config BPDUs are tx too often uses hold time */

⌨️ 快捷键说明

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