mirror of
https://github.com/reactos/reactos.git
synced 2024-10-05 08:54:40 +00:00
9f2f507057
0.4.15-dev-6256-g8ef47d2e5e
[NETSTAT] Optimize a bit (#5405) partially 0.4.15-dev-6245-g5ee97b9537
[NETSTAT] -b flag implies -o flag on Windows XP/2003. CORE-19006 (#5377) partially 0.4.15-dev-6211-g40864bc15c
[NETSTAT] Fix crash when parsing the protocol CORE-19005 (#5363) 0.4.15-dev-3338-g0e75fc9240
[NETSTAT] Fix coverity #1477187 "Double free" (#4069) CORE-17831 [I ported this double-free-fix earlier already into releases/0.4.13 & releases/0.4.14 and it didn't affect any older releases than that] partially 0.4.14-dev-479-g1fa2780796
[NETSTAT] Fix output formats 0.4.13-dev-584-g5e10c4ed32
[NETSTAT] ShowUdpTable(): Fix "tcp" copypasta (#1699) partially 0.4.13-dev-579-gb695971c7f
[NETSTAT] Simplify some code partially 0.4.13-dev-578-gab7dc56d6c
[NETSTAT] Formatting partially 0.4.13-dev-519-gdda5ec44b0
[NETSTAT] Simplify DoFormatMessage() (just the changed retval)
57 lines
1.8 KiB
C
57 lines
1.8 KiB
C
|
|
/* Maximum string lengths for ASCII ip address and port names */
|
|
#define HOSTNAMELEN 256
|
|
#define PORTNAMELEN 256
|
|
#define ADDRESSLEN HOSTNAMELEN+PORTNAMELEN
|
|
|
|
/* command line options */
|
|
BOOL bNoOptions = FALSE; // print default
|
|
BOOL bDoShowAllCons = FALSE; // -a
|
|
BOOL bDoShowProcName = FALSE; // -b
|
|
BOOL bDoShowEthStats = FALSE; // -e
|
|
BOOL bDoShowNumbers = FALSE; // -n
|
|
BOOL bDoShowProtoCons = FALSE; // -p
|
|
BOOL bDoShowRouteTable = FALSE; // -r
|
|
BOOL bDoShowProtoStats = FALSE; // -s
|
|
BOOL bDoShowProcessId = FALSE; // -o
|
|
BOOL bDoDispSeqComp = FALSE; // -v
|
|
BOOL bLoopOutput = FALSE; // interval
|
|
|
|
/* Undocumented extended information structures available only on XP and higher */
|
|
typedef struct {
|
|
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
|
|
DWORD dwProcessId;
|
|
} MIB_TCPEXROW, *PMIB_TCPEXROW;
|
|
|
|
typedef struct {
|
|
DWORD dwNumEntries;
|
|
MIB_TCPEXROW table;
|
|
} MIB_TCPEXTABLE, *PMIB_TCPEXTABLE;
|
|
|
|
typedef struct {
|
|
DWORD dwLocalAddr; // address on local computer
|
|
DWORD dwLocalPort; // port number on local computer
|
|
DWORD dwProcessId;
|
|
} MIB_UDPEXROW, *PMIB_UDPEXROW;
|
|
|
|
typedef struct {
|
|
DWORD dwNumEntries;
|
|
MIB_UDPEXROW table;
|
|
} MIB_UDPEXTABLE, *PMIB_UDPEXTABLE;
|
|
|
|
/* function declarations */
|
|
VOID ShowIpStatistics(VOID);
|
|
VOID ShowIcmpStatistics(VOID);
|
|
VOID ShowTcpStatistics(VOID);
|
|
VOID ShowUdpStatistics(VOID);
|
|
VOID ShowEthernetStatistics(VOID);
|
|
VOID ShowTcpTable(VOID);
|
|
VOID ShowUdpTable(VOID);
|
|
PCHAR GetPortName(UINT Port, PCSTR Proto, CHAR Name[PORTNAMELEN], INT NameLen);
|
|
PCHAR GetIpHostName(BOOL local, UINT ipaddr, CHAR name[HOSTNAMELEN], int namelen);
|
|
VOID Usage(VOID);
|