Kernel - Slight reworks to timer code
[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 sUDPEndpoint     tUDPEndpoint;
13 typedef struct sUDPPacket       tUDPPacket;
14 typedef struct sUDPChannel      tUDPChannel;
15
16 struct sUDPHeader
17 {
18         Uint16  SourcePort;
19         Uint16  DestPort;
20         Uint16  Length;
21         Uint16  Checksum;
22         Uint8   Data[];
23 };
24
25 struct sUDPEndpoint
26 {
27         Uint16  Port;
28         Uint16  AddrType;
29         union {
30                 tIPv4   v4;
31                 tIPv6   v6;
32         }       Addr;
33 };
34
35 struct sUDPPacket
36 {
37         struct sUDPPacket       *Next;
38         tUDPEndpoint    Remote;
39         size_t  Length;
40         Uint8   Data[];
41 };
42
43 struct sUDPChannel
44 {
45         struct sUDPChannel      *Next;
46         tInterface      *Interface;
47         Uint16  LocalPort;
48
49         tUDPEndpoint    Remote; // Only accept packets form this address/port pair
50          int    RemoteMask;     // Mask on the address
51         
52         tVFS_Node       Node;
53         tShortSpinlock  lQueue;
54         tUDPPacket      * volatile Queue;
55         tUDPPacket      *QueueEnd;
56 };
57
58 #endif
59

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