A quick internet search, and the fact that currently we only have one other "meshnet" reference here (an answer on this question) strongly implies there is no such ready to go solution (but see the last paragraph).
You may find this interesting:
https://superuser.com/q/382519/257378
I'm inclined to agree with the accepted answer there that the Pi is not the best choice for this, especially since the 100 Mbps ethernet shares a bus with the potential bandwidth-hog of USB -- an issue that might become more serious if you want a wifi AP too. Which then raises a question about this:
I'm looking to integrate the RPi inside of a router and then have it as a meshnet network node.
If you mean you want to exploit the router hardware but use the pi because it makes life easier, I won't say it is impossible, but it is on the zany and impractical side. Of course a lot can be learned that way, it comes down to what you want to get out of this.
The combined USB/Ethernet bus, max ~240 Mbps, is the fastest connection the pi has. You cannot add significantly to it with some kind of serial or I2C connection. And there is only one of them, so if you are intending to pipe data back and forth to another system (the router), you are going to be lucky to get 100 Mbps in the end no matter how you do it. So how feasible this is depends completely on what kind of service you intent to provide.
Of course, I do not think you have to pipe all the data through the pi...but in that case I also think you need to do a lot of software work on both sides. You are very unlikely to find a ready-made solution for this because it is, again, not something most people would consider practical.
I did find this image:
NYC Meshberry
The page is still there, but the Raspbian based image they refer would now be two years old, and presumably this is for that particular urban meshnet. Neither of these things makes it useless at least as a reference point, however, if you are serious and have a decent grasp on the OS and relevant software.
Hyperboria would presumably be another good reference point.