Coda Distributed File System
dump.h
Go to the documentation of this file.
1/* BLURB gpl
2
3 Coda File System
4 Release 8
5
6 Copyright (c) 1987-2021 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU General Public Licence Version 2, as shown in the
11file LICENSE. The technical and financial contributors to Coda are
12listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19#ifndef _DUMP_H_
20#define _DUMP_H_ 1
21
22#define DUMPVERSION 2
23
24#define DUMPENDMAGIC 0x3A214B6E
25#define DUMPBEGINMAGIC 0xB3A11322
26
27#define D_DUMPHEADER 1
28#define D_VOLUMEHEADER 2
29#define D_SMALLINDEX 3
30#define D_LARGEINDEX 4
31#define D_VNODE 5
32#define D_VV 6
33#define D_ENDVV 7
34#define D_DUMPEND 8
35#define D_VOLUMEDISKDATA 9
36#define D_NULLVNODE 10
37#define D_DIRPAGES 11
38#define D_FILEDATA 12
39#define D_RMVNODE 13
40#define D_BADINODE 14
41#define D_MAX 20
42
43#define MAXDUMPTIMES 50
44
45struct DumpHeader {
47 VolumeId volumeId;
48 VolumeId parentId;
49 char volumeName[V_MAXVOLNAMELEN];
50 unsigned int Incremental;
51 Date_t backupDate;
52 unsigned int oldest, latest;
53};
54
55typedef struct {
56 char *DumpBuf; /* Start of buffer for spooling */
57 char *DumpBufPtr; /* Current position in buffer */
58 char *DumpBufEnd; /* End of buffer */
59 unsigned long offset; /* Number of bytes read or written so far. */
60 RPC2_Handle rpcid; /* RPCid of connection, NULL if dumping to file */
61 int DumpFd; /* fd to which to flush or VolId if using RPC */
62 unsigned long nbytes; /* Count of total bytes transferred. */
63 unsigned long secs; /* Elapsed time for transfers -- not whole op */
65#define VOLID DumpFd /* Overload this field if using newstyle dump */
66
67/* Exported Routines (from dumpstuff.cc) */
68extern DumpBuffer_t *InitDumpBuf(char *buf, long size, VolumeId volid,
69 RPC2_Handle rpcid);
70extern DumpBuffer_t *InitDumpBuf(char *buf, long size, int fd);
71extern int DumpDouble(DumpBuffer_t *, char, unsigned int, unsigned int);
72extern int DumpInt32(DumpBuffer_t *, char tag, unsigned int value);
73extern int DumpByte(DumpBuffer_t *, char tag, char value);
74extern int DumpBool(DumpBuffer_t *, char tag, unsigned int value);
75extern int DumpArrayInt32(DumpBuffer_t *, char, unsigned int *, int nelem);
76extern int DumpShort(DumpBuffer_t *, char tag, unsigned int value);
77extern int DumpString(DumpBuffer_t *, char tag, char *s);
78extern int DumpByteString(DumpBuffer_t *, char tag, char *bs, int nbytes);
79extern int DumpVV(DumpBuffer_t *, char tag, struct ViceVersionVector *vv);
80extern int DumpFile(DumpBuffer_t *, char tag, int fd, int vnode);
81extern int DumpTag(DumpBuffer_t *, char tag);
82extern int DumpEnd(DumpBuffer_t *);
83
84/* Exported Routines (from readstuff.cc) */
85extern signed char ReadTag(DumpBuffer_t *);
86extern int PutTag(char, DumpBuffer_t *);
87extern int ReadShort(DumpBuffer_t *, unsigned short *sp);
88extern int ReadInt32(DumpBuffer_t *, unsigned int *lp);
89extern int ReadString(DumpBuffer_t *, char *to, int max);
90extern int ReadByteString(DumpBuffer_t *, char *to, int size);
91extern int ReadDumpHeader(DumpBuffer_t *, struct DumpHeader *hp);
93extern int ReadVV(DumpBuffer_t *, ViceVersionVector *vv);
94extern int ReadFile(DumpBuffer_t *, FILE *);
95extern int EndOfDump(DumpBuffer_t *);
96
97#ifdef __cplusplus
98extern "C" {
99#endif
100
101/* from strencode.c */
102char *yaml_encode_double_quoted_string(char *string);
103
104#ifdef __cplusplus
105}
106#endif
107
108#endif /* _DUMP_H_ */
int EndOfDump(DumpBuffer_t *)
Definition: readstuff.cc:389
int ReadVV(DumpBuffer_t *, ViceVersionVector *vv)
Definition: readstuff.cc:284
int DumpVV(DumpBuffer_t *, char tag, struct ViceVersionVector *vv)
Definition: dumpstuff.cc:304
int DumpByte(DumpBuffer_t *, char tag, char value)
Definition: dumpstuff.cc:193
int DumpFile(DumpBuffer_t *, char tag, int fd, int vnode)
Definition: dumpstuff.cc:321
int ReadString(DumpBuffer_t *, char *to, int max)
Definition: readstuff.cc:241
int PutTag(char, DumpBuffer_t *)
Definition: readstuff.cc:207
int ReadVolumeDiskData(DumpBuffer_t *, VolumeDiskData *vol)
Definition: readstuff.cc:418
int ReadByteString(DumpBuffer_t *, char *to, int size)
Definition: readstuff.cc:272
int DumpString(DumpBuffer_t *, char tag, char *s)
Definition: dumpstuff.cc:276
int DumpBool(DumpBuffer_t *, char tag, unsigned int value)
Definition: dumpstuff.cc:265
int DumpInt32(DumpBuffer_t *, char tag, unsigned int value)
Definition: dumpstuff.cc:227
DumpBuffer_t * InitDumpBuf(char *buf, long size, VolumeId volid, RPC2_Handle rpcid)
Definition: dumpstuff.cc:81
int ReadDumpHeader(DumpBuffer_t *, struct DumpHeader *hp)
Definition: readstuff.cc:343
int DumpEnd(DumpBuffer_t *)
Definition: dumpstuff.cc:353
int DumpShort(DumpBuffer_t *, char tag, unsigned int value)
Definition: dumpstuff.cc:254
int DumpTag(DumpBuffer_t *, char tag)
Definition: dumpstuff.cc:183
int DumpArrayInt32(DumpBuffer_t *, char, unsigned int *, int nelem)
Definition: dumpstuff.cc:238
int DumpByteString(DumpBuffer_t *, char tag, char *bs, int nbytes)
Definition: dumpstuff.cc:290
int ReadShort(DumpBuffer_t *, unsigned short *sp)
Definition: readstuff.cc:217
char * yaml_encode_double_quoted_string(char *string)
Definition: strencode.c:46
int DumpDouble(DumpBuffer_t *, char, unsigned int, unsigned int)
Definition: dumpstuff.cc:214
int ReadInt32(DumpBuffer_t *, unsigned int *lp)
Definition: readstuff.cc:229
signed char ReadTag(DumpBuffer_t *)
Definition: readstuff.cc:198
int ReadFile(DumpBuffer_t *, FILE *)
Definition: readstuff.cc:533
RPC2_Integer RPC2_Handle
Definition: rpc2.h:345
Definition: dump.h:55
int DumpFd
Definition: dump.h:61
unsigned long secs
Definition: dump.h:63
unsigned long offset
Definition: dump.h:59
RPC2_Handle rpcid
Definition: dump.h:60
char * DumpBufPtr
Definition: dump.h:57
char * DumpBuf
Definition: dump.h:56
char * DumpBufEnd
Definition: dump.h:58
unsigned long nbytes
Definition: dump.h:62
Definition: dump.h:45
unsigned int oldest
Definition: dump.h:52
VolumeId parentId
Definition: dump.h:48
unsigned int latest
Definition: dump.h:52
char volumeName[V_MAXVOLNAMELEN]
Definition: dump.h:49
int version
Definition: dump.h:46
VolumeId volumeId
Definition: dump.h:47
unsigned int Incremental
Definition: dump.h:50
Date_t backupDate
Definition: dump.h:51
Definition: volume.h:108
TYPE_TAG tag
Definition: symtab.c:72