-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBRHeader.py
More file actions
executable file
·96 lines (74 loc) · 4.29 KB
/
BRHeader.py
File metadata and controls
executable file
·96 lines (74 loc) · 4.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import VMSBackupHelper
import BaseHeader
import enum
@VMSBackupHelper.static_init
class BRHeader(BaseHeader.BaseHeader) :
class RecordType(enum.IntEnum) :
RECORD_NULL = 0, # null record
RECORD_SUMMARY = 1, # BACKUP summary record
RECORD_VOLUME = 2, # volume summary record
RECORD_FILE = 3, # file attribute record
RECORD_VBN = 4, # file virtual block record
RECORD_PHYSVOL = 5, # physical volume attribute record
RECORD_LBN = 6, # physical volume logical block record
RECORD_FID = 7, # file ID record
RECORD_FILE_EXT = 8, # file attribute extension record
RECORD_LBN_576 = 9, # 576 byte LBN record
RECORD_RS_DIRATTR = 10, # RSTS directory attribute record
RECORD_ALIAS = 11,
RECORD_MAX_RTYPE = 12 # max record type
def static_init(self) -> None :
self.kAddressData = VMSBackupHelper.addr()
self.kAddressData.add("W_RSIZE", None, None, VMSBackupHelper.sizeof.uint16_t)
self.kAddressData.add("W_RTYPE", "W_RSIZE", "W_RSIZE", VMSBackupHelper.sizeof.uint16_t)
self.kAddressData.add("L_FLAGS", "W_RTYPE", "W_RTYPE", VMSBackupHelper.sizeof.uint32_t)
self.kAddressData.add("V_BADDATA", "L_FLAGS", None, VMSBackupHelper.sizeof.uint8_t)
self.kAddressData.add("V_DIRECTORY", "L_FLAGS", None, VMSBackupHelper.sizeof.uint8_t)
self.kAddressData.add("V_NONSEQUENTIAL", "L_FLAGS", None, VMSBackupHelper.sizeof.uint8_t)
self.kAddressData.add("V_BLOCKERRS", "L_FLAGS", None, VMSBackupHelper.sizeof.uint8_t)
self.kAddressData.add("V_ALIAS_ENTRY", "L_FLAGS", None, VMSBackupHelper.sizeof.uint8_t)
self.kAddressData.add("V_HEADONLY", "L_FLAGS", None, VMSBackupHelper.sizeof.uint8_t)
self.kAddressData.add("L_ADDRESS", "L_FLAGS", "L_FLAGS", VMSBackupHelper.sizeof.uint32_t)
self.kAddressData.add("W_BLOCKFLAGS", "L_ADDRESS", "L_ADDRESS", VMSBackupHelper.sizeof.uint16_t)
self.kAddressData.add("W_RESERVED", "W_BLOCKFLAGS", "W_BLOCKFLAGS", VMSBackupHelper.sizeof.uint16_t)
#end
def W_RSIZE(self) -> int :
return self.kAddressData.get("W_RSIZE", self.kBuffer, self.kCache)
#end
def W_RTYPE(self) -> int :
return self.kAddressData.get("W_RTYPE", self.kBuffer, self.kCache)
#end
def L_FLAGS(self) -> int :
return self.kAddressData.get("L_FLAGS", self.kBuffer, self.kCache)
#end
def V_BADDATA(self) -> bool :
return (self.kAddressData.get("V_BADDATA", self.kBuffer, self.kCache) & 0x80) == 0x80
#end
def V_DIRECTORY(self) -> bool :
return (self.kAddressData.get("V_DIRECTORY", self.kBuffer, self.kCache) & 0x40) == 0x40
#end
def V_NONSEQUENTIAL(self) -> bool :
return (self.kAddressData.get("V_NONSEQUENTIAL", self.kBuffer, self.kCache) & 0x20) == 0x20
#end
def V_BLOCKERRS(self) -> bool :
return (self.kAddressData.get("V_BLOCKERRS", self.kBuffer, self.kCache) & 0x10) == 0x10
#end
def V_ALIAS_ENTRY(self) -> bool :
return (self.kAddressData.get("V_ALIAS_ENTRY", self.kBuffer, self.kCache) & 0x08) == 0x08
#end
def V_HEADONLY(self) -> bool :
return (self.kAddressData.get("V_HEADONLY", self.kBuffer, self.kCache) & 0x04) == 0x04
#end
def L_ADDRESS(self) -> int :
return self.kAddressData.get("L_ADDRESS", self.kBuffer, self.kCache)
#end
def W_BLOCKFLAGS(self) -> int :
return self.kAddressData.get("W_BLOCKFLAGS", self.kBuffer, self.kCache)
#end
def W_RESERVED(self) -> int :
return self.kAddressData.get("W_RESERVED", self.kBuffer, self.kCache)
#end
def GetLength(self) -> bool :
return (self.kAddressData.length())
#end
#end