#include "bcmtypes.h"
#include "psidefs.h"
+#include "objectdefs.h"
#include "wldefs.h"
#include "nanoxml.h"
-#define PSX_NAME_LEN 16
+#define PSX_NAME_LEN 24
#define PSX_MAGIC_LEN 16
#define PSX_MAGIC_VALUE "-$-PSI-$02.12r01"
#define PSX_CRC32_INIT_VALUE 0xffffffff /* Initial CRC32 checksum value */
#define SATURDAY 0x20
#define SUNDAY 0x40
-/* important limitation: when adding the appName or objectName in either direction, it is
-important not to have appName and objName having the same prefix. The table entry search
-only compare strings up to the prefix length, case not sensitive, to cover situation
-such as APP_ID wan_vpi_vci, only wan is searched in the table. Therefore, it is not
-okay to have Lan as the appId, and objectName as lanSomethingSomething. The search
-entry would think lanSomethingSomething is an appId name. */
-
-#define APPNAME_WAN_PREFIX "wan"
-#define APPNAME_IPSRV_PREFIX "ipsrv"
-#define APPNAME_PPPSRV_PREFIX "pppsrv"
-#define APPNAME_PPP_FORMAT "pppsrv_%d_%d"
-#define APPNAME_IPSRV_ENTRY_FORMAT "ipsrv_%d_%d"
-#define OBJNAME_LAN_ENTRY_FORMAT "entry%d" /* cannot be lan, need to change */
-#define OBJNAME_PPP_ENTRY_FORMAT "ppp_conId%d"
-#define OBJNAME_IPSRV_ENTRY_FORMAT "dhcpc_conId%d"
-#define OBJNAME_WAN_ENTRY_FORMAT "entry%d" /* cannot be wan, need to change */
-#define OBJNAME_GEN_ENTRY_FORMAT "entry"
-
#define XML_PSI_START_TAG "<psitree>"
#define XML_PSI_END_TAG "</psitree>"
#define PSX_ATTRNAME_SET 1
#define PSX_ATTRSTR_SET 2
+/* object and attribute names definitions */
+#define PSX_ATTR_STATE "state"
+
typedef enum {
PSX_STS_OK = 0,
PSX_STS_ERR_GENERAL,
PSX_OBJ_FNC endObjFnc; /* end of object, do verification/storeToPSI, oresource deallocated */
} PSX_OBJ_ITEM, *PPSX_OBJ_ITEM;
-/* object and attribute names definitions */
-#define PSX_ATTR_STATE "state"
-/* system info */
-#define PSX_OBJ_SYS_USER_NAME "sysUserName"
-#define PSX_OBJ_SYS_PASSWORD "sysPassword"
-#define PSX_OBJ_SPT_USER_NAME "sptUserName"
-#define PSX_OBJ_SPT_PASSWORD "sptPassword"
-#define PSX_OBJ_USR_USER_NAME "usrUserName"
-#define PSX_OBJ_USR_PASSWORD "usrPassword"
-#define PSX_OBJ_DEF_GATEWAY "defaultGateway"
-#define PSX_OBJ_DNS "dns"
-#define PSX_OBJ_SYSLOG "sysLog"
-#define PSX_OBJ_SNMP "snmp"
-#define PSX_OBJ_PROTOCOL "protocol"
-#define PSX_OBJ_ETHCFG "ethCfg"
-#define PSX_OBJ_MGCP_CFG "mgcpCfg"
-#define PSX_OBJ_SIP_CFG "sipCfg"
-
-
-#define PSX_ATTR_DNS_PRIMARY "primary"
-#define PSX_ATTR_DNS_SECONDARY "secondary"
-#define PSX_ATTR_DNS_DYNAMIC "dynamic"
-
-#define PSX_ATTR_SYSLOG_DISPLAY_LEVEL "displayLevel"
-#define PSX_ATTR_SYSLOG_LOG_LEVEL "logLevel"
-#define PSX_ATTR_SYSLOG_OPTION "option"
-#define PSX_ATTR_SYSLOG_SERVER_IP "serverIP"
-#define PSX_ATTR_SYSLOG_SERVER_PORT "serverPort"
-
-#define PSX_ATTR_PMAP_IFC_NAME "pmapIfName"
-#define PSX_ATTR_PMAP_IFC_STATUS "pmapIfcStatus"
-
-#define PSX_ATTR_VOICE_MGCP_TAG "mgcpCfg"
-#define PSX_ATTR_VOICE_MGCP_CA_ADDR "caAddr"
-#define PSX_ATTR_VOICE_MGCP_GW_NAME "gwName"
-#define PSX_ATTR_VOICE_MGCP_IF_NAME "ifName"
-#define PSX_ATTR_VOICE_MGCP_PREF_CODEC "prefCodec"
-#define PSX_ATTR_VOICE_SIP_TAG "sipCfg"
-#define PSX_ATTR_VOICE_SIP_PROXY_ADDR "proxyAddr"
-#define PSX_ATTR_VOICE_SIP_PROXY_PORT "proxyPort"
-#define PSX_ATTR_VOICE_SIP_REGISTRAR_ADDR "registrarAddr"
-#define PSX_ATTR_VOICE_SIP_REGISTRAR_PORT "registrarPort"
-#define PSX_ATTR_VOICE_SIP_LOG_ADDR "logAddr"
-#define PSX_ATTR_VOICE_SIP_LOG_PORT "logPort"
-#define PSX_ATTR_VOICE_SIP_EXT1 "ext1"
-#define PSX_ATTR_VOICE_SIP_PASSWORD1 "password1"
-#define PSX_ATTR_VOICE_SIP_EXT2 "ext2"
-#define PSX_ATTR_VOICE_SIP_PASSWORD2 "password2"
-#define PSX_ATTR_VOICE_SIP_EXT3 "ext3"
-#define PSX_ATTR_VOICE_SIP_PASSWORD3 "password3"
-#define PSX_ATTR_VOICE_SIP_EXT4 "ext4"
-#define PSX_ATTR_VOICE_SIP_PASSWORD4 "password4"
-#define PSX_ATTR_VOICE_SIP_IF_NAME "ifName"
-
-#define PSX_ATTR_ETH_CFG_SPEED "speed"
-#define PSX_ATTR_ETH_CFG_TYPE "type"
-#define PSX_ATTR_ETH_CFG_MTU "MTU"
-#define PSX_ATTR_IPP_MAKE "make"
-#define PSX_ATTR_IPP_DEV "dev"
-#define PSX_ATTR_IPP_NAME "name"
#if defined(__cplusplus)
extern "C" {
#endif
extern PSX_STATUS xmlSetDdnsNode(FILE* file, const char *appName, const UINT16 id,
const PSI_VALUE value, const UINT16 length);
+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,
extern PSX_STATUS xmlGetSysPasswordAttr(char *attrName, char* attrValue);
extern PSX_STATUS xmlStartSysUserNamePasswordObj(char *appName, char *objName);
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);
extern PSX_STATUS xmlGetMacFilterEntryAttr(char *attrName, char* attrValue);
extern PSX_STATUS xmlEndMacFilterEntryObj(char *appName, char *objName);
extern PSX_STATUS xmlGetQosClsAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlStartQosClsEntryObj(char *appName, char *objName);
extern PSX_STATUS xmlEndQosClsObj(char *appName, char *objName);
extern PSX_STATUS xmlGetQosClsEntryAttr(char *attrName, char* attrValue);
extern PSX_STATUS xmlEndQosClsEntryObj(char *appName, char *objName);
extern PSX_STATUS xmlEndWirelessMacFilterEntryObj(char *appName, char *objName);
extern PSX_STATUS xmlGetWirelessMacFilterAttr(char *attrName, char* attrValue);
extern PSX_STATUS xmlEndWirelessMacFilterObj(char *appName, char *objName);
+extern void xmlSetWirelessMssidVarsAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value, const UINT16 length);
+extern PSX_STATUS xmlGetWirelessMssidVarsAttr(char * attrName, char * attrValue);
+extern PSX_STATUS xmlEndWirelessMssidVarsObj(char *appName, char *objName);
+extern PSX_STATUS xmlGetWirelessMssidVarsEntryAttr(char *attrName, char* attrValue);
+extern PSX_STATUS xmlEndWirelessMssidVarsEntryObj(char *appName, char *objName);
extern PSX_STATUS xmlGetRouteObjNode(char *appName, char *objName, char *attrName, char* attrValue);
extern PSX_STATUS xmlStartRouteObjNode(char *appName, char *objName);
extern PSX_STATUS xmlEndRouteObjNode(char *appName, char *objName);
extern PSX_STATUS xmlGetIppAttr(char *attrName, char* attrValue);
extern PSX_STATUS xmlStartIppObj(char *appName, char *objName);
extern PSX_STATUS xmlEndIppObj(char *appName, char *objName);
+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);
+extern PSX_STATUS xmlEndIPSecNode(char *appName, char *objName);
+extern PSX_STATUS xmlSetCertNode(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value, const UINT16 length);
+extern PSX_STATUS xmlGetCertNode(char *appName, char *objName, char *attrName, char* attrValue);
+extern PSX_STATUS xmlStartCertNode(char *appName, char *objName);
+extern PSX_STATUS xmlEndCertNode(char *appName, char *objName);
+
+
+extern char *xmlWirelessGetPhyType(void);
+extern int xmlWirelessGetCoreRev(void);
+extern int xmlWirelessGetBands(void);
+extern int xmlWirelessGetValidBand(int band);
+
+
+extern PSX_STATUS xmlGetPortMirrorCfgAttr(char *attrName, char* attrValue) ;
+extern PSX_STATUS xmlEndPortMirrorCfgObj(char *appName, char *objName) ;
+extern void xmlSetPortMirrorStatusAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value, const UINT16 length) ;
+extern PSX_STATUS xmlGetPortMirrorStatusAttr(char *attrName, char* attrValue) ;
+extern PSX_STATUS xmlStartPortMirrorStatusAttr(char *appName, char *objName) ;
+extern PSX_STATUS xmlEndPortMirrorStatusAttr(char *appName, char *objName) ;
+extern void xmlSetPortMirrorCfgEntryAttr(FILE *file, const char *name, const UINT16 id, const PSI_VALUE value, const UINT16 length) ;
+extern PSX_STATUS xmlGetPortMirrorCfgEntryAttr(char *attrName, char* attrValue) ;
+extern PSX_STATUS xmlEndPortMirrorCfgEntryAttrObj(char *appName, char *objName) ;
+extern PSX_STATUS xmlSetPortMirrorObjNode (FILE* file, const char *appName, const UINT16 id, const PSI_VALUE value, const UINT16 length) ;
+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) ;
+
+extern int base64Encode(const void *inp, int insize, char **outptr);
+extern void base64Decode(unsigned char *dest, char *src, int *rawLength);
#if defined(__cplusplus)
}
#endif