Re: Best Way To Access Ubuntu Routing Table Details
If it's homework, you can say so.
Originally Posted by jeraldpaul
Why would its size help? If you could get the size that would be the number of characters.
1. I believe that routing table is stored at /proc/net/route and we cannot
access its size through the C programming method struct stat
Why not just open the file and read it in C?
2. I use popen
to read the output of one of the following command to get the size of the routing table:
I think you misunderstand you the pipe works. Also "wc -c" will give the number of characters, which is not what you want.
Make it work, then make it work well is an old adage, but still a good one.
3. So I am using the wc
with the plugs -c
to do my stuff I am doing but I believe it is really inefficient if my routing table has millions of entries and if I do this wc thing very frequently
Please create new threads for new questions.
Please wrap code in code tags using the '#' button or enter it in your post like this: [code]...[/code].