首页 > 代码库 > quagga源码学习--BGP协议对等体的状态机

quagga源码学习--BGP协议对等体的状态机

创建完bgp peer之后,就要bgp start了,不然费那么大劲创建出来不做事情就销毁了,就很尴尬了。

那么对等体一旦start起来,就会进入各自的状态,在不同的状态下处理各自的事件消息。

下面列举一些状态和事件的集合:

 1 /* BGP finite state machine status.  */
 2 #define Idle                                     1
 3 #define Connect                                  2
 4 #define Active                                   3
 5 #define OpenSent                                 4
 6 #define OpenConfirm                              5
 7 #define Established                              6
 8 #define Clearing                                 7
 9 #define Deleted                                  8
10 #define BGP_STATUS_MAX                           9
11 
12 /* BGP finite state machine events.  */
13 #define BGP_Start                                1
14 #define BGP_Stop                                 2
15 #define TCP_connection_open                      3
16 #define TCP_connection_closed                    4
17 #define TCP_connection_open_failed               5
18 #define TCP_fatal_error                          6
19 #define ConnectRetry_timer_expired               7
20 #define Hold_Timer_expired                       8
21 #define KeepAlive_timer_expired                  9
22 #define Receive_OPEN_message                    10
23 #define Receive_KEEPALIVE_message               11
24 #define Receive_UPDATE_message                  12
25 #define Receive_NOTIFICATION_message            13
26 #define Clearing_Completed                      14
27 #define BGP_EVENTS_MAX                          15

 

quagga源码学习--BGP协议对等体的状态机