[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpUjkWcHk+3MLiw=xSbRq0MaLKarNZoX2KBcFyTNBZsSiw@mail.gmail.com>
Date: Wed, 25 Jan 2017 14:05:30 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Sriram V <vshrirama@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>
Subject: Re: network status
On Tue, Jan 24, 2017 at 11:39 AM, Sriram V <vshrirama@...il.com> wrote:
> Hello,
>
> Apologies in case, this is not the right list of this question.
>
> I wanted to check, How can i find out if a network status has changed
>
> 1. How can the user application find out if the link status has changed?
There are some flags per netdevice for its link status, IFF_LOWER_UP
etc., they are sent to user-space via rtnetlink message, ->ifi_flags.
> 2. what changes do i need to add in the driver to indicate to the user
> applications that ethernet cable has been plugged in or unplugged.
>
Probably nothing but calling netif_carrier_on/off() API's.
> 3. How should a user application know the status change (Should the
> userapp poll on the interface/is there an uevent interface to indicate
> the link status change)
>
It needs to subscribe to the rtnetlink group RTNLGRP_LINK to receive
the broadcasts from kernel.
Powered by blists - more mailing lists