I have a simple application that does provides property table for network
devices (maybe it would be useful for a more complete example somewhere).
The app is more to show how to use sdbus, not to replace network manager.

The next step is to add ethtool statistics. Each type of network device will 
have
different set of named properties. How could this be implemented?
So far, the only idea would be to dynamically build a vtable then
register it?


# busctl tree  org.networkplumber.net1
└─/org
  └─/org/networkplumber
    └─/org/networkplumber/net1
      └─/org/networkplumber/net1/interface
        ├─/org/networkplumber/net1/interface/eno1
        ├─/org/networkplumber/net1/interface/eno2
        ├─/org/networkplumber/net1/interface/ens11
        └─/org/networkplumber/net1/interface/lo

# busctl introspect org.networkplumber.net1 
/org/networkplumber/net1/interface/eno1
NAME                                TYPE      SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface -         -            -
.Introspect                         method    -         s            -
org.freedesktop.DBus.Peer           interface -         -            -
.GetMachineId                       method    -         s            -
.Ping                               method    -         -            -
org.freedesktop.DBus.Properties     interface -         -            -
.Get                                method    ss        v            -
.GetAll                             method    s         a{sv}        -
.Set                                method    ssv       -            -
.PropertiesChanged                  signal    sa{sv}as  -            -
org.networkplumber.net1.Interface   interface -         -            -
.carrier                            property  q         1            -
.ifindex                            property  q         2            -
.iflink                             property  q         2            -
.mtu                                property  q         1500         -


Want to be able to add these:
# ethtool -S eno1 | grep -v ' 0$'
NIC statistics:
     rx_packets: 84980
     tx_packets: 32068
     rx_bytes: 107413644
     tx_bytes: 9299204
     rx_broadcast: 219
     tx_broadcast: 84
     rx_multicast: 152
     tx_multicast: 157
     multicast: 152
     tx_tcp_seg_good: 1561
     rx_long_byte_count: 107413644
     tx_queue_0_packets: 6888
     tx_queue_0_bytes: 3127349
     tx_queue_1_packets: 6307
     tx_queue_1_bytes: 3623152
     tx_queue_2_packets: 12569
     tx_queue_2_bytes: 1239345
     tx_queue_3_packets: 6304
     tx_queue_3_bytes: 1163512
     rx_queue_0_packets: 17936
     rx_queue_0_bytes: 21464312
     rx_queue_1_packets: 20651
     rx_queue_1_bytes: 27029893
     rx_queue_2_packets: 12642
     rx_queue_2_bytes: 13132543
     rx_queue_3_packets: 33751
     rx_queue_3_bytes: 45446976

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to