2 Replies Latest reply on Feb 22, 2015 4:30 AM by ktown

    Remote IP Address Lookup for Incoming TCP Packets

    ktown

      Is there a method to determine the remote IP address and socket when receiving TCP packets, so that the info can be properly logged? i.e.: "Received xxx from 192.168.1.110:5000\r\n"

       

      UDP packets can make use of wiced_udp_packet_get_info but there doesn't seem to be a way to do this with TCP packets (there isn't a 'wiced_tcp_packet_get_info' function)?

       

      I was digging into the low level wiced_tcp_socket_t implementation but this differents between NetX and lwip, and even hard-coding struct members from the NetX implementation (yuck) I still didn't get meaningful data back for the remote IP address and socket when TCP data arrives on the test echo server.

       

      For reference sake I think the NetX fields are 'nx_tcp_socket_connect_ip' and 'nx_tcp_socket_connect_port', but this is a terrible approach anyway.

       

      Unless I'm fundamentally misunderstanding something, this seems like a pretty big gap in the API that there isn't an easy way to get access to the remote IP address.  If there is an example of how to do this, can you please point me to it or provide a simple code snippet showing how we can log this info in something basic like the TCP echo server provided?