X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/b7ef7f49c9f6b4de962ae32776866bd1d5d59c3b..7665bf323e76ed1ebcfd137e2ab0bd356b43a5e8:/Demos/Device/RNDISEthernet/Lib/ICMP.c?ds=sidebyside diff --git a/Demos/Device/RNDISEthernet/Lib/ICMP.c b/Demos/Device/RNDISEthernet/Lib/ICMP.c index da4ffcfa1..ee87f8383 100644 --- a/Demos/Device/RNDISEthernet/Lib/ICMP.c +++ b/Demos/Device/RNDISEthernet/Lib/ICMP.c @@ -40,12 +40,13 @@ /** Processes an ICMP packet inside an Ethernet frame, and writes the appropriate response * to the output Ethernet frame if the host is issuing a ICMP ECHO request. * + * \param FrameIN Pointer to the incomming Ethernet frame information structure * \param InDataStart Pointer to the start of the incoming packet's ICMP header * \param OutDataStart Pointer to the start of the outgoing packet's ICMP header * * \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise */ -int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart) +int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart, void* OutDataStart) { ICMP_Header_t* ICMPHeaderIN = (ICMP_Header_t*)InDataStart; ICMP_Header_t* ICMPHeaderOUT = (ICMP_Header_t*)OutDataStart; @@ -62,7 +63,7 @@ int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart) ICMPHeaderOUT->Id = ICMPHeaderIN->Id; ICMPHeaderOUT->Sequence = ICMPHeaderIN->Sequence; - uint16_t DataSize = FrameIN.FrameLength - ((((uint16_t)InDataStart + sizeof(ICMP_Header_t)) - (uint16_t)FrameIN.FrameData)); + uint16_t DataSize = FrameIN->FrameLength - ((((uint16_t)InDataStart + sizeof(ICMP_Header_t)) - (uint16_t)FrameIN->FrameData)); /* Copy the remaining payload to the response - echo requests should echo back any sent data */ memcpy(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)],