X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Modules%2FIPStack%2Fudp.c;h=4ce447d852fb7818e067b15d9731b37497e56f81;hb=775bf8013abe9fe4ef3d4883ea2e43bba2a84da1;hp=760c99743dfc4b205bcc3347442f8fc55014dfbd;hpb=ff1aacd48c7b616508c1d4e7a7ba03f741ee2cda;p=tpg%2Facess2.git diff --git a/Modules/IPStack/udp.c b/Modules/IPStack/udp.c index 760c9974..4ce447d8 100644 --- a/Modules/IPStack/udp.c +++ b/Modules/IPStack/udp.c @@ -11,6 +11,8 @@ // === PROTOTYPES === void UDP_Initialise(); void UDP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffer); +void UDP_Unreachable(tInterface *Interface, int Code, void *Address, int Length, void *Buffer); +void UDP_SendPacket(tUDPChannel *Channel, void *Data, size_t Length); // --- Listening Server tVFS_Node *UDP_Server_Init(tInterface *Interface); char *UDP_Server_ReadDir(tVFS_Node *Node, int ID); @@ -50,6 +52,7 @@ void UDP_Initialise() { IPStack_AddFile(&gUDP_ServerFile); IPStack_AddFile(&gUDP_ClientFile); + //IPv4_RegisterCallback(IP4PROT_UDP, UDP_GetPacket, UDP_Unreachable); IPv4_RegisterCallback(IP4PROT_UDP, UDP_GetPacket); } @@ -69,9 +72,7 @@ int UDP_int_ScanList(tUDPChannel *List, tInterface *Interface, void *Address, in chan = chan->Next) { if(chan->Interface != Interface) continue; - //Log("[UDP ] Local (0x%04x) == Dest (0x%04x)", chan->LocalPort, ntohs(hdr->DestPort)); if(chan->LocalPort != ntohs(hdr->DestPort)) continue; - //Log("[UDP ] Remote (0x%04x) == Source (0x%04x)", chan->RemotePort, ntohs(hdr->SourcePort)); if(chan->RemotePort != ntohs(hdr->SourcePort)) continue; if(Interface->Type == 4) { @@ -148,6 +149,14 @@ void UDP_GetPacket(tInterface *Interface, void *Address, int Length, void *Buffe } +/** + * \brief Handle an ICMP Unrechable Error + */ +void UDP_Unreachable(tInterface *Interface, int Code, void *Address, int Length, void *Buffer) +{ + +} + /** * \brief Send a packet * \param Channel Channel to send the packet from