[NTDLL]
[reactos.git] / reactos / base / applications / network / netstat / netstat.h
1
2 /* Maximum string lengths for ASCII ip address and port names */
3 #define HOSTNAMELEN 256
4 #define PORTNAMELEN 256
5 #define ADDRESSLEN HOSTNAMELEN+PORTNAMELEN
6
7 /* command line options */
8 BOOL bNoOptions = FALSE; // print default
9 BOOL bDoShowAllCons = FALSE; // -a
10 BOOL bDoShowProcName = FALSE; // -b
11 BOOL bDoShowEthStats = FALSE; // -e
12 BOOL bDoShowNumbers = FALSE; // -n
13 BOOL bDoShowProtoCons = FALSE; // -p
14 BOOL bDoShowRouteTable = FALSE; // -r
15 BOOL bDoShowProtoStats = FALSE; // -s
16 BOOL bDoDispSeqComp = FALSE; // -v
17 BOOL bLoopOutput = FALSE; // interval
18
19
20 /* Undocumented extended information structures available only on XP and higher */
21 typedef struct {
22 DWORD dwState; // state of the connection
23 DWORD dwLocalAddr; // address on local computer
24 DWORD dwLocalPort; // port number on local computer
25 DWORD dwRemoteAddr; // address on remote computer
26 DWORD dwRemotePort; // port number on remote computer
27 DWORD dwProcessId;
28 } MIB_TCPEXROW, *PMIB_TCPEXROW;
29
30 typedef struct {
31 DWORD dwNumEntries;
32 MIB_TCPEXROW table;
33 } MIB_TCPEXTABLE, *PMIB_TCPEXTABLE;
34
35 typedef struct {
36 DWORD dwLocalAddr; // address on local computer
37 DWORD dwLocalPort; // port number on local computer
38 DWORD dwProcessId;
39 } MIB_UDPEXROW, *PMIB_UDPEXROW;
40
41 typedef struct {
42 DWORD dwNumEntries;
43 MIB_UDPEXROW table;
44 } MIB_UDPEXTABLE, *PMIB_UDPEXTABLE;
45
46
47 /* function declerations */
48 BOOL ParseCmdline(int argc, char* argv[]);
49 BOOL DisplayOutput(VOID);
50 DWORD DoFormatMessage(DWORD ErrorCode);
51 VOID ShowIpStatistics(VOID);
52 VOID ShowIcmpStatistics(VOID);
53 VOID ShowTcpStatistics(VOID);
54 VOID ShowUdpStatistics(VOID);
55 VOID ShowEthernetStatistics(VOID);
56 VOID ShowTcpTable(VOID);
57 VOID ShowUdpTable(VOID);
58 PCHAR GetPortName(UINT Port, PCSTR Proto, CHAR Name[PORTNAMELEN], INT NameLen);
59 PCHAR GetIpHostName(BOOL local, UINT ipaddr, CHAR name[HOSTNAMELEN], int namelen);
60 VOID Usage(VOID);
61