http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / userapps / broadcom / cfm / inc / psixml.h
index 4fbd0d4..956f9aa 100755 (executable)
@@ -1,15 +1,17 @@
 /*****************************************************************************
-//
-//  Copyright (c) 2004  Broadcom Corporation
-//  All Rights Reserved
-//  No portions of this material may be reproduced in any form without the
-//  written permission of:
-//          Broadcom Corporation
-//          16215 Alton Parkway
-//          Irvine, California 92619
-//  All information contained in this document is Broadcom Corporation
-//  company private, proprietary, and trade secret.
-//
+# <:copyright-gpl
+# Copyright 2004 Broadcom Corp. All Rights Reserved.
+# This program is free software; you can distribute it and/or modify it
+# under the terms of the GNU General Public License (Version 2) as
+# published by the Free Software Foundation.
+# This program is distributed in the hope it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
+# :>
 ******************************************************************************
 //
 //  Filename:       psixml.h
@@ -36,7 +38,7 @@
 #define PSX_MAGIC_VALUE                "-$-PSI-$02.12r01"
 #define PSX_CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
 #define PSX_CRC32_GOOD_VALUE 0xdebb20e3 /* Good final CRC32 checksum value */
-#define PSX_STR_LEN                    50 
+#define PSX_STR_LEN                    50
 #define PSX_VERIFY                     1
 #define PSX_STORE                      0
 #define PSX_TABLE_TYPE                 2
@@ -56,7 +58,8 @@
 
 #define XML_PORT_RANGE_MIN     1
 #define XML_PORT_RANGE_MAX     65535
-#define XML_MAX_SNMP_STR_LEN   15
+//#define XML_MAX_SNMP_STR_LEN   15
+#define XML_MAX_SNMP_STR_LEN   64//Andy exten to 64
 #define XML_MAX_TOD_ENTRY      16
 
 /* string  */
@@ -75,12 +78,15 @@ typedef enum {
    PSX_STS_ERR_FIND_HDL_FNC,
    PSX_STS_ERR_FATAL,
    PSX_STS_ERR_MILD
+#if defined(SUPPORT_PARTCONF)
+   ,PSX_STS_RESTORE_SAME
+#endif
 } PSX_STATUS;
 
 /* internal callback statemachine */
 typedef enum {
    state_start,
-   state_psi_begin,  
+   state_psi_begin,
    state_psi_end
 } xml_state;
 
@@ -96,6 +102,9 @@ typedef struct xmlParseState {
    int tableIndex;
    PSX_STATUS errorFlag;
    int verify;                    /* verify=1 verifcation only, verfify=0 conversion only */
+#if defined(SUPPORT_PARTCONF)
+   int restore;                      /*restore=1 do restore configure*/
+#endif
 } XML_PARSE_STATE, *pXML_PARSE_STATE;
 
 typedef PSX_STATUS (*PSX_SET_OBJ_FNC) (FILE *file, const char *appName, const UINT16 id,
@@ -166,6 +175,8 @@ extern PSX_STATUS xmlSetDdnsNode(FILE* file, const char *appName, const UINT16 i
 
 extern void xmlSetTr69cAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
                 const UINT16 length);
+extern void xmlSetMgmtLockAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                const UINT16 length);
 extern void xmlSetStrObjAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
                       const UINT16 length);
 extern void xmlSetSysLogAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
@@ -234,7 +245,11 @@ extern void xmlSetDdnsAttr(FILE *file, const char *name, const UINT16 id, const
                    const UINT16 length);
 extern void xmlSetEthAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
                   const UINT16 length);
+#if defined(SUPPORT_PARTCONF)
+extern PSX_STATUS xmlParse(char *xmlBuffer, int xmlSize, int verify, int restore);
+#else
 extern PSX_STATUS xmlParse(char *xmlBuffer, int xmlSize, int verify);
+#endif
 extern void xmlTagBegin(nxml_t handle, const char *tag_name, unsigned len);
 extern void xmlTagEnd(nxml_t handle, const char *tag_name, unsigned len);
 extern void xmlAttrBegin(nxml_t handle, const char *tag_name, unsigned len);
@@ -257,6 +272,9 @@ extern PSX_STATUS xmlEndSysUserNamePasswordObj(char *appName, char *objName);
 extern PSX_STATUS xmlGetTr69cAttr(char *attrName, char* attrValue);
 extern PSX_STATUS xmlStartTr69cObj(char *appName, char *objName);
 extern PSX_STATUS xmlEndTr69cObj(char *appName, char *objName);
+extern PSX_STATUS xmlGetMgmtLockAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlStartMgmtLockObj(char *appName, char *objName);
+extern PSX_STATUS xmlEndMgmtLockObj(char *appName, char *objName);
 extern PSX_STATUS xmlGetDftGwAttr(char *attrName, char* attrValue);
 extern PSX_STATUS xmlStartDftGwObj(char *appName, char *objName);
 extern PSX_STATUS xmlEndDftGwObj(char *appName, char *objName);
@@ -416,22 +434,46 @@ extern PSX_STATUS xmlGetToDAttr(char *attrName, char* attrValue);
 extern PSX_STATUS xmlEndToDObj(char *appName, char *objName);
 extern PSX_STATUS xmlGetToDEntryAttr(char *attrName, char* attrValue);
 extern PSX_STATUS xmlEndToDEntryObj(char *appName, char *objName);
+
 extern PSX_STATUS xmlSetVoiceNode(FILE* file, const char *appName, const UINT16 id,
                                   const PSI_VALUE value, const UINT16 length);
 
 extern PSX_STATUS xmlGetVoiceNode(char *appName, char *objName, char *attrName, char* attrValue);
 extern PSX_STATUS xmlStartVoiceNode(char *appName, char *objName);
 extern PSX_STATUS xmlEndVoiceNode(char *appName, char *objName);
-extern void  xmlSetMgcpAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
-                            const UINT16 length);
-extern void  xmlSetSipAttr(FILE* file, const char *appName, const UINT16 id,
+#if defined(IP_RV_SIP)
+  extern void  xmlSetRvSipAttr(FILE* file, const char *appName, const UINT16 id,
+                           const PSI_VALUE value, const UINT16 length);
+  extern PSX_STATUS xmlStartRvSipObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlEndRvSipObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlGetRvSipAttr(char *attrName, char* attrValue);
+  extern void  xmlSetRvSipExtAttr(FILE* file, const char *appName, const UINT16 id,
+                           const PSI_VALUE value, const UINT16 length);
+  extern PSX_STATUS xmlStartRvSipExtObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlEndRvSipExtObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlGetRvSipExtAttr(char *attrName, char* attrValue);
+  extern void  xmlSetRvSipDpAttr(FILE* file, const char *appName, const UINT16 id,
                            const PSI_VALUE value, const UINT16 length);
-extern PSX_STATUS xmlStartMgcpObjNode(char *appName, char *objName);
-extern PSX_STATUS xmlEndMgcpObjNode(char *appName, char *objName);
-extern PSX_STATUS xmlGetMgcpAttr(char *attrName, char* attrValue);
-extern PSX_STATUS xmlStartSipObjNode(char *appName, char *objName);
-extern PSX_STATUS xmlEndSipObjNode(char *appName, char *objName);
-extern PSX_STATUS xmlGetSipAttr(char *attrName, char* attrValue);
+  extern PSX_STATUS xmlStartRvSipDpObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlEndRvSipDpObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlGetRvSipDpAttr(char *attrName, char* attrValue);
+  extern void  xmlSetRvSip4PAttr(FILE* file, const char *appName, const UINT16 id,
+                           const PSI_VALUE value, const UINT16 length);
+  extern PSX_STATUS xmlStartRvSip4PObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlEndRvSip4PObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlGetRvSip4PAttr(char *attrName, char* attrValue);
+#else
+  extern void  xmlSetMgcpAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                              const UINT16 length);
+  extern void  xmlSetSipAttr(FILE* file, const char *appName, const UINT16 id,
+                             const PSI_VALUE value, const UINT16 length);
+  extern PSX_STATUS xmlStartMgcpObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlEndMgcpObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlGetMgcpAttr(char *attrName, char* attrValue);
+  extern PSX_STATUS xmlStartSipObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlEndSipObjNode(char *appName, char *objName);
+  extern PSX_STATUS xmlGetSipAttr(char *attrName, char* attrValue);
+#endif
 
 extern PSX_STATUS xmlGetEthAttr(char *attrName, char* attrValue);
 extern PSX_STATUS xmlSetIppNode(FILE* file, const char *appName, const UINT16 id,
@@ -440,6 +482,13 @@ extern PSX_STATUS xmlGetIppNode(char *appName, char *objName, char *attrName, ch
 extern PSX_STATUS xmlGetIppAttr(char *attrName, char* attrValue);
 extern PSX_STATUS xmlStartIppObj(char *appName, char *objName);
 extern PSX_STATUS xmlEndIppObj(char *appName, char *objName);
+#ifdef SUPPORT_DDNSD
+extern void xmlSetDdnsStatusObjAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);
+extern PSX_STATUS xmlGetDdnsStatusAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlStartDdnsStatusObj(char *appName, char *objName);
+extern PSX_STATUS xmlEndDdnsStatusObj(char *appName, char *objName);
+#endif
 extern PSX_STATUS xmlSetIPSecNode(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value, const UINT16 length);
 extern PSX_STATUS xmlGetIPSecNode(char *appName, char *objName, char *attrName, char* attrValue);
 extern PSX_STATUS xmlStartIPSecNode(char *appName, char *objName);
@@ -452,9 +501,17 @@ extern PSX_STATUS xmlEndCertNode(char *appName, char *objName);
 
 extern char *xmlWirelessGetPhyType(void);
 extern int xmlWirelessGetCoreRev(void);
-extern int xmlWirelessGetBands();
+extern int xmlWirelessGetBands(void);
 extern int xmlWirelessGetValidBand(int band);
 
+#ifdef BUILD_STATIC_DNS
+extern void wsnXmlSetStaticDns(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);
+extern PSX_STATUS wsnXmlStartStaticDns(char *appName, char *objName);
+
+extern PSX_STATUS wsnXmlGetStaticDns(char *attrName, char* attrValue);
+extern PSX_STATUS wsnXmlEndStaticDns(char *appName, char *objName);
+#endif
 
 extern PSX_STATUS xmlGetPortMirrorCfgAttr(char *attrName, char* attrValue) ;
 extern PSX_STATUS xmlEndPortMirrorCfgObj(char *appName, char *objName) ;
@@ -469,9 +526,111 @@ extern PSX_STATUS xmlSetPortMirrorObjNode (FILE* file, const char *appName, cons
 extern PSX_STATUS xmlGetPortMirrorObjNode(char *appName, char *objName, char *attrName, char* attrValue) ;
 extern PSX_STATUS xmlStartPortMirrorObjNode(char *appName, char *objName) ;
 extern PSX_STATUS xmlEndPortMirrorObjNode(char *appName, char *objName) ;
+/*Wilson porting from 3.02, (05/25/2006)*/
+extern void xmlSetHostNameObjAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);
+extern PSX_STATUS xmlStartHostNameObj(char *appName, char *objName);
 
+extern PSX_STATUS xmlGetHostNameAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndHostNameObj(char *appName, char *objName);
+#ifdef ODM_MULTI_LANG
+extern void wsnXmlSetWebLang(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);
+extern PSX_STATUS wsnXmlStartWebLang(char *appName, char *objName);
+
+extern PSX_STATUS wsnXmlGetWebLang(char *attrName, char* attrValue);
+extern PSX_STATUS wsnXmlEndWebLang(char *appName, char *objName);
+#endif
+extern void encryptData(char *dest, char *src, int length);
+extern void decryptData(char *dest, char *src, int length);
+/*End Wilson porting from 3.02, (05/25/2006)*/
 extern int base64Encode(const void *inp, int insize, char **outptr);
 extern void base64Decode(unsigned char *dest, char *src, int *rawLength);
+extern void xmlSetFWObjAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);//add by wilson
+extern PSX_STATUS xmlGetSysFWAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlStartSysFWObj(char *appName, char *objName);
+extern PSX_STATUS xmlEndSysFWObj(char *appName, char *objName);
+
+extern PSX_STATUS xmlSetDhcpMapObjNode(FILE* file, const char *appName, const UINT16 id,
+                           const PSI_VALUE value, const UINT16 length);
+extern void xmlSetDhcpMapAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                     const UINT16 length);
+extern PSX_STATUS xmlStartDhcpMapObjNode(char *appName, char *objName);
+extern PSX_STATUS xmlEndDhcpMapObjNode(char *appName, char *objName);
+extern PSX_STATUS xmlEndDhcpMapObj(char *appName, char *objName);
+extern PSX_STATUS xmlGetDhcpMapObjNode(char *appName, char *objName, char *attrName, char* attrValue);
+extern PSX_STATUS xmlGetDhcpMapAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndDhcpMapEntryObj(char *appName, char *objName);
+extern PSX_STATUS xmlGetDhcpMapEntryAttr(char *attrName, char* attrValue);
+//Remote Access IP List
+extern PSX_STATUS xmlSetRemoteIpObjNode(FILE* file, const char *appName, const UINT16 id,
+                           const PSI_VALUE value, const UINT16 length);
+extern PSX_STATUS xmlStartRemoteIpObjNode(char *appName, char *objName);
+extern PSX_STATUS xmlGetRemoteIpObjNode(char *appName, char *objName, char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndRemoteIpObjNode(char *appName, char *objName);
+extern void xmlSetRemoteIpAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                     const UINT16 length);
+extern PSX_STATUS xmlGetRemoteIpAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndRemoteIpObj(char *appName, char *objName);
+extern PSX_STATUS xmlGetRemoteIpEntryAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndRemoteIpEntryObj(char *appName, char *objName);
+//end Remote Access IP List
+
+//Paul porting from 2.21.5, 7/24/2006
+#ifdef INCLUDE_PRINT_SERVER
+extern void xmlSetPrinterServerObjAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);
+extern PSX_STATUS xmlStartPrinterServerObj(char *appName, char *objName);
+
+extern PSX_STATUS xmlGetPrinterServerAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndPrinterServerObj(char *appName, char *objName);
+#endif
+//Paul porting end
+
+#ifdef SUPPORT_ODM_VOICE_QOS
+extern void xmlSetVoiceQoSAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                   const UINT16 length);
+extern PSX_STATUS xmlStartVoiceQoSObj(char *appName, char *objName);
+extern PSX_STATUS xmlGetVoiceQoSAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndVoiceQoSObj(char *appName, char *objName);
+#endif
+#ifdef BUILD_PPP_DOMAIN_SUFFIX
+extern void xmlSetPppSuffix(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);
+extern PSX_STATUS xmlStartPppSuffix(char *appName, char *objName);
+
+extern PSX_STATUS xmlGetPppSuffix(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndPppSuffix(char *appName, char *objName);
+#endif
+#if defined(SUPPORT_SYS_ALG)
+#if defined(SUPPORT_SYS_VPN_ALG) || defined(SUPPORT_SYS_SIP_ALG)
+extern void xmlSetSysAlg(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                       const UINT16 length);
+extern PSX_STATUS xmlGetSysAlg(char *attrName, char* attrValue);
+extern PSX_STATUS xmlStartSysAlg(char *appName, char *objName);
+extern PSX_STATUS xmlEndSysAlg(char *appName, char *objName);
+#endif
+#endif
+
+#if defined(SUPPORT_MULTIPLE_VOIP_PROVIDERS) //Paul add, 6/13/2006
+extern void xmlSetSipProviderAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                     const UINT16 length);
+extern PSX_STATUS xmlGetSipProviderAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlGetSipProviderEntryAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndSipProviderObj(char *appName, char *objName);
+extern PSX_STATUS xmlEndSipProviderEntryObj(char *appName, char *objName);
+#endif //Paul add end
+
+#if defined(ODM_LANG_NETGEAR)
+extern void wsnXmlSetBlankState(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value,
+                      const UINT16 length);
+extern PSX_STATUS wsnXmlStartBlankState(char *appName, char *objName);
+
+extern PSX_STATUS wsnXmlGetBlankState(char *attrName, char* attrValue);
+extern PSX_STATUS wsnXmlEndBlankState(char *appName, char *objName);
+#endif
+
 #if defined(__cplusplus)
 }
 #endif