wasmer_journal/concrete/
archived.rs

1use num_enum::{IntoPrimitive, TryFromPrimitive};
2use rkyv::rancor::Fallible;
3use rkyv::ser::{Allocator, Writer};
4use rkyv::{
5    api::serialize_using, Archive, Deserialize as RkyvDeserialize, Serialize as RkyvSerialize,
6};
7use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr};
8use std::time::{Duration, SystemTime};
9
10use super::*;
11
12pub const JOURNAL_MAGIC_NUMBER: u64 = 0x310d6dd027362979;
13pub const JOURNAL_MAGIC_NUMBER_BYTES: [u8; 8] = JOURNAL_MAGIC_NUMBER.to_be_bytes();
14
15#[repr(u16)]
16#[derive(
17    Debug,
18    Clone,
19    Copy,
20    PartialEq,
21    Eq,
22    IntoPrimitive,
23    TryFromPrimitive,
24    RkyvSerialize,
25    RkyvDeserialize,
26    Archive,
27)]
28#[rkyv(derive(Debug))]
29pub enum JournalEntryRecordType {
30    InitModuleV1 = 1,
31    ProcessExitV1 = 2,
32    SetThreadV1 = 3,
33    CloseThreadV1 = 4,
34    FileDescriptorSeekV1 = 5,
35    FileDescriptorWriteV1 = 6,
36    UpdateMemoryRegionV1 = 7,
37    SetClockTimeV1 = 9,
38    OpenFileDescriptorV1 = 10,
39    CloseFileDescriptorV1 = 11,
40    RenumberFileDescriptorV1 = 12,
41    DuplicateFileDescriptorV1 = 13,
42    CreateDirectoryV1 = 14,
43    RemoveDirectoryV1 = 15,
44    PathSetTimesV1 = 16,
45    FileDescriptorSetTimesV1 = 17,
46    FileDescriptorSetSizeV1 = 18,
47    FileDescriptorSetFlagsV1 = 19,
48    FileDescriptorSetRightsV1 = 20,
49    FileDescriptorAdviseV1 = 21,
50    FileDescriptorAllocateV1 = 22,
51    CreateHardLinkV1 = 23,
52    CreateSymbolicLinkV1 = 24,
53    UnlinkFileV1 = 25,
54    PathRenameV1 = 26,
55    ChangeDirectoryV1 = 27,
56    EpollCreateV1 = 28,
57    EpollCtlV1 = 29,
58    TtySetV1 = 30,
59    CreatePipeV1 = 31,
60    CreateEventV1 = 32,
61    PortAddAddrV1 = 33,
62    PortDelAddrV1 = 34,
63    PortAddrClearV1 = 35,
64    PortBridgeV1 = 36,
65    PortUnbridgeV1 = 37,
66    PortDhcpAcquireV1 = 38,
67    PortGatewaySetV1 = 39,
68    PortRouteAddV1 = 40,
69    PortRouteClearV1 = 41,
70    PortRouteDelV1 = 42,
71    SocketOpenV1 = 43,
72    SocketListenV1 = 44,
73    SocketBindV1 = 45,
74    SocketConnectedV1 = 46,
75    SocketAcceptedV1 = 47,
76    SocketJoinIpv4MulticastV1 = 48,
77    SocketJoinIpv6MulticastV1 = 49,
78    SocketLeaveIpv4MulticastV1 = 50,
79    SocketLeaveIpv6MulticastV1 = 51,
80    SocketSendFileV1 = 52,
81    SocketSendToV1 = 53,
82    SocketSendV1 = 54,
83    SocketSetOptFlagV1 = 55,
84    SocketSetOptSizeV1 = 56,
85    SocketSetOptTimeV1 = 57,
86    SocketShutdownV1 = 58,
87    SnapshotV1 = 59,
88    ClearEtherealV1 = 60,
89    OpenFileDescriptorV2 = 61,
90    DuplicateFileDescriptorV2 = 62,
91    FileDescriptorSetFdFlagsV1 = 63,
92    SocketPairV1 = 64,
93}
94
95impl JournalEntryRecordType {
96    /// # Safety
97    ///
98    /// `rykv` makes direct memory references to achieve high performance
99    /// however this does mean care must be taken that the data itself
100    /// can not be manipulated or corrupted.
101    pub unsafe fn deserialize_archive(self, data: &[u8]) -> anyhow::Result<JournalEntry<'_>> {
102        match self {
103            JournalEntryRecordType::InitModuleV1 => {
104                ArchivedJournalEntry::InitModuleV1(rkyv::access_unchecked(data))
105            }
106            JournalEntryRecordType::ClearEtherealV1 => {
107                ArchivedJournalEntry::ClearEtherealV1(rkyv::access_unchecked(data))
108            }
109            JournalEntryRecordType::ProcessExitV1 => {
110                ArchivedJournalEntry::ProcessExitV1(rkyv::access_unchecked(data))
111            }
112            JournalEntryRecordType::SetThreadV1 => {
113                ArchivedJournalEntry::SetThreadV1(rkyv::access_unchecked(data))
114            }
115            JournalEntryRecordType::CloseThreadV1 => {
116                ArchivedJournalEntry::CloseThreadV1(rkyv::access_unchecked(data))
117            }
118            JournalEntryRecordType::FileDescriptorSeekV1 => {
119                ArchivedJournalEntry::FileDescriptorSeekV1(rkyv::access_unchecked(data))
120            }
121            JournalEntryRecordType::FileDescriptorWriteV1 => {
122                ArchivedJournalEntry::FileDescriptorWriteV1(rkyv::access_unchecked(data))
123            }
124            JournalEntryRecordType::UpdateMemoryRegionV1 => {
125                ArchivedJournalEntry::UpdateMemoryRegionV1(rkyv::access_unchecked(data))
126            }
127            JournalEntryRecordType::SetClockTimeV1 => {
128                ArchivedJournalEntry::SetClockTimeV1(rkyv::access_unchecked(data))
129            }
130            JournalEntryRecordType::OpenFileDescriptorV1 => {
131                ArchivedJournalEntry::OpenFileDescriptorV1(rkyv::access_unchecked(data))
132            }
133            JournalEntryRecordType::OpenFileDescriptorV2 => {
134                ArchivedJournalEntry::OpenFileDescriptorV2(rkyv::access_unchecked(data))
135            }
136            JournalEntryRecordType::CloseFileDescriptorV1 => {
137                ArchivedJournalEntry::CloseFileDescriptorV1(rkyv::access_unchecked(data))
138            }
139            JournalEntryRecordType::RenumberFileDescriptorV1 => {
140                ArchivedJournalEntry::RenumberFileDescriptorV1(rkyv::access_unchecked(data))
141            }
142            JournalEntryRecordType::DuplicateFileDescriptorV1 => {
143                ArchivedJournalEntry::DuplicateFileDescriptorV1(rkyv::access_unchecked(data))
144            }
145            JournalEntryRecordType::DuplicateFileDescriptorV2 => {
146                ArchivedJournalEntry::DuplicateFileDescriptorV2(rkyv::access_unchecked(data))
147            }
148            JournalEntryRecordType::CreateDirectoryV1 => {
149                ArchivedJournalEntry::CreateDirectoryV1(rkyv::access_unchecked(data))
150            }
151            JournalEntryRecordType::RemoveDirectoryV1 => {
152                ArchivedJournalEntry::RemoveDirectoryV1(rkyv::access_unchecked(data))
153            }
154            JournalEntryRecordType::PathSetTimesV1 => {
155                ArchivedJournalEntry::PathSetTimesV1(rkyv::access_unchecked(data))
156            }
157            JournalEntryRecordType::FileDescriptorSetTimesV1 => {
158                ArchivedJournalEntry::FileDescriptorSetTimesV1(rkyv::access_unchecked(data))
159            }
160            JournalEntryRecordType::FileDescriptorSetSizeV1 => {
161                ArchivedJournalEntry::FileDescriptorSetSizeV1(rkyv::access_unchecked(data))
162            }
163            JournalEntryRecordType::FileDescriptorSetFdFlagsV1 => {
164                ArchivedJournalEntry::FileDescriptorSetFdFlagsV1(rkyv::access_unchecked(data))
165            }
166            JournalEntryRecordType::FileDescriptorSetFlagsV1 => {
167                ArchivedJournalEntry::FileDescriptorSetFlagsV1(rkyv::access_unchecked(data))
168            }
169            JournalEntryRecordType::FileDescriptorSetRightsV1 => {
170                ArchivedJournalEntry::FileDescriptorSetRightsV1(rkyv::access_unchecked(data))
171            }
172            JournalEntryRecordType::FileDescriptorAdviseV1 => {
173                ArchivedJournalEntry::FileDescriptorAdviseV1(rkyv::access_unchecked(data))
174            }
175            JournalEntryRecordType::FileDescriptorAllocateV1 => {
176                ArchivedJournalEntry::FileDescriptorAllocateV1(rkyv::access_unchecked(data))
177            }
178            JournalEntryRecordType::CreateHardLinkV1 => {
179                ArchivedJournalEntry::CreateHardLinkV1(rkyv::access_unchecked(data))
180            }
181            JournalEntryRecordType::CreateSymbolicLinkV1 => {
182                ArchivedJournalEntry::CreateSymbolicLinkV1(rkyv::access_unchecked(data))
183            }
184            JournalEntryRecordType::UnlinkFileV1 => {
185                ArchivedJournalEntry::UnlinkFileV1(rkyv::access_unchecked(data))
186            }
187            JournalEntryRecordType::PathRenameV1 => {
188                ArchivedJournalEntry::PathRenameV1(rkyv::access_unchecked(data))
189            }
190            JournalEntryRecordType::ChangeDirectoryV1 => {
191                ArchivedJournalEntry::ChangeDirectoryV1(rkyv::access_unchecked(data))
192            }
193            JournalEntryRecordType::EpollCreateV1 => {
194                ArchivedJournalEntry::EpollCreateV1(rkyv::access_unchecked(data))
195            }
196            JournalEntryRecordType::EpollCtlV1 => {
197                ArchivedJournalEntry::EpollCtlV1(rkyv::access_unchecked(data))
198            }
199            JournalEntryRecordType::TtySetV1 => {
200                ArchivedJournalEntry::TtySetV1(rkyv::access_unchecked(data))
201            }
202            JournalEntryRecordType::CreatePipeV1 => {
203                ArchivedJournalEntry::CreatePipeV1(rkyv::access_unchecked(data))
204            }
205            JournalEntryRecordType::CreateEventV1 => {
206                ArchivedJournalEntry::CreateEventV1(rkyv::access_unchecked(data))
207            }
208            JournalEntryRecordType::PortAddAddrV1 => {
209                ArchivedJournalEntry::PortAddAddrV1(rkyv::access_unchecked(data))
210            }
211            JournalEntryRecordType::PortDelAddrV1 => {
212                ArchivedJournalEntry::PortDelAddrV1(rkyv::access_unchecked(data))
213            }
214            JournalEntryRecordType::PortAddrClearV1 => return Ok(JournalEntry::PortAddrClearV1),
215            JournalEntryRecordType::PortBridgeV1 => {
216                ArchivedJournalEntry::PortBridgeV1(rkyv::access_unchecked(data))
217            }
218            JournalEntryRecordType::PortUnbridgeV1 => return Ok(JournalEntry::PortUnbridgeV1),
219            JournalEntryRecordType::PortDhcpAcquireV1 => {
220                return Ok(JournalEntry::PortDhcpAcquireV1)
221            }
222            JournalEntryRecordType::PortGatewaySetV1 => {
223                ArchivedJournalEntry::PortGatewaySetV1(rkyv::access_unchecked(data))
224            }
225            JournalEntryRecordType::PortRouteAddV1 => {
226                ArchivedJournalEntry::PortRouteAddV1(rkyv::access_unchecked(data))
227            }
228            JournalEntryRecordType::PortRouteClearV1 => return Ok(JournalEntry::PortRouteClearV1),
229            JournalEntryRecordType::PortRouteDelV1 => {
230                ArchivedJournalEntry::PortRouteDelV1(rkyv::access_unchecked(data))
231            }
232            JournalEntryRecordType::SocketOpenV1 => {
233                ArchivedJournalEntry::SocketOpenV1(rkyv::access_unchecked(data))
234            }
235            JournalEntryRecordType::SocketPairV1 => {
236                ArchivedJournalEntry::SocketPairV1(rkyv::access_unchecked(data))
237            }
238            JournalEntryRecordType::SocketListenV1 => {
239                ArchivedJournalEntry::SocketListenV1(rkyv::access_unchecked(data))
240            }
241            JournalEntryRecordType::SocketBindV1 => {
242                ArchivedJournalEntry::SocketBindV1(rkyv::access_unchecked(data))
243            }
244            JournalEntryRecordType::SocketConnectedV1 => {
245                ArchivedJournalEntry::SocketConnectedV1(rkyv::access_unchecked(data))
246            }
247            JournalEntryRecordType::SocketAcceptedV1 => {
248                ArchivedJournalEntry::SocketAcceptedV1(rkyv::access_unchecked(data))
249            }
250            JournalEntryRecordType::SocketJoinIpv4MulticastV1 => {
251                ArchivedJournalEntry::SocketJoinIpv4MulticastV1(rkyv::access_unchecked(data))
252            }
253            JournalEntryRecordType::SocketJoinIpv6MulticastV1 => {
254                ArchivedJournalEntry::SocketJoinIpv6MulticastV1(rkyv::access_unchecked(data))
255            }
256            JournalEntryRecordType::SocketLeaveIpv4MulticastV1 => {
257                ArchivedJournalEntry::SocketLeaveIpv4MulticastV1(rkyv::access_unchecked(data))
258            }
259            JournalEntryRecordType::SocketLeaveIpv6MulticastV1 => {
260                ArchivedJournalEntry::SocketLeaveIpv6MulticastV1(rkyv::access_unchecked(data))
261            }
262            JournalEntryRecordType::SocketSendFileV1 => {
263                ArchivedJournalEntry::SocketSendFileV1(rkyv::access_unchecked(data))
264            }
265            JournalEntryRecordType::SocketSendToV1 => {
266                ArchivedJournalEntry::SocketSendToV1(rkyv::access_unchecked(data))
267            }
268            JournalEntryRecordType::SocketSendV1 => {
269                ArchivedJournalEntry::SocketSendV1(rkyv::access_unchecked(data))
270            }
271            JournalEntryRecordType::SocketSetOptFlagV1 => {
272                ArchivedJournalEntry::SocketSetOptFlagV1(rkyv::access_unchecked(data))
273            }
274            JournalEntryRecordType::SocketSetOptSizeV1 => {
275                ArchivedJournalEntry::SocketSetOptSizeV1(rkyv::access_unchecked(data))
276            }
277            JournalEntryRecordType::SocketSetOptTimeV1 => {
278                ArchivedJournalEntry::SocketSetOptTimeV1(rkyv::access_unchecked(data))
279            }
280            JournalEntryRecordType::SocketShutdownV1 => {
281                ArchivedJournalEntry::SocketShutdownV1(rkyv::access_unchecked(data))
282            }
283            JournalEntryRecordType::SnapshotV1 => {
284                ArchivedJournalEntry::SnapshotV1(rkyv::access_unchecked(data))
285            }
286        }
287        .try_into()
288    }
289}
290
291impl<'a> JournalEntry<'a> {
292    pub fn archive_record_type(&self) -> JournalEntryRecordType {
293        match self {
294            Self::InitModuleV1 { .. } => JournalEntryRecordType::InitModuleV1,
295            Self::ClearEtherealV1 { .. } => JournalEntryRecordType::ClearEtherealV1,
296            Self::UpdateMemoryRegionV1 { .. } => JournalEntryRecordType::UpdateMemoryRegionV1,
297            Self::ProcessExitV1 { .. } => JournalEntryRecordType::ProcessExitV1,
298            Self::SetThreadV1 { .. } => JournalEntryRecordType::SetThreadV1,
299            Self::CloseThreadV1 { .. } => JournalEntryRecordType::CloseThreadV1,
300            Self::FileDescriptorSeekV1 { .. } => JournalEntryRecordType::FileDescriptorSeekV1,
301            Self::FileDescriptorWriteV1 { .. } => JournalEntryRecordType::FileDescriptorWriteV1,
302            Self::SetClockTimeV1 { .. } => JournalEntryRecordType::SetClockTimeV1,
303            Self::CloseFileDescriptorV1 { .. } => JournalEntryRecordType::CloseFileDescriptorV1,
304            Self::OpenFileDescriptorV1 { .. } => JournalEntryRecordType::OpenFileDescriptorV1,
305            Self::OpenFileDescriptorV2 { .. } => JournalEntryRecordType::OpenFileDescriptorV2,
306            Self::RenumberFileDescriptorV1 { .. } => {
307                JournalEntryRecordType::RenumberFileDescriptorV1
308            }
309            Self::DuplicateFileDescriptorV1 { .. } => {
310                JournalEntryRecordType::DuplicateFileDescriptorV1
311            }
312            Self::DuplicateFileDescriptorV2 { .. } => {
313                JournalEntryRecordType::DuplicateFileDescriptorV2
314            }
315            Self::CreateDirectoryV1 { .. } => JournalEntryRecordType::CreateDirectoryV1,
316            Self::RemoveDirectoryV1 { .. } => JournalEntryRecordType::RemoveDirectoryV1,
317            Self::PathSetTimesV1 { .. } => JournalEntryRecordType::PathSetTimesV1,
318            Self::FileDescriptorSetTimesV1 { .. } => {
319                JournalEntryRecordType::FileDescriptorSetTimesV1
320            }
321            Self::FileDescriptorSetFdFlagsV1 { .. } => {
322                JournalEntryRecordType::FileDescriptorSetFdFlagsV1
323            }
324            Self::FileDescriptorSetFlagsV1 { .. } => {
325                JournalEntryRecordType::FileDescriptorSetFlagsV1
326            }
327            Self::FileDescriptorSetRightsV1 { .. } => {
328                JournalEntryRecordType::FileDescriptorSetRightsV1
329            }
330            Self::FileDescriptorSetSizeV1 { .. } => JournalEntryRecordType::FileDescriptorSetSizeV1,
331            Self::FileDescriptorAdviseV1 { .. } => JournalEntryRecordType::FileDescriptorAdviseV1,
332            Self::FileDescriptorAllocateV1 { .. } => {
333                JournalEntryRecordType::FileDescriptorAllocateV1
334            }
335            Self::CreateHardLinkV1 { .. } => JournalEntryRecordType::CreateHardLinkV1,
336            Self::CreateSymbolicLinkV1 { .. } => JournalEntryRecordType::CreateSymbolicLinkV1,
337            Self::UnlinkFileV1 { .. } => JournalEntryRecordType::UnlinkFileV1,
338            Self::PathRenameV1 { .. } => JournalEntryRecordType::PathRenameV1,
339            Self::ChangeDirectoryV1 { .. } => JournalEntryRecordType::ChangeDirectoryV1,
340            Self::EpollCreateV1 { .. } => JournalEntryRecordType::EpollCreateV1,
341            Self::EpollCtlV1 { .. } => JournalEntryRecordType::EpollCtlV1,
342            Self::TtySetV1 { .. } => JournalEntryRecordType::TtySetV1,
343            Self::CreatePipeV1 { .. } => JournalEntryRecordType::CreatePipeV1,
344            Self::CreateEventV1 { .. } => JournalEntryRecordType::CreateEventV1,
345            Self::PortAddAddrV1 { .. } => JournalEntryRecordType::PortAddAddrV1,
346            Self::PortDelAddrV1 { .. } => JournalEntryRecordType::PortDelAddrV1,
347            Self::PortAddrClearV1 => JournalEntryRecordType::PortAddrClearV1,
348            Self::PortBridgeV1 { .. } => JournalEntryRecordType::PortBridgeV1,
349            Self::PortUnbridgeV1 => JournalEntryRecordType::PortUnbridgeV1,
350            Self::PortDhcpAcquireV1 => JournalEntryRecordType::PortDhcpAcquireV1,
351            Self::PortGatewaySetV1 { .. } => JournalEntryRecordType::PortGatewaySetV1,
352            Self::PortRouteAddV1 { .. } => JournalEntryRecordType::PortRouteAddV1,
353            Self::PortRouteClearV1 => JournalEntryRecordType::PortRouteClearV1,
354            Self::PortRouteDelV1 { .. } => JournalEntryRecordType::PortRouteDelV1,
355            Self::SocketOpenV1 { .. } => JournalEntryRecordType::SocketOpenV1,
356            Self::SocketPairV1 { .. } => JournalEntryRecordType::SocketPairV1,
357            Self::SocketListenV1 { .. } => JournalEntryRecordType::SocketListenV1,
358            Self::SocketBindV1 { .. } => JournalEntryRecordType::SocketBindV1,
359            Self::SocketConnectedV1 { .. } => JournalEntryRecordType::SocketConnectedV1,
360            Self::SocketAcceptedV1 { .. } => JournalEntryRecordType::SocketAcceptedV1,
361            Self::SocketJoinIpv4MulticastV1 { .. } => {
362                JournalEntryRecordType::SocketJoinIpv4MulticastV1
363            }
364            Self::SocketJoinIpv6MulticastV1 { .. } => {
365                JournalEntryRecordType::SocketJoinIpv6MulticastV1
366            }
367            Self::SocketLeaveIpv4MulticastV1 { .. } => {
368                JournalEntryRecordType::SocketLeaveIpv4MulticastV1
369            }
370            Self::SocketLeaveIpv6MulticastV1 { .. } => {
371                JournalEntryRecordType::SocketLeaveIpv6MulticastV1
372            }
373            Self::SocketSendFileV1 { .. } => JournalEntryRecordType::SocketSendFileV1,
374            Self::SocketSendToV1 { .. } => JournalEntryRecordType::SocketSendToV1,
375            Self::SocketSendV1 { .. } => JournalEntryRecordType::SocketSendV1,
376            Self::SocketSetOptFlagV1 { .. } => JournalEntryRecordType::SocketSetOptFlagV1,
377            Self::SocketSetOptSizeV1 { .. } => JournalEntryRecordType::SocketSetOptSizeV1,
378            Self::SocketSetOptTimeV1 { .. } => JournalEntryRecordType::SocketSetOptTimeV1,
379            Self::SocketShutdownV1 { .. } => JournalEntryRecordType::SocketShutdownV1,
380            Self::SnapshotV1 { .. } => JournalEntryRecordType::SnapshotV1,
381        }
382    }
383
384    pub fn serialize_archive<T: Fallible + Writer + Allocator>(
385        self,
386        serializer: &mut T,
387    ) -> anyhow::Result<usize>
388    where
389        T::Error: rkyv::rancor::Source,
390    {
391        let amt = match self {
392            JournalEntry::InitModuleV1 { wasm_hash } => {
393                serialize_using(&JournalEntryInitModuleV1 { wasm_hash }, serializer)
394            }
395            JournalEntry::ClearEtherealV1 => {
396                serialize_using(&JournalEntryClearEtherealV1 {}, serializer)
397            }
398            JournalEntry::UpdateMemoryRegionV1 {
399                region,
400                compressed_data,
401            } => serialize_using(
402                &JournalEntryUpdateMemoryRegionV1 {
403                    start: region.start,
404                    end: region.end,
405                    compressed_data: compressed_data.into(),
406                },
407                serializer,
408            ),
409            JournalEntry::ProcessExitV1 { exit_code } => serialize_using(
410                &JournalEntryProcessExitV1 {
411                    exit_code: exit_code.map(|e| e.into()),
412                },
413                serializer,
414            ),
415            JournalEntry::SetThreadV1 {
416                id,
417                call_stack,
418                memory_stack,
419                store_data,
420                is_64bit,
421                start,
422                layout,
423            } => serialize_using(
424                &JournalEntrySetThreadV1 {
425                    id,
426                    call_stack: call_stack.into(),
427                    memory_stack: memory_stack.into(),
428                    store_data: store_data.into(),
429                    start: start.into(),
430                    layout: layout.into(),
431                    is_64bit,
432                },
433                serializer,
434            ),
435            JournalEntry::CloseThreadV1 { id, exit_code } => serialize_using(
436                &JournalEntryCloseThreadV1 {
437                    id,
438                    exit_code: exit_code.map(|e| e.into()),
439                },
440                serializer,
441            ),
442            JournalEntry::FileDescriptorSeekV1 { fd, offset, whence } => serialize_using(
443                &JournalEntryFileDescriptorSeekV1 {
444                    fd,
445                    offset,
446                    whence: whence.into(),
447                },
448                serializer,
449            ),
450            JournalEntry::FileDescriptorWriteV1 {
451                fd,
452                offset,
453                data,
454                is_64bit,
455            } => serialize_using(
456                &JournalEntryFileDescriptorWriteV1 {
457                    fd,
458                    offset,
459                    data: data.into(),
460                    is_64bit,
461                },
462                serializer,
463            ),
464            JournalEntry::SetClockTimeV1 { clock_id, time } => serialize_using(
465                &JournalEntrySetClockTimeV1 {
466                    clock_id: clock_id.into(),
467                    time,
468                },
469                serializer,
470            ),
471            JournalEntry::CloseFileDescriptorV1 { fd } => {
472                serialize_using(&JournalEntryCloseFileDescriptorV1 { fd }, serializer)
473            }
474            JournalEntry::OpenFileDescriptorV1 {
475                fd,
476                dirfd,
477                dirflags,
478                path,
479                o_flags,
480                fs_rights_base,
481                fs_rights_inheriting,
482                fs_flags,
483            } => serialize_using(
484                &JournalEntryOpenFileDescriptorV1 {
485                    fd,
486                    dirfd,
487                    dirflags,
488                    path: path.into(),
489                    o_flags: o_flags.bits(),
490                    fs_rights_base: fs_rights_base.bits(),
491                    fs_rights_inheriting: fs_rights_inheriting.bits(),
492                    fs_flags: fs_flags.bits(),
493                },
494                serializer,
495            ),
496            JournalEntry::OpenFileDescriptorV2 {
497                fd,
498                dirfd,
499                dirflags,
500                path,
501                o_flags,
502                fs_rights_base,
503                fs_rights_inheriting,
504                fs_flags,
505                fd_flags,
506            } => serialize_using(
507                &JournalEntryOpenFileDescriptorV2 {
508                    fd,
509                    dirfd,
510                    dirflags,
511                    path: path.into(),
512                    o_flags: o_flags.bits(),
513                    fs_rights_base: fs_rights_base.bits(),
514                    fs_rights_inheriting: fs_rights_inheriting.bits(),
515                    fs_flags: fs_flags.bits(),
516                    fd_flags: fd_flags.bits(),
517                },
518                serializer,
519            ),
520            JournalEntry::RenumberFileDescriptorV1 { old_fd, new_fd } => serialize_using(
521                &JournalEntryRenumberFileDescriptorV1 { old_fd, new_fd },
522                serializer,
523            ),
524            JournalEntry::DuplicateFileDescriptorV1 {
525                original_fd,
526                copied_fd,
527            } => serialize_using(
528                &JournalEntryDuplicateFileDescriptorV1 {
529                    original_fd,
530                    copied_fd,
531                },
532                serializer,
533            ),
534            JournalEntry::DuplicateFileDescriptorV2 {
535                original_fd,
536                copied_fd,
537                cloexec,
538            } => serialize_using(
539                &JournalEntryDuplicateFileDescriptorV2 {
540                    original_fd,
541                    copied_fd,
542                    cloexec,
543                },
544                serializer,
545            ),
546            JournalEntry::CreateDirectoryV1 { fd, path } => serialize_using(
547                &JournalEntryCreateDirectoryV1 {
548                    fd,
549                    path: path.into(),
550                },
551                serializer,
552            ),
553            JournalEntry::RemoveDirectoryV1 { fd, path } => serialize_using(
554                &JournalEntryRemoveDirectoryV1 {
555                    fd,
556                    path: path.into(),
557                },
558                serializer,
559            ),
560            JournalEntry::PathSetTimesV1 {
561                fd,
562                flags,
563                path,
564                st_atim,
565                st_mtim,
566                fst_flags,
567            } => serialize_using(
568                &JournalEntryPathSetTimesV1 {
569                    fd,
570                    flags,
571                    path: path.into(),
572                    st_atim,
573                    st_mtim,
574                    fst_flags: fst_flags.bits(),
575                },
576                serializer,
577            ),
578            JournalEntry::FileDescriptorSetTimesV1 {
579                fd,
580                st_atim,
581                st_mtim,
582                fst_flags,
583            } => serialize_using(
584                &JournalEntryFileDescriptorSetTimesV1 {
585                    fd,
586                    st_atim,
587                    st_mtim,
588                    fst_flags: fst_flags.bits(),
589                },
590                serializer,
591            ),
592            JournalEntry::FileDescriptorSetFdFlagsV1 { fd, flags } => serialize_using(
593                &JournalEntryFileDescriptorSetFdFlagsV1 {
594                    fd,
595                    flags: flags.bits(),
596                },
597                serializer,
598            ),
599            JournalEntry::FileDescriptorSetFlagsV1 { fd, flags } => serialize_using(
600                &JournalEntryFileDescriptorSetFlagsV1 {
601                    fd,
602                    flags: flags.bits(),
603                },
604                serializer,
605            ),
606            JournalEntry::FileDescriptorSetRightsV1 {
607                fd,
608                fs_rights_base,
609                fs_rights_inheriting,
610            } => serialize_using(
611                &JournalEntryFileDescriptorSetRightsV1 {
612                    fd,
613                    fs_rights_base: fs_rights_base.bits(),
614                    fs_rights_inheriting: fs_rights_inheriting.bits(),
615                },
616                serializer,
617            ),
618            JournalEntry::FileDescriptorSetSizeV1 { fd, st_size } => serialize_using(
619                &JournalEntryFileDescriptorSetSizeV1 { fd, st_size },
620                serializer,
621            ),
622            JournalEntry::FileDescriptorAdviseV1 {
623                fd,
624                offset,
625                len,
626                advice,
627            } => serialize_using(
628                &JournalEntryFileDescriptorAdviseV1 {
629                    fd,
630                    offset,
631                    len,
632                    advice: advice.into(),
633                },
634                serializer,
635            ),
636            JournalEntry::FileDescriptorAllocateV1 { fd, offset, len } => serialize_using(
637                &JournalEntryFileDescriptorAllocateV1 { fd, offset, len },
638                serializer,
639            ),
640            JournalEntry::CreateHardLinkV1 {
641                old_fd,
642                old_path,
643                old_flags,
644                new_fd,
645                new_path,
646            } => serialize_using(
647                &JournalEntryCreateHardLinkV1 {
648                    old_fd,
649                    old_path: old_path.into(),
650                    old_flags,
651                    new_fd,
652                    new_path: new_path.into(),
653                },
654                serializer,
655            ),
656            JournalEntry::CreateSymbolicLinkV1 {
657                old_path,
658                fd,
659                new_path,
660            } => serialize_using(
661                &JournalEntryCreateSymbolicLinkV1 {
662                    old_path: old_path.into(),
663                    fd,
664                    new_path: new_path.into(),
665                },
666                serializer,
667            ),
668            JournalEntry::UnlinkFileV1 { fd, path } => serialize_using(
669                &JournalEntryUnlinkFileV1 {
670                    fd,
671                    path: path.into(),
672                },
673                serializer,
674            ),
675            JournalEntry::PathRenameV1 {
676                old_fd,
677                old_path,
678                new_fd,
679                new_path,
680            } => serialize_using(
681                &JournalEntryPathRenameV1 {
682                    old_fd,
683                    old_path: old_path.into(),
684                    new_fd,
685                    new_path: new_path.into(),
686                },
687                serializer,
688            ),
689            JournalEntry::ChangeDirectoryV1 { path } => serialize_using(
690                &JournalEntryChangeDirectoryV1 { path: path.into() },
691                serializer,
692            ),
693            JournalEntry::EpollCreateV1 { fd } => {
694                serialize_using(&JournalEntryEpollCreateV1 { fd }, serializer)
695            }
696            JournalEntry::EpollCtlV1 {
697                epfd,
698                op,
699                fd,
700                event,
701            } => serialize_using(
702                &JournalEntryEpollCtlV1 {
703                    epfd,
704                    op: op.into(),
705                    fd,
706                    event: event.map(|e| e.into()),
707                },
708                serializer,
709            ),
710            JournalEntry::TtySetV1 { tty, line_feeds } => serialize_using(
711                &JournalEntryTtySetV1 {
712                    cols: tty.cols,
713                    rows: tty.rows,
714                    width: tty.width,
715                    height: tty.height,
716                    stdin_tty: tty.stdin_tty,
717                    stdout_tty: tty.stdout_tty,
718                    stderr_tty: tty.stderr_tty,
719                    echo: tty.echo,
720                    line_buffered: tty.line_buffered,
721                    line_feeds,
722                },
723                serializer,
724            ),
725            JournalEntry::CreatePipeV1 { read_fd, write_fd } => {
726                serialize_using(&JournalEntryCreatePipeV1 { read_fd, write_fd }, serializer)
727            }
728            JournalEntry::CreateEventV1 {
729                initial_val,
730                flags,
731                fd,
732            } => serialize_using(
733                &JournalEntryCreateEventV1 {
734                    initial_val,
735                    flags,
736                    fd,
737                },
738                serializer,
739            ),
740            JournalEntry::PortAddAddrV1 { cidr } => {
741                serialize_using(&JournalEntryPortAddAddrV1 { cidr: cidr.into() }, serializer)
742            }
743            JournalEntry::PortDelAddrV1 { addr } => {
744                serialize_using(&JournalEntryPortDelAddrV1 { addr }, serializer)
745            }
746            JournalEntry::PortAddrClearV1 => serialize_using(&(), serializer),
747            JournalEntry::PortBridgeV1 {
748                network,
749                token,
750                security,
751            } => serialize_using(
752                &JournalEntryPortBridgeV1 {
753                    network: network.into(),
754                    token: token.into(),
755                    security: security.into(),
756                },
757                serializer,
758            ),
759            JournalEntry::PortUnbridgeV1 => serialize_using(&(), serializer),
760            JournalEntry::PortDhcpAcquireV1 => serialize_using(&(), serializer),
761            JournalEntry::PortGatewaySetV1 { ip } => {
762                serialize_using(&JournalEntryPortGatewaySetV1 { ip }, serializer)
763            }
764            JournalEntry::PortRouteAddV1 {
765                cidr,
766                via_router,
767                preferred_until,
768                expires_at,
769            } => serialize_using(
770                &JournalEntryPortRouteAddV1 {
771                    cidr: cidr.into(),
772                    via_router,
773                    preferred_until,
774                    expires_at,
775                },
776                serializer,
777            ),
778            JournalEntry::PortRouteClearV1 => serialize_using(&(), serializer),
779            JournalEntry::PortRouteDelV1 { ip } => {
780                serialize_using(&JournalEntryPortRouteDelV1 { ip }, serializer)
781            }
782            JournalEntry::SocketOpenV1 { af, ty, pt, fd } => serialize_using(
783                &JournalEntrySocketOpenV1 {
784                    af: af.into(),
785                    ty: ty.into(),
786                    pt: pt.into(),
787                    fd,
788                },
789                serializer,
790            ),
791            JournalEntry::SocketPairV1 { fd1, fd2 } => {
792                serialize_using(&JournalEntrySocketPairV1 { fd1, fd2 }, serializer)
793            }
794            JournalEntry::SocketListenV1 { fd, backlog } => {
795                serialize_using(&JournalEntrySocketListenV1 { fd, backlog }, serializer)
796            }
797            JournalEntry::SocketBindV1 { fd, addr } => {
798                serialize_using(&JournalEntrySocketBindV1 { fd, addr }, serializer)
799            }
800            JournalEntry::SocketConnectedV1 {
801                fd,
802                local_addr,
803                peer_addr,
804            } => serialize_using(
805                &JournalEntrySocketConnectedV1 {
806                    fd,
807                    local_addr,
808                    peer_addr,
809                },
810                serializer,
811            ),
812            JournalEntry::SocketAcceptedV1 {
813                listen_fd,
814                fd,
815                local_addr: addr,
816                peer_addr,
817                fd_flags,
818                non_blocking: nonblocking,
819            } => serialize_using(
820                &JournalEntrySocketAcceptedV1 {
821                    listen_fd,
822                    fd,
823                    local_addr: addr,
824                    peer_addr,
825                    fd_flags: fd_flags.bits(),
826                    nonblocking,
827                },
828                serializer,
829            ),
830            JournalEntry::SocketJoinIpv4MulticastV1 {
831                fd,
832                multiaddr,
833                iface,
834            } => serialize_using(
835                &JournalEntrySocketJoinIpv4MulticastV1 {
836                    fd,
837                    multiaddr,
838                    iface,
839                },
840                serializer,
841            ),
842            JournalEntry::SocketJoinIpv6MulticastV1 {
843                fd,
844                multi_addr: multiaddr,
845                iface,
846            } => serialize_using(
847                &JournalEntrySocketJoinIpv6MulticastV1 {
848                    fd,
849                    multiaddr,
850                    iface,
851                },
852                serializer,
853            ),
854            JournalEntry::SocketLeaveIpv4MulticastV1 {
855                fd,
856                multi_addr: multiaddr,
857                iface,
858            } => serialize_using(
859                &JournalEntrySocketLeaveIpv4MulticastV1 {
860                    fd,
861                    multiaddr,
862                    iface,
863                },
864                serializer,
865            ),
866            JournalEntry::SocketLeaveIpv6MulticastV1 {
867                fd,
868                multi_addr: multiaddr,
869                iface,
870            } => serialize_using(
871                &JournalEntrySocketLeaveIpv6MulticastV1 {
872                    fd,
873                    multiaddr,
874                    iface,
875                },
876                serializer,
877            ),
878            JournalEntry::SocketSendFileV1 {
879                socket_fd,
880                file_fd,
881                offset,
882                count,
883            } => serialize_using(
884                &JournalEntrySocketSendFileV1 {
885                    socket_fd,
886                    file_fd,
887                    offset,
888                    count,
889                },
890                serializer,
891            ),
892            JournalEntry::SocketSendToV1 {
893                fd,
894                data,
895                flags,
896                addr,
897                is_64bit,
898            } => serialize_using(
899                &JournalEntrySocketSendToV1 {
900                    fd,
901                    data: data.into(),
902                    flags,
903                    addr,
904                    is_64bit,
905                },
906                serializer,
907            ),
908            JournalEntry::SocketSendV1 {
909                fd,
910                data,
911                flags,
912                is_64bit,
913            } => serialize_using(
914                &JournalEntrySocketSendV1 {
915                    fd,
916                    data: data.into(),
917                    flags,
918                    is_64bit,
919                },
920                serializer,
921            ),
922            JournalEntry::SocketSetOptFlagV1 { fd, opt, flag } => serialize_using(
923                &JournalEntrySocketSetOptFlagV1 {
924                    fd,
925                    opt: opt.into(),
926                    flag,
927                },
928                serializer,
929            ),
930            JournalEntry::SocketSetOptSizeV1 { fd, opt, size } => serialize_using(
931                &JournalEntrySocketSetOptSizeV1 {
932                    fd,
933                    opt: opt.into(),
934                    size,
935                },
936                serializer,
937            ),
938            JournalEntry::SocketSetOptTimeV1 { fd, ty, time } => serialize_using(
939                &JournalEntrySocketSetOptTimeV1 {
940                    fd,
941                    ty: ty.into(),
942                    time,
943                },
944                serializer,
945            ),
946            JournalEntry::SocketShutdownV1 { fd, how } => serialize_using(
947                &JournalEntrySocketShutdownV1 {
948                    fd,
949                    how: how.into(),
950                },
951                serializer,
952            ),
953            JournalEntry::SnapshotV1 { when, trigger } => serialize_using(
954                &JournalEntrySnapshotV1 {
955                    since_epoch: when
956                        .duration_since(SystemTime::UNIX_EPOCH)
957                        .unwrap_or(Duration::ZERO),
958                    trigger: trigger.into(),
959                },
960                serializer,
961            ),
962        }
963        .map_err(|err| anyhow::format_err!("failed to serialize journal record - {}", err))?;
964        Ok(amt)
965    }
966}
967
968/// The journal log entries are serializable which
969/// allows them to be written directly to a file
970///
971/// Note: This structure is versioned which allows for
972/// changes to the journal entry types without having to
973/// worry about backward and forward compatibility
974#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
975#[rkyv(derive(Debug))]
976pub(crate) struct JournalEntryHeader {
977    pub record_type: u16,
978    pub record_size: u64,
979}
980
981pub enum ArchivedJournalEntry<'a> {
982    InitModuleV1(&'a ArchivedJournalEntryInitModuleV1),
983    ClearEtherealV1(&'a ArchivedJournalEntryClearEtherealV1),
984    ProcessExitV1(&'a ArchivedJournalEntryProcessExitV1),
985    SetThreadV1(&'a ArchivedJournalEntrySetThreadV1<'a>),
986    CloseThreadV1(&'a ArchivedJournalEntryCloseThreadV1),
987    FileDescriptorSeekV1(&'a ArchivedJournalEntryFileDescriptorSeekV1),
988    FileDescriptorWriteV1(&'a ArchivedJournalEntryFileDescriptorWriteV1<'a>),
989    UpdateMemoryRegionV1(&'a ArchivedJournalEntryUpdateMemoryRegionV1<'a>),
990    SetClockTimeV1(&'a ArchivedJournalEntrySetClockTimeV1),
991    OpenFileDescriptorV1(&'a ArchivedJournalEntryOpenFileDescriptorV1<'a>),
992    OpenFileDescriptorV2(&'a ArchivedJournalEntryOpenFileDescriptorV2<'a>),
993    CloseFileDescriptorV1(&'a ArchivedJournalEntryCloseFileDescriptorV1),
994    RenumberFileDescriptorV1(&'a ArchivedJournalEntryRenumberFileDescriptorV1),
995    DuplicateFileDescriptorV1(&'a ArchivedJournalEntryDuplicateFileDescriptorV1),
996    DuplicateFileDescriptorV2(&'a ArchivedJournalEntryDuplicateFileDescriptorV2),
997    CreateDirectoryV1(&'a ArchivedJournalEntryCreateDirectoryV1<'a>),
998    RemoveDirectoryV1(&'a ArchivedJournalEntryRemoveDirectoryV1<'a>),
999    PathSetTimesV1(&'a ArchivedJournalEntryPathSetTimesV1<'a>),
1000    FileDescriptorSetTimesV1(&'a ArchivedJournalEntryFileDescriptorSetTimesV1),
1001    FileDescriptorSetSizeV1(&'a ArchivedJournalEntryFileDescriptorSetSizeV1),
1002    FileDescriptorSetFdFlagsV1(&'a ArchivedJournalEntryFileDescriptorSetFdFlagsV1),
1003    FileDescriptorSetFlagsV1(&'a ArchivedJournalEntryFileDescriptorSetFlagsV1),
1004    FileDescriptorSetRightsV1(&'a ArchivedJournalEntryFileDescriptorSetRightsV1),
1005    FileDescriptorAdviseV1(&'a ArchivedJournalEntryFileDescriptorAdviseV1),
1006    FileDescriptorAllocateV1(&'a ArchivedJournalEntryFileDescriptorAllocateV1),
1007    CreateHardLinkV1(&'a ArchivedJournalEntryCreateHardLinkV1<'a>),
1008    CreateSymbolicLinkV1(&'a ArchivedJournalEntryCreateSymbolicLinkV1<'a>),
1009    UnlinkFileV1(&'a ArchivedJournalEntryUnlinkFileV1<'a>),
1010    PathRenameV1(&'a ArchivedJournalEntryPathRenameV1<'a>),
1011    ChangeDirectoryV1(&'a ArchivedJournalEntryChangeDirectoryV1<'a>),
1012    EpollCreateV1(&'a ArchivedJournalEntryEpollCreateV1),
1013    EpollCtlV1(&'a ArchivedJournalEntryEpollCtlV1),
1014    TtySetV1(&'a ArchivedJournalEntryTtySetV1),
1015    CreatePipeV1(&'a ArchivedJournalEntryCreatePipeV1),
1016    CreateEventV1(&'a ArchivedJournalEntryCreateEventV1),
1017    PortAddAddrV1(&'a ArchivedJournalEntryPortAddAddrV1),
1018    PortDelAddrV1(&'a ArchivedJournalEntryPortDelAddrV1),
1019    PortAddrClearV1,
1020    PortBridgeV1(&'a ArchivedJournalEntryPortBridgeV1<'a>),
1021    PortUnbridgeV1,
1022    PortDhcpAcquireV1,
1023    PortGatewaySetV1(&'a ArchivedJournalEntryPortGatewaySetV1),
1024    PortRouteAddV1(&'a ArchivedJournalEntryPortRouteAddV1),
1025    PortRouteClearV1,
1026    PortRouteDelV1(&'a ArchivedJournalEntryPortRouteDelV1),
1027    SocketOpenV1(&'a ArchivedJournalEntrySocketOpenV1),
1028    SocketPairV1(&'a ArchivedJournalEntrySocketPairV1),
1029    SocketListenV1(&'a ArchivedJournalEntrySocketListenV1),
1030    SocketBindV1(&'a ArchivedJournalEntrySocketBindV1),
1031    SocketConnectedV1(&'a ArchivedJournalEntrySocketConnectedV1),
1032    SocketAcceptedV1(&'a ArchivedJournalEntrySocketAcceptedV1),
1033    SocketJoinIpv4MulticastV1(&'a ArchivedJournalEntrySocketJoinIpv4MulticastV1),
1034    SocketJoinIpv6MulticastV1(&'a ArchivedJournalEntrySocketJoinIpv6MulticastV1),
1035    SocketLeaveIpv4MulticastV1(&'a ArchivedJournalEntrySocketLeaveIpv4MulticastV1),
1036    SocketLeaveIpv6MulticastV1(&'a ArchivedJournalEntrySocketLeaveIpv6MulticastV1),
1037    SocketSendFileV1(&'a ArchivedJournalEntrySocketSendFileV1),
1038    SocketSendToV1(&'a ArchivedJournalEntrySocketSendToV1<'a>),
1039    SocketSendV1(&'a ArchivedJournalEntrySocketSendV1<'a>),
1040    SocketSetOptFlagV1(&'a ArchivedJournalEntrySocketSetOptFlagV1),
1041    SocketSetOptSizeV1(&'a ArchivedJournalEntrySocketSetOptSizeV1),
1042    SocketSetOptTimeV1(&'a ArchivedJournalEntrySocketSetOptTimeV1),
1043    SocketShutdownV1(&'a ArchivedJournalEntrySocketShutdownV1),
1044    SnapshotV1(&'a ArchivedJournalEntrySnapshotV1),
1045}
1046
1047#[repr(C)]
1048#[repr(align(8))]
1049#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1050#[rkyv(derive(Debug), attr(repr(align(8))))]
1051pub struct JournalEntryInitModuleV1 {
1052    pub wasm_hash: Box<[u8]>,
1053}
1054
1055#[repr(C)]
1056#[repr(align(8))]
1057#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1058#[rkyv(derive(Debug), attr(repr(align(8))))]
1059pub struct JournalEntryClearEtherealV1 {}
1060
1061#[repr(C)]
1062#[repr(align(8))]
1063#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1064#[rkyv(derive(Debug), attr(repr(align(8))))]
1065pub struct JournalEntryProcessExitV1 {
1066    pub exit_code: Option<JournalExitCodeV1>,
1067}
1068
1069#[repr(C)]
1070#[repr(align(8))]
1071#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1072#[rkyv(attr(repr(align(8))))]
1073pub struct JournalEntrySetThreadV1<'a> {
1074    pub id: u32,
1075    pub call_stack: AlignedCowVec<'a, u8>,
1076    pub memory_stack: AlignedCowVec<'a, u8>,
1077    pub store_data: AlignedCowVec<'a, u8>,
1078    pub start: JournalThreadStartTypeV1,
1079    pub layout: JournalWasiMemoryLayout,
1080    pub is_64bit: bool,
1081}
1082
1083#[repr(C)]
1084#[repr(align(8))]
1085#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1086#[rkyv(attr(repr(align(8))))]
1087pub struct JournalEntryCloseThreadV1 {
1088    pub id: u32,
1089    pub exit_code: Option<JournalExitCodeV1>,
1090}
1091
1092#[repr(C)]
1093#[repr(align(8))]
1094#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1095#[rkyv(derive(Debug), attr(repr(align(8))))]
1096pub struct JournalEntryFileDescriptorSeekV1 {
1097    pub fd: u32,
1098    pub whence: JournalWhenceV1,
1099    pub offset: i64,
1100}
1101
1102/// WARNING!!!! Do not change this structure without updating
1103/// "/lib/cli/src/commands/journal/mount/fs.rs"
1104///
1105/// The code over there assumes that the aligned vector is the
1106/// first item in the serialized entry
1107#[repr(C)]
1108#[repr(align(8))]
1109#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1110#[rkyv(attr(repr(align(8))))]
1111pub struct JournalEntryFileDescriptorWriteV1<'a> {
1112    /// DO NOT MOVE!
1113    pub data: AlignedCowVec<'a, u8>,
1114    pub offset: u64,
1115    pub fd: u32,
1116    pub is_64bit: bool,
1117}
1118
1119#[repr(C)]
1120#[repr(align(8))]
1121#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1122#[rkyv(attr(repr(align(8))))]
1123pub struct JournalEntryUpdateMemoryRegionV1<'a> {
1124    pub compressed_data: AlignedCowVec<'a, u8>,
1125    pub start: u64,
1126    pub end: u64,
1127}
1128
1129#[repr(C)]
1130#[repr(align(8))]
1131#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1132#[rkyv(derive(Debug), attr(repr(align(8))))]
1133pub struct JournalEntrySetClockTimeV1 {
1134    pub clock_id: JournalSnapshot0ClockidV1,
1135    pub time: u64,
1136}
1137
1138#[repr(C)]
1139#[repr(align(8))]
1140#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1141#[rkyv(attr(repr(align(8))))]
1142pub struct JournalEntryOpenFileDescriptorV1<'a> {
1143    pub fd: u32,
1144    pub dirfd: u32,
1145    pub dirflags: u32,
1146    pub fs_flags: u16,
1147    pub o_flags: u16,
1148    pub fs_rights_base: u64,
1149    pub fs_rights_inheriting: u64,
1150    pub path: AlignedCowStr<'a>,
1151}
1152
1153#[repr(C)]
1154#[repr(align(8))]
1155#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1156#[rkyv(attr(repr(align(8))))]
1157pub struct JournalEntryOpenFileDescriptorV2<'a> {
1158    pub fd: u32,
1159    pub dirfd: u32,
1160    pub dirflags: u32,
1161    pub fs_flags: u16,
1162    pub fd_flags: u16,
1163    pub o_flags: u16,
1164    pub fs_rights_base: u64,
1165    pub fs_rights_inheriting: u64,
1166    pub path: AlignedCowStr<'a>,
1167}
1168
1169#[repr(C)]
1170#[repr(align(8))]
1171#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1172#[rkyv(derive(Debug), attr(repr(align(8))))]
1173pub struct JournalEntryCloseFileDescriptorV1 {
1174    pub fd: u32,
1175}
1176
1177#[repr(C)]
1178#[repr(align(8))]
1179#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1180#[rkyv(derive(Debug), attr(repr(align(8))))]
1181pub struct JournalEntryRenumberFileDescriptorV1 {
1182    pub old_fd: u32,
1183    pub new_fd: u32,
1184}
1185
1186#[repr(C)]
1187#[repr(align(8))]
1188#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1189#[rkyv(derive(Debug), attr(repr(align(8))))]
1190pub struct JournalEntryDuplicateFileDescriptorV1 {
1191    pub original_fd: u32,
1192    pub copied_fd: u32,
1193}
1194
1195#[repr(C)]
1196#[repr(align(8))]
1197#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1198#[rkyv(derive(Debug), attr(repr(align(8))))]
1199pub struct JournalEntryDuplicateFileDescriptorV2 {
1200    pub original_fd: u32,
1201    pub copied_fd: u32,
1202    pub cloexec: bool,
1203}
1204
1205#[repr(C)]
1206#[repr(align(8))]
1207#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1208#[rkyv(attr(repr(align(8))))]
1209pub struct JournalEntryCreateDirectoryV1<'a> {
1210    pub fd: u32,
1211    pub path: AlignedCowStr<'a>,
1212}
1213
1214#[repr(C)]
1215#[repr(align(8))]
1216#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1217#[rkyv(attr(repr(align(8))))]
1218pub struct JournalEntryRemoveDirectoryV1<'a> {
1219    pub fd: u32,
1220    pub path: AlignedCowStr<'a>,
1221}
1222
1223#[repr(C)]
1224#[repr(align(8))]
1225#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1226#[rkyv(attr(repr(align(8))))]
1227pub struct JournalEntryPathSetTimesV1<'a> {
1228    pub fd: u32,
1229    pub flags: u32,
1230    pub path: AlignedCowStr<'a>,
1231    pub st_atim: u64,
1232    pub st_mtim: u64,
1233    pub fst_flags: u16,
1234}
1235
1236#[repr(C)]
1237#[repr(align(8))]
1238#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1239#[rkyv(derive(Debug), attr(repr(align(8))))]
1240pub struct JournalEntryFileDescriptorSetTimesV1 {
1241    pub fd: u32,
1242    pub fst_flags: u16,
1243    pub st_atim: u64,
1244    pub st_mtim: u64,
1245}
1246
1247#[repr(C)]
1248#[repr(align(8))]
1249#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1250#[rkyv(derive(Debug), attr(repr(align(8))))]
1251pub struct JournalEntryFileDescriptorSetSizeV1 {
1252    pub fd: u32,
1253    pub st_size: u64,
1254}
1255
1256#[repr(C)]
1257#[repr(align(8))]
1258#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1259#[rkyv(derive(Debug), attr(repr(align(8))))]
1260pub struct JournalEntryFileDescriptorSetFdFlagsV1 {
1261    pub fd: u32,
1262    pub flags: u16,
1263}
1264
1265#[repr(C)]
1266#[repr(align(8))]
1267#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1268#[rkyv(derive(Debug), attr(repr(align(8))))]
1269pub struct JournalEntryFileDescriptorSetFlagsV1 {
1270    pub fd: u32,
1271    pub flags: u16,
1272}
1273
1274#[repr(C)]
1275#[repr(align(8))]
1276#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1277#[rkyv(derive(Debug), attr(repr(align(8))))]
1278pub struct JournalEntryFileDescriptorSetRightsV1 {
1279    pub fd: u32,
1280    pub fs_rights_base: u64,
1281    pub fs_rights_inheriting: u64,
1282}
1283
1284#[repr(C)]
1285#[repr(align(8))]
1286#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1287#[rkyv(derive(Debug), attr(repr(align(8))))]
1288pub struct JournalEntryFileDescriptorAdviseV1 {
1289    pub fd: u32,
1290    pub offset: u64,
1291    pub len: u64,
1292    pub advice: JournalAdviceV1,
1293}
1294
1295#[repr(C)]
1296#[repr(align(8))]
1297#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1298#[rkyv(derive(Debug), attr(repr(align(8))))]
1299pub struct JournalEntryFileDescriptorAllocateV1 {
1300    pub fd: u32,
1301    pub offset: u64,
1302    pub len: u64,
1303}
1304
1305#[repr(C)]
1306#[repr(align(8))]
1307#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1308#[rkyv(attr(repr(align(8))))]
1309pub struct JournalEntryCreateHardLinkV1<'a> {
1310    pub old_fd: u32,
1311    pub old_path: AlignedCowStr<'a>,
1312    pub old_flags: u32,
1313    pub new_fd: u32,
1314    pub new_path: AlignedCowStr<'a>,
1315}
1316
1317#[repr(C)]
1318#[repr(align(8))]
1319#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1320#[rkyv(attr(repr(align(8))))]
1321pub struct JournalEntryCreateSymbolicLinkV1<'a> {
1322    pub fd: u32,
1323    pub old_path: AlignedCowStr<'a>,
1324    pub new_path: AlignedCowStr<'a>,
1325}
1326
1327#[repr(C)]
1328#[repr(align(8))]
1329#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1330#[rkyv(attr(repr(align(8))))]
1331pub struct JournalEntryUnlinkFileV1<'a> {
1332    pub fd: u32,
1333    pub path: AlignedCowStr<'a>,
1334}
1335
1336#[repr(C)]
1337#[repr(align(8))]
1338#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1339#[rkyv(attr(repr(align(8))))]
1340pub struct JournalEntryPathRenameV1<'a> {
1341    pub old_fd: u32,
1342    pub old_path: AlignedCowStr<'a>,
1343    pub new_fd: u32,
1344    pub new_path: AlignedCowStr<'a>,
1345}
1346
1347#[repr(C)]
1348#[repr(align(8))]
1349#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1350#[rkyv(attr(repr(align(8))))]
1351pub struct JournalEntryChangeDirectoryV1<'a> {
1352    pub path: AlignedCowStr<'a>,
1353}
1354
1355#[repr(C)]
1356#[repr(align(8))]
1357#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1358#[rkyv(derive(Debug), attr(repr(align(8))))]
1359pub struct JournalEntryEpollCreateV1 {
1360    pub fd: u32,
1361}
1362
1363#[repr(C)]
1364#[repr(align(8))]
1365#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1366#[rkyv(derive(Debug), attr(repr(align(8))))]
1367pub struct JournalEntryEpollCtlV1 {
1368    pub epfd: u32,
1369    pub op: JournalEpollCtlV1,
1370    pub fd: u32,
1371    pub event: Option<JournalEpollEventCtlV1>,
1372}
1373
1374#[repr(C)]
1375#[repr(align(8))]
1376#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1377#[rkyv(derive(Debug), attr(repr(align(8))))]
1378pub struct JournalEntryTtySetV1 {
1379    pub cols: u32,
1380    pub rows: u32,
1381    pub width: u32,
1382    pub height: u32,
1383    pub stdin_tty: bool,
1384    pub stdout_tty: bool,
1385    pub stderr_tty: bool,
1386    pub echo: bool,
1387    pub line_buffered: bool,
1388    pub line_feeds: bool,
1389}
1390
1391#[repr(C)]
1392#[repr(align(8))]
1393#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1394#[rkyv(derive(Debug), attr(repr(align(8))))]
1395pub struct JournalEntryCreatePipeV1 {
1396    pub read_fd: u32,
1397    pub write_fd: u32,
1398}
1399
1400#[repr(C)]
1401#[repr(align(8))]
1402#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1403#[rkyv(derive(Debug), attr(repr(align(8))))]
1404pub struct JournalEntryCreateEventV1 {
1405    pub initial_val: u64,
1406    pub flags: u16,
1407    pub fd: u32,
1408}
1409
1410#[repr(C)]
1411#[repr(align(8))]
1412#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1413#[rkyv(derive(Debug), attr(repr(align(8))))]
1414pub struct JournalEntryPortAddAddrV1 {
1415    pub cidr: JournalIpCidrV1,
1416}
1417
1418#[repr(C)]
1419#[repr(align(8))]
1420#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1421#[rkyv(derive(Debug), attr(repr(align(8))))]
1422pub struct JournalEntryPortDelAddrV1 {
1423    pub addr: IpAddr,
1424}
1425
1426#[repr(C)]
1427#[repr(align(8))]
1428#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1429#[rkyv(attr(repr(align(8))))]
1430pub struct JournalEntryPortBridgeV1<'a> {
1431    pub network: AlignedCowStr<'a>,
1432    pub token: AlignedCowStr<'a>,
1433    pub security: JournalStreamSecurityV1,
1434}
1435
1436#[repr(C)]
1437#[repr(align(8))]
1438#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1439#[rkyv(derive(Debug), attr(repr(align(8))))]
1440pub struct JournalEntryPortGatewaySetV1 {
1441    pub ip: IpAddr,
1442}
1443
1444#[repr(C)]
1445#[repr(align(8))]
1446#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1447#[rkyv(derive(Debug), attr(repr(align(8))))]
1448pub struct JournalEntryPortRouteAddV1 {
1449    pub cidr: JournalIpCidrV1,
1450    pub via_router: IpAddr,
1451    pub preferred_until: Option<Duration>,
1452    pub expires_at: Option<Duration>,
1453}
1454
1455#[repr(C)]
1456#[repr(align(8))]
1457#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1458#[rkyv(derive(Debug), attr(repr(align(8))))]
1459pub struct JournalEntryPortRouteDelV1 {
1460    pub ip: IpAddr,
1461}
1462
1463#[repr(C)]
1464#[repr(align(8))]
1465#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1466#[rkyv(derive(Debug), attr(repr(align(8))))]
1467pub struct JournalEntrySocketOpenV1 {
1468    pub af: JournalAddressfamilyV1,
1469    pub ty: JournalSocktypeV1,
1470    pub pt: u16,
1471    pub fd: u32,
1472}
1473
1474#[repr(align(8))]
1475#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1476#[rkyv(derive(Debug), attr(repr(align(8))))]
1477pub struct JournalEntrySocketPairV1 {
1478    pub fd1: u32,
1479    pub fd2: u32,
1480}
1481
1482#[repr(C)]
1483#[repr(align(8))]
1484#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1485#[rkyv(derive(Debug), attr(repr(align(8))))]
1486pub struct JournalEntrySocketListenV1 {
1487    pub fd: u32,
1488    pub backlog: u32,
1489}
1490
1491#[repr(C)]
1492#[repr(align(8))]
1493#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1494#[rkyv(derive(Debug), attr(repr(align(8))))]
1495pub struct JournalEntrySocketBindV1 {
1496    pub fd: u32,
1497    pub addr: SocketAddr,
1498}
1499
1500#[repr(C)]
1501#[repr(align(8))]
1502#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1503#[rkyv(derive(Debug), attr(repr(align(8))))]
1504pub struct JournalEntrySocketConnectedV1 {
1505    pub fd: u32,
1506    pub local_addr: SocketAddr,
1507    pub peer_addr: SocketAddr,
1508}
1509
1510#[repr(C)]
1511#[repr(align(8))]
1512#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1513#[rkyv(derive(Debug), attr(repr(align(8))))]
1514pub struct JournalEntrySocketAcceptedV1 {
1515    pub listen_fd: u32,
1516    pub fd: u32,
1517    pub local_addr: SocketAddr,
1518    pub peer_addr: SocketAddr,
1519    pub fd_flags: u16,
1520    pub nonblocking: bool,
1521}
1522
1523#[repr(C)]
1524#[repr(align(8))]
1525#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1526#[rkyv(derive(Debug), attr(repr(align(8))))]
1527pub struct JournalEntrySocketJoinIpv4MulticastV1 {
1528    pub fd: u32,
1529    pub multiaddr: Ipv4Addr,
1530    pub iface: Ipv4Addr,
1531}
1532
1533#[repr(C)]
1534#[repr(align(8))]
1535#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1536#[rkyv(derive(Debug), attr(repr(align(8))))]
1537pub struct JournalEntrySocketJoinIpv6MulticastV1 {
1538    pub fd: u32,
1539    pub multiaddr: Ipv6Addr,
1540    pub iface: u32,
1541}
1542
1543#[repr(C)]
1544#[repr(align(8))]
1545#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1546#[rkyv(derive(Debug), attr(repr(align(8))))]
1547pub struct JournalEntrySocketLeaveIpv4MulticastV1 {
1548    pub fd: u32,
1549    pub multiaddr: Ipv4Addr,
1550    pub iface: Ipv4Addr,
1551}
1552
1553#[repr(C)]
1554#[repr(align(8))]
1555#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1556#[rkyv(derive(Debug), attr(repr(align(8))))]
1557pub struct JournalEntrySocketLeaveIpv6MulticastV1 {
1558    pub fd: u32,
1559    pub multiaddr: Ipv6Addr,
1560    pub iface: u32,
1561}
1562
1563#[repr(C)]
1564#[repr(align(8))]
1565#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1566#[rkyv(derive(Debug), attr(repr(align(8))))]
1567pub struct JournalEntrySocketSendFileV1 {
1568    pub socket_fd: u32,
1569    pub file_fd: u32,
1570    pub offset: u64,
1571    pub count: u64,
1572}
1573
1574#[repr(C)]
1575#[repr(align(8))]
1576#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1577#[rkyv(attr(repr(align(8))))]
1578pub struct JournalEntrySocketSendToV1<'a> {
1579    pub fd: u32,
1580    pub data: AlignedCowVec<'a, u8>,
1581    pub flags: u16,
1582    pub addr: SocketAddr,
1583    pub is_64bit: bool,
1584}
1585
1586#[repr(C)]
1587#[repr(align(8))]
1588#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1589#[rkyv(attr(repr(align(8))))]
1590pub struct JournalEntrySocketSendV1<'a> {
1591    pub fd: u32,
1592    pub data: AlignedCowVec<'a, u8>,
1593    pub flags: u16,
1594    pub is_64bit: bool,
1595}
1596
1597#[repr(C)]
1598#[repr(align(8))]
1599#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1600#[rkyv(derive(Debug), attr(repr(align(8))))]
1601pub struct JournalEntrySocketSetOptFlagV1 {
1602    pub fd: u32,
1603    pub opt: JournalSockoptionV1,
1604    pub flag: bool,
1605}
1606
1607#[repr(C)]
1608#[repr(align(8))]
1609#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1610#[rkyv(derive(Debug), attr(repr(align(8))))]
1611pub struct JournalEntrySocketSetOptSizeV1 {
1612    pub fd: u32,
1613    pub opt: JournalSockoptionV1,
1614    pub size: u64,
1615}
1616
1617#[repr(C)]
1618#[repr(align(8))]
1619#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1620#[rkyv(derive(Debug), attr(repr(align(8))))]
1621pub struct JournalEntrySocketSetOptTimeV1 {
1622    pub fd: u32,
1623    pub ty: JournalTimeTypeV1,
1624    pub time: Option<Duration>,
1625}
1626
1627#[repr(C)]
1628#[repr(align(8))]
1629#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1630#[rkyv(derive(Debug), attr(repr(align(8))))]
1631pub struct JournalEntrySocketShutdownV1 {
1632    pub fd: u32,
1633    pub how: JournalSocketShutdownV1,
1634}
1635
1636#[repr(C)]
1637#[repr(align(8))]
1638#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1639#[rkyv(derive(Debug), attr(repr(align(8))))]
1640pub struct JournalEntrySnapshotV1 {
1641    pub since_epoch: Duration,
1642    pub trigger: JournalSnapshotTriggerV1,
1643}
1644
1645#[repr(C)]
1646#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1647#[rkyv(derive(Debug))]
1648pub enum JournalSnapshot0ClockidV1 {
1649    Realtime,
1650    Monotonic,
1651    ProcessCputimeId,
1652    ThreadCputimeId,
1653    Unknown = 255,
1654}
1655
1656#[repr(C)]
1657#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1658#[rkyv(derive(Debug))]
1659pub enum JournalWhenceV1 {
1660    Set,
1661    Cur,
1662    End,
1663    Unknown = 255,
1664}
1665
1666#[repr(C)]
1667#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1668#[rkyv(derive(Debug))]
1669pub enum JournalAdviceV1 {
1670    Normal,
1671    Sequential,
1672    Random,
1673    Willneed,
1674    Dontneed,
1675    Noreuse,
1676    Unknown = 255,
1677}
1678
1679#[repr(C)]
1680#[repr(align(8))]
1681#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1682#[rkyv(derive(Debug))]
1683pub struct JournalIpCidrV1 {
1684    pub ip: IpAddr,
1685    pub prefix: u8,
1686}
1687
1688#[repr(C)]
1689#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1690#[rkyv(derive(Debug))]
1691pub enum JournalExitCodeV1 {
1692    Errno(u16),
1693    Other(i32),
1694}
1695
1696#[repr(C)]
1697#[derive(
1698    Debug,
1699    Clone,
1700    Copy,
1701    PartialEq,
1702    Eq,
1703    PartialOrd,
1704    Ord,
1705    Hash,
1706    RkyvSerialize,
1707    RkyvDeserialize,
1708    Archive,
1709)]
1710#[rkyv(derive(Debug))]
1711pub enum JournalSnapshotTriggerV1 {
1712    Idle,
1713    Listen,
1714    Environ,
1715    Stdin,
1716    Timer,
1717    Sigint,
1718    Sigalrm,
1719    Sigtstp,
1720    Sigstop,
1721    NonDeterministicCall,
1722    Bootstrap,
1723    Transaction,
1724    Explicit,
1725}
1726
1727#[repr(C)]
1728#[derive(
1729    Debug,
1730    Clone,
1731    Copy,
1732    PartialEq,
1733    Eq,
1734    PartialOrd,
1735    Ord,
1736    Hash,
1737    RkyvSerialize,
1738    RkyvDeserialize,
1739    Archive,
1740)]
1741#[rkyv(derive(Debug))]
1742pub enum JournalEpollCtlV1 {
1743    Add,
1744    Mod,
1745    Del,
1746    Unknown,
1747}
1748
1749#[repr(C)]
1750#[repr(align(8))]
1751#[derive(Debug, Clone, RkyvSerialize, RkyvDeserialize, Archive)]
1752#[rkyv(derive(Debug))]
1753pub struct JournalEpollEventCtlV1 {
1754    pub events: u32,
1755    pub ptr: u64,
1756    pub fd: u32,
1757    pub data1: u32,
1758    pub data2: u64,
1759}
1760
1761#[repr(C)]
1762#[derive(
1763    Debug,
1764    Clone,
1765    Copy,
1766    PartialEq,
1767    Eq,
1768    PartialOrd,
1769    Ord,
1770    Hash,
1771    RkyvSerialize,
1772    RkyvDeserialize,
1773    Archive,
1774)]
1775#[rkyv(derive(Debug))]
1776pub enum JournalStreamSecurityV1 {
1777    Unencrypted,
1778    AnyEncryption,
1779    ClassicEncryption,
1780    DoubleEncryption,
1781    Unknown,
1782}
1783
1784#[repr(C)]
1785#[derive(
1786    Debug,
1787    Clone,
1788    Copy,
1789    PartialEq,
1790    Eq,
1791    PartialOrd,
1792    Ord,
1793    Hash,
1794    RkyvSerialize,
1795    RkyvDeserialize,
1796    Archive,
1797)]
1798#[rkyv(derive(Debug))]
1799pub enum JournalAddressfamilyV1 {
1800    Unspec,
1801    Inet4,
1802    Inet6,
1803    Unix,
1804}
1805
1806#[repr(C)]
1807#[derive(
1808    Debug,
1809    Clone,
1810    Copy,
1811    PartialEq,
1812    Eq,
1813    PartialOrd,
1814    Ord,
1815    Hash,
1816    RkyvSerialize,
1817    RkyvDeserialize,
1818    Archive,
1819)]
1820#[rkyv(derive(Debug))]
1821pub enum JournalSocktypeV1 {
1822    Unknown,
1823    Stream,
1824    Dgram,
1825    Raw,
1826    Seqpacket,
1827}
1828
1829#[repr(C)]
1830#[derive(
1831    Debug,
1832    Clone,
1833    Copy,
1834    PartialEq,
1835    Eq,
1836    PartialOrd,
1837    Ord,
1838    Hash,
1839    RkyvSerialize,
1840    RkyvDeserialize,
1841    Archive,
1842)]
1843#[rkyv(derive(Debug))]
1844pub enum JournalSockoptionV1 {
1845    Noop,
1846    ReusePort,
1847    ReuseAddr,
1848    NoDelay,
1849    DontRoute,
1850    OnlyV6,
1851    Broadcast,
1852    MulticastLoopV4,
1853    MulticastLoopV6,
1854    Promiscuous,
1855    Listening,
1856    LastError,
1857    KeepAlive,
1858    Linger,
1859    OobInline,
1860    RecvBufSize,
1861    SendBufSize,
1862    RecvLowat,
1863    SendLowat,
1864    RecvTimeout,
1865    SendTimeout,
1866    ConnectTimeout,
1867    AcceptTimeout,
1868    Ttl,
1869    MulticastTtlV4,
1870    Type,
1871    Proto,
1872}
1873
1874#[repr(C)]
1875#[derive(
1876    Debug,
1877    Clone,
1878    Copy,
1879    PartialEq,
1880    Eq,
1881    PartialOrd,
1882    Ord,
1883    Hash,
1884    RkyvSerialize,
1885    RkyvDeserialize,
1886    Archive,
1887)]
1888#[rkyv(derive(Debug))]
1889pub enum JournalTimeTypeV1 {
1890    ReadTimeout,
1891    WriteTimeout,
1892    AcceptTimeout,
1893    ConnectTimeout,
1894    BindTimeout,
1895    Linger,
1896}
1897
1898#[repr(C)]
1899#[derive(
1900    Debug,
1901    Clone,
1902    Copy,
1903    PartialEq,
1904    Eq,
1905    PartialOrd,
1906    Ord,
1907    Hash,
1908    RkyvSerialize,
1909    RkyvDeserialize,
1910    Archive,
1911)]
1912#[rkyv(derive(Debug))]
1913pub enum JournalSocketShutdownV1 {
1914    Read,
1915    Write,
1916    Both,
1917}
1918
1919#[repr(C)]
1920#[repr(align(8))]
1921#[derive(
1922    Debug,
1923    Clone,
1924    Copy,
1925    RkyvSerialize,
1926    RkyvDeserialize,
1927    Archive,
1928    PartialOrd,
1929    Ord,
1930    PartialEq,
1931    Eq,
1932    Hash,
1933)]
1934#[rkyv(derive(Debug), attr(repr(align(8))))]
1935pub enum JournalThreadStartTypeV1 {
1936    MainThread,
1937    ThreadSpawn { start_ptr: u64 },
1938}
1939
1940#[repr(C)]
1941#[repr(align(8))]
1942#[derive(Debug, Clone, Copy, RkyvSerialize, RkyvDeserialize, Archive, PartialEq, Eq, Hash)]
1943#[rkyv(derive(Debug), attr(repr(align(8))))]
1944pub struct JournalWasiMemoryLayout {
1945    pub stack_upper: u64,
1946    pub stack_lower: u64,
1947    pub guard_size: u64,
1948    pub stack_size: u64,
1949}