ns-allinone-2.35/tcp/tcp-full.cc
int
FullTcpAgent::outflags()
{
	// in real TCP an RST is added in the CLOSED state
	static int tcp_outflags[TCP_NSTATES] = {
		TH_ACK,          	/* 0, CLOSED */  
		0,                      /* 1, LISTEN */ 
		TH_SYN,                 /* 2, SYN_SENT */
		TH_SYN|TH_ACK,          /* 3, SYN_RECEIVED */
		TH_ACK,                 /* 4, ESTABLISHED */
		TH_ACK,                 /* 5, CLOSE_WAIT */
		TH_FIN|TH_ACK,          /* 6, FIN_WAIT_1 */
		TH_FIN|TH_ACK,          /* 7, CLOSING */
		TH_FIN|TH_ACK,          /* 8, LAST_ACK */
		TH_ACK,                 /* 9, FIN_WAIT_2 */
		/* 10, TIME_WAIT --- not used in simulator */
	};

	if (state_ < 0 || (state_ >= TCP_NSTATES)) {
		fprintf(stderr, "%f FullTcpAgent(%s): invalid state %d\n",
			now(), name(), state_);
		return (0x0);
	}

	return (tcp_outflags[state_]);
}
/*
 * flags that are completely dependent on the tcp state
 * these are used for the next outgoing packet in foutput()
 * (in real TCP, see tcp_fsm.h, the "tcp_outflags" array)
 */
flags that are completely dependent on the tcp state
these are used for the next outgoing packet in foutput()
(in real TCP, see tcp_fsm.h, the "tcp_outflags" array)
flags that are completely dependent on the tcp state these are used for the next outgoing packet in foutput () ( in real TCP see tcp_fsm . h the " tcp_outflags " array )
int
FullTcpAgent::outflags()
{
	static int tcp_outflags[TCP_NSTATES] = {
		TH_ACK,          	  
		0,                       
		TH_SYN,                 
		TH_SYN|TH_ACK,          
		TH_ACK,                 
		TH_ACK,                 
		TH_FIN|TH_ACK,          
		TH_FIN|TH_ACK,          
		TH_FIN|TH_ACK,          
		TH_ACK,                 
	};
	if (state_ < 0 || (state_ >= TCP_NSTATES)) {
		fprintf(stderr, "%f FullTcpAgent(%s): invalid state %d\n",
			now(), name(), state_);
		return (0x0);
	}
	return (tcp_outflags[state_]);
}
int FullTcpAgent :: outflags ( ) { static int tcp_outflags [ TCP_NSTATES ] = { TH_ACK , 0 , TH_SYN , TH_SYN | TH_ACK , TH_ACK , TH_ACK , TH_FIN | TH_ACK , TH_FIN | TH_ACK , TH_FIN | TH_ACK , TH_ACK , } ; if ( state_ < 0 || ( state_ >= TCP_NSTATES ) ) { fprintf ( stderr , " \n " , now ( ) , name ( ) , state_ ) ; return ( 0x0 ) ; } return ( tcp_outflags [ state_ ] ) ; }
flags that are completely dependent on the tcp state
 these are used for the next outgoing packet in foutput()
 (in real TCP, see tcp_fsm.h, the "tcp_outflags" array)
flags that are completely dependent on the tcp state these are used for the next outgoing packet in foutput () ( in real TCP see tcp_fsm . h the " tcp_outflags " array )
// in real TCP an RST is added in the CLOSED state /* 0, CLOSED */ /* 1, LISTEN */ /* 2, SYN_SENT */ /* 3, SYN_RECEIVED */ /* 4, ESTABLISHED */ /* 5, CLOSE_WAIT */ /* 6, FIN_WAIT_1 */ /* 7, CLOSING */ /* 8, LAST_ACK */ /* 9, FIN_WAIT_2 */ /* 10, TIME_WAIT --- not used in simulator */