User Manual, Developers Guide and API Documentation

FiniteStateMachine.cpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #include <TCP/FiniteStateMachine.hpp>
00029 
00030 
00031 using namespace tcp;
00032 
00033 FiniteStateMachine::FiniteStateMachine(const ConnectionControlInterface::VariablesType& _v, wns::logger::Logger _logger) :
00034     ConnectionControlInterface(_v),
00035     logger(_logger)
00036 {
00037     changeState(createState<Closed>());
00038     MESSAGE_SINGLE(NORMAL, logger, "FSM initialized to state " + getStateName());
00039 }
00040 
00041 void
00042 FiniteStateMachine::syn()
00043 {
00044     MESSAGE_SINGLE(NORMAL, logger, "Sending SYN.");
00045     changeState(getState()->syn());
00046 }
00047 
00048 void
00049 FiniteStateMachine::syn_ack()
00050 {
00051     MESSAGE_SINGLE(NORMAL, logger, "Sending SYN_ACK.");
00052     changeState(getState()->syn_ack());
00053 }
00054 
00055 void
00056 FiniteStateMachine::ack()
00057 {
00058     MESSAGE_SINGLE(NORMAL, logger, "Sending ACK.");
00059     changeState(getState()->ack());
00060 }
00061 
00062 void
00063 FiniteStateMachine::fin()
00064 {
00065     MESSAGE_SINGLE(NORMAL, logger, "Sending FIN.");
00066     changeState(getState()->fin());
00067 }
00068 
00069 void
00070 FiniteStateMachine::rst()
00071 {
00072     MESSAGE_SINGLE(NORMAL, logger, "Sending RST.");
00073     changeState(getState()->rst());
00074 }
00075 
00076 void
00077 FiniteStateMachine::fin_ack()
00078 {
00079     MESSAGE_SINGLE(NORMAL, logger, "Sending FIN_ACK.");
00080     changeState(getState()->fin_ack());
00081 }

Generated on Thu May 24 03:32:17 2012 for openWNS by  doxygen 1.5.5