#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) |
| |
| static BOOLEAN | UDPIsBroadcastAddress (_In_ PIP_ADDRESS Address) |
| | Checks whether an address is the limited broadcast address or the directed broadcast address of a non-loopback interface.
|
| |
| 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}
ULONG UDPv4ChecksumCalculate(PIPv4_HEADER IPHeader, PUCHAR PacketBuffer, ULONG DataLength)
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ 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 452 of file udp.c.
452 {
453 if( HintPort ) {
455 else return (
UINT)-1;
459}
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 461 of file udp.c.
461 {
463}
VOID DeallocatePort(PPORT_SET PortSet, ULONG Port)
Referenced by AddrFileFree().
◆ UDPIsBroadcastAddress()
Checks whether an address is the limited broadcast address or the directed broadcast address of a non-loopback interface.
- Parameters
-
| [in] | Address | Destination address to check. |
- Returns
- TRUE if the address is a broadcast address, FALSE otherwise.
Definition at line 163 of file udp.c.
165{
169
172
173 if (
Address->Address.IPv4Address == 0xFFFFFFFF)
175
177
180 {
182 break;
183 }
185
187
188 return IsBroadcast;
189}
BOOLEAN AddrIsEqual(PIP_ADDRESS Address1, PIP_ADDRESS Address2)
KSPIN_LOCK InterfaceListLock
VOID TcpipReleaseSpinLock(PKSPIN_LOCK SpinLock, KIRQL Irql)
VOID TcpipAcquireSpinLock(PKSPIN_LOCK SpinLock, PKIRQL Irql)
#define ForEachInterface(n)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Referenced by UDPSendDatagram().
◆ UDPReceive()
Definition at line 310 of file udp.c.
320{
327
329
330 switch (IPPacket->
Type) {
331
334 DstAddress = &IPPacket->
DstAddr;
335 SrcAddress = &IPPacket->
SrcAddr;
336 break;
337
338
341
342
343 return;
344
345 default:
346 return;
347 }
348
350
351
356 {
358 return;
359 }
360
361
364
366 return;
367 }
368
370
371
373
374
375
376
377
378
382 &SearchContext);
383 if (AddrFile) {
384 do {
386 SrcAddress,
387 DstAddress,
390 IPPacket,
394 } else {
395
396
399
400
401 }
403}
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::@1204 Address
IPv4_RAW_ADDRESS IPv4Address
#define DereferenceObject(Object)
Referenced by UDPStartup().
◆ UDPSendDatagram()
Definition at line 191 of file udp.c.
207{
217
219
221 AddrFile, ConnInfo, BufferData,
DataSize));
223
224 switch( RemoteAddressTa->
Address[0].AddressType ) {
228 RemoteAddressTa->
Address[0].Address[0].in_addr;
229 RemotePort = RemoteAddressTa->
Address[0].Address[0].sin_port;
230 break;
231
232 default:
235 }
236
239 {
240
241
242
243
247 }
248
250 }
251 else
252 {
256 }
257 }
258
262 RemotePort,
265 BufferData,
267
269 {
272 }
273
274
278 {
280 if (LoopNCE !=
NULL &&
282 &LoopPacket,
284 RemotePort,
287 BufferData,
289 {
291 }
292 }
293
295
297
300
303
305
307}
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)
static BOOLEAN UDPIsBroadcastAddress(_In_ PIP_ADDRESS Address)
Checks whether an address is the limited broadcast address or the directed broadcast address of a non...
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 431 of file udp.c.
438{
441
443
444
446
448
450}
VOID IPRegisterProtocol(UINT ProtocolNumber, IP_PROTOCOL_HANDLER Handler)
VOID PortsShutdown(PPORT_SET PortSet)
Referenced by TiUnload().
◆ UDPStartup()
Definition at line 406 of file udp.c.
413{
415
417
419
421
422
424
426
428}
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