- Do not generate manifest files for drivers or native apps.
[reactos.git] / reactos / drivers / net / tcpip / include / udp.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS TCP/IP protocol driver
4 * FILE: include/udp.h
5 * PURPOSE: User Datagram Protocol definitions
6 */
7 #ifndef __UDP_H
8 #define __UDP_H
9
10 #define UDP_STARTING_PORT 0x8000
11 #define UDP_DYNAMIC_PORTS 0x8000
12
13 /* UDPv4 header structure */
14 #include <pshpack1.h>
15 typedef struct UDP_HEADER {
16 USHORT SourcePort; /* Source port */
17 USHORT DestPort; /* Destination port */
18 USHORT Length; /* Size of header and data */
19 USHORT Checksum; /* Checksum of datagram */
20 } UDP_HEADER, *PUDP_HEADER;
21
22 /* UDPv4 pseudo header */
23 typedef struct UDP_PSEUDO_HEADER {
24 ULONG SourceAddress; /* Source address */
25 ULONG DestAddress; /* Destination address */
26 UCHAR Zero; /* Reserved */
27 UCHAR Protocol; /* Protocol */
28 USHORT UDPLength; /* Size of UDP datagram */
29 } UDP_PSEUDO_HEADER, *PUDP_PSEUDO_HEADER;
30 #include <poppack.h>
31
32 typedef struct UDP_STATISTICS {
33 ULONG InputDatagrams;
34 ULONG NumPorts;
35 ULONG InputErrors;
36 ULONG OutputDatagrams;
37 ULONG NumAddresses;
38 } UDP_STATISTICS, *PUDP_STATISTICS;
39
40 extern UDP_STATISTICS UDPStats;
41
42 VOID UDPSend(
43 PVOID Context,
44 PDATAGRAM_SEND_REQUEST SendRequest);
45
46 NTSTATUS UDPSendDatagram(
47 PADDRESS_FILE AddrFile,
48 PTDI_CONNECTION_INFORMATION ConnInfo,
49 PCHAR BufferData,
50 ULONG DataSize,
51 PULONG DataUsed );
52
53 NTSTATUS UDPReceiveDatagram(
54 PADDRESS_FILE AddrFile,
55 PTDI_CONNECTION_INFORMATION ConnInfo,
56 PCHAR Buffer,
57 ULONG ReceiveLength,
58 ULONG ReceiveFlags,
59 PTDI_CONNECTION_INFORMATION ReturnInfo,
60 PULONG BytesReceived,
61 PDATAGRAM_COMPLETION_ROUTINE Complete,
62 PVOID Context);
63
64 VOID UDPReceive(
65 PIP_INTERFACE Interface,
66 PIP_PACKET IPPacket);
67
68 NTSTATUS UDPStartup(
69 VOID);
70
71 NTSTATUS UDPShutdown(
72 VOID);
73 UINT UDPAllocatePort( UINT HintPort );
74 VOID UDPFreePort( UINT Port );
75
76 #endif /* __UDP_H */
77
78 /* EOF */