:pserver:cvsanon@mok.lvcm.com:/CVS/ReactOS reactos
[reactos.git] / 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
11 /* UDPv4 header structure */
12 typedef struct UDP_HEADER {
13   USHORT SourcePort; /* Source port */
14   USHORT DestPort;   /* Destination port */
15   USHORT Length;     /* Size of header and data */
16   USHORT Checksum;   /* Checksum of datagram */
17 } __attribute__((packed)) UDP_HEADER, *PUDP_HEADER;
18
19 /* UDPv4 pseudo header */
20 typedef struct UDP_PSEUDO_HEADER {
21   ULONG SourceAddress; /* Source address */
22   ULONG DestAddress;   /* Destination address */
23   UCHAR Zero;          /* Reserved */
24   UCHAR Protocol;      /* Protocol */
25   USHORT UDPLength;    /* Size of UDP datagram */
26 } __attribute__((packed)) UDP_PSEUDO_HEADER, *PUDP_PSEUDO_HEADER;
27
28
29 typedef struct UDP_STATISTICS {
30   ULONG InputDatagrams;
31   ULONG NumPorts;
32   ULONG InputErrors;
33   ULONG OutputDatagrams;
34   ULONG NumAddresses;
35 } UDP_STATISTICS, *PUDP_STATISTICS;
36
37 VOID UDPSend(
38   PVOID Context,
39   PDATAGRAM_SEND_REQUEST SendRequest);
40
41 NTSTATUS UDPSendDatagram(
42   PTDI_REQUEST Request,
43   PTDI_CONNECTION_INFORMATION ConnInfo,
44   PNDIS_BUFFER Buffer,
45   ULONG DataSize);
46
47 NTSTATUS UDPReceiveDatagram(
48   PTDI_REQUEST Request,
49   PTDI_CONNECTION_INFORMATION ConnInfo,
50   PNDIS_BUFFER Buffer,
51   ULONG ReceiveLength,
52   ULONG ReceiveFlags,
53   PTDI_CONNECTION_INFORMATION ReturnInfo,
54   PULONG BytesReceived);
55
56 VOID UDPReceive(
57   PNET_TABLE_ENTRY NTE,
58   PIP_PACKET IPPacket);
59
60 NTSTATUS UDPStartup(
61   VOID);
62
63 NTSTATUS UDPShutdown(
64   VOID);
65
66 #endif /* __UDP_H */
67
68 /* EOF */