1*c1245a89SJoachim Henze #pragma once
2c2c66affSColin Finck 
3c2c66affSColin Finck /* Maximum string lengths for ASCII ip address and port names */
4c2c66affSColin Finck #define HOSTNAMELEN     256
5c2c66affSColin Finck #define PORTNAMELEN     256
6c2c66affSColin Finck #define ADDRESSLEN      HOSTNAMELEN+PORTNAMELEN
7c2c66affSColin Finck 
8c2c66affSColin Finck /* command line options */
9c2c66affSColin Finck BOOL bNoOptions        = FALSE; // print default
10c2c66affSColin Finck BOOL bDoShowAllCons    = FALSE; // -a
11c2c66affSColin Finck BOOL bDoShowProcName   = FALSE; // -b
12c2c66affSColin Finck BOOL bDoShowEthStats   = FALSE; // -e
13c2c66affSColin Finck BOOL bDoShowNumbers    = FALSE; // -n
14*c1245a89SJoachim Henze BOOL bDoShowProcessId  = FALSE; // -o
15c2c66affSColin Finck BOOL bDoShowProtoCons  = FALSE; // -p
16c2c66affSColin Finck BOOL bDoShowRouteTable = FALSE; // -r
17c2c66affSColin Finck BOOL bDoShowProtoStats = FALSE; // -s
18c2c66affSColin Finck BOOL bDoDispSeqComp    = FALSE; // -v
19c2c66affSColin Finck BOOL bLoopOutput       = FALSE; // interval
20c2c66affSColin Finck 
21c2c66affSColin Finck /* Undocumented extended information structures available only on XP and higher */
22c2c66affSColin Finck typedef struct {
23c2c66affSColin Finck   DWORD dwState;        // state of the connection
24c2c66affSColin Finck   DWORD dwLocalAddr;    // address on local computer
25c2c66affSColin Finck   DWORD dwLocalPort;    // port number on local computer
26c2c66affSColin Finck   DWORD dwRemoteAddr;   // address on remote computer
27c2c66affSColin Finck   DWORD dwRemotePort;   // port number on remote computer
28c2c66affSColin Finck   DWORD dwProcessId;
29c2c66affSColin Finck } MIB_TCPEXROW, *PMIB_TCPEXROW;
30c2c66affSColin Finck 
31c2c66affSColin Finck typedef struct {
32c2c66affSColin Finck     DWORD dwNumEntries;
33c2c66affSColin Finck     MIB_TCPEXROW table;
34c2c66affSColin Finck } MIB_TCPEXTABLE, *PMIB_TCPEXTABLE;
35c2c66affSColin Finck 
36c2c66affSColin Finck typedef struct {
37c2c66affSColin Finck   DWORD   dwLocalAddr;    // address on local computer
38c2c66affSColin Finck   DWORD   dwLocalPort;    // port number on local computer
39c2c66affSColin Finck   DWORD   dwProcessId;
40c2c66affSColin Finck } MIB_UDPEXROW, *PMIB_UDPEXROW;
41c2c66affSColin Finck 
42c2c66affSColin Finck typedef struct {
43c2c66affSColin Finck     DWORD dwNumEntries;
44c2c66affSColin Finck     MIB_UDPEXROW table;
45c2c66affSColin Finck } MIB_UDPEXTABLE, *PMIB_UDPEXTABLE;
46c2c66affSColin Finck 
47c2c66affSColin Finck /* function declarations */
48c2c66affSColin Finck VOID ShowIpStatistics(VOID);
49c2c66affSColin Finck VOID ShowIcmpStatistics(VOID);
50c2c66affSColin Finck VOID ShowTcpStatistics(VOID);
51c2c66affSColin Finck VOID ShowUdpStatistics(VOID);
52c2c66affSColin Finck VOID ShowEthernetStatistics(VOID);
53b695971cSHermès Bélusca-Maïto BOOL ShowTcpTable(VOID);
54b695971cSHermès Bélusca-Maïto BOOL ShowUdpTable(VOID);
55ab7dc56dSHermès Bélusca-Maïto PCHAR GetPortName(UINT Port, PCSTR Proto, CHAR Name[], INT NameLen);
56ab7dc56dSHermès Bélusca-Maïto PCHAR GetIpHostName(BOOL Local, UINT IpAddr, CHAR Name[], INT NameLen);
57