Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Nov 2001 07:54:51 +1030
From:      Ian West <ian@niw.com.au>
To:        freebsd-net@freebsd.org
Subject:   Results from RTM_GET on route socket ?
Message-ID:  <20011106075451.E34308@rose.niw.com.au>

next in thread | raw e-mail | index | archive | help
I am a bit confused about the results of RTM_GET. Below is a hexdump of
the response I am getting,  The response rtm_addrs field is 0x37 which
I believe indicates I should have values for the following in top down
order.

     #define RTA_DST       0x1    /* destination sockaddr present */
     #define RTA_GATEWAY   0x2    /* gateway sockaddr present */
     #define RTA_NETMASK   0x4    /* netmask sockaddr present */
     #define RTA_IFP       0x10   /* interface name sockaddr present */
     #define RTA_IFA       0x20   /* interface addr sockaddr present */

Starting at the * (Offset 5c, sizeof(struct rt_msghdr) I have 16 bytes
for RTA_DST, 16 bytes for RTA_GATEWAY, and then 4 null bytes. After this
there seems to be a valid RTA_IFP, and RTA_IFA. My understanding is that
the items should be sockaddr's, what is the correct way to interpret the
null bytes ? (I don't want to write iffy code that breaks later :-)

0x0000: c8 00 05 04 02 00 00 00 43 08 01 00 37 00 00 00 H       C   7
0x0010: ef 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 o
0x0020: 00 00 00 00 00 00 00 00 dc 05 00 00 00 00 00 00         \
0x0030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0040: 00 00 00 00 00 00 00 00 d5 17 00 00 00 00 00 00         U
0x0050: 00 00 00 00 00 00 00 00 00 00 00 00*10 02 00 00
0x0060: 00 00 00 00 00 00 00 00 00 00 00 00 10 02 00 00
0x0070: c0 a8 01 0a 00 00 00 00 00 00 00 00 00 00 00 00 @(
0x0080: 38 12 02 00 06 03 06 00 64 63 30 00 80 c8 cd 23 8       dc0  HM#
0x0090: fd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 }
0x00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x00b0: 00 00 00 00 00 00 00 00 10 02 00 00 c0 a8 01 09             @(
0x00c0: 00 00 00 00 00 00 00 00 -- -- -- -- -- -- -- --

Thanks for any feedback..

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011106075451.E34308>