/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <alloca.h>
#include <sys/byteorder.h>
#include "fru_access_impl.h"
#include "fruraw.h"
#pragma init(initialize_raw_access)
extern raw_list_t *g_raw;
static void
initialize_raw_access(void)
{
int count;
}
}
static hash_obj_t *
{
return (next_hash_obj);
}
}
return (NULL);
}
static void
{
/* where to add ? */
}
}
static hash_obj_t *
{
return (NULL);
}
return (NULL);
}
return (hash_obj);
}
static hash_obj_t *
{
return (NULL);
}
return (NULL);
}
return (hash_obj);
}
static hash_obj_t *
{
return (NULL);
}
return (NULL);
}
return (hash_obj);
}
static hash_obj_t *
{
return (NULL);
}
return (NULL);
}
return (hash_obj);
}
static hash_obj_t *
{
switch (object_type) {
case CONTAINER_TYPE:
break;
case SECTION_TYPE:
return (NULL);
}
break;
case SEGMENT_TYPE:
return (NULL);
}
break;
case PACKET_TYPE:
break;
default:
return (NULL);
}
return (hash_obj);
}
static void
{
/* add the packet object in the end of list */
return;
}
;
}
}
static void
{
/* if prev is NULL it's the first object in the list */
}
} else {
}
}
}
}
static void
{
return;
}
} else {
return;
}
}
}
}
} else {
}
}
}
static void
{
return;
}
;
}
}
static void
{
return;
}
;
}
}
static char *
{
int i = 0;
int j = 0;
for (i = 0; buf[i] != '\0'; i++) {
buf[i] = '\0';
return (buf);
}
}
}
*matched = '\0';
return (NULL);
}
static void
{
}
static int
{
char *item;
char *token;
char *field;
char matched;
int foundIt = 0;
return (-1);
cont_info->num_sections = 0;
/* ignore all comments */
/* find the names */
if (token != 0x00) {
while (token != 0x00) {
foundIt = 1;
goto found;
}
}
/* check the last remaining item */
if ((item != 0x00) &&
foundIt = 1;
goto found;
}
}
}
found :
if (foundIt == 1) {
if (token == 0x00) {
return (-1);
}
while (token != 0x00) {
if (token == 0x00) {
return (-1);
}
= 1;
= 0;
} else {
return (-1);
}
if (token == 0x00) {
return (-1);
}
if (item == '\0') {
return (-1);
}
(cont_info->num_sections)++;
}
}
return (0);
}
/* ARGSUSED */
int
{
int count;
if (sec_object == NULL) {
return (-1);
}
return (-1);
}
return (-1);
}
if (seg_object == NULL) {
return (-1);
}
/* populate segment_t */
segment++;
}
return (0);
}
static int
{
}
return (size);
}
static int
{
int crc_offset = 0;
unsigned char orig_crc8 = 0;
unsigned char calc_crc8 = 0;
switch (head_ver) {
case SECTION_HDR_VER:
crc_offset = 4;
break;
default:
return (0);
}
}
static int
{
int retval;
int size;
int count;
unsigned char *buffer;
return (-1);
}
/* populate section_t */
/* read section header layout */
sizeof (sec_hdr));
return (-1);
}
return (-1);
}
/* size = section layout + total sizeof segment header */
* sizeof (segment_layout_t));
return (-1);
}
/* segment header buffer */
return (-1);
}
/* read segment header */
return (-1);
}
/* copy section header layout */
/* copy segment header layout */
sizeof (sec_hdr));
/* verify crc8 */
return (-1);
}
/* bug fix for frutool */
return (0);
} else {
sec_obj->num_of_segment = 0;
}
return (-1);
}
}
return (0);
}
/* ARGSUSED */
int
{
int count;
int num_sec = 0;
if (cont_object == NULL) {
return (-1);
}
return (-1);
}
return (-1);
}
count++) {
/* populate section_t */
section++;
num_sec++;
}
}
return (num_sec);
}
static uint32_t
{
int protection;
int offset = 0;
unsigned char *buffer;
return ((uint32_t)-1);
}
return ((uint32_t)-1);
}
/* traverse the packet object list for all the tags and payload */
}
}
return (crc); /* computed crc */
}
static int
{
int retval;
if (retval != -1) {
return (0);
}
return (-1);
}
static int
{
int tag_size;
int paylen;
int retval;
int seg_limit = 0;
int pktcnt = 0;
char *data;
char *ignore_flag;
if (retval == -1) {
return (-1);
}
/* section hash object */
return (-1);
}
while (data[0] != SEG_TRAILER_TAG) {
if (tagtype == -1) {
return (-1);
}
if (tag_size == -1) {
return (-1);
}
return (-1);
}
if (paylen == -1) {
return (-1);
}
return (-1);
}
return (-1);
}
if (pkt_hash_obj == NULL) {
return (-1);
}
return (-1);
}
return (-1);
}
/* don't change this */
pktcnt++;
offset);
if (retval == -1) {
return (retval);
}
}
sizeof (origcrc));
if (ignore_flag != NULL) {
return (pktcnt);
}
return (-1);
}
return (-1);
}
}
return (pktcnt);
}
/* ARGSUSED */
int
{
if (hash_object == NULL) {
return (-1);
}
}
/* ARGSUSED */
int
{
if (sec_object == NULL) {
return (-1);
}
return (-1);
}
return (sec_obj->num_of_segment);
}
/* ARGSUSED */
int
{
int pktcnt;
int length;
return (-1);
}
if (segment_object == NULL) {
return (-1);
}
return (0);
}
if (cont_hash_obj == NULL) {
return (-1);
}
return (segment_object->num_of_packets);
}
/* section hash object */
return (-1);
}
/* valid segment header b'cos crc8 already validated */
return (-1);
}
segment_object->num_of_packets = 0;
if (pktcnt == -1) {
}
return (segment_object->num_of_packets);
}
/* ARGSUSED */
int
{
int count;
/* segment hash object */
if (seg_hash_obj == NULL) {
return (-1);
}
return (-1);
}
if (pkt_hash_obj == NULL) {
return (-1);
}
}
return (0);
}
/* ARGSUSED */
{
/* packet hash object */
if (packet_hash_obj == NULL) {
return (-1);
}
/* verify payload length */
return (-1);
}
return (nbytes);
}
{
int retval;
int count;
if (cont_hash_obj == NULL) {
return (NULL);
}
if (cont_conf_file == NULL) {
&cont_info);
if (retval < 0) {
}
} else {
&cont_info);
}
if (retval < 0) {
return (NULL);
}
if (sec_hash_obj == NULL) {
return (NULL);
}
}
return (cont_hash_obj->obj_hdl);
}
int
{
/* lookup for container hash object */
return (0);
}
/* points to section object list */
/* traverse section object list */
while (sec_hash_obj != NULL) {
/* traverse segment hash object in the section */
/* object handle of the segment hash object */
obj_hdl =
}
/* going to free section hash object, relink the hash object */
}
} else {
}
}
}
/* free container hash object */
}
} else {
}
}
return (0);
}