Linux运营商检测通知 [英] Linux carrier detection notification

查看:206
本文介绍了Linux运营商检测通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux中是否有接口来获取网络接口运营商变更的通知?我知道可以轮询与SIOCETHTOOL的接口,但是想知道是否有任何方法可以得到通知,或者是否有任何因载波检测更改而返回的阻塞呼叫?

Is there an interface in Linux to get notification of a network interface carrier change? I know its possible to poll an interface with SIOCETHTOOL, but was wondering if there was any way to get notified or any blocking calls that would return on carrier detection changes?

推荐答案

是否需要运营商过渡或接口状态更改?对于接口状态,您可以侦听NETLINK_ROUTE netlink套接字并等待RTM_NEWLINK和RTM_DELLINK消息

Do you need carrier transition or interface state change? For the interface state you could listen to the NETLINK_ROUTE netlink socket and wait for RTM_NEWLINK and RTM_DELLINK messages

这篇关于Linux运营商检测通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆