MIB_TCP6ROW2 structure (tcpmib.h)
The MIB_TCP6ROW2 structure contains information that describes an IPv6 TCP connection.
Syntax
typedef struct _MIB_TCP6ROW2 {
IN6_ADDR LocalAddr;
DWORD dwLocalScopeId;
DWORD dwLocalPort;
IN6_ADDR RemoteAddr;
DWORD dwRemoteScopeId;
DWORD dwRemotePort;
MIB_TCP_STATE State;
DWORD dwOwningPid;
TCP_CONNECTION_OFFLOAD_STATE dwOffloadState;
} MIB_TCP6ROW2, *PMIB_TCP6ROW2;
Members
LocalAddr
Type: IN6_ADDR
The local IPv6 address for the TCP connection on the local computer. A value of zero indicates the listener can accept a connection on any interface.
dwLocalScopeId
Type: DWORD
The local scope ID for the TCP connection on the local computer.
dwLocalPort
Type: DWORD
The local port number in network byte order for the TCP connection on the local computer.
The maximum size of an IP port number is 16 bits, so only the lower 16 bits should be used. The upper 16 bits may contain uninitialized data.
RemoteAddr
Type: IN6_ADDR
The IPv6 address for the TCP connection on the remote computer. When the State member is MIB_TCP_STATE_LISTEN, this value has no meaning.
dwRemoteScopeId
Type: DWORD
The remote scope ID for the TCP connection on the remote computer. When the State member is MIB_TCP_STATE_LISTEN, this value has no meaning.
dwRemotePort
Type: DWORD
The remote port number in network byte order for the TCP connection on the remote computer. When the State member is MIB_TCP_STATE_LISTEN, this value has no meaning.
The maximum size of an IP port number is 16 bits, so only the lower 16 bits should be used. The upper 16 bits may contain uninitialized data.
State
Type: MIB_TCP_STATE
The state of the TCP connection. This member can be one of the values from the MIB_TCP_STATE enumeration type defined in the Tcpmib.h header file.
dwOwningPid
Type: DWORD
The PID of the process that issued a context bind for this TCP connection.
dwOffloadState
Type: TCP_CONNECTION_OFFLOAD_STATE
The offload state for this TCP connection. This parameter can be one of the enumeration values for the TCP_CONNECTION_OFFLOAD_STATE defined in the Tcpmib.h header.
Remarks
The MIB_TCP6ROW2 structure is defined on Windows Vista and later.
The GetTcp6Table2 function retrieves the IPv6 TCP connection table on the local computer and returns this information in a MIB_TCP6TABLE2 structure.
An array of MIB_TCP6ROW2 structures are contained in the MIB_TCP6TABLE2 structure.
The State 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: 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. For more information, see http://www.ietf.org/rfc/rfc793.txt.
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 dwLocalScopeId, and dwRemoteScopeId members are in network byte order. In order to use the dwLocalScopeId or dwRemoteScopeId members, the ntohl or inet_ntoa functions in Windows Sockets or similar functions may be needed.
The LocalAddr and RemoteAddr members are stored in in6_addr structures. The RtlIpv6AddressToString or RtlIpv6AddressToStringEx functions may be used to convert the IPv6 address in the LocalAddr or RemoteAddr members to a string without loading the Windows Sockets DLL.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Header | tcpmib.h (include Iphlpapi.h) |