[mpls-linux-general] How to interprete the buffer received from the netlink socket.
Status: Beta
Brought to you by:
jleu
From: Suryakant <s_...@ya...> - 2001-12-03 03:01:23
|
Hi, I am trying to read routing table on linux machine using netlink socket. Can anybody please help me, how to interprete the buffer received from the netlink socket. The buffer containes data like this : [Print format is <space> between two bytes and <\n> between to entries] 84 0 0 0 24 0 2 0 148 99 0 64 14 3 0 0 2 32 0 0 254 0 0 3 0 2 0 144 8 0 1 0 255 255 255 255 8 0 4 0 1 0 0 0 8 0 7 0 192 168 250 137 24 0 12 0 1 0 0 0 252 9 0 0 0 0 0 0 0 0 0 0 21 4 0 0 8 0 3 0 3 0 0 0 92 0 0 0 24 0 2 0 148 99 0 64 14 3 0 0 2 32 32 0 254 0 0 3 0 2 0 148 8 0 1 0 192 168 250 159 8 0 2 0 192 168 250 144 8 0 4 0 1 0 0 0 8 0 7 0 192 168 250 137 24 0 12 0 1 0 0 0 224 48 0 0 0 0 0 0 0 0 0 0 101 6 0 0 8 0 3 0 3 0 0 0 92 0 0 0 24 0 2 0 148 99 0 64 14 3 0 0 2 32 32 0 254 0 0 2 0 2 0 128 8 0 1 0 192 168 250 137 8 0 2 0 192 135 240 218 8 0 4 0 1 0 0 0 8 0 7 0 192 168 250 137 24 0 12 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 93 0 0 0 8 0 3 0 3 0 0 0 104 0 0 0 24 0 2 0 148 99 0 64 14 3 0 0 2 32 32 0 254 0 0 1 0 2 0 0 8 0 1 0 192 135 240 218 8 0 2 0 192 168 250 137 8 0 4 0 3 0 0 0 8 0 5 0 192 168 250 129 20 0 8 0 8 0 2 0 220 5 0 0 8 0 4 0 44 1 0 0 24 0 12 0 2 0 0 0 181 62 1 0 0 0 0 0 0 0 0 0 2 0 0 0 My requirement is to get routing entries (fib) but what I am getting is matching with entries in /proc/net/rt_cache [Print of /proc/net/rt_cache] 1 Iface Destination Gateway Flags RefCnt Use Metric Source MTU Window IRTT TOS HHRef HHUptod SpecDst 2 lo FFFFFFFF FFFFFFFF 90000000 0 1057 0 00000000 0 0 0 00 -1 0 89FAA8C0 3 lo 9FFAA8C0 9FFAA8C0 94000000 0 1675 0 90FAA8C0 0 0 0 00 -1 0 89FAA8C0 4 lo 89FAA8C0 89FAA8C0 80000000 0 139 0 DAF087C0 0 0 0 00 -1 0 89FAA8C0 5 eth0 DAF087C0 81FAA8C0 0 1 2 0 89FAA8C0 1500 0 300 00 2 1 89FAA8C0 Kindly reply ASAP. Thanks in advance .... Surya |