Hi Marco,

On Wed, May 02, 2012 at 05:45:55PM +0200, Marco Jakobs wrote:
> Hi,
> 
> i have some UDP transmissions where i need to definitely set the
> source port (my transmission port) to a given value!

Maybe this is pretty old for 1.4.0, but it may help you.

I wrote several years ago a NTP server, NTP uses the same port for source 
and destination in most cases, which is 123/UDP.

This is what I used:


Bind, so use source port = 123:

udp_bind(n->udp_socket, IP_ADDR_ANY, 123);
udp_recv(n->udp_socket, ntp_net_recv_callback, n);


Send to using port 123 as destination, on the same socket, so source and 
destination port = 123:

udp_sendto(n->udp_socket, pkt_buf, ntpserver, 123);


Sylvain

Attachment: signature.asc
Description: Digital signature

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to