/*************************************************
File name:sftp.h
Author: 	JianHui Zheng
Version:	9:00:00 
Date:  		2007-10-9
Description:sftp.cµÄÍ·ÎÄ¼þ
			
			
			
			
												
History:               
No. 		
Author:		  
Date:		 
Version:	   
Description:
*************************************************/
#ifndef _SFTP_SEND_H_
#define _SFTP_SEND_H_

#include  <pthread.h>
#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  <dirent.h>
#include 	<sys/types.h>


#ifndef _T_DWORD
#define _T_DWORD
typedef unsigned int DWORD;
#endif

#include "mysql.h"

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

/********************************************************/
/******             Constant Define                ******/
/********************************************************/
/* The hpmn servers info update timeslot (Second) */
#define HPMN_INFO_UPDATE_TIME 60	
/* The hpmn servers count which this version to support */
#define HPMN_SERVER_COUNT 100
/* Wait time when the server send file fail */
#define WAIT_TIME 10
/* The max number of thread */
#define MAX_THREAD_NUM 8

#define MAX_FAIL_TIMEOUT 300

/* The max number of File Transfer object */
#define MAX_FILE_TRANSFER_NUM 32


/* The return value of the function */
#define SUCCESSFUL 1
#define FAIL 0

#ifndef SFTP_DEBUG
	#define SFTP_DEBUG 0
#endif

/********************************************************/
/******              Struct Define                 ******/
/********************************************************/
/* The information of the hpmn servers */
typedef struct HpmnServer
{
	char mcc[8];							//The mcc of the HPMN server
	char mnc[8];							//The mnc of the HPMN server
	char tadig[8];						//The tadig of the HPMN server, length=5
	char serverIP[16];				//The remote IP address of the HPMN server, xxx.xxx.xxx.xxx
	char loginName[64];				//The user name to login the remote HPMN server
	char loginPass[64];				//The user password to login the remote HPMN server
	int timeSlot;							//The timeslot to send the nrtrde to the remote HPMN server
	char reportDir[256];			//The directory to send the report files to the HPMN server
	char nrtrdeDir[256];			//The directory to send the nrtrde files to the HPMN server

	int sendFileTimeout;			//When the value<0, then send the nrtrde file to remote HPMN server
}HpmnServer;

/* The information of the file transfer object */
typedef struct FileTransfer
{
	char srcDir[128];
	char dstDir[128];
	char dstIP[16];
	char filter[16];
	char logName[32];
	char logPass[32];
	int curFileIndex;
	int waitTime;
	int failTimeout;
}FileTransfer;

#endif
