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

📄 vmacbstr.h

📁 以太网交换机协议平台stp协议的设计与实现源代码。
💻 H
📖 第 1 页 / 共 2 页
字号:
/* management members */

	char					name[32];

	ULONG					dot1dBasePort;
	ULONG					dot1dBasePortIfIndex;
	ULONG					dot1dBasePortCircuit;
	ULONG					dot1dBasePortDelayExceededDiscards;
	ULONG					dot1dBasePortMtuExceededDiscards;

	ULONG					number_of_forward_transitions;
	ULONG					number_of_frames_forwarded;
	ULONG					dot1dTpPortInFrames;
	ULONG					number_of_frames_discarded;
	ULONG					number_of_frames_received_while_database_is_full;

	ULONG					number_of_rx_frames_filtered;
	ULONG					number_of_tx_frames_filtered;
	ULONG					number_of_bridge_pdus_sent;

	USHORT				maximum_packet_size;

	ULONG					dot1dTpPort;

	BYTE_ENUM (BOOLEAN) 		dot1dStpPortEnable;

} STP_PORT_CLASS;

typedef	struct	STP_CLASS
{
	ULONG 										number_of_spanning_tree_ports;
	USHORT										number_of_fd_entries;
	ULONG											number_of_hash_table_entries;
	USHORT										hash_mask;
	USHORT										size_of_hash_key;
	STP_PORT_CLASS								port[NUMBER_OF_SPANNING_TREE_PORTS + 1];
	BRIDGE_CONFIGURATION_BPDU				bridge_configuration_BPDU[NUMBER_OF_SPANNING_TREE_PORTS + 1];
	BRIDGE_TOPOLOGY_CHANGE_NOTIFICATION	bridge_topology_change_notification[NUMBER_OF_SPANNING_TREE_PORTS + 1];

	enum STP_BASE_TYPE						dot1dBaseType;
	enum STP_TYPE								dot1dStpProtocolSpecification;

	TIMER											hello_timer;
	TIMER											topology_change_notification_timer;
	TIMER											topology_change_timer;

	THIS_BRIDGE									this_bridge;

#if !defined (SMALL_ENTRY)
	LINK											free_fd_entries_queue;
#else
	USHORT_LINK									free_fd_entries_queue;
	#define LINK USHORT_LINK /* for prototypes */
#endif

	FILTERING_DATABASE_TABLE 				*sptr_fd_table;
	HASH_TABLE 									*sptr_hash_table;

	FILTERING_DATABASE_ENTRY 				*sptr_first_entry_in_fd_table;

	FILTERING_DATABASE_TABLE 				*sptr_filters_table;

	LINK											free_filtering_entries_queue;

	LINK											filtering_entries_queue;

	BYTE_ENUM (BOOLEAN)						mac_bridge_enabled;

	ULONG 										current_entry_to_check_age;
	ULONG 										upper_limit_on_number_of_entries;
	ULONG 										number_of_entries_timed_out;

	void 											(*fptr_topology_change_detection) (void);
	void 											(*fptr_new_root) (void);

	BYTE_ENUM (BOOLEAN)						filtering_database_table_is_full;
	enum BOOLEAN								enabled;
	BYTE_ENUM (BOOLEAN) 						timer_enabled;
	enum BOOLEAN								stp_algorithm_enabled;

	ULONG											stack_id;
	ULONG											clock_ticks_per_second;
	ULONG 										number_of_bridge_clock_ticks;

	enum BOOLEAN								stp_printing_enabled;
	enum BOOLEAN								memory_printing_enabled;
	enum BOOLEAN								alarm_printing_enabled;
	enum BOOLEAN								snmp_printing_enabled;
	enum BOOLEAN								data_printing_enabled;
	enum BOOLEAN								stp_algorithm_printing_enabled;

	enum BOOLEAN 								initialization_breakpoint_enabled;

} STP_CLASS;

/* brouter.c */
enum	SORT_RETURN	compare_addresses (MAC_ADDRESS *sptr_address_1,MAC_ADDRESS *sptr_address_2);

/* macbrini.c */

enum TEST initialize_bridge (ULONG clock_ticks_per_second);
void initialize_bridge_configuration_bpdu (void);
void big_endianize_packet (BRIDGE_CONFIGURATION_BPDU *sptr_bridge_configuration_BPDU);
void little_endianize_packet (BRIDGE_CONFIGURATION_BPDU *sptr_bridge_configuration_BPDU);
enum	SORT_RETURN	compare_identifiers (BRIDGE_IDENTIFIER *sptr_address_1,BRIDGE_IDENTIFIER *sptr_address_2);
enum SORT_RETURN compare_port_identifiers (PORT_IDENTIFIER *sptr_address_1,PORT_IDENTIFIER *sptr_address_2);

#if !defined (BIG_ENDIAN)
	ULONG swap_long (ULONG ulong_to_swap_bytes_with);
	USHORT swap (USHORT ushort_to_swap_bytes_with);
#endif

/* macbrspn.c */

void initialize_bridge_spanning_tree (void);
void initialize_port (USHORT port_number);
void	transmit_configuration (USHORT port_number);
enum BOOLEAN root_bridge (void);
void	configuration_BPDU_generation (void);
enum	BOOLEAN designated_port (USHORT port_number);
void	transmit_topology_change_notification (void);
void	configuration_update (void);
void become_designated_port (USHORT port_number);
void port_state_selection (void);
void	topology_change_detection (void);
void	bridge_protocol_message_received (USHORT port_number,BRIDGE_CONFIGURATION_BPDU *sptr_rx_buffer);

/* macbrrx.c */

enum RX_PACKET_STATE mac_bridge_rx (USHORT port_number,ETHERNET_BUFFER *sptr_rx_buffer,USHORT size_of_buffer);

/* macbrtx.c */
void send_mac_bridge_PDU (USHORT port_number,BRIDGE_CONFIGURATION_BPDU *sptr_tx_buffer,USHORT size_of_buffer);
void convert_ethernet_header_to_token_ring (ETHERNET_HEADER *sptr_tx_buffer);
void convert_token_ring_header_to_ethernet (ETHERNET_BUFFER *sptr_tx_buffer,USHORT size_of_buffer);

/* macbrdb.c */

void	initialize_hashing_table (void);
enum FD_TABLE_ENTRY_TYPE add_entry_to_filtering_database (USHORT source_mac_address_ushort,
	ULONG source_mac_address_ulong,USHORT port_number,enum FD_TABLE_ENTRY_TYPE type);
FILTERING_DATABASE_ENTRY *find_source_address (LINK *sptr_queue_entry,USHORT source_mac_address_ushort,
	ULONG source_mac_address_ulong);
void	database_entry_timer_check (void);
void add_bridge_addresses_to_static_forwarding_table (void);
FILTERING_DATABASE_ENTRY *get_destination_address_database_entry (USHORT destination_mac_address_ushort,
	ULONG destination_mac_address_ulong);


void delete_entry_from_queue (LINK *sptr_queue_link,LINK *sptr_link_to_delete);
void *get_entry_from_queue (LINK *sptr_link);
void add_entry_to_queue (LINK *sptr_link,LINK *sptr_link_to_add);

/* macbrtim.c */

void mac_bridge_timer (void);
void set_timer (TIMER *sptr_timer,enum TIMER_COMMAND start_or_stop);
void start_message_age_timer (TIMER *sptr_timer,enum TIMER_COMMAND start_or_stop,ULONG timer_value);

/* macbrmgr.c */

void	enable_port (USHORT port_number);
void	disable_port (USHORT port_number);
void	set_bridge_priority (BRIDGE_IDENTIFIER *sptr_bridge_id);
void	set_port_priority (USHORT port_number,BYTE priority);
void	set_path_cost (USHORT port_number, ULONG path_cost);

/* macbrmgt.c */

enum BOOLEAN stp_forwarding_enabled (USHORT port_number);
void stp_printf (enum STP_PRINTF_GROUPS printf_group,const char *cptr_format, ...);
void enable_or_disable_stp_printing (enum BOOLEAN enable_or_disable);
void enable_or_disable_stp_group_printing (enum BOOLEAN enable_or_disable,enum STP_PRINTF_GROUPS printf_group);

#if defined (DEBUG)
	void display_spanning_tree_packet (USHORT port_number,ETHERNET_BUFFER *sptr_rx_packet,USHORT size_of_packet);
#endif

/* macbrflt.c */

enum BOOLEAN stp_filter (USHORT port_number,ETHERNET_BUFFER *sptr_rx_buffer);

/* macbrcfg.c */
enum TEST mac_bridge_control (enum PROTOCOL_CONTROL_OPERATION command,ULONG parameter_0,ULONG parameter_1); 
ULONG stp_get_configuration_table_address (void);

/*macbsnmp.c*/
enum TEST stp_get_spanning_tree_mib_variable  (char *module_name, MIB_ACCESS_PARAMETERS *sptr_mib_access_parameters);

⌨️ 快捷键说明

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