Sponge
CS144's user-space TCP library
tcp_state.hh
Go to the documentation of this file.
1 #ifndef SPONGE_LIBSPONGE_TCP_STATE
2 #define SPONGE_LIBSPONGE_TCP_STATE
3 
4 #include "tcp_receiver.hh"
5 
6 #include <string>
7 
22 class TCPState {
23  public:
25  static std::string state_summary(const TCPReceiver &receiver);
26 };
27 
29 const std::string ERROR = "error (connection was reset)";
30 const std::string LISTEN = "waiting for SYN: ackno is empty";
31 const std::string SYN_RECV = "SYN received (ackno exists), and input to stream hasn't ended";
32 const std::string FIN_RECV = "input to stream has ended";
33 } // namespace TCPReceiverStateSummary
34 
35 #endif // SPONGE_LIBSPONGE_TCP_STATE
std::string
tcp_receiver.hh
TCPReceiverStateSummary
Definition: tcp_state.hh:28
TCPReceiverStateSummary::FIN_RECV
const std::string FIN_RECV
Definition: tcp_state.hh:32
TCPReceiver
The "receiver" part of a TCP implementation.
Definition: tcp_receiver.hh:16
TCPReceiverStateSummary::LISTEN
const std::string LISTEN
Definition: tcp_state.hh:30
TCPState
Summary of a TCPConnection's internal state.
Definition: tcp_state.hh:22
TCPReceiverStateSummary::SYN_RECV
const std::string SYN_RECV
Definition: tcp_state.hh:31
TCPState::state_summary
static std::string state_summary(const TCPReceiver &receiver)
Summarize the state of a TCPReceiver in a string.
Definition: tcp_state.cc:5
TCPReceiverStateSummary::ERROR
const std::string ERROR
Definition: tcp_state.hh:29