问题
I'm trying to implement a routing algorithm in Linux kernel. i.e. When the Linux host is configured to act as a router. Is it possible to add a routing algorithm to the kernel code base and register it as it is done with most of the kernel services? Like creating our own scheduling policy, registering a usb device etc.?
Thanks in Advance, Binoy
回答1:
There is a special subsystem in linux kernel for packet processing and inspection - netfilter. iptables, for example, is based on netfilter. It basically gives you hooks, to which you can bind your callbacks. I don't know will it be enough to implement new routing algorithm, but anyway it's a good starting point.
来源:https://stackoverflow.com/questions/21449283/implementing-linux-kernel-as-a-router