More work on winsock stack (ping is now working)
[reactos.git] / reactos / drivers / net / tditest / include / tditest.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TDI test driver
4 * FILE: include/tditest.h
5 * PURPOSE: Testing TDI drivers
6 */
7 #ifndef __TDITEST_H
8 #define __TDITEST_H
9
10 #ifdef _MSC_VER
11 #include <basetsd.h>
12 #include <ntddk.h>
13 #include <windef.h>
14 #include <tdikrnl.h>
15 #include <tdiinfo.h>
16 #else
17 #include <ddk/ntddk.h>
18 #include <net/tdikrnl.h>
19 #include <net/tdiinfo.h>
20 #endif
21
22 #include <debug.h>
23
24
25 /* Name of UDP device */
26 #define UDP_DEVICE_NAME L"\\Device\\Udp"
27 //#define UDP_DEVICE_NAME L"\\Device\\NTUdp"
28
29
30 #ifdef i386
31
32 /* DWORD network to host byte order conversion for i386 */
33 #define DN2H(dw) \
34 ((((dw) & 0xFF000000L) >> 24) | \
35 (((dw) & 0x00FF0000L) >> 8) | \
36 (((dw) & 0x0000FF00L) << 8) | \
37 (((dw) & 0x000000FFL) << 24))
38
39 /* DWORD host to network byte order conversion for i386 */
40 #define DH2N(dw) \
41 ((((dw) & 0xFF000000L) >> 24) | \
42 (((dw) & 0x00FF0000L) >> 8) | \
43 (((dw) & 0x0000FF00L) << 8) | \
44 (((dw) & 0x000000FFL) << 24))
45
46 /* WORD network to host order conversion for i386 */
47 #define WN2H(w) \
48 ((((w) & 0xFF00) >> 8) | \
49 (((w) & 0x00FF) << 8))
50
51 /* WORD host to network byte order conversion for i386 */
52 #define WH2N(w) \
53 ((((w) & 0xFF00) >> 8) | \
54 (((w) & 0x00FF) << 8))
55
56 #else /* i386 */
57
58 /* DWORD network to host byte order conversion for other architectures */
59 #define DN2H(dw) \
60 (dw)
61
62 /* DWORD host to network byte order conversion for other architectures */
63 #define DH2N(dw) \
64 (dw)
65
66 /* WORD network to host order conversion for other architectures */
67 #define WN2H(w) \
68 (w)
69
70 /* WORD host to network byte order conversion for other architectures */
71 #define WH2N(w) \
72 (w)
73
74 #endif /* i386 */
75
76
77 typedef struct IPSNMP_INFO {
78 ULONG Forwarding;
79 ULONG DefaultTTL;
80 ULONG InReceives;
81 ULONG InHdrErrors;
82 ULONG InAddrErrors;
83 ULONG ForwDatagrams;
84 ULONG InUnknownProtos;
85 ULONG InDiscards;
86 ULONG InDelivers;
87 ULONG OutRequests;
88 ULONG RoutingDiscards;
89 ULONG OutDiscards;
90 ULONG OutNoRoutes;
91 ULONG ReasmTimeout;
92 ULONG ReasmReqds;
93 ULONG ReasmOks;
94 ULONG ReasmFails;
95 ULONG FragOks;
96 ULONG FragFails;
97 ULONG FragCreates;
98 ULONG NumIf;
99 ULONG NumAddr;
100 ULONG NumRoutes;
101 } IPSNMP_INFO, *PIPSNMP_INFO;
102
103 typedef struct IPADDR_ENTRY {
104 ULONG Addr;
105 ULONG Index;
106 ULONG Mask;
107 ULONG BcastAddr;
108 ULONG ReasmSize;
109 USHORT Context;
110 USHORT Pad;
111 } IPADDR_ENTRY, *PIPADDR_ENTRY;
112
113
114 #define TL_INSTANCE 0
115
116 #define IP_MIB_STATS_ID 0x1
117 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102
118
119
120 /* IOCTL codes */
121 #define IOCTL_TCP_QUERY_INFORMATION_EX \
122 CTL_CODE(FILE_DEVICE_NETWORK, 0, METHOD_NEITHER, FILE_ANY_ACCESS)
123 #define IOCTL_TCP_SET_INFORMATION_EX \
124 CTL_CODE(FILE_DEVICE_NETWORK, 1, METHOD_BUFFERED, FILE_WRITE_ACCESS)
125
126
127 #define TEST_PORT 2000
128
129 #endif /*__TDITEST_H */
130
131 /* EOF */