How to analyze the contents of the / proc / net / route file for Android.
I use the "cat" command to read the file
`process proc_route = Runtime.getRuntime().exec("cat /proc/net/route");`
He shows a conclusion like this
Iface Destination Gateway Flags RefCnt Use Metric Mask Mtu Window IRTT
eth0 0202000A 00000000 0005 0 0 0 FFFFFFFF 0 0 0
eth0 0002000A 00000000 0001 0 0 0 FFFFFFFF 0 0 0
eth0 00000000 00000000 0003 0 0 0 00000000 0 0 0
I want the result to be like
Iface Destination Gateway Flags RefCnt Use Metric Mask Mtu Window IRTT
eth0 10.0.2.2 0.0.0.0 0005 0 0 0 255.255.255.255 0 0 0
eth0 10.0.2.0 0.0.0.0 0001 0 0 0 255.255.255.255 0 0 0
eth0 10.0.0.0 0.0.0.0 0003 0 0 0 0.0.0.0 0 0 0
Is there a command or utility for this?
source
share