tcp_fsm.h is (mostly) unused, and utterly misleading
As pointed out in #5711 tcp_fsm.h contains a duplicate set of the TCPS_* state machine states, but with different values.
A search of the source base suggests that this header is unused, except to the extent that we both install and package it (and that ipf may use it on... some? platforms?).
Someone who knows the network stack should confirm this, and delete tcp_fsm.h if it's accurate.
Updated by Dan McDonald almost 9 years ago
- Difficulty changed from Medium to Hard
It's more complicated, unfortunately.
tcp_fsm.h is in the netinet/ directory. These values for TCP's state machine are the BSD internal versions. Packages like ipfilter, and other 3rd-party networking tools, use the netinet/ headers for many things, including the TCP state machine definitions.
A quick analysis of IPfilter suggest we might be able to remove the file without breaking illumos-gate builds, because IPfilter itself DUPLICATES the TCP FSM states as IPF_TCPS_* in usr/src/uts/common/inet/ipf/netinet/ip_compat.h. I'm very concerned about 3rd-party userland apps which may depend on the presence of this file.
To further complicate things, the illumos TCP FSM adds two addtional states: IDLE and BOUND, between CLOSED and LISTEN. These help us, esp. back in the days of TLI/XTI, but even with sockets they are useful.