We are using W5200 for ethernet communication. Microcontroller and w5200 are interfaced through SPI. We want to implement IP filtering in our firmware. Once connection is established we our read out the destination ip address (i.e read out DIPR0-3) and check it against our vaild ip address. Is it the correct procedure to verify the incoming connection request ip address?
Once it is identified incoming connection ip address is not valid what are the sequence of operations to accept new connection?
What I planned to do is write 0.0.0.0 to DIPR registers and zeros to DHAR registers and close the socket. Then open the socket again move to listen mode and wait for new connection. is this sequence correct ? is there any more operations required?
The above mechanism was in the context of TCP connection. What would be the mechanism for UDP connection?