4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 2000-2001 by Sun Microsystems, Inc.
24 * All rights reserved.
27 #ifndef _PAYLOADREADER_H
28 #define _PAYLOADREADER_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
43 #define ITER_THERE_ONLY 1
47 // will send the data back in (data,dataLen)
48 static fru_errno_t
readData(PathDef
*path
, Ancestor
*curDef
,
50 uint8_t *payload
, size_t payloadLen
,
51 void **data
, size_t *dataLen
);
53 // will update the data in payload which can then be written back.
54 static fru_errno_t
updateData(PathDef
*path
, Ancestor
*curDef
,
56 uint8_t *payload
, size_t payloadLen
,
57 void *data
, size_t dataLen
);
59 // will return the nuber of iterations actually there.
60 static fru_errno_t
findIterThere(PathDef
*path
, Ancestor
*curDef
,
62 uint8_t *payload
, size_t payloadLen
,
66 static int getIterationOffset(uint8_t *iter
, int iterLen
,
67 PathDef
*path
, int *rcIterThere
,
69 int onlyFindingIterThereFlag
);
70 static int calcOffset(int iterType
,
71 uint8_t head
, uint8_t tail
,
72 uint8_t iterThere
, uint8_t iterPoss
,
73 size_t length
, int index
,
76 static fru_errno_t
readRecurse(PathDef
*path
,
77 uint8_t *cur
, size_t curLen
,
78 void **data
, size_t *dataLen
,
79 int onlyFindingIterThereFlag
);
81 static fru_errno_t
updateRecurse(PathDef
*path
,
82 uint8_t *cur
, size_t curLen
,
83 void *data
, size_t dataLen
);
85 static int getOffsetIntoRecord(fru_regdef_t
*recDef
,
86 fru_regdef_t
*elemDef
);
90 PayloadReader(const PayloadReader
&);
91 void operator=(const PayloadReader
&);
102 #endif /* _PAYLOADREADER_H */