Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2001 16:48:47 -0500 (EST)
From:      Robert Watson <rwatson@FreeBSD.ORG>
To:        Samuel Tardieu <sam@inf.enst.fr>
Cc:        Josef Karthauser <joe@tao.org.uk>, hackers@FreeBSD.ORG, n_hibma@FreeBSD.ORG
Subject:   Re: Link up/down events
Message-ID:  <Pine.NEB.3.96L.1010110164324.84173A-100000@fledge.watson.org>
In-Reply-To: <2001-01-10-18-06-45%2Btrackit%2Bsam@inf.enst.fr>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 10 Jan 2001, Samuel Tardieu wrote:

> On 10/01, Robert Watson wrote:
> 
> | Presumably at some point in the stack, that notification is translated
> | from a hardware event, which might be associated with devd in some manner
> | (and possibly also exposed there).
> 
> This is the ideal situation. The other one being that the status can be
> read, which would require some polling to monitor the link status.

If can already be polled, I believe through an ioctl, in -CURRENT at
least:

fxp0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
        ether 00:d0:b7:68:4a:7b 
        media: autoselect status: no carrier
        supported media: autoselect 100baseTX <full-duplex> 100baseTX
10baseT/UTP <full-duplex> 10baseT/UTP
P <full-duplex> 10baseT/UTP
xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::2b0:d0ff:fe2b:76d5%xl0 prefixlen 64 scopeid 0x3 
        inet 10.33.40.80 netmask 0xffff0000 broadcast 10.33.255.255
        ether 00:b0:d0:2b:76:d5 
        media: autoselect (10baseT/UTP) status: active
        supported media: autoselect 100baseTX <full-duplex> 100baseTX
10baseT/UTP <full-duplex> 10baseT/UTP

Not that fxp0 is reporting no carrier, whereas xl0 is reporting an active
link.  A quick glance at the ifmedia.c from ifconfig shows:

        if (ifmr.ifm_status & IFM_AVALID) {
                printf(" status: ");
                switch (IFM_TYPE(ifmr.ifm_active)) {
                case IFM_ETHER:
                        if (ifmr.ifm_status & IFM_ACTIVE)
                                printf("active");
                        else
                                printf("no carrier");
                        break;

                case IFM_FDDI:
                case IFM_TOKEN:
                        if (ifmr.ifm_status & IFM_ACTIVE)
                                printf("inserted");
                        else
                                printf("no ring");
                        break;
                }

As I stated previously, I believe that the link change event should be
propagated up through the network stack and announced to applications via
the routing socket primitive, which already announces the arrival and
departure of interfaces.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services





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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1010110164324.84173A-100000>