http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / inc / psidefs.h
1 /*****************************************************************************
2 # <:copyright-gpl
3 # Copyright 2004 Broadcom Corp. All Rights Reserved.
4 # This program is free software; you can distribute it and/or modify it
5 # under the terms of the GNU General Public License (Version 2) as
6 # published by the Free Software Foundation.
7 # This program is distributed in the hope it will be useful, but WITHOUT
8 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
10 # for more details.
11 # You should have received a copy of the GNU General Public License along
12 # with this program; if not, write to the Free Software Foundation, Inc.,
13 # 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
14 # :>
15 ******************************************************************************
16 //
17 //  Filename:       psidefs.h
18 //  Author:         Peter T. Tran
19 //  Creation Date:  12/26/01
20 //
21 ******************************************************************************
22 //  Description:
23 //      Define the PsiDefs functions.
24 //
25 *****************************************************************************/
26
27 #ifndef __PSIDEFS_H__
28 #define __PSIDEFS_H__
29
30 /********************** Include Files ***************************************/
31
32 #include <stdio.h>
33 #include "bcmtypes.h"
34
35 /********************** Global Constants ************************************/
36 #define PSI_MAGIC_LEN   16
37 #define PSI_HEADER_LEN  (PSI_MAGIC_LEN + sizeof(UINT16))
38 #define PSI_VERSION_LEN 6
39
40 #define PSI_OPTIONS                     0
41 #define PSI_PRIORITY                    20
42 #define PSI_STACK_SIZE                  5000
43 #define PSI_PROFILE_NUM_MAX             1
44 #define PSI_PROFILE_NAME_LEN_MAX        16
45
46 // ratio of PSI buffer size in RAM and xml PSI size
47 // xml PSI is more compact. As data have variable size, no space is wasted 
48 #define PSI_BUFFER_TO_XML_FACTOR        4
49
50 #define PSI_VALUE       void*
51 #define PSI_HANDLE      void*
52
53 #define NUM_PORTS       1
54 #define PSI_PATH_DEFAULTCONFIG          "/etc/default.cfg"
55 #define PSI_PATH_RUNTIMECONFIG          "/var/backupsettings.cfg"
56 #define PSI_XML_PATH_FLASHCONFIG        "/var/psi.xml"
57 #define PSI_XML_PATH_RUNTIMECONFIG      "/var/psiRunning.xml"
58 #define PSI_XML_FLASH_CONFIG            1
59 #define PSI_XML_RUNNING_CONFIG          2
60 #define PSI_XML_ALL_CONFIG              3
61 #define PSI_NUMBER_OF_CHANGES           "/var/psiNumChanges"
62 #define PSI_BUFF_SIZE                   128
63
64 /********************** Global Enums ****************************************/
65
66 typedef enum _psiStatus {
67    PSI_STS_OK = 0,
68    PSI_STS_ERR_GENERAL,
69    PSI_STS_ERR_MEMORY,
70    PSI_STS_ERR_OBJECT_NOT_FOUND,
71    PSI_STS_ERR_APP_NOT_FOUND,
72    PSI_STS_ERR_OBJECT_EXIST,
73    PSI_STS_ERR_APP_EXIST,
74    PSI_STS_ERR_INVALID_LENGTH,
75    PSI_STS_ERR_INVALID_VALUE,
76    PSI_STS_ERR_INVALID_CRC,
77    PSI_STS_ERR_INVALID_MAGIC_VALUE,
78    PSI_STS_ERR_INVALID_PROFILE_NUM,
79    PSI_STS_ERR_PROFILE_NAME,
80    PSI_STS_ERR_PROFILE_TOO_LARGE,
81    PSI_STS_ERR_CONFIGFILE_UNKNOWN,
82    PSI_STS_ERR_CONFIGFILE_SIZE
83 #if defined(SUPPORT_PARTCONF)
84    ,PSI_STS_RESTORE_SAME
85 #endif   
86 } PSI_STATUS;
87
88 #endif