use super::lib::*;
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxCpuState {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "index")))]
pub index: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid")))]
pub pid: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pcpu")))]
pub pcpu: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "time")))]
pub time: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tname")))]
pub tname: SbpString<[u8; 15], Unterminated>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cmdline")))]
pub cmdline: SbpString<Vec<u8>, Unterminated>,
}
impl ConcreteMessage for MsgLinuxCpuState {
const MESSAGE_TYPE: u16 = 32520;
const MESSAGE_NAME: &'static str = "MSG_LINUX_CPU_STATE";
}
impl SbpMessage for MsgLinuxCpuState {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxCpuState {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxCpuState(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxCpuState {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <SbpString<[u8; 15], Unterminated> as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, Unterminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.index)
+ WireFormat::len(&self.pid)
+ WireFormat::len(&self.pcpu)
+ WireFormat::len(&self.time)
+ WireFormat::len(&self.flags)
+ WireFormat::len(&self.tname)
+ WireFormat::len(&self.cmdline)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.index, buf);
WireFormat::write(&self.pid, buf);
WireFormat::write(&self.pcpu, buf);
WireFormat::write(&self.time, buf);
WireFormat::write(&self.flags, buf);
WireFormat::write(&self.tname, buf);
WireFormat::write(&self.cmdline, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxCpuState {
sender_id: None,
index: WireFormat::parse_unchecked(buf),
pid: WireFormat::parse_unchecked(buf),
pcpu: WireFormat::parse_unchecked(buf),
time: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
tname: WireFormat::parse_unchecked(buf),
cmdline: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxCpuStateDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "index")))]
pub index: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid")))]
pub pid: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pcpu")))]
pub pcpu: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tname")))]
pub tname: SbpString<[u8; 15], Unterminated>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cmdline")))]
pub cmdline: SbpString<Vec<u8>, Unterminated>,
}
impl ConcreteMessage for MsgLinuxCpuStateDepA {
const MESSAGE_TYPE: u16 = 32512;
const MESSAGE_NAME: &'static str = "MSG_LINUX_CPU_STATE_DEP_A";
}
impl SbpMessage for MsgLinuxCpuStateDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxCpuStateDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxCpuStateDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxCpuStateDepA {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <SbpString<[u8; 15], Unterminated> as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, Unterminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.index)
+ WireFormat::len(&self.pid)
+ WireFormat::len(&self.pcpu)
+ WireFormat::len(&self.tname)
+ WireFormat::len(&self.cmdline)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.index, buf);
WireFormat::write(&self.pid, buf);
WireFormat::write(&self.pcpu, buf);
WireFormat::write(&self.tname, buf);
WireFormat::write(&self.cmdline, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxCpuStateDepA {
sender_id: None,
index: WireFormat::parse_unchecked(buf),
pid: WireFormat::parse_unchecked(buf),
pcpu: WireFormat::parse_unchecked(buf),
tname: WireFormat::parse_unchecked(buf),
cmdline: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxMemState {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "index")))]
pub index: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid")))]
pub pid: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pmem")))]
pub pmem: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "time")))]
pub time: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tname")))]
pub tname: SbpString<[u8; 15], Unterminated>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cmdline")))]
pub cmdline: SbpString<Vec<u8>, Unterminated>,
}
impl ConcreteMessage for MsgLinuxMemState {
const MESSAGE_TYPE: u16 = 32521;
const MESSAGE_NAME: &'static str = "MSG_LINUX_MEM_STATE";
}
impl SbpMessage for MsgLinuxMemState {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxMemState {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxMemState(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxMemState {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <SbpString<[u8; 15], Unterminated> as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, Unterminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.index)
+ WireFormat::len(&self.pid)
+ WireFormat::len(&self.pmem)
+ WireFormat::len(&self.time)
+ WireFormat::len(&self.flags)
+ WireFormat::len(&self.tname)
+ WireFormat::len(&self.cmdline)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.index, buf);
WireFormat::write(&self.pid, buf);
WireFormat::write(&self.pmem, buf);
WireFormat::write(&self.time, buf);
WireFormat::write(&self.flags, buf);
WireFormat::write(&self.tname, buf);
WireFormat::write(&self.cmdline, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxMemState {
sender_id: None,
index: WireFormat::parse_unchecked(buf),
pid: WireFormat::parse_unchecked(buf),
pmem: WireFormat::parse_unchecked(buf),
time: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
tname: WireFormat::parse_unchecked(buf),
cmdline: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxMemStateDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "index")))]
pub index: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid")))]
pub pid: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pmem")))]
pub pmem: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "tname")))]
pub tname: SbpString<[u8; 15], Unterminated>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cmdline")))]
pub cmdline: SbpString<Vec<u8>, Unterminated>,
}
impl ConcreteMessage for MsgLinuxMemStateDepA {
const MESSAGE_TYPE: u16 = 32513;
const MESSAGE_NAME: &'static str = "MSG_LINUX_MEM_STATE_DEP_A";
}
impl SbpMessage for MsgLinuxMemStateDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxMemStateDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxMemStateDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxMemStateDepA {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <SbpString<[u8; 15], Unterminated> as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, Unterminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.index)
+ WireFormat::len(&self.pid)
+ WireFormat::len(&self.pmem)
+ WireFormat::len(&self.tname)
+ WireFormat::len(&self.cmdline)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.index, buf);
WireFormat::write(&self.pid, buf);
WireFormat::write(&self.pmem, buf);
WireFormat::write(&self.tname, buf);
WireFormat::write(&self.cmdline, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxMemStateDepA {
sender_id: None,
index: WireFormat::parse_unchecked(buf),
pid: WireFormat::parse_unchecked(buf),
pmem: WireFormat::parse_unchecked(buf),
tname: WireFormat::parse_unchecked(buf),
cmdline: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxProcessFdCount {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "index")))]
pub index: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid")))]
pub pid: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "fd_count")))]
pub fd_count: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cmdline")))]
pub cmdline: SbpString<Vec<u8>, Unterminated>,
}
impl ConcreteMessage for MsgLinuxProcessFdCount {
const MESSAGE_TYPE: u16 = 32518;
const MESSAGE_NAME: &'static str = "MSG_LINUX_PROCESS_FD_COUNT";
}
impl SbpMessage for MsgLinuxProcessFdCount {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxProcessFdCount {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxProcessFdCount(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxProcessFdCount {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, Unterminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.index)
+ WireFormat::len(&self.pid)
+ WireFormat::len(&self.fd_count)
+ WireFormat::len(&self.cmdline)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.index, buf);
WireFormat::write(&self.pid, buf);
WireFormat::write(&self.fd_count, buf);
WireFormat::write(&self.cmdline, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxProcessFdCount {
sender_id: None,
index: WireFormat::parse_unchecked(buf),
pid: WireFormat::parse_unchecked(buf),
fd_count: WireFormat::parse_unchecked(buf),
cmdline: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxProcessFdSummary {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "sys_fd_count")))]
pub sys_fd_count: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "most_opened")))]
pub most_opened: SbpString<Vec<u8>, DoubleNullTerminated>,
}
impl ConcreteMessage for MsgLinuxProcessFdSummary {
const MESSAGE_TYPE: u16 = 32519;
const MESSAGE_NAME: &'static str = "MSG_LINUX_PROCESS_FD_SUMMARY";
}
impl SbpMessage for MsgLinuxProcessFdSummary {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxProcessFdSummary {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxProcessFdSummary(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxProcessFdSummary {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, DoubleNullTerminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.sys_fd_count) + WireFormat::len(&self.most_opened)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.sys_fd_count, buf);
WireFormat::write(&self.most_opened, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxProcessFdSummary {
sender_id: None,
sys_fd_count: WireFormat::parse_unchecked(buf),
most_opened: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxProcessSocketCounts {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "index")))]
pub index: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid")))]
pub pid: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "socket_count")))]
pub socket_count: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "socket_types")))]
pub socket_types: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "socket_states")))]
pub socket_states: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cmdline")))]
pub cmdline: SbpString<Vec<u8>, Unterminated>,
}
impl ConcreteMessage for MsgLinuxProcessSocketCounts {
const MESSAGE_TYPE: u16 = 32515;
const MESSAGE_NAME: &'static str = "MSG_LINUX_PROCESS_SOCKET_COUNTS";
}
impl SbpMessage for MsgLinuxProcessSocketCounts {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxProcessSocketCounts {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxProcessSocketCounts(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxProcessSocketCounts {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, Unterminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.index)
+ WireFormat::len(&self.pid)
+ WireFormat::len(&self.socket_count)
+ WireFormat::len(&self.socket_types)
+ WireFormat::len(&self.socket_states)
+ WireFormat::len(&self.cmdline)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.index, buf);
WireFormat::write(&self.pid, buf);
WireFormat::write(&self.socket_count, buf);
WireFormat::write(&self.socket_types, buf);
WireFormat::write(&self.socket_states, buf);
WireFormat::write(&self.cmdline, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxProcessSocketCounts {
sender_id: None,
index: WireFormat::parse_unchecked(buf),
pid: WireFormat::parse_unchecked(buf),
socket_count: WireFormat::parse_unchecked(buf),
socket_types: WireFormat::parse_unchecked(buf),
socket_states: WireFormat::parse_unchecked(buf),
cmdline: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxProcessSocketQueues {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "index")))]
pub index: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid")))]
pub pid: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "recv_queued")))]
pub recv_queued: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "send_queued")))]
pub send_queued: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "socket_types")))]
pub socket_types: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "socket_states")))]
pub socket_states: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "address_of_largest")))]
pub address_of_largest: SbpString<[u8; 64], Unterminated>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "cmdline")))]
pub cmdline: SbpString<Vec<u8>, Unterminated>,
}
impl ConcreteMessage for MsgLinuxProcessSocketQueues {
const MESSAGE_TYPE: u16 = 32516;
const MESSAGE_NAME: &'static str = "MSG_LINUX_PROCESS_SOCKET_QUEUES";
}
impl SbpMessage for MsgLinuxProcessSocketQueues {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxProcessSocketQueues {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxProcessSocketQueues(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxProcessSocketQueues {
const MIN_LEN: usize = <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <SbpString<[u8; 64], Unterminated> as WireFormat>::MIN_LEN
+ <SbpString<Vec<u8>, Unterminated> as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.index)
+ WireFormat::len(&self.pid)
+ WireFormat::len(&self.recv_queued)
+ WireFormat::len(&self.send_queued)
+ WireFormat::len(&self.socket_types)
+ WireFormat::len(&self.socket_states)
+ WireFormat::len(&self.address_of_largest)
+ WireFormat::len(&self.cmdline)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.index, buf);
WireFormat::write(&self.pid, buf);
WireFormat::write(&self.recv_queued, buf);
WireFormat::write(&self.send_queued, buf);
WireFormat::write(&self.socket_types, buf);
WireFormat::write(&self.socket_states, buf);
WireFormat::write(&self.address_of_largest, buf);
WireFormat::write(&self.cmdline, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxProcessSocketQueues {
sender_id: None,
index: WireFormat::parse_unchecked(buf),
pid: WireFormat::parse_unchecked(buf),
recv_queued: WireFormat::parse_unchecked(buf),
send_queued: WireFormat::parse_unchecked(buf),
socket_types: WireFormat::parse_unchecked(buf),
socket_states: WireFormat::parse_unchecked(buf),
address_of_largest: WireFormat::parse_unchecked(buf),
cmdline: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxSocketUsage {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "avg_queue_depth")))]
pub avg_queue_depth: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "max_queue_depth")))]
pub max_queue_depth: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "socket_state_counts")))]
pub socket_state_counts: [u16; 16],
#[cfg_attr(feature = "serde", serde(rename(serialize = "socket_type_counts")))]
pub socket_type_counts: [u16; 16],
}
impl ConcreteMessage for MsgLinuxSocketUsage {
const MESSAGE_TYPE: u16 = 32517;
const MESSAGE_NAME: &'static str = "MSG_LINUX_SOCKET_USAGE";
}
impl SbpMessage for MsgLinuxSocketUsage {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxSocketUsage {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxSocketUsage(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxSocketUsage {
const MIN_LEN: usize = <u32 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <[u16; 16] as WireFormat>::MIN_LEN
+ <[u16; 16] as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.avg_queue_depth)
+ WireFormat::len(&self.max_queue_depth)
+ WireFormat::len(&self.socket_state_counts)
+ WireFormat::len(&self.socket_type_counts)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.avg_queue_depth, buf);
WireFormat::write(&self.max_queue_depth, buf);
WireFormat::write(&self.socket_state_counts, buf);
WireFormat::write(&self.socket_type_counts, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxSocketUsage {
sender_id: None,
avg_queue_depth: WireFormat::parse_unchecked(buf),
max_queue_depth: WireFormat::parse_unchecked(buf),
socket_state_counts: WireFormat::parse_unchecked(buf),
socket_type_counts: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxSysState {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "mem_total")))]
pub mem_total: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pcpu")))]
pub pcpu: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pmem")))]
pub pmem: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "procs_starting")))]
pub procs_starting: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "procs_stopping")))]
pub procs_stopping: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid_count")))]
pub pid_count: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "time")))]
pub time: u32,
#[cfg_attr(feature = "serde", serde(rename(serialize = "flags")))]
pub flags: u8,
}
impl ConcreteMessage for MsgLinuxSysState {
const MESSAGE_TYPE: u16 = 32522;
const MESSAGE_NAME: &'static str = "MSG_LINUX_SYS_STATE";
}
impl SbpMessage for MsgLinuxSysState {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxSysState {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxSysState(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxSysState {
const MIN_LEN: usize = <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u32 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.mem_total)
+ WireFormat::len(&self.pcpu)
+ WireFormat::len(&self.pmem)
+ WireFormat::len(&self.procs_starting)
+ WireFormat::len(&self.procs_stopping)
+ WireFormat::len(&self.pid_count)
+ WireFormat::len(&self.time)
+ WireFormat::len(&self.flags)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.mem_total, buf);
WireFormat::write(&self.pcpu, buf);
WireFormat::write(&self.pmem, buf);
WireFormat::write(&self.procs_starting, buf);
WireFormat::write(&self.procs_stopping, buf);
WireFormat::write(&self.pid_count, buf);
WireFormat::write(&self.time, buf);
WireFormat::write(&self.flags, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxSysState {
sender_id: None,
mem_total: WireFormat::parse_unchecked(buf),
pcpu: WireFormat::parse_unchecked(buf),
pmem: WireFormat::parse_unchecked(buf),
procs_starting: WireFormat::parse_unchecked(buf),
procs_stopping: WireFormat::parse_unchecked(buf),
pid_count: WireFormat::parse_unchecked(buf),
time: WireFormat::parse_unchecked(buf),
flags: WireFormat::parse_unchecked(buf),
}
}
}
#[cfg_attr(feature = "serde", derive(serde::Serialize))]
#[derive(Debug, Clone)]
pub struct MsgLinuxSysStateDepA {
#[cfg_attr(feature = "serde", serde(skip_serializing))]
pub sender_id: Option<u16>,
#[cfg_attr(feature = "serde", serde(rename(serialize = "mem_total")))]
pub mem_total: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pcpu")))]
pub pcpu: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pmem")))]
pub pmem: u8,
#[cfg_attr(feature = "serde", serde(rename(serialize = "procs_starting")))]
pub procs_starting: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "procs_stopping")))]
pub procs_stopping: u16,
#[cfg_attr(feature = "serde", serde(rename(serialize = "pid_count")))]
pub pid_count: u16,
}
impl ConcreteMessage for MsgLinuxSysStateDepA {
const MESSAGE_TYPE: u16 = 32514;
const MESSAGE_NAME: &'static str = "MSG_LINUX_SYS_STATE_DEP_A";
}
impl SbpMessage for MsgLinuxSysStateDepA {
fn message_name(&self) -> &'static str {
<Self as ConcreteMessage>::MESSAGE_NAME
}
fn message_type(&self) -> u16 {
<Self as ConcreteMessage>::MESSAGE_TYPE
}
fn sender_id(&self) -> Option<u16> {
self.sender_id
}
fn set_sender_id(&mut self, new_id: u16) {
self.sender_id = Some(new_id);
}
fn encoded_len(&self) -> usize {
WireFormat::len(self) + crate::HEADER_LEN + crate::CRC_LEN
}
}
impl TryFrom<Sbp> for MsgLinuxSysStateDepA {
type Error = TryFromSbpError;
fn try_from(msg: Sbp) -> Result<Self, Self::Error> {
match msg {
Sbp::MsgLinuxSysStateDepA(m) => Ok(m),
_ => Err(TryFromSbpError),
}
}
}
impl WireFormat for MsgLinuxSysStateDepA {
const MIN_LEN: usize = <u16 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u8 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN
+ <u16 as WireFormat>::MIN_LEN;
fn len(&self) -> usize {
WireFormat::len(&self.mem_total)
+ WireFormat::len(&self.pcpu)
+ WireFormat::len(&self.pmem)
+ WireFormat::len(&self.procs_starting)
+ WireFormat::len(&self.procs_stopping)
+ WireFormat::len(&self.pid_count)
}
fn write<B: BufMut>(&self, buf: &mut B) {
WireFormat::write(&self.mem_total, buf);
WireFormat::write(&self.pcpu, buf);
WireFormat::write(&self.pmem, buf);
WireFormat::write(&self.procs_starting, buf);
WireFormat::write(&self.procs_stopping, buf);
WireFormat::write(&self.pid_count, buf);
}
fn parse_unchecked<B: Buf>(buf: &mut B) -> Self {
MsgLinuxSysStateDepA {
sender_id: None,
mem_total: WireFormat::parse_unchecked(buf),
pcpu: WireFormat::parse_unchecked(buf),
pmem: WireFormat::parse_unchecked(buf),
procs_starting: WireFormat::parse_unchecked(buf),
procs_stopping: WireFormat::parse_unchecked(buf),
pid_count: WireFormat::parse_unchecked(buf),
}
}
}