rpm
5.4.10
rpmdb
header_internal.h
Go to the documentation of this file.
1
#ifndef H_HEADER_INTERNAL
2
#define H_HEADER_INTERNAL
3
8
#include <
rpmtag.h
>
9
#include <yarn.h>
10
11
#if !defined(__LCLINT__)
12
#include <netinet/in.h>
13
#endif
/* __LCLINT__ */
14
19
#define hdrchkTags(_ntags) ((_ntags) & 0xff000000)
20
24
#define hdrchkType(_type) ((_type) < 1 || (_type) > RPM_MAX_TYPE)
25
30
#define hdrchkData(_nbytes) ((_nbytes) & 0xc0000000)
31
35
/*@unchecked@*/
/*@observer@*/
36
extern
int
rpm_typeAlign
[16];
37
#define hdrchkAlign(_type, _off) ((_off) & (rpm_typeAlign[_type]-1))
38
42
#define hdrchkRange(_dl, _off) ((_off) < 0 || (_off) > (_dl))
43
44
#define INDEX_MALLOC_SIZE 8
45
46
/*
47
* Teach header.c about legacy tags.
48
*/
49
#define HEADER_OLDFILENAMES 1027
50
#define HEADER_BASENAMES 1117
51
55
typedef
/*@abstract@*/
struct
entryInfo_s
*
entryInfo
;
56
struct
entryInfo_s
{
57
rpmTag
tag
;
58
rpmTagType
type
;
59
rpmint32_t
offset
;
60
rpmTagCount
count
;
61
};
62
63
#define REGION_TAG_TYPE RPM_BIN_TYPE
64
#define REGION_TAG_COUNT sizeof(struct entryInfo_s)
65
66
#define ENTRY_IS_REGION(_e) \
67
(((_e)->info.tag >= HEADER_IMAGE) && ((_e)->info.tag < HEADER_REGIONS))
68
#define ENTRY_IN_REGION(_e) ((_e)->info.offset < 0)
69
73
typedef
/*@abstract@*/
struct
indexEntry_s
*
indexEntry
;
74
struct
indexEntry_s
{
75
struct
entryInfo_s
info;
76
/*@owned@*/
77
void
*
data
;
78
size_t
length
;
79
size_t
rdlen
;
80
};
81
85
struct
headerToken_s
{
86
struct
rpmioItem_s
_item;
87
unsigned
char
magic[8];
88
/*@only@*/
/*@null@*/
89
void
*
blob
;
90
size_t
bloblen
;
91
/*@only@*/
/*@null@*/
92
const
char
*
origin
;
93
/*@only@*/
/*@null@*/
94
const
char
*
baseurl
;
95
/*@only@*/
/*@null@*/
96
const
char
*
digest
;
97
/*@only@*/
/*@null@*/
98
const
char
*
parent
;
99
/*@null@*/
100
void
*
rpmdb
;
101
struct
stat sb;
102
rpmuint32_t
instance
;
103
rpmuint32_t
startoff
;
104
rpmuint32_t
endoff
;
105
struct
rpmop_s
h_loadops;
106
struct
rpmop_s
h_getops;
107
/*@owned@*/
108
indexEntry
index
;
109
size_t
indexUsed
;
110
size_t
indexAlloced
;
111
rpmuint32_t
flags
;
112
#define HEADERFLAG_SORTED (1 << 0)
113
#define HEADERFLAG_ALLOCATED (1 << 1)
114
#define HEADERFLAG_LEGACY (1 << 2)
115
#define HEADERFLAG_DEBUG (1 << 3)
116
#define HEADERFLAG_SIGNATURE (1 << 4)
117
#define HEADERFLAG_MAPPED (1 << 5)
118
#define HEADERFLAG_RDONLY (1 << 6)
119
#if defined(__LCLINT__)
120
/*@refs@*/
121
int
nrefs;
122
#endif
123
};
124
125
#ifdef __cplusplus
126
extern
"C"
{
127
#endif
128
138
int
headerVerifyInfo
(
rpmuint32_t
il,
rpmuint32_t
dl,
const
void
* pev,
void
* iv,
int
negate)
139
/*@modifies *iv @*/
;
140
141
#ifdef __cplusplus
142
}
143
#endif
144
145
#endif
/* H_HEADER_INTERNAL */
headerToken_s::origin
const char * origin
Definition:
header_internal.h:92
headerToken_s::rpmdb
void * rpmdb
Definition:
header_internal.h:100
headerToken_s::digest
const char * digest
Definition:
header_internal.h:96
indexEntry_s::rdlen
size_t rdlen
Definition:
header_internal.h:79
entryInfo_s::type
rpmTagType type
Definition:
header_internal.h:58
headerToken_s
The Header data structure.
Definition:
header_internal.h:85
headerVerifyInfo
int headerVerifyInfo(rpmuint32_t il, rpmuint32_t dl, const void *pev, void *iv, int negate)
Perform simple sanity and range checks on header tag(s).
Definition:
header_internal.c:36
entryInfo_s::tag
rpmTag tag
Definition:
header_internal.h:57
rpm_typeAlign
int rpm_typeAlign[16]
Sanity check on data alignment for data type.
Definition:
header_internal.c:17
entryInfo_s::count
rpmTagCount count
Definition:
header_internal.h:60
headerToken_s::blob
void * blob
Definition:
header_internal.h:89
rpmuint32_t
unsigned int rpmuint32_t
Definition:
rpmiotypes.h:25
indexEntry_s::data
void * data
Definition:
header_internal.h:77
entryInfo
struct entryInfo_s * entryInfo
Description of tag data.
Definition:
header_internal.h:55
rpmtag.h
indexEntry_s
Definition:
header_internal.h:74
rpmTagType
enum rpmTagType_e rpmTagType
Definition:
rpmtag.h:46
rpmop_s
Cumulative statistics for an operation.
Definition:
rpmsw.h:33
headerToken_s::instance
rpmuint32_t instance
Definition:
header_internal.h:102
rpmint32_t
int rpmint32_t
Definition:
rpmiotypes.h:30
headerToken_s::endoff
rpmuint32_t endoff
Definition:
header_internal.h:104
headerToken_s::indexUsed
size_t indexUsed
Definition:
header_internal.h:109
headerToken_s::startoff
rpmuint32_t startoff
Definition:
header_internal.h:103
headerToken_s::flags
rpmuint32_t flags
Definition:
header_internal.h:111
headerToken_s::index
indexEntry index
Definition:
header_internal.h:108
indexEntry
struct indexEntry_s * indexEntry
A single tag from a Header.
Definition:
header_internal.h:73
entryInfo_s::offset
rpmint32_t offset
Definition:
header_internal.h:59
rpmioItem_s
Definition:
rpmiotypes.h:39
entryInfo_s
Definition:
header_internal.h:56
headerToken_s::parent
const char * parent
Definition:
header_internal.h:98
headerToken_s::bloblen
size_t bloblen
Definition:
header_internal.h:90
headerToken_s::baseurl
const char * baseurl
Definition:
header_internal.h:94
rpmTag
enum rpmTag_e rpmTag
Definition:
rpmtag.h:471
indexEntry_s::length
size_t length
Definition:
header_internal.h:78
headerToken_s::indexAlloced
size_t indexAlloced
Definition:
header_internal.h:110
rpmTagCount
rpmuint32_t rpmTagCount
Definition:
rpmtag.h:54
Generated by
1.8.12