libbsd: React to link status change events

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Apr 29 11:45:44 UTC 2021


On 29/04/2021 13:43, Jan.Sommer at dlr.de wrote:

> is there an easy way to register a callback function or block until a link status change of an Ethernet device occurs in the libbsd stack?
> Searching for it, I found some references for EV_NETDEV in kqueue, but this seems to be a legacy function which has been removed years ago.
>
> In the console of the Zedboard, for example, I see those events as info statements, but haven't found an API to hook into that:
>
> info: lo0: link state changed to UP
> info: cgem0: link state changed to DOWN
> info: cgem0: link state changed to UP
You can look at the dhcpcd code to figure out how this works. I think a 
routing socket can be used to get these events.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/



More information about the users mailing list