reactos/base/applications/network/netstat/netstat.h
Joachim Henze c1245a897f
[NETSTAT] pragma once, reorder, fix pl-PL.rc (#5407)
- add a pragma once into the header
- order -o options alphabetically also for the global variables, not only in usage-help
- pl-PL.rc: fix wrong alignment of IDS_ETHERNET_THEADER and its data
- pl-PL.rc: also don't pad the data with 2 spaces here in the beginning, which
            we don't do in any other locale, and MS netstat also doesn't do that here.
            pl-PL.rc most likely got this wrong because it was created while en-US wasn't finished yet.
2023-07-06 18:19:30 +02:00

57 lines
1.8 KiB
C

#pragma once
/* 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 bDoShowProcessId = FALSE; // -o
BOOL bDoShowProtoCons = FALSE; // -p
BOOL bDoShowRouteTable = FALSE; // -r
BOOL bDoShowProtoStats = FALSE; // -s
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);
BOOL ShowTcpTable(VOID);
BOOL ShowUdpTable(VOID);
PCHAR GetPortName(UINT Port, PCSTR Proto, CHAR Name[], INT NameLen);
PCHAR GetIpHostName(BOOL Local, UINT IpAddr, CHAR Name[], INT NameLen);