Add .gitattributes and .gitignore files and normalize line endings in the repository...
[reactos.git] / sdk / include / psdk / tcpioctl.h
1 /*
2 * tcpioctl.h
3 *
4 * Set and query ioctl constants for tcpip.sys
5 *
6 * Contributors:
7 * Created by Art Yerkes (ayerkes@speakeasy.net) from
8 * drivers/net/tcpip/include/ticonsts.h
9 *
10 * THIS SOFTWARE IS NOT COPYRIGHTED
11 *
12 * This source code is offered for use in the public domain. You may
13 * use, modify or distribute it freely.
14 *
15 * This code is distributed in the hope that it will be useful but
16 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
17 * DISCLAIMED. This includes but is not limited to warranties of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 *
20 */
21
22 #ifndef _TCPIOCTL_H
23 #define _TCPIOCTL_H
24
25 #define DD_TCP_DEVICE_NAME L"\\Device\\Tcp"
26
27 /* TCP/UDP/RawIP IOCTL code definitions */
28
29 #define FSCTL_TCP_BASE FILE_DEVICE_NETWORK
30
31 #define _TCP_CTL_CODE(Function, Method, Access) \
32 CTL_CODE(FSCTL_TCP_BASE, Function, Method, Access)
33
34 #define IOCTL_TCP_QUERY_INFORMATION_EX \
35 _TCP_CTL_CODE(0, METHOD_NEITHER, FILE_ANY_ACCESS)
36
37 #define IOCTL_TCP_SET_INFORMATION_EX \
38 _TCP_CTL_CODE(1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
39
40 #define IOCTL_QUERY_IP_HW_ADDRESS \
41 _TCP_CTL_CODE(15, METHOD_BUFFERED, FILE_ANY_ACCESS)
42
43 #define IOCTL_SET_IP_ADDRESS \
44 _TCP_CTL_CODE(14, METHOD_BUFFERED, FILE_WRITE_ACCESS)
45
46 #define IOCTL_DELETE_IP_ADDRESS \
47 _TCP_CTL_CODE(16, METHOD_BUFFERED, FILE_WRITE_ACCESS)
48
49 #define IF_MIB_STATS_ID 1
50 #define IP_MIB_STATS_ID 1
51 #define IP_MIB_ARPTABLE_ENTRY_ID 0x101
52 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
53 #define IP_INTFC_INFO_ID 0x103
54 #define MAX_PHYSADDR_SIZE 8
55
56 /* Address Object Options */
57 #define AO_OPTION_TTL 1
58 #define AO_OPTION_MCASTTTL 2
59 #define AO_OPTION_MCASTIF 3
60 #define AO_OPTION_XSUM 4
61 #define AO_OPTION_IPOPTIONS 5
62 #define AO_OPTION_ADD_MCAST 6
63 #define AO_OPTION_DEL_MCAST 7
64 #define AO_OPTION_TOS 8
65 #define AO_OPTION_IP_DONTFRAGMENT 9
66 #define AO_OPTION_MCASTLOOP 10
67 #define AO_OPTION_BROADCAST 11
68 #define AO_OPTION_IP_HDRINCL 12
69 #define AO_OPTION_RCVALL 13
70 #define AO_OPTION_RCVALL_MCAST 14
71 #define AO_OPTION_RCVALL_IGMPMCAST 15
72 #define AO_OPTION_UNNUMBEREDIF 16
73 #define AO_OPTION_IP_UCASTIF 17
74 #define AO_OPTION_ABSORB_RTRALERT 18
75 #define AO_OPTION_LIMIT_BCASTS 19
76 #define AO_OPTION_INDEX_BIND 20
77 #define AO_OPTION_INDEX_MCASTIF 21
78 #define AO_OPTION_INDEX_ADD_MCAST 22
79 #define AO_OPTION_INDEX_DEL_MCAST 23
80 #define AO_OPTION_IFLIST 24
81 #define AO_OPTION_ADD_IFLIST 25
82 #define AO_OPTION_DEL_IFLIST 26
83 #define AO_OPTION_IP_PKTINFO 27
84 #define AO_OPTION_ADD_MCAST_SRC 28
85 #define AO_OPTION_DEL_MCAST_SRC 29
86 #define AO_OPTION_MCAST_FILTER 30
87 #define AO_OPTION_BLOCK_MCAST_SRC 31
88 #define AO_OPTION_UNBLOCK_MCAST_SRC 32
89 #define AO_OPTION_UDP_CKSUM_COVER 33
90 #define AO_OPTION_WINDOW 34
91 #define AO_OPTION_SCALE_CWIN 35
92 #define AO_OPTION_RCV_HOPLIMIT 36
93 #define AO_OPTION_UNBIND 37
94 #define AO_OPTION_PROTECT 38
95
96 /* TCP connection options */
97 #define TCP_SOCKET_NODELAY 1
98
99 typedef struct IFEntry
100 {
101 ULONG if_index;
102 ULONG if_type;
103 ULONG if_mtu;
104 ULONG if_speed;
105 ULONG if_physaddrlen;
106 UCHAR if_physaddr[MAX_PHYSADDR_SIZE];
107 ULONG if_adminstatus;
108 ULONG if_operstatus;
109 ULONG if_lastchange;
110 ULONG if_inoctets;
111 ULONG if_inucastpkts;
112 ULONG if_innucastpkts;
113 ULONG if_indiscards;
114 ULONG if_inerrors;
115 ULONG if_inunknownprotos;
116 ULONG if_outoctets;
117 ULONG if_outucastpkts;
118 ULONG if_outnucastpkts;
119 ULONG if_outdiscards;
120 ULONG if_outerrors;
121 ULONG if_outqlen;
122 ULONG if_descrlen;
123 UCHAR if_descr[1];
124 } IFEntry;
125
126 typedef struct IPSNMPInfo
127 {
128 ULONG ipsi_forwarding;
129 ULONG ipsi_defaultttl;
130 ULONG ipsi_inreceives;
131 ULONG ipsi_inhdrerrors;
132 ULONG ipsi_inaddrerrors;
133 ULONG ipsi_forwdatagrams;
134 ULONG ipsi_inunknownprotos;
135 ULONG ipsi_indiscards;
136 ULONG ipsi_indelivers;
137 ULONG ipsi_outrequests;
138 ULONG ipsi_routingdiscards;
139 ULONG ipsi_outdiscards;
140 ULONG ipsi_outnoroutes;
141 ULONG ipsi_reasmtimeout;
142 ULONG ipsi_reasmreqds;
143 ULONG ipsi_reasmoks;
144 ULONG ipsi_reasmfails;
145 ULONG ipsi_fragoks;
146 ULONG ipsi_fragfails;
147 ULONG ipsi_fragcreates;
148 ULONG ipsi_numif;
149 ULONG ipsi_numaddr;
150 ULONG ipsi_numroutes;
151 } IPSNMPInfo;
152
153 typedef struct IPAddrEntry
154 {
155 ULONG iae_addr;
156 ULONG iae_index;
157 ULONG iae_mask;
158 ULONG iae_bcastaddr;
159 ULONG iae_reasmsize;
160 USHORT iae_context;
161 USHORT iae_pad;
162 } IPAddrEntry;
163
164 typedef struct IPInterfaceInfo
165 {
166 ULONG iii_flags;
167 ULONG iii_mtu;
168 ULONG iii_speed;
169 ULONG iii_addrlength;
170 UCHAR iii_addr[1];
171 } IPInterfaceInfo;
172
173 #endif/*_TCPIOCTL_H*/