aboutsummaryrefslogtreecommitdiff
path: root/src/structs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/structs.rs')
-rw-r--r--src/structs.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/structs.rs b/src/structs.rs
index 8a98d5227..beda9f364 100644
--- a/src/structs.rs
+++ b/src/structs.rs
@@ -92,6 +92,18 @@ pub struct EventHeader {
92} 92}
93impl_bytes!(EventHeader); 93impl_bytes!(EventHeader);
94 94
95impl EventHeader {
96 pub fn byteswap(&mut self) {
97 self.version = self.version.to_be();
98 self.flags = self.flags.to_be();
99 self.event_type = self.event_type.to_be();
100 self.status = self.status.to_be();
101 self.reason = self.reason.to_be();
102 self.auth_type = self.auth_type.to_be();
103 self.datalen = self.datalen.to_be();
104 }
105}
106
95#[derive(Clone, Copy)] 107#[derive(Clone, Copy)]
96#[repr(C)] 108#[repr(C)]
97pub struct DownloadHeader { 109pub struct DownloadHeader {