Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to retrieve Ethernet interface status

60 views
Skip to first unread message

emb...@online.ru

unread,
Apr 24, 2008, 3:32:26 AM4/24/08
to
Dear colleagues,

On LynxOS 4.0 how can I know from the application if the ethernet
interface is up or down? ioctl with SIOCGIFFLAGS always returns that
link is up. Same info printed by ifconfig.

Ethernet driver definitely has this info but it does not export it in
any way out: SIOCGIFFLAGS is not processed by the driver_ioctl
routine. There's always a way to patch the driver but i would prefer
some 'legal' way.

Thanks to everybody who helps.

love.f...@gmail.com

unread,
May 2, 2008, 2:17:22 PM5/2/08
to

What is the driver you are using ?

vs

unread,
May 4, 2008, 2:00:30 AM5/4/08
to

Both available on MVME-5500: gfec & em

raghu...@gmail.com

unread,
Jun 26, 2012, 5:04:49 AM6/26/12
to
Here is the solution

int check_link(unsigned char instance)
{

#if 0
struct ifreq ifr;
bzero((char *)&ifr, sizeof(struct ifreq));

strncpy(ifr.ifr_name,"gt1",3);
ioctl(dev_str[instance].sock_fd,SIOCGIFFLAGS,&ifr);
if((ifr.ifr_ifru.ifru_flags & IFACE_UP) && (ifr.ifr_ifru.ifru_flags & IFACE_RUNNING)){
return 1;
else
#endif
return 1;
}
0 new messages