|
@@ -283,20 +283,14 @@ fn unpack_nodestatus(c_nodestatus: ffi::corosync_cfg_node_status_v1) -> Result<N
|
|
|
onwire_ver: c_nodestatus.onwire_min,
|
|
onwire_ver: c_nodestatus.onwire_min,
|
|
|
link_status: Vec::<LinkStatus>::new(),
|
|
link_status: Vec::<LinkStatus>::new(),
|
|
|
};
|
|
};
|
|
|
- for i in 0..CFG_MAX_LINKS {
|
|
|
|
|
|
|
+ for c_link in c_nodestatus.link_status.iter().take(CFG_MAX_LINKS) {
|
|
|
let ls = LinkStatus {
|
|
let ls = LinkStatus {
|
|
|
- enabled: u8_to_bool(c_nodestatus.link_status[i].enabled),
|
|
|
|
|
- connected: u8_to_bool(c_nodestatus.link_status[i].connected),
|
|
|
|
|
- dynconnected: u8_to_bool(c_nodestatus.link_status[i].dynconnected),
|
|
|
|
|
- mtu: c_nodestatus.link_status[i].mtu,
|
|
|
|
|
- src_ipaddr: string_from_bytes(
|
|
|
|
|
- &c_nodestatus.link_status[i].src_ipaddr[0],
|
|
|
|
|
- CFG_MAX_HOST_LEN,
|
|
|
|
|
- )?,
|
|
|
|
|
- dst_ipaddr: string_from_bytes(
|
|
|
|
|
- &c_nodestatus.link_status[i].dst_ipaddr[0],
|
|
|
|
|
- CFG_MAX_HOST_LEN,
|
|
|
|
|
- )?,
|
|
|
|
|
|
|
+ enabled: u8_to_bool(c_link.enabled),
|
|
|
|
|
+ connected: u8_to_bool(c_link.connected),
|
|
|
|
|
+ dynconnected: u8_to_bool(c_link.dynconnected),
|
|
|
|
|
+ mtu: c_link.mtu,
|
|
|
|
|
+ src_ipaddr: string_from_bytes(&c_link.src_ipaddr[0], CFG_MAX_HOST_LEN)?,
|
|
|
|
|
+ dst_ipaddr: string_from_bytes(&c_link.dst_ipaddr[0], CFG_MAX_HOST_LEN)?,
|
|
|
};
|
|
};
|
|
|
ns.link_status.push(ls);
|
|
ns.link_status.push(ls);
|
|
|
}
|
|
}
|