X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Fudp.h;h=391478941fd571848b237d165cf0253c438c852b;hb=f42e912b8bc615c2009b795ce12d4c54cef4ee8b;hp=2cc743abd02f4a83d3cd7e71b9f2870fe8975164;hpb=ff1aacd48c7b616508c1d4e7a7ba03f741ee2cda;p=tpg%2Facess2.git diff --git a/Modules/IPStack/udp.h b/Modules/IPStack/udp.h index 2cc743ab..39147894 100644 --- a/Modules/IPStack/udp.h +++ b/Modules/IPStack/udp.h @@ -9,7 +9,7 @@ #include "ipv4.h" typedef struct sUDPHeader tUDPHeader; -typedef struct sUDPServer tUDPServer; +typedef struct sUDPEndpoint tUDPEndpoint; typedef struct sUDPPacket tUDPPacket; typedef struct sUDPChannel tUDPChannel; @@ -22,9 +22,20 @@ struct sUDPHeader Uint8 Data[]; }; +struct sUDPEndpoint +{ + Uint16 Port; + Uint16 AddrType; + union { + tIPv4 v4; + tIPv6 v6; + } Addr; +}; + struct sUDPPacket { struct sUDPPacket *Next; + tUDPEndpoint Remote; size_t Length; Uint8 Data[]; }; @@ -34,30 +45,15 @@ struct sUDPChannel struct sUDPChannel *Next; tInterface *Interface; Uint16 LocalPort; - union { - tIPv4 v4; - tIPv6 v6; - } RemoteAddr; - Uint16 RemotePort; - tVFS_Node Node; - tSpinlock lQueue; - tUDPPacket * volatile Queue; - tUDPPacket *QueueEnd; -}; -struct sUDPServer -{ - struct sUDPServer *Next; + tUDPEndpoint Remote; // Only accept packets form this address/port pair + int RemoteMask; // Mask on the address tVFS_Node Node; - - tInterface *Interface; - Uint16 ListenPort; - int NextID; - int NumChannels; - tUDPChannel *Channels; - tSpinlock Lock; - tUDPChannel * volatile NewChannels; + tShortSpinlock lQueue; + tUDPPacket * volatile Queue; + tUDPPacket *QueueEnd; }; #endif +