/* Title:	subsDataBackup.h
 * Description:	back up the subscriber data
 * Author:	Cui Ticun
 * Date:	2005/01/15
 */

#include 	<assert.h>
#include	<stdio.h>
#include	<stdlib.h>
#include	<errno.h>
#include	<string.h>
#include	<ctype.h>
#include	<math.h>
#include	<memory.h>
#include	<sys/types.h>
#include	<netinet/in.h>
#include	<sys/socket.h>
#include	<arpa/inet.h>
#include	<netdb.h>
#include	<sys/wait.h>
#include	<unistd.h>
#include	<signal.h>
#include	<sys/ipc.h>
#include	<sys/shm.h>
#include	<sys/sem.h>
#include	<sys/msg.h>
#include	<sys/time.h>
#include	<time.h>
#include    <net/if.h>
#include	<syslog.h>
#include	<termio.h>
#include    <fcntl.h>
#include    <stdarg.h>
#include    <syslog.h>
#include    <sys/io.h>
#include    <error.h>
#include	<sys/stat.h>
#include	<ftw.h>

#include "../../../../plat/public/src/include/pub_include.h"
#include "../../../omcLib/c_program/omcLib/omcLib.h"
#include "../../../../plat/snmp/src/include/snmp.h"
#include "mysql.h"

#define subsDataBackup_LogPath		"../log"
#define subsDataBackup_LogFile		"subsDataBackup"
#define subsComm_backupPath		"/usr/local/apache/htdocs/db_backup/subsData"

#define MaxSysConfNum		18
#define MAX_GETALL_TIMEOUT 7200

#define HOSTNAME			"localhost"
#define PUB_DB				"OMC_PUB"					//OMC's public database
#define SysConfTable		"OMC_PUB.sysConf"			//system config table
#define subsConfTable		"OMC_PUB.sysSubsConf"		//system config table
#define CommTable			"OMC_PUB.subscriberComm"	//command table
#define IpTable				"OMC_PUB.sysInfo"			//system's IP table
#define subsDataBackupTable	"OMC_PUB.subsDataBackup"	//
#define omcPubVarConfTable	"OMC_PUB.omcPubVarConf"	//

//commState flag define
#define nProcFail		0
#define nWaitProc		1
#define nInProc			2
#define nOutProc		3

//subs data backup state
#define nNotBackup		0
#define nWaitBackup		1
#define nInBackup		2
#define nOutBackup		3

typedef struct subsData_Backup{
	int backupStat;
	int sysTypeNo;
	int dataTypeNo;
	int sysNo;
	int subSysNo;
	char subsDataTable[128];
	char tmpDataTable[128];
}subsData_Backup;

/* by simon at 23/9/25 */
// subsData_Backup subsDataBackup[MaxSysConfNum];
	
//Interface Functions Declare,define in subsComm.c
void subsDataBackupInit();
void subsDataBackupTimer();
