📄 ospf_neighbor_state_machine.c
字号:
/* ospf_neighbor_state_machine.c - OSPF neighbor state machine *//* Copyright 2000 - 2003 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------02a,03jul03,ram Backed out SPR#88600 workaround 21,26may03,dsk SPR 88600 fix for stuck in EXCHANGE_START (timer added to restart if stuck in exchange start state too long) 20,12december01,kc Invoked ospf2Mapi_request() only if neighbor sm is executed. 19,13october01,kc Dynamic configuration changes. 18,14august01,kc Added support for ospfVirtNbrTable updates. 17,26june01,jkw Moved global variables to ospf_globals.h for cleanup 16,26september00,reshma Added WindRiver CopyRight 15,25september00,reshma RFC-1587 implementation for OSPF NSSA Option, also tested against ANVL. 14,07july00,reshma Unix compatibility related changes. 13,04april00,reshma Added some MIB support (Read only).Passed all important ANVL OSPF tests. 12,23december99,reshma Compatibility with VxWorks-IP and VxWorks RTM-interface 11,28december98,jack Compiled and added some comments 10,11november98,jack Config changes, linted and big endian changes 09,30october98,jack Incorporate changes for compilation on Vxworks 08,23august98,jack ANVL tested OSPF with PATRICIA tree route table and no recursion 07,10august98,jack PATRICIA Route Table Based OSPF Code Base 06,04june98,jack Integration with RTM and BGP 05,24april98,jack RTM changes 04,10july97,cindy Pre-release v1.52b 03,02october97,cindy Release Version 1.52 02,22october96,cindy Release Version 1.50 01,05june96,cindy First Beta Release*//*DESCRIPTIONospf_neighbor_state_machine.c is used for executing the neighbor state machine. This filetakes in an neighbor event and the neighbor's current state and executes the neighbor statemachine to produce a new neighbor state.This file is used whenever the neighbor state machine is called.*/#include "ospf.h"#include "ospf_neighbor_state_machine.h"#if defined (__OSPF_VIRTUAL_STACK__)#include "ospf_vs_lib.h"#endif /* __OSPF_VIRTUAL_STACK__ *//************************************************************************/void ospf_execute_neighbor_state_machine (enum OSPF_NEIGHBOR_EVENT event,enum OSPF_NEIGHBOR_STATE state,OSPF_INTERFACE *sptr_interface, OSPF_NEIGHBOR *sptr_neighbor){#if defined (__OPAQUE_LSA__) OSPF_OPAQUE_CALLBACK *sptr_opaque_callback = NULL; OSPF_OPAQUE_CALLBACK *sptr_next_node = NULL;#endif /* __OPAQUE_LSA__ */ OSPF_PRINTF_DEBUG (OSPF_DEBUG_PRINTF, "OSPF: Entering ospf_execute_neighbor_state_machine\r\n"); if (ospf_neighbor_event_processing_table[event][state].fptr_neighbor_transition_function != NULL) { (*ospf_neighbor_event_processing_table[event][state].fptr_neighbor_transition_function) (sptr_interface, sptr_neighbor, event);#if defined (__OSPF_MIB__) /* tell OSPF MIB API to update the operational status and statistics * for this neighbor */ if ( (event != OSPF_NEIGHBOR_DOWN) && (event != OSPF_KILL_NEIGHBOR) ) { if ( sptr_interface->type == OSPF_VIRTUAL_LINK) ospf2Mapi_request( (void *)sptr_neighbor, ospfVirtNbrUpdateReqType ); else ospf2Mapi_request( (void *)sptr_neighbor, ospfNbrUpdateReqType ); }#endif /* __OSPF_MIB__ */ }#if defined (__OPAQUE_LSA__) for (sptr_opaque_callback = ospf.sptr_type_9_callback_list_head; sptr_opaque_callback != NULL; sptr_opaque_callback = sptr_next_node) { sptr_next_node = sptr_opaque_callback->sptr_forward_link; sptr_opaque_callback->neighbor_state_machine_change_hook(event,state,sptr_interface,sptr_neighbor); } for (sptr_opaque_callback = ospf.sptr_type_10_callback_list_head; sptr_opaque_callback != NULL; sptr_opaque_callback = sptr_next_node) { sptr_next_node = sptr_opaque_callback->sptr_forward_link; sptr_opaque_callback->neighbor_state_machine_change_hook(event,state,sptr_interface,sptr_neighbor); } for (sptr_opaque_callback = ospf.sptr_type_11_callback_list_head; sptr_opaque_callback != NULL; sptr_opaque_callback = sptr_next_node) { sptr_next_node = sptr_opaque_callback->sptr_forward_link; sptr_opaque_callback->neighbor_state_machine_change_hook(event,state,sptr_interface,sptr_neighbor); }#endif /* __OPAQUE_LSA__ */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -