When an Open message is received:
-- Ignore contents of the Open message (handle Open and BGP error checking in another issue)
-- Send an Open message
-- Send a Keepalive message
-- Advance to OpenConfirm
-- Start the keepalive and hold timers (should be based on the open message but just use config for now)
When a Notification message is received:
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket (we need some way to alert when this happens)
When a Shutdown event is received:
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket
When any other event happens (mainly Update message, possibly more timers later on but make this a catch-all):
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket (we need some way to alert when this happens)
OpenConfirm
When a Shutdown event is received:
-- Send a notification message with Cease
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket
When the hold timer expires (timer expired event and hold timer is done)
-- Send a notification message with error code hold timer expired
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket (we need some way to alert when this happens)
When the keepalive timer expires (timer expired event and keepalive timer is done)
-- Send a keepalive message and reset the timer
When a Keepalive message is received:
-- Reset the hold timer
-- Move to the Established state
When a Notification message is received:
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket (we need some way to alert when this happens)
When an Open message is received:
-- Send a notification message with Cease
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket (we need some way to alert when this happens)
When any other event happens (mainly Update message, possibly more timers later on but make this a catch-all):
-- Send a notification message with error code Finite State Machine Error
-- Move to the idle state (no way out of there)
-- It is up to the holder of the Beeper to handle the socket (we need some way to alert when this happens)
Established
Normal processing for Keepalive and Update messages (resetting hold timer)
Process everything else like OpenConfirm (except Keepalive keeps us in this state)
No error detection here yet (we'll accept messages with valid headers that parse correctly)
From the RFC (ignore the manualstart/stop events)
Active
OpenConfirm
Established