when Protocol-Reject is seen in Opened state.
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define RCSID "$Id: fsm.c,v 1.21 2004/02/02 02:52:51 carlsonj Exp $"
+#define RCSID "$Id: fsm.c,v 1.22 2004/02/02 03:57:19 carlsonj Exp $"
* send a terminate-request message as configured.
*/
static void
* send a terminate-request message as configured.
*/
static void
+terminate_layer(f, nextstate)
{
if( f->state != OPENED )
UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */
{
if( f->state != OPENED )
UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */
* We've already fired off one Terminate-Request just to be nice
* to the peer, but we're not going to wait for a reply.
*/
* We've already fired off one Terminate-Request just to be nice
* to the peer, but we're not going to wait for a reply.
*/
+ f->state = nextstate == CLOSING ? CLOSED : STOPPED;
if( f->callbacks->finished )
(*f->callbacks->finished)(f);
return;
if( f->callbacks->finished )
(*f->callbacks->finished)(f);
return;
TIMEOUT(fsm_timeout, f, f->timeouttime);
--f->retransmits;
TIMEOUT(fsm_timeout, f, f->timeouttime);
--f->retransmits;
case ACKRCVD:
case ACKSENT:
case OPENED:
case ACKRCVD:
case ACKSENT:
case OPENED:
+ terminate_layer(f, CLOSING);
+ terminate_layer(f, STOPPING);