www.usr.com/support/gpl/USR9107_release.1.4.tar.gz
[bcm963xx.git] / userapps / broadcom / cfm / inc / psidefs.h
1 /*****************************************************************************
2 //
3 //  Copyright (c) 2000-2001  Broadcom Corporation
4 //  All Rights Reserved
5 //  No portions of this material may be reproduced in any form without the
6 //  written permission of:
7 //          Broadcom Corporation
8 //          16215 Alton Parkway
9 //          Irvine, California 92619
10 //  All information contained in this document is Broadcom Corporation
11 //  company private, proprietary, and trade secret.
12 //
13 ******************************************************************************
14 //
15 //  Filename:       psidefs.h
16 //  Author:         Peter T. Tran
17 //  Creation Date:  12/26/01
18 //
19 ******************************************************************************
20 //  Description:
21 //      Define the PsiDefs functions.
22 //
23 *****************************************************************************/
24
25 #ifndef __PSIDEFS_H__
26 #define __PSIDEFS_H__
27
28 /********************** Include Files ***************************************/
29
30 #include <stdio.h>
31 #include "bcmtypes.h"
32
33 /********************** Global Constants ************************************/
34 #define PSI_MAGIC_LEN   16
35 #define PSI_HEADER_LEN  (PSI_MAGIC_LEN + sizeof(UINT16))
36 #define PSI_VERSION_LEN 6
37
38 #define PSI_OPTIONS                     0
39 #define PSI_PRIORITY                    20
40 #define PSI_STACK_SIZE                  5000
41 #define PSI_PROFILE_NUM_MAX             1
42 #define PSI_PROFILE_NAME_LEN_MAX        16
43
44 // ratio of PSI buffer size in RAM and xml PSI size
45 // xml PSI is more compact. As data have variable size, no space is wasted 
46 #define PSI_BUFFER_TO_XML_FACTOR        4
47
48 #define PSI_VALUE       void*
49 #define PSI_HANDLE      void*
50
51 #define NUM_PORTS       1
52 #define PSI_PATH_DEFAULTCONFIG          "/etc/default.cfg"
53 #define PSI_PATH_RUNTIMECONFIG          "/var/backupsettings.cfg"
54 #define PSI_XML_PATH_FLASHCONFIG        "/var/psi.xml"
55 #define PSI_XML_PATH_RUNTIMECONFIG      "/var/psiRunning.xml"
56 #define PSI_XML_FLASH_CONFIG            1
57 #define PSI_XML_RUNNING_CONFIG          2
58 #define PSI_XML_ALL_CONFIG              3
59 #define PSI_NUMBER_OF_CHANGES           "/var/psiNumChanges"
60 #define PSI_BUFF_SIZE                   128
61
62 /********************** Global Enums ****************************************/
63
64 typedef enum _psiStatus {
65    PSI_STS_OK = 0,
66    PSI_STS_ERR_GENERAL,
67    PSI_STS_ERR_MEMORY,
68    PSI_STS_ERR_OBJECT_NOT_FOUND,
69    PSI_STS_ERR_APP_NOT_FOUND,
70    PSI_STS_ERR_OBJECT_EXIST,
71    PSI_STS_ERR_APP_EXIST,
72    PSI_STS_ERR_INVALID_LENGTH,
73    PSI_STS_ERR_INVALID_VALUE,
74    PSI_STS_ERR_INVALID_CRC,
75    PSI_STS_ERR_INVALID_MAGIC_VALUE,
76    PSI_STS_ERR_INVALID_PROFILE_NUM,
77    PSI_STS_ERR_PROFILE_NAME,
78    PSI_STS_ERR_PROFILE_TOO_LARGE,
79    PSI_STS_ERR_CONFIGFILE_UNKNOWN,
80    PSI_STS_ERR_CONFIGFILE_SIZE
81 } PSI_STATUS;
82
83 #endif