1: /*
2: * $Id: jnldefs.h,v 1.3 2025/03/09 19:14:25 snw Exp $
3: * Data structures and constants for journaling
4: *
5: *
6: * Author: Serena Willis <snw@coherent-logic.com>
7: * Copyright (C) 1998 MUG Deutschland
8: * Copyright (C) 2020, 2025 Coherent Logic Development LLC
9: *
10: *
11: * This file is part of FreeM.
12: *
13: * FreeM is free software: you can redistribute it and/or modify
14: * it under the terms of the GNU Affero Public License as published by
15: * the Free Software Foundation, either version 3 of the License, or
16: * (at your option) any later version.
17: *
18: * FreeM is distributed in the hope that it will be useful,
19: * but WITHOUT ANY WARRANTY; without even the implied warranty of
20: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21: * GNU Affero Public License for more details.
22: *
23: * You should have received a copy of the GNU Affero Public License
24: * along with FreeM. If not, see <https://www.gnu.org/licenses/>.
25: *
26: * $Log: jnldefs.h,v $
27: * Revision 1.3 2025/03/09 19:14:25 snw
28: * First phase of REUSE compliance and header reformat
29: *
30: *
31: * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC
32: * SPDX-License-Identifier: AGPL-3.0-or-later
33: **/
34:
35: #define FRM_JNL_VERSION 2
36:
37: #define JNLA_TSTART 0
38: #define JNLA_TRESTART 1
39: #define JNLA_TROLLBACK 2
40: #define JNLA_TCOMMIT 3
41: #define JNLA_SET 4
42: #define JNLA_KILL 5
43: #define JNLA_CHECKPOINT_OK 6
44: #define JNLA_CHECKPOINT_FAIL 7
45: #define JNLA_CHECKPOINT_RESTORE 7
46: #define JNLA_CHECKPOINT_REMOVE 8
47:
48: /* replication status values */
49: #define REPL_STAT_AWAIT 0
50: #define REPL_STAT_SENDING 1
51: #define REPL_STAT_OK 2
52: #define REPL_STAT_FAILED 3
53:
54: typedef struct jnl_hdr_t {
55: char magic[5]; /* FRMJL */
56: short fmt_version; /* FRM_JNL_VERSION */
57: char host_triplet[40]; /* the host triplet supplied by the build system */
58: } jnl_hdr_t;
59:
60: typedef struct jnl_ent_t {
61:
62: char host_id[256];
63: unsigned long tran_id;
64:
65: time_t ts; /* timestamp */
66: pid_t pid;
67: short repl_stat; /* can be any of the REPL_STAT_ constants defined above */
68: short action; /* can be any of the JNLA_ constants defined above */
69:
70: char key[1024];
71: char data[1024];
72:
73: } jnl_ent_t;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>