-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tag.hpp
115 lines (90 loc) · 1.86 KB
/
Tag.hpp
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#pragma once
#include <cstdint>
#include <iostream>
struct Tag {
enum Type {
PrimaryVDesc = 1,
AVDP,
VDescPtr,
ImplUseVDesc,
PartitionDesc,
LogicVDesc,
UnallocSpDesc,
TermDesc,
LogicVIntergrityDesc,
FileSetDesc = 256,
FileEntry = 261
};
uint16_t type;
uint16_t version;
uint8_t checksum;
uint16_t serial;
uint16_t CRC;
uint16_t CRC_length;
uint32_t location;
uint32_t real_location;
Tag(uint32_t location);
void setData(uint8_t *buffer);
bool isChecksumOK() const;
bool isLocationOK() const;
bool isValid() const;
std::string toString() const;
std::string getTypeName() const;
};
struct extend_ad {
uint32_t length;
uint32_t location;
void setData(uint8_t *buffer);
std::string toString() const;
};
struct regid {
uint8_t flags;
bool isDirty;
bool isProtected;
uint8_t id[24];
uint8_t suffix[9];
void setData(uint8_t *buffer);
std::string toString() const;
};
struct Timestamp {
uint16_t type;
uint8_t flags;
int data;
int16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
uint8_t centiseconds;
uint8_t hundreds_microseconds;
uint8_t microseconds;
void setData(uint8_t *buffer);
std::string toString() const;
std::string dump() const;
};
struct charspec {
uint8_t type;
uint8_t data[63];
void setData(uint8_t *buffer);
std::string toString() const;
};
struct lb_addr {
uint32_t block_nbr;
uint16_t partition_ref_nbr;
void setData(uint8_t *buffer);
std::string toString() const;
};
struct long_ad {
uint32_t length;
lb_addr location;
uint8_t implementation_use[6];
void setData(uint8_t *buffer);
std::string toString() const;
};
struct short_ad {
uint32_t length;
uint32_t position;
void setData(uint8_t *buffer);
std::string toString() const;
};