[Charset ISO-8859-1 unsupported, filtering to ASCII...]
> 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) )
the problem is that a graph (which is what ultimately
is a state diagram) does not generally have a total
ordering so making comparisons other than == or != is
the best way to induce programming errors.
> 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
No way! that would be even more wrong.
One state is one bit, and state changes are strict assignments.
The bit-set only makes it more efficient to test for set membership
( "state \in {S1, S2, S3 ...}" becomes ( tp->t_state & (S1|S2|S3) != 0 )
cheers
luigi
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message