#include "precomp.h"
Go to the source code of this file.
|
NTSTATUS | AddUDPHeaderIPv4 (PADDRESS_FILE AddrFile, PIP_ADDRESS RemoteAddress, USHORT RemotePort, PIP_ADDRESS LocalAddress, USHORT LocalPort, PIP_PACKET IPPacket, PVOID Data, UINT DataLength) |
|
NTSTATUS | BuildUDPPacket (PADDRESS_FILE AddrFile, PIP_PACKET Packet, PIP_ADDRESS RemoteAddress, USHORT RemotePort, PIP_ADDRESS LocalAddress, USHORT LocalPort, PCHAR DataBuffer, UINT DataLen) |
|
NTSTATUS | UDPSendDatagram (PADDRESS_FILE AddrFile, PTDI_CONNECTION_INFORMATION ConnInfo, PCHAR BufferData, ULONG DataSize, PULONG DataUsed) |
|
VOID | UDPReceive (PIP_INTERFACE Interface, PIP_PACKET IPPacket) |
|
NTSTATUS | UDPStartup (VOID) |
|
NTSTATUS | UDPShutdown (VOID) |
|
UINT | UDPAllocatePort (UINT HintPort) |
|
VOID | UDPFreePort (UINT Port) |
|
◆ AddUDPHeaderIPv4()
Definition at line 16 of file udp.c.
35{
38
41
47
50
51
55
57
61
63
68
73
75}
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
ULONG UDPv4ChecksumCalculate(PIPv4_HEADER IPHeader, PUCHAR PacketBuffer, ULONG DataLength)
#define NT_SUCCESS(StatCode)
#define TI_DbgPrint(_t_, _x_)
struct _tagUDPHeader UDPHeader
NTSTATUS AddGenericHeaderIPv4(PADDRESS_FILE AddrFile, PIP_ADDRESS RemoteAddress, USHORT RemotePort, PIP_ADDRESS LocalAddress, USHORT LocalPort, PIP_PACKET IPPacket, UINT DataLength, UINT Protocol, UINT ExtraLength, PVOID *NextHeader)
#define RtlCopyMemory(Destination, Source, Length)
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR LocalAddress
_Must_inspect_result_ _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR RemoteAddress
Referenced by BuildUDPPacket().
◆ BuildUDPPacket()
Definition at line 78 of file udp.c.
97{
99
101
102
104
106
107
111
113 {
116 }
117
121
126 break;
128
130 default:
132 break;
133 }
139 }
140
142
144
146
148}
PIP_PACKET IPInitializePacket(PIP_PACKET IPPacket, ULONG Type)
PCHAR A2S(PIP_ADDRESS Address)
NTSTATUS AddUDPHeaderIPv4(PADDRESS_FILE AddrFile, PIP_ADDRESS RemoteAddress, USHORT RemotePort, PIP_ADDRESS LocalAddress, USHORT LocalPort, PIP_PACKET IPPacket, PVOID Data, UINT DataLength)
#define AllocatePacketWithBuffer(x, y, z)
_In_ NDIS_HANDLE _In_ PNDIS_PACKET Packet
#define DISPLAY_IP_PACKET(x)
#define STATUS_UNSUCCESSFUL
Referenced by UDPSendDatagram().
◆ UDPAllocatePort()
Definition at line 382 of file udp.c.
382 {
383 if( HintPort ) {
385 else return (
UINT)-1;
389}
BOOLEAN AllocatePort(PPORT_SET PortSet, ULONG Port)
ULONG AllocatePortFromRange(PPORT_SET PortSet, ULONG Lowest, ULONG Highest)
#define UDP_STARTING_PORT
#define UDP_DYNAMIC_PORTS
Referenced by FileOpenAddress().
◆ UDPFreePort()
Definition at line 391 of file udp.c.
391 {
393}
VOID DeallocatePort(PPORT_SET PortSet, ULONG Port)
Referenced by AddrFileFree().
◆ UDPReceive()
Definition at line 240 of file udp.c.
250{
257
259
260 switch (IPPacket->
Type) {
261
264 DstAddress = &IPPacket->
DstAddr;
265 SrcAddress = &IPPacket->
SrcAddr;
266 break;
267
268
271
272
273 return;
274
275 default:
276 return;
277 }
278
280
281
286 {
288 return;
289 }
290
291
294
296 return;
297 }
298
300
301
303
304
305
306
307
308
312 &SearchContext);
313 if (AddrFile) {
314 do {
316 SrcAddress,
317 DstAddress,
320 IPPacket,
324 } else {
325
326
329
330
331 }
333}
PADDRESS_FILE AddrSearchFirst(PIP_ADDRESS Address, USHORT Port, USHORT Protocol, PAF_SEARCH SearchContext)
PADDRESS_FILE AddrSearchNext(PAF_SEARCH SearchContext)
VOID DGDeliverData(PADDRESS_FILE AddrFile, PIP_ADDRESS SrcAddress, PIP_ADDRESS DstAddress, USHORT SrcPort, USHORT DstPort, PIP_PACKET IPPacket, UINT DataSize)
struct _tagIPv4Header IPv4Header
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct UDP_HEADER * PUDP_HEADER
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
union IP_ADDRESS::@1014 Address
IPv4_RAW_ADDRESS IPv4Address
#define DereferenceObject(Object)
Referenced by UDPStartup().
◆ UDPSendDatagram()
Definition at line 150 of file udp.c.
166{
174
176
178 AddrFile, ConnInfo, BufferData,
DataSize));
180
181 switch( RemoteAddressTa->
Address[0].AddressType ) {
185 RemoteAddressTa->
Address[0].Address[0].in_addr;
186 RemotePort = RemoteAddressTa->
Address[0].Address[0].sin_port;
187 break;
188
189 default:
192 }
193
196 {
197
198
199
200
204 }
205
207 }
208 else
209 {
213 }
214 }
215
219 RemotePort,
222 BufferData,
224
226
229
233
235
237}
BOOLEAN AddrIsUnspecified(PIP_ADDRESS Address)
PNEIGHBOR_CACHE_ENTRY RouteGetRouteToDestination(PIP_ADDRESS Destination)
NTSTATUS BuildUDPPacket(PADDRESS_FILE AddrFile, PIP_PACKET Packet, PIP_ADDRESS RemoteAddress, USHORT RemotePort, PIP_ADDRESS LocalAddress, USHORT LocalPort, PCHAR DataBuffer, UINT DataLen)
PNEIGHBOR_CACHE_ENTRY NBLocateNeighbor(PIP_ADDRESS Address, PIP_INTERFACE Interface)
#define STATUS_NETWORK_UNREACHABLE
struct _TA_ADDRESS_IP::_AddrIp Address[1]
struct _TA_ADDRESS_IP * PTA_IP_ADDRESS
#define TDI_ADDRESS_TYPE_IP
#define UnlockObject(Object)
#define LockObject(Object)
NTSTATUS IPSendDatagram(PIP_PACKET IPPacket, PNEIGHBOR_CACHE_ENTRY NCE)
#define STATUS_INVALID_PARAMETER
Referenced by FileOpenAddress().
◆ UDPShutdown()
Definition at line 361 of file udp.c.
368{
371
373
374
376
378
380}
VOID IPRegisterProtocol(UINT ProtocolNumber, IP_PROTOCOL_HANDLER Handler)
VOID PortsShutdown(PPORT_SET PortSet)
Referenced by TiUnload().
◆ UDPStartup()
Definition at line 336 of file udp.c.
343{
345
347
349
351
352
354
356
358}
NTSTATUS PortsStartup(PPORT_SET PortSet, UINT StartingPort, UINT PortsToManage)
VOID UDPReceive(PIP_INTERFACE Interface, PIP_PACKET IPPacket)
#define RtlZeroMemory(Destination, Length)
Referenced by DriverEntry().
◆ UDPInitialized
◆ UDPPorts