MIB_TCPROW (Compact 2013)

3/26/2014

This structure contains information for a TCP connection.

Syntax

typedef struct _MIB_TCPROW {
  DWORD dwState; 
  DWORD dwLocalAddr; 
  DWORD dwLocalPort; 
  DWORD dwRemoteAddr; 
  DWORD dwRemotePort; 
} MIB_TCPROW, *PMIB_TCPROW;

Members

  • dwState
    The state of the TCP connection. The following list shows the possible values. This member can have one of these values:

    Value

    Meaning

    MIB_TCP_STATE_CLOSED

    1

    The TCP connection is in the CLOSED state that represents no connection state at all.

    MIB_TCP_STATE_LISTEN

    2

    The TCP connection is in the LISTEN state waiting for a connection request from any remote TCP and port.

    MIB_TCP_STATE_SYN_SENT

    3

    The TCP connection is in the SYN-SENT state waiting for a matching connection request after having sent a connection request (SYN packet).

    MIB_TCP_STATE_SYN_RCVD

    4

    The TCP connection is in the SYN-RECEIVED state waiting for a confirming connection request acknowledgement after having both received and sent a connection request (SYN packet).

    MIB_TCP_STATE_ESTAB

    5

    The TCP connection is in the ESTABLISHED state that represents an open connection, data that is received can be delivered to the user. This is the usual state for the data transfer phase of the TCP connection.

    MIB_TCP_STATE_FIN_WAIT1

    6

    The TCP connection is FIN-WAIT-1 state waiting for a connection termination request from the remote TCP, or an acknowledgement of the connection termination request previously sent.

    MIB_TCP_STATE_FIN_WAIT2

    7

    The TCP connection is FIN-WAIT-1 state waiting for a connection termination request from the remote TCP.

    MIB_TCP_STATE_CLOSE_WAIT

    8

    The TCP connection is in the CLOSE-WAIT state waiting for a connection termination request from the local user.

    MIB_TCP_STATE_CLOSING

    9

    The TCP connection is in the CLOSING state waiting for a connection termination request acknowledgement from the remote TCP.

    MIB_TCP_STATE_LAST_ACK

    10

    The TCP connection is in the LAST-ACK state waiting for an acknowledgement of the connection termination request previously sent to the remote TCP (which includes an acknowledgment of its connection termination request).

    MIB_TCP_STATE_TIME_WAIT

    11

    The TCP connection is in the TIME-WAIT state waiting for enough time to pass to make sure that the remote TCP received the acknowledgement of its connection termination request.

    MIB_TCP_STATE_DELETE_TCB

    12

    The TCP connection is in the delete TCB state that represents the deletion of the Transmission Control Block (TCB), a data structure used to maintain information on each TCP entry.

  • dwLocalAddr
    The address for the connection on the local device.
  • dwLocalPort
    The port number for the connection on the local device.
  • dwRemoteAddr
    The address for the connection on the remote device.
  • dwRemotePort
    The port number for the connection on the remote device.

Remarks

The port numbers are listed in the TCP table in network order.

The GetTcpTable function retrieves the IPv4 TCP connection table on the local device and returns this information in a MIB_TCPTABLE structure. An array of MIB_TCPROW structures are contained in the MIB_TCPTABLE structure. The MIB_TCPROW structure is also used by the SetTcpEntry function.

The dwState member indicates the state of the TCP entry in a TCP state diagram. A TCP connection progresses through a series of states during its lifetime. The states are as follows: LISTEN, SYN-SENT, SYN-RECEIVED, ESTABLISHED, FIN-WAIT-1, FIN-WAIT-2, CLOSE-WAIT, CLOSING, LAST-ACK, TIME-WAIT, and the fictional state CLOSED. The CLOSED state is fictional because it represents the state when there is no Transmission Control Block, and therefore, no connection. The TCP protocol is described in RFC 793.

The dwLocalAddr and dwRemoteAddr members are stored as a DWORD in the same format as the in_addr structure. In order to use the dwLocalAddr or dwRemoteAddr members, the ntohl or inet_ntoa functions in Windows Sockets or similar functions may be needed.

The dwLocalPort, and dwRemotePort members are in network byte order. In order to use the dwLocalPort or dwRemotePort members, the ntohs or inet_ntoa functions in Windows Sockets or similar functions may be needed.

The header file organization has changed. This structure is defined in the Tcpmib.h header file, not in the Iprtrmib.h header file. Be aware that the Tcpmib.h header file is automatically included in Iprtrmib.h, which is automatically included in the Iphlpapi.h header file. The Tcpmib.h and Iprtrmib.h header files should never be used directly.

Requirements

Header

iprtrmib.h,
ws2def.h,
ws2ipdef.h

See Also

Reference

MIB Structures
GetTcp6Table
GetTcp6Table2
GetTcpTable
GetTcpTable2
in_addr
inet_ntoa
IP Helper Structures
MIB_TCP6ROW
MIB_TCP6ROW2
MIB_TCP6TABLE
MIB_TCP6TABLE2
MIB_TCP6ROW2
MIB_TCPROW2
MIB_TCPTABLE
MIB_TCPTABLE2
ntohl
ntohs
SetTcpEntry