|
|
|
@ -151,7 +151,10 @@ impl<T: Log> EbpfLogger<T> {
|
|
|
|
|
.ok_or_else(|| Error::MapNotFound)?
|
|
|
|
|
.iter()
|
|
|
|
|
.filter_map(|id| MapInfo::from_id(*id).ok())
|
|
|
|
|
.find(|map_info| map_info.name_as_str() == Some(MAP_NAME))
|
|
|
|
|
.find(|map_info| match map_info.name_as_str() {
|
|
|
|
|
Some(name) => name == MAP_NAME,
|
|
|
|
|
None => false,
|
|
|
|
|
})
|
|
|
|
|
.ok_or(Error::MapNotFound)?;
|
|
|
|
|
let map = MapData::from_id(map.id())?;
|
|
|
|
|
|
|
|
|
@ -292,7 +295,7 @@ impl Format for u32 {
|
|
|
|
|
Some(DisplayHint::Ip) => Ok(Ipv4Formatter::format(*self)),
|
|
|
|
|
Some(DisplayHint::LowerMac) => Err(()),
|
|
|
|
|
Some(DisplayHint::UpperMac) => Err(()),
|
|
|
|
|
None => Ok(DefaultFormatter::format(self)),
|
|
|
|
|
_ => Ok(DefaultFormatter::format(self)),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -348,7 +351,7 @@ impl Format for [u8; 6] {
|
|
|
|
|
Some(DisplayHint::Ip) => Err(()),
|
|
|
|
|
Some(DisplayHint::LowerMac) => Ok(LowerMacFormatter::format(*self)),
|
|
|
|
|
Some(DisplayHint::UpperMac) => Ok(UpperMacFormatter::format(*self)),
|
|
|
|
|
None => Err(()),
|
|
|
|
|
_ => Err(()),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -362,7 +365,7 @@ impl Format for [u8; 16] {
|
|
|
|
|
Some(DisplayHint::Ip) => Ok(Ipv6Formatter::format(*self)),
|
|
|
|
|
Some(DisplayHint::LowerMac) => Err(()),
|
|
|
|
|
Some(DisplayHint::UpperMac) => Err(()),
|
|
|
|
|
None => Err(()),
|
|
|
|
|
_ => Err(()),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -376,7 +379,7 @@ impl Format for [u16; 8] {
|
|
|
|
|
Some(DisplayHint::Ip) => Ok(Ipv6Formatter::format(*self)),
|
|
|
|
|
Some(DisplayHint::LowerMac) => Err(()),
|
|
|
|
|
Some(DisplayHint::UpperMac) => Err(()),
|
|
|
|
|
None => Err(()),
|
|
|
|
|
_ => Err(()),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -392,7 +395,7 @@ macro_rules! impl_format {
|
|
|
|
|
Some(DisplayHint::Ip) => Err(()),
|
|
|
|
|
Some(DisplayHint::LowerMac) => Err(()),
|
|
|
|
|
Some(DisplayHint::UpperMac) => Err(()),
|
|
|
|
|
None => Ok(DefaultFormatter::format(self)),
|
|
|
|
|
_ => Ok(DefaultFormatter::format(self)),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -421,7 +424,7 @@ macro_rules! impl_format_float {
|
|
|
|
|
Some(DisplayHint::Ip) => Err(()),
|
|
|
|
|
Some(DisplayHint::LowerMac) => Err(()),
|
|
|
|
|
Some(DisplayHint::UpperMac) => Err(()),
|
|
|
|
|
None => Ok(DefaultFormatter::format(self)),
|
|
|
|
|
_ => Ok(DefaultFormatter::format(self)),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|