show link state of HDLC netdev
We want to see the link state (up/down) of each HDLC netdev on which we have NS-VCs configured.
This should not be queried at the time of the "show" command, but we shoul continuously have an "ip link monitor" running, which will provide us with state change events. We then update some internal state member variables as well as log any state transitions.
#1 Updated by laforge about 2 months ago
- Status changed from New to In Progress
- Priority changed from Normal to High
- % Done changed from 0 to 50
The patch currently only receives events. What's missing is to obtain the initial state at start-up.
#2 Updated by laforge about 2 months ago
- % Done changed from 50 to 80
From v4 of https://gerrit.osmocom.org/c/libosmocore/+/21458 onwards, the initial state is also dumped. The state nicely reflects in the VTY, and we get related log messages.
<0024> gprs_ns2_fr.c:420 FR net-device 'hdlcnet2': Physical link state changed: DOWN <0024> gprs_ns2_fr.c:420 FR net-device 'hdlcnet2': Physical link state changed: UP
OsmoGbProxy> show ns binds FR bind: hdlcnet1, role: NETWORK, link: UP NSVCI 00001: fr)netif: hdlcnet1 dlci: 16 FR bind: hdlcnet2, role: NETWORK, link: UP NSVCI 00002: fr)netif: hdlcnet2 dlci: 17 FR bind: hdlcnet3, role: NETWORK, link: UP NSVCI 00003: fr)netif: hdlcnet3 dlci: 18 FR bind: hdlcnet4, role: NETWORK, link: UP NSVCI 00004: fr)netif: hdlcnet4 dlci: 19