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
11 * Copyright 2000 James Hatheway
13 * This library is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU Lesser General Public
15 * License as published by the Free Software Foundation; either
16 * version 2.1 of the License, or (at your option) any later version.
18 * This library is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * Lesser General Public License for more details.
23 * You should have received a copy of the GNU Lesser General Public
24 * License along with this library; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #ifndef WSCONTROL_H_INCLUDED
29 #define WSCONTROL_H_INCLUDED
31 typedef unsigned char uchar
; /* This doesn't seem to be in any standard headers */
33 #define WSCTL_SUCCESS 0
36 * TCP/IP action codes.
38 #define WSCNTL_TCPIP_QUERY_INFO 0x00000000
39 #define WSCNTL_TCPIP_SET_INFO 0x00000001
40 #define WSCNTL_TCPIP_ICMP_ECHO 0x00000002
41 #define WSCNTL_TCPIP_TEST 0x00000003
44 /* Structure of an entity ID */
45 typedef struct TDIEntityID
47 unsigned long tei_entity
;
48 unsigned long tei_instance
;
51 /* Structure of an object ID */
52 typedef struct TDIObjectID
54 TDIEntityID toi_entity
;
55 unsigned long toi_class
;
56 unsigned long toi_type
;
60 typedef struct IPSNMPInfo
62 unsigned long ipsi_forwarding
;
63 unsigned long ipsi_defaultttl
;
64 unsigned long ipsi_inreceives
;
65 unsigned long ipsi_inhdrerrors
;
66 unsigned long ipsi_inaddrerrors
;
67 unsigned long ipsi_forwdatagrams
;
68 unsigned long ipsi_inunknownprotos
;
69 unsigned long ipsi_indiscards
;
70 unsigned long ipsi_indelivers
;
71 unsigned long ipsi_outrequests
;
72 unsigned long ipsi_routingdiscards
;
73 unsigned long ipsi_outdiscards
;
74 unsigned long ipsi_outnoroutes
;
75 unsigned long ipsi_reasmtimeout
;
76 unsigned long ipsi_reasmreqds
;
77 unsigned long ipsi_reasmoks
;
78 unsigned long ipsi_reasmfails
;
79 unsigned long ipsi_fragoks
;
80 unsigned long ipsi_fragfails
;
81 unsigned long ipsi_fragcreates
;
82 unsigned long ipsi_numif
;
83 unsigned long ipsi_numaddr
;
84 unsigned long ipsi_numroutes
;
87 typedef struct IPAddrEntry
89 unsigned long iae_addr
;
90 unsigned long iae_index
;
91 unsigned long iae_mask
;
92 unsigned long iae_bcastaddr
;
93 unsigned long iae_reasmsize
;
108 #define MAX_PHYSADDR_SIZE 8
109 #define MAX_IFDESCR_LEN 256
110 typedef struct IFEntry
112 unsigned long if_index
;
113 unsigned long if_type
;
114 unsigned long if_mtu
;
115 unsigned long if_speed
;
116 unsigned long if_physaddrlen
;
117 uchar if_physaddr
[MAX_PHYSADDR_SIZE
];
118 unsigned long if_adminstatus
;
119 unsigned long if_operstatus
;
120 unsigned long if_lastchange
;
121 unsigned long if_inoctets
;
122 unsigned long if_inucastpkts
;
123 unsigned long if_innucastpkts
;
124 unsigned long if_indiscards
;
125 unsigned long if_inerrors
;
126 unsigned long if_inunknownprotos
;
127 unsigned long if_outoctets
;
128 unsigned long if_outucastpkts
;
129 unsigned long if_outnucastpkts
;
130 unsigned long if_outdiscards
;
131 unsigned long if_outerrors
;
132 unsigned long if_outqlen
;
133 unsigned long if_descrlen
;
138 /* FIXME: real name and definition of this struct that contains
139 * an IP route table entry is unknown */
140 typedef struct IPRouteEntry
{
141 unsigned long ire_addr
;
142 unsigned long ire_index
; /*matches if_index in IFEntry and iae_index in IPAddrEntry */
143 unsigned long ire_metric
;
144 unsigned long ire_option4
;
145 unsigned long ire_option5
;
146 unsigned long ire_option6
;
147 unsigned long ire_gw
;
148 unsigned long ire_option8
;
149 unsigned long ire_option9
;
150 unsigned long ire_option10
;
151 unsigned long ire_mask
;
152 unsigned long ire_option12
;
156 /* Not sure what EXACTLY most of this stuff does.
157 WsControl was implemented mainly by observing
158 its behaviour in Win98 ************************/
159 #define INFO_CLASS_GENERIC 0x100
160 #define INFO_CLASS_PROTOCOL 0x200
161 #define INFO_TYPE_PROVIDER 0x100
162 #define ENTITY_LIST_ID 0
163 #define CL_NL_ENTITY 0x301
164 #define IF_ENTITY 0x200
165 #define ENTITY_TYPE_ID 1
166 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
167 #define IP_MIB_ROUTETABLE_ENTRY_ID 0x101 /* FIXME: not real name */
168 /************************************************/
170 /* Valid values to get back from entity type ID query */
171 #define CO_TL_NBF 0x400 /* Entity implements NBF prot. */
172 #define CO_TL_SPX 0x402 /* Entity implements SPX prot. */
173 #define CO_TL_TCP 0x404 /* Entity implements TCP prot. */
174 #define CO_TL_SPP 0x406 /* Entity implements SPP prot. */
175 #define CL_TL_NBF 0x401 /* CL NBF protocol */
176 #define CL_TL_UDP 0x403 /* Entity implements UDP */
177 #define ER_ICMP 0x380 /* The ICMP protocol */
178 #define CL_NL_IPX 0x301 /* Entity implements IPX */
179 #define CL_NL_IP 0x303 /* Entity implements IP */
180 #define AT_ARP 0x280 /* Entity implements ARP */
181 #define AT_NULL 0x282 /* Entity does no address */
182 #define IF_GENERIC 0x200 /* Generic interface */
183 #define IF_MIB 0x202 /* Supports MIB-2 interface */
186 #endif /* WSCONTROL_H_INCLUDED */