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 #include <ntddk.h> 11 #include <tdikrnl.h> 12 #include <tdiinfo.h> 13 #include "debug.h" 14 15 16 /* Name of UDP device */ 17 #define UDP_DEVICE_NAME L"\\Device\\Udp" 18 19 #ifdef i386 20 21 /* DWORD network to host byte order conversion for i386 */ 22 #define DN2H(dw) \ 23 ((((dw) & 0xFF000000L) >> 24) | \ 24 (((dw) & 0x00FF0000L) >> 8) | \ 25 (((dw) & 0x0000FF00L) << 8) | \ 26 (((dw) & 0x000000FFL) << 24)) 27 28 /* DWORD host to network byte order conversion for i386 */ 29 #define DH2N(dw) \ 30 ((((dw) & 0xFF000000L) >> 24) | \ 31 (((dw) & 0x00FF0000L) >> 8) | \ 32 (((dw) & 0x0000FF00L) << 8) | \ 33 (((dw) & 0x000000FFL) << 24)) 34 35 /* WORD network to host order conversion for i386 */ 36 #define WN2H(w) \ 37 ((((w) & 0xFF00) >> 8) | \ 38 (((w) & 0x00FF) << 8)) 39 40 /* WORD host to network byte order conversion for i386 */ 41 #define WH2N(w) \ 42 ((((w) & 0xFF00) >> 8) | \ 43 (((w) & 0x00FF) << 8)) 44 45 #else /* i386 */ 46 47 /* DWORD network to host byte order conversion for other architectures */ 48 #define DN2H(dw) \ 49 (dw) 50 51 /* DWORD host to network byte order conversion for other architectures */ 52 #define DH2N(dw) \ 53 (dw) 54 55 /* WORD network to host order conversion for other architectures */ 56 #define WN2H(w) \ 57 (w) 58 59 /* WORD host to network byte order conversion for other architectures */ 60 #define WH2N(w) \ 61 (w) 62 63 #endif /* i386 */ 64 65 66 typedef struct IPSNMP_INFO { 67 ULONG Forwarding; 68 ULONG DefaultTTL; 69 ULONG InReceives; 70 ULONG InHdrErrors; 71 ULONG InAddrErrors; 72 ULONG ForwDatagrams; 73 ULONG InUnknownProtos; 74 ULONG InDiscards; 75 ULONG InDelivers; 76 ULONG OutRequests; 77 ULONG RoutingDiscards; 78 ULONG OutDiscards; 79 ULONG OutNoRoutes; 80 ULONG ReasmTimeout; 81 ULONG ReasmReqds; 82 ULONG ReasmOks; 83 ULONG ReasmFails; 84 ULONG FragOks; 85 ULONG FragFails; 86 ULONG FragCreates; 87 ULONG NumIf; 88 ULONG NumAddr; 89 ULONG NumRoutes; 90 } IPSNMP_INFO, *PIPSNMP_INFO; 91 92 typedef struct IPADDR_ENTRY { 93 ULONG Addr; 94 ULONG Index; 95 ULONG Mask; 96 ULONG BcastAddr; 97 ULONG ReasmSize; 98 USHORT Context; 99 USHORT Pad; 100 } IPADDR_ENTRY, *PIPADDR_ENTRY; 101 102 103 #define TL_INSTANCE 0 104 105 #define IP_MIB_STATS_ID 0x1 106 #define IP_MIB_ADDRTABLE_ENTRY_ID 0x102 107 108 109 /* IOCTL codes */ 110 #define IOCTL_TCP_QUERY_INFORMATION_EX \ 111 CTL_CODE(FILE_DEVICE_NETWORK, 0, METHOD_NEITHER, FILE_ANY_ACCESS) 112 #define IOCTL_TCP_SET_INFORMATION_EX \ 113 CTL_CODE(FILE_DEVICE_NETWORK, 1, METHOD_BUFFERED, FILE_WRITE_ACCESS) 114 115 116 #define TEST_PORT 2000 117 118 #endif /*__TDITEST_H */ 119 120 /* EOF */ 121 122