Luigi,
A slightly more concise way of making the same change would be as follows:

#define TCPS_HAVERCVDFIN(s)     ( (s) >= TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && 
(s) != TCPS_FIN_WAIT_2) )

With the bit mask based scheme you have suggested, it might also be possible to do 
interesting things things like state tracking for individal connections, such that 
every time we move into the next state instead of doing something like tp->t_state = 
TCPS_SYN_RCVD, we can have something like tp->t_state |= TCPS_SYN_RCVD . The only 
useful purpose that I can think of would be have a history of the past states in the 
t_state variable.

Even without this ORing change, it would still make writing macros such as the above 
easier

Regards
-AG

Luigi Rizzo <[EMAIL PROTECTED]> wrote:
>
> this macro suggests that it would be better to
> define tcp states as a set of individual bits, so
> one does not have to do arithmetics on state IDs.
> 
> � � cheers
> � � luigi
> 
> > Currently in tcp_fsm.h its defined as :
> > #define TCPS_HAVERCVDFIN(s) � � ((s) >= TCPS_TIME_WAIT)
> > 
> > when IMHO it should be: (to consider all possible cases of having recd a FIN?)
> > 
> > #define TCPS_HAVERCVDFIN(s) � � ( ((s) >= TCPS_TIME_WAIT) || ((s) == 
>TCPS_CLOSE_WAIT) || ((s) == TCPS_LAST_ACK) || ((s) == TCPS_CLOSING) �)
> > 
> > -AG
> > 
> > __________________________________________________________________
> > Get your own FREE, personal Netscape Webmail account today at 
>http://webmail.netscape.com/
> > 
> > To Unsubscribe: send mail to [EMAIL PROTECTED]
> > with "unsubscribe freebsd-net" in the body of the message
> > 
> 
> 
__________________________________________________________________
Get your own FREE, personal Netscape Webmail account today at 
http://webmail.netscape.com/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to