feat(project): Establish initial IRTT workspace and protocol definitions

Set up the multi-crate project structure and add the core IRTT protocol with pinned dependencies for reproducible builds.
This commit is contained in:
Nils Andreas Svee committed 2026-04-28 16:03:50 +07:00
1 parent dd8b55ad9f
commit 82491f0f61
21 files changed
+1594 -4

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
use crate::{error::Result, ProtoError};
pub const FLAG_OPEN: u8 = 0x01;
pub const FLAG_REPLY: u8 = 0x02;
pub const FLAG_CLOSE: u8 = 0x04;
pub const FLAG_HMAC: u8 = 0x08;
pub const RESERVED_FLAGS_MASK: u8 = 0xF0;
pub fn validate_flags(flags: u8) -> Result<()> {
let reserved = flags & RESERVED_FLAGS_MASK;
if reserved != 0 {
return Err(ProtoError::ReservedFlags(reserved));
}
Ok(())
}
pub fn has(flags: u8, flag: u8) -> bool {
flags & flag != 0
}