mirror of
https://github.com/Noratrieb/cluelessh.git
synced 2026-01-16 01:15:04 +01:00
glorious sans-io tests
This commit is contained in:
parent
d68caf8e3c
commit
8c1f3afd89
3 changed files with 107 additions and 12 deletions
|
|
@ -148,6 +148,10 @@ pub struct Packet {
|
|||
impl Packet {
|
||||
pub const DEFAULT_BLOCK_SIZE: u8 = 8;
|
||||
|
||||
pub fn packet_type(&self) -> u8 {
|
||||
self.payload[0]
|
||||
}
|
||||
|
||||
pub(crate) fn from_full(bytes: &[u8]) -> Result<Self> {
|
||||
let Some(padding_length) = bytes.first() else {
|
||||
return Err(client_error!("empty packet"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue