receive UDP on a very wide range of multiple ports
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
receive UDP on a very wide range of multiple ports
i have a use for a way for a program to receive datagrams (UDP) on a very wide range of ports, wider than the number of file descriptors a single process could have open. i am wondering if there is some way to bind a single socket to receive datagrams over a specified range of ports, or every port. the process can be initialized with root permissions.
You can add a hook on netfilter. If incoming packet meet condition, it is inserted into a FIFO. In user space, a socket program read the FIFO and process it.
but ... how do you express a netfilter rule to send all UDP packets destined for ports 4000..7999 on this host to be sent to the process running program "foo" or a named socket "foo" or a named fifo "foo"? do you have examples?
the rules get put in place in the kernel. i am talking about the rule form itself. that would be how the iptables command communicates with the kernel. but for discussion i am only talking about rules conceptually since the real goal is something else. so the input to iptables or the output (to the kernel) from iptables is what i am wanting to know.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.