You probably don't want to modify the kernel itself, but merely use the
route command to modify the runtime routing behavior.
If you really mean to modify the kernel, then my best suggestion is to dig into the kernel sources.
<your-kernel>/net/ipv4/route.c looks like a good place to start.
--- rod.