2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/tcpip.h
5 * PURPOSE: TCP/IP protocol driver definitions
6 * NOTES: Spin lock acquire order:
7 * - Net table list lock
9 * - Interface list lock
11 * - Neighbor cache lock
25 #include <ddk/ntddk.h>
27 #include <ddk/tdikrnl.h>
28 #include <ddk/tdiinfo.h>
34 /* Define _NTTEST_ to make test version. Device names are prefixed with
35 'NT' to allow the driver to run side by side with MS TCP/IP driver */
38 /* FIXME: The following should be moved to ntddk.h or tdi headers */
41 #ifndef IO_NETWORK_INCREMENT
42 #define IO_NETWORK_INCREMENT 2
48 /* EXPORTED is already defined ddk/defines.h */
49 #define EXPORTED __declspec(dllexport)
60 #define MIN(value1, value2) \
61 ((value1 < value2)? value1 : value2)
63 #define MAX(value1, value2) \
64 ((value1 > value2)? value1 : value2)
66 #define NDIS_BUFFER_TAG FOURCC('n','b','u','f')
67 #define NDIS_PACKET_TAG FOURCC('n','p','k','t')
71 /* DWORD network to host byte order conversion for i386 */
73 ((((dw) & 0xFF000000L) >> 24) | \
74 (((dw) & 0x00FF0000L) >> 8) | \
75 (((dw) & 0x0000FF00L) << 8) | \
76 (((dw) & 0x000000FFL) << 24))
78 /* DWORD host to network byte order conversion for i386 */
80 ((((dw) & 0xFF000000L) >> 24) | \
81 (((dw) & 0x00FF0000L) >> 8) | \
82 (((dw) & 0x0000FF00L) << 8) | \
83 (((dw) & 0x000000FFL) << 24))
85 /* WORD network to host order conversion for i386 */
87 ((((w) & 0xFF00) >> 8) | \
88 (((w) & 0x00FF) << 8))
90 /* WORD host to network byte order conversion for i386 */
92 ((((w) & 0xFF00) >> 8) | \
93 (((w) & 0x00FF) << 8))
97 /* DWORD network to host byte order conversion for other architectures */
101 /* DWORD host to network byte order conversion for other architectures */
105 /* WORD network to host order conversion for other architectures */
109 /* WORD host to network byte order conversion for other architectures */
115 typedef TDI_STATUS (*InfoRequest_f
)( UINT InfoClass
,
123 typedef TDI_STATUS (*InfoSet_f
)( UINT InfoClass
,
131 /* Sufficient information to manage the entity list */
136 InfoRequest_f info_req
;
141 #define htons(x) (((x) << 16) | (((x) >> 8) & 0xff))
144 /* Global variable */
145 extern PDEVICE_OBJECT TCPDeviceObject
;
146 extern PDEVICE_OBJECT UDPDeviceObject
;
147 extern PDEVICE_OBJECT IPDeviceObject
;
148 extern PDEVICE_OBJECT RawIPDeviceObject
;
149 extern LIST_ENTRY InterfaceListHead
;
150 extern KSPIN_LOCK InterfaceListLock
;
151 extern LIST_ENTRY AddressFileListHead
;
152 extern KSPIN_LOCK AddressFileListLock
;
153 extern NDIS_HANDLE GlobalPacketPool
;
154 extern NDIS_HANDLE GlobalBufferPool
;
155 extern KSPIN_LOCK EntityListLock
;
156 extern TDIEntityInfo
*EntityList
;
157 extern ULONG EntityCount
;
158 extern ULONG EntityMax
;
159 extern UDP_STATISTICS UDPStats
;
161 extern NTSTATUS
TiGetProtocolNumber( PUNICODE_STRING FileName
,
164 #endif /* __TCPIP_H */