3 * This header file includes #defines, structure and type definitions,
4 * and function declarations that support the implementation of the
5 * (undocumented) Winsock 1 call WsControl.
7 * The functionality of WsControl was created by observing its behaviour
8 * in Windows 98, so there are likely to be bugs with the assumptions
12 #ifndef WSCONTROL_H_INCLUDED
13 #define WSCONTROL_H_INCLUDED
15 typedef unsigned char uchar
; /* This doesn't seem to be in any standard headers */
17 #define WSCTL_SUCCESS 0
18 #define PROCFS_NETDEV_FILE "/proc/net/dev" /* Points to the file in the /proc fs
19 that lists the network devices.
20 Do we need an #ifdef LINUX for this? */
22 /* WsControl Helper Functions */
23 int WSCNTL_GetInterfaceCount(void); /* Obtains the number of network interfaces */
24 int WSCNTL_GetInterfaceName(int, char *); /* Obtains the name of an interface */
25 int WSCNTL_GetTransRecvStat(int intNumber
, ulong
*transBytes
, ulong
*recvBytes
); /* Obtains bytes
26 recv'd/trans by interface */
29 * TCP/IP action codes.
31 #define WSCNTL_TCPIP_QUERY_INFO 0x00000000
32 #define WSCNTL_TCPIP_SET_INFO 0x00000001
33 #define WSCNTL_TCPIP_ICMP_ECHO 0x00000002
34 #define WSCNTL_TCPIP_TEST 0x00000003
37 /* Structure of an entity ID */
38 typedef struct TDIEntityID
44 /* Structure of an object ID */
45 typedef struct TDIObjectID
47 TDIEntityID toi_entity
;
53 typedef struct IPSNMPInfo
55 ulong ipsi_forwarding
;
56 ulong ipsi_defaultttl
;
57 ulong ipsi_inreceives
;
58 ulong ipsi_inhdrerrors
;
59 ulong ipsi_inaddrerrors
;
60 ulong ipsi_forwdatagrams
;
61 ulong ipsi_inunknownprotos
;
62 ulong ipsi_indiscards
;
63 ulong ipsi_indelivers
;
64 ulong ipsi_outrequests
;
65 ulong ipsi_routingdiscards
;
66 ulong ipsi_outdiscards
;
67 ulong ipsi_outnoroutes
;
68 ulong ipsi_reasmtimeout
;
69 ulong ipsi_reasmreqds
;
71 ulong ipsi_reasmfails
;
74 ulong ipsi_fragcreates
;
80 typedef struct IPAddrEntry
92 #define MAX_PHYSADDR_SIZE 8
93 #define MAX_IFDESCR_LEN 256
94 typedef struct IFEntry
100 ulong if_physaddrlen
;
101 uchar if_physaddr
[MAX_PHYSADDR_SIZE
];
102 ulong if_adminstatus
;
106 ulong if_inucastpkts
;
107 ulong if_innucastpkts
;
110 ulong if_inunknownprotos
;
112 ulong if_outucastpkts
;
113 ulong if_outnucastpkts
;
114 ulong if_outdiscards
;
122 /* Not sure what EXACTLY most of this stuff does.
123 WsControl was implemented mainly by observing
124 its behaviour in Win98 ************************/
125 #define INFO_CLASS_GENERIC 0x100
126 #define INFO_CLASS_PROTOCOL 0x200
127 #define INFO_TYPE_PROVIDER 0x100
128 #define ENTITY_LIST_ID 0
129 #define CL_NL_ENTITY 0x301
130 #define IF_ENTITY 0x200
131 #define ENTITY_TYPE_ID 1
132 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
133 /************************************************/
135 /* Valid values to get back from entity type ID query */
136 #define CO_TL_NBF 0x400 /* Entity implements NBF prot. */
137 #define CO_TL_SPX 0x402 /* Entity implements SPX prot. */
138 #define CO_TL_TCP 0x404 /* Entity implements TCP prot. */
139 #define CO_TL_SPP 0x406 /* Entity implements SPP prot. */
140 #define CL_TL_NBF 0x401 /* CL NBF protocol */
141 #define CL_TL_UDP 0x403 /* Entity implements UDP */
142 #define ER_ICMP 0x380 /* The ICMP protocol */
143 #define CL_NL_IPX 0x301 /* Entity implements IPX */
144 #define CL_NL_IP 0x303 /* Entity implements IP */
145 #define AT_ARP 0x280 /* Entity implements ARP */
146 #define AT_NULL 0x282 /* Entity does no address */
147 #define IF_GENERIC 0x200 /* Generic interface */
148 #define IF_MIB 0x202 /* Supports MIB-2 interface */
151 #endif /* WSCONTROL_H_INCLUDED */