Altair <email@example.com> wrote:
“Xiaodan Tang” <> firstname.lastname@example.org> > ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:ap285l$g7c$> email@example.com> …
Altair <> firstname.lastname@example.org> > wrote:
I’m trying to obtain statistics of ethernet interface. I do SIOCGIFCONF
to get list of intefaces and then … what to do then? According to
i/o operate either with “ifconf” structure or “ifreq”… i don’t see
get data into
“ifnet” structure containing needed for me members: input/output errors
of sent/received packets, etc…
Look into your /usr/demo/src/socket/if_example.c
I do know about if_example.c. Unfortunately it doesn’t demonstrate how to
structure with datas. No problem with obtaining flags/addresses/… The
question is how
to get interface statistics stored in ifnet structure.
Oops, I thought you are looking for interfaces…
No, you can not extract those informations. netstat have special
arrangement with stack to get those informations.
You either have to obtain netstat source from your sales rep, or
you have to popen(“netstat -ni”, …), and parse the output.