GetTcpTable
<script src="../langref.js"></script>
GetTcpTable
The GetTcpTable function retrieves the TCP connection table.
DWORD GetTcpTable( PMIB_TCPTABLE pTcpTable , // buffer for the connection table PDWORD pdwSize , // size of the buffer BOOL bOrder // sort the table? );
Parameters
-
pTcpTable
- [out] Pointer to a buffer that receives the TCP connection table as a MIB_TCPTABLE structure. pdwSize
-
[in, out] On input, specifies the size of the buffer pointed to by the
pTcpTable parameter.
On output, if the buffer is not large enough to hold the returned connection table, the function sets this parameter equal to the required buffer size.
bOrder
-
[in] Specifies whether the connection table should be sorted. If this parameter is TRUE, the table is sorted in the order of:
- Local IP address
- Local port
- Remote IP address
- Remote port
Return Values
If the function succeeds, the return value is NO_ERROR.
If the function fails, use FormatMessage to obtain the message string for the returned error.
Requirements
Windows NT/2000 or later: Requires Windows NT 4.0 SP4 or later.
Windows 95/98/Me: Requires Windows 98 or later.
Header: Declared in Iphlpapi.h.
Library: Use Iphlpapi.lib.
MIB_TCPTABLE <script src="../langref.js"></script>
MIB_TCPTABLE
The MIB_TCPTABLE structure contains a table of TCP connections.
typedef struct _MIB_TCPTABLE { DWORD dwNumEntries ; // number of entries in the table MIB_TCPROW table [ANY_SIZE]; // array of TCP connections } MIB_TCPTABLE, *PMIB_TCPTABLE;
Members
-
dwNumEntries
- Specifies the number of entries in the table. table[ANY_SIZE]
- Pointer to a table of TCP connections implemented as an array of MIB_TCPROW structures.
-
-
-
MIB_TCPROW
<script src="../langref.js"></script>
MIB_TCPROW
The MIB_TCPROW structure contains information for a TCP connection.
typedef struct _MIB_TCPROW { DWORD dwState ; // state of the connection DWORD dwLocalAddr ; // address on local computer DWORD dwLocalPort ; // port number on local computer DWORD dwRemoteAddr ; // address on remote computer DWORD dwRemotePort ; // port number on remote computer } MIB_TCPROW, *PMIB_TCPROW;
Members
-
dwState
-
Specifies the state of the TCP connection. This member can have one of the following values.
Value Description MIB_TCP_STATE_CLOSED To be determined. MIB_TCP_STATE_LISTEN To be determined. MIB_TCP_STATE_SYN_SENT To be determined. MIB_TCP_STATE_SYN_RCVD To be determined. MIB_TCP_STATE_ESTAB To be determined. MIB_TCP_STATE_FIN_WAIT1 To be determined. MIB_TCP_STATE_FIN_WAIT2 To be determined. MIB_TCP_STATE_CLOSE_WAIT To be determined. MIB_TCP_STATE_CLOSING To be determined. MIB_TCP_STATE_LAST_ACK To be determined. MIB_TCP_STATE_TIME_WAIT To be determined. MIB_TCP_STATE_DELETE_TCB Transmission Control Block (TCB) deleted.
dwLocalAddr
- Specifies the address for the connection on the local computer. dwLocalPort
- Specifies the port number for the connection on the local computer. dwRemoteAddr
- Specifies the address for the connection on the remote computer. dwRemotePort
- Specifies the port number the connection on the remote computer.
-
-
-
Specifies the state of the TCP connection. This member can have one of the following values.
GetUdpTable
<script src="../langref.js"></script>
GetUdpTable
The GetUdpTable function retrieves the User Datagram Protocol (UDP) listener table.
DWORD GetUdpTable( PMIB_UDPTABLE pUdpTable , // buffer for the listener table PDWORD pdwSize , // size of buffer BOOL bOrder // sort the table? );
Parameters
-
pUdpTable
- [out] Pointer to a buffer that receives the UDP listener table as a MIB_UDPTABLE structure. pdwSize
-
[in, out] On input, specifies the size of the buffer pointed to by the
pUdpTable parameter.
On output, if the buffer is not large enough to hold the returned listener table, the function sets this parameter equal to the required buffer size.
bOrder
-
[in] Specifies whether the returned table should be sorted. If this parameter is TRUE, the table is sorted in the order of:
- IP address
- Port
Return Values
If the function succeeds, the return value is NO_ERROR.
If the function fails, use FormatMessage to obtain the message string for the returned error.
Requirements
Windows NT/2000 or later: Requires Windows NT 4.0 SP4 or later.
Windows 95/98/Me: Requires Windows 98 or later.
Header: Declared in Iphlpapi.h.
Library: Use Iphlpapi.lib.
MIB_UDPTABLE <script src="../langref.js"></script>
MIB_UDPTABLE
The MIB_UDPTABLE structure contains a table of MIB_UDPROW structures.
typedef struct _MIB_UDPTABLE { DWORD dwNumEntries ; // number of entries in the table MIB_UDPROW table [ANY_SIZE]; // table of MIB_UDPROW structs } MIB_UDPTABLE, *PMIB_UDPTABLE;
Members
-
dwNumEntries
- Specifies the number of entries in the table. table[ANY_SIZE]
- Pointer to an array of MIB_UDPROW structures.
-
-
-
MIB_UDPROW
<script src="../langref.js"></script>
MIB_UDPROW
The MIB_UDPROW structure contains address information for sending and receiving User Datagram Protocol (UDP) datagrams.
typedef struct _MIB_UDPROW { DWORD dwLocalAddr ; // IP address on local computer DWORD dwLocalPort ; // port number on local computer } MIB_UDPROW, *PMIB_UDPROW;
Members
-
dwLocalAddr
- Specifies the IP address on the local computer. dwLocalPort
- Specifies the port number on the local computer.