diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-07-11 22:44:42 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-07-11 22:44:42 +0200 |
| commit | 3ffdbd2ca3ed7cc3da95c391f1928342afb55e10 (patch) | |
| tree | 05173dd196d6034b1d217bf8162d7334577a4376 /src/structs.rs | |
| parent | 30b7800f9ae0a7f26e292dbe55cc67fbe2d1b131 (diff) | |
stuff
Diffstat (limited to 'src/structs.rs')
| -rw-r--r-- | src/structs.rs | 12 |
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 | } |
| 93 | impl_bytes!(EventHeader); | 93 | impl_bytes!(EventHeader); |
| 94 | 94 | ||
| 95 | impl 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)] |
| 97 | pub struct DownloadHeader { | 109 | pub struct DownloadHeader { |
