// Functions in ftp.c
extern XCHAR Upgrade_pServerIP[IP_ALEN];
extern DCHAR Upgrade_iType;
#define UPGRADE_GET_SET		0		// .set file
#define UPGRADE_GET_BIN		1		// firmware binary file
#define UPGRADE_GET_CFG		2		// configuration text file
#define UPGRADE_GET_MAP		3		// digitmap text file
#define UPGRADE_GET_PHB		4

#ifdef VER_IPH_E00
#define	FTP_DEFAULT_CONFIG	5
#define	FTP_IVR_FILE		6
#endif

// Functions in Ftpapps.c
void OnProvisionEnd();
void CloseFileAndCheckLimit();
void ProvGetFileName();
void ProvHandleSetFile();
void ProvStartUpgrade();

// Functions in cfg_cvt.c
void CfgTxt2Bin();
void PhbTxt2Bin();

// Functions in http_client.c
void HttpClientInitialize();
BOOLEAN HttpClientRun();
void HttpClientHandleTimer();
void HttpClientStart(PXCHAR pDstIP, USHORT iDstPort);
void HttpClientStartAgain();

#ifdef OEM_NET2PHONE 
// Functions in voiceline.c
void VoiceLineStartUpgrade(PXCHAR pDstIP, USHORT iDstPort);
void VoiceLineHandleExtraTask();
void VoiceLineHandleCloseEvent();
void VoiceLineHandleResetEvent();
void VoiceLineHandleDataEvent();
void VoiceLineHandleConnectEvent();
void VoiceLineHandleTimerOut();
#else
// Functions in http_client.c
void HttpUpgrade(UCHAR iType);

// Functions in ftp.c
void FtpInitialize();
BOOLEAN FtpControlRun();
BOOLEAN FtpDataRun();
void FtpControlHandleTimer();
void FtpDataHandleTimer();
void FtpUpgrade(UCHAR iType);

// Functions in Tftp.c
void TftpInitialize();													
void TftpHandleTimer();
BOOLEAN TftpRun();
void TftpUpgrade(UCHAR iType);
#endif
