Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Oct 2002 09:10:58 -0700 (PDT)
From:      yatin chalke <yat_33@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   Parsing route dump received by using sysctl
Message-ID:  <20021004161058.91584.qmail@web9503.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
Hi,

I am currently trying to get a route dump in
freebsd4.4 using sysctl with NET_RT_DUMP.

I am running into problems while parsing the returned
rt_msghdr structures.

The sockaddr structures returned after the rt_msghdr
are messed up and it is not giving correct gateway or
netmask.

For ex: when I am parsing the received route dump the
netmask received is nonzero(random value) for a
default route (which it returns as 0.0.0.0) and also
netmask doesnt appear to be a sockaddr structure.

Also for further routes gateway and netmasks are
0.0.0.0.
I am  parsing the received sockaddr structures to get
all the values depending on flag bits set in rt_msghdr
structure.

If anyone can help me in this matter it will be a
great help.

Thanks,
--Yatin


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

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




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