Adds an initial WSAIoctl function with support for only the
[wine.git] / dlls / wsock32 / wscontrol.h
blob65e9a7315b01706582b890a32ed2a5c2489a0a3d
1 /* wscontrol.h
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
9 * that were made.
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
40 ulong tei_entity;
41 ulong tei_instance;
42 } TDIEntityID;
44 /* Structure of an object ID */
45 typedef struct TDIObjectID
47 TDIEntityID toi_entity;
48 ulong toi_class;
49 ulong toi_type;
50 ulong toi_id;
51 } TDIObjectID;
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;
70 ulong ipsi_reasmoks;
71 ulong ipsi_reasmfails;
72 ulong ipsi_fragoks;
73 ulong ipsi_fragfails;
74 ulong ipsi_fragcreates;
75 ulong ipsi_numif;
76 ulong ipsi_numaddr;
77 ulong ipsi_numroutes;
78 } IPSNMPInfo;
80 typedef struct IPAddrEntry
82 ulong iae_addr;
83 ulong iae_index;
84 ulong iae_mask;
85 ulong iae_bcastaddr;
86 ulong iae_reasmsize;
87 ushort iae_context;
88 ushort iae_pad;
89 } IPAddrEntry;
92 #define MAX_PHYSADDR_SIZE 8
93 #define MAX_IFDESCR_LEN 256
94 typedef struct IFEntry
96 ulong if_index;
97 ulong if_type;
98 ulong if_mtu;
99 ulong if_speed;
100 ulong if_physaddrlen;
101 uchar if_physaddr[MAX_PHYSADDR_SIZE];
102 ulong if_adminstatus;
103 ulong if_operstatus;
104 ulong if_lastchange;
105 ulong if_inoctets;
106 ulong if_inucastpkts;
107 ulong if_innucastpkts;
108 ulong if_indiscards;
109 ulong if_inerrors;
110 ulong if_inunknownprotos;
111 ulong if_outoctets;
112 ulong if_outucastpkts;
113 ulong if_outnucastpkts;
114 ulong if_outdiscards;
115 ulong if_outerrors;
116 ulong if_outqlen;
117 ulong if_descrlen;
118 uchar if_descr[1];
119 } IFEntry;
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 */