36c36e1580bde76e3ab1a02ce7e05d57132a657f
[tpg/acess2.git] / Modules / IPStack / udp.h
1 /*
2  * Acess2 IP Stack
3  * - UDP Definitions
4  */
5 #ifndef _UDP_H_
6 #define _UDP_H_
7
8 #include "ipstack.h"
9 #include "ipv4.h"
10
11 typedef struct sUDPHeader       tUDPHeader;
12 typedef struct sUDPPacket       tUDPPacket;
13 typedef struct sUDPChannel      tUDPChannel;
14
15 struct sUDPHeader
16 {
17         Uint16  SourcePort;
18         Uint16  DestPort;
19         Uint16  Length;
20         Uint16  Checksum;
21         Uint8   Data[];
22 };
23
24 struct sUDPPacket
25 {
26         struct sUDPPacket       *Next;
27         size_t  Length;
28         Uint8   Data[];
29 };
30
31 struct sUDPChannel
32 {
33         struct sUDPChannel      *Next;
34         tInterface      *Interface;
35         Uint16  LocalPort;
36         union {
37                 tIPv4   v4;
38                 tIPv6   v6;
39         }       RemoteAddr;
40         Uint16  RemotePort;
41         tVFS_Node       Node;
42         tSpinlock       lQueue;
43         tUDPPacket      * volatile Queue;
44         tUDPPacket      *QueueEnd;
45 };
46
47 #endif

UCC git Repository :: git.ucc.asn.au