blob: 895d1460e7d9431dec099c9593b40f275a62456e [file] [log] [blame]
/**
* @file ext_ftp_func.h
* @brief ÌṩÁËzte_ftpÍⲿÏûÏ¢ºÍÏûÏ¢½á¹¹¶¨Òå
*
* Copyright (C) 2017 Sanechips Technology Co., Ltd.
* @author
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#ifndef __EXT_FTP_FUNC_H__
#define __EXT_FTP_FUNC_H__
/*******************************************************************************
* Include header files *
******************************************************************************/
#include "message.h"
/*******************************************************************************
* Macro definitions *
******************************************************************************/
#define MAX_FILE_NAME_LENTH 64
/*******************************************************************************
* Type definitions *
******************************************************************************/
/* zte_ftpÄ£¿é´ò¿ªÇëÇóÏûÏ¢Êý¾Ý½á¹¹*/
struct zteftp_open_reqmsg {
unsigned int channel; /* ftpÆô¶¯»ùÓÚµÄchannelÀàÐÍ.0~3*/
char destination[256];/*ftpÕ¾µãip/url : port*/
char username[256];/*µÇ¼Óû§Ãû*/
char password[256];/*µÇ¼ÃÜÂë*/
unsigned int mode;/*0±íʾÖ÷¶¯FTPģʽ£»1±íʾ±»¶¯FTPģʽ*/
unsigned int tout;/*5~180s,FTPÃüÁî»òÕßÊý¾Ý¿ÕÏг¬Ê±ÉèÖ㬵¥Î»s£»Ä¬ÈÏΪ30s*/
unsigned int ftptype;/*0±íʾ¶þ½øÖÆÄ£Ê½(ĬÈÏ);1±íʾÎı¾Ä£Ê½*/
};
/* zte_ftpÄ£¿é´ò¿ªÏìÓ¦ÏûÏ¢Êý¾Ý½á¹¹*/
struct zteftp_open_rspmsg {
int result;/*0±íʾOK£»-1±íʾERROR*/
int err;/*´íÎóÂë*/
};
/* ״̬²éѯÏìÓ¦ÏûÏ¢Êý¾Ý½á¹¹*/
struct zteftp_query_rspmsg {
int connect_status;/*1±íʾÁ¬½Ó³É¹¦£»0±íʾÁ¬½Óʧ°Ü*/
};
/* zte_ftpÄ£¿é¹Ø±ÕÏìÓ¦ÏûÏ¢Êý¾Ý½á¹¹*/
struct zteftp_close_rspmsg {
int result;/*0±íʾ¹Ø±ÕOK£»-1±íʾ¹Ø±ÕERROR*/
};
/* zte_ftpÄ£¿é»ñÈ¡FTP·þÎñÆ÷¶ÔÓ¦ÎļþµÄ³¤¶ÈÇëÇóÏûÏ¢Êý¾Ý½á¹¹*/
struct zteftp_size_reqmsg {
char file_name[MAX_FILE_NAME_LENTH];
};
struct zteftp_size_rspmsg {
int file_lenth;
};
/* zte_ftpÄ£¿éÏÂÔØ¹¦ÄÜÏûÏ¢Êý¾Ý½á¹¹*/
struct zteftp_get_reqmsg {
char file_name[MAX_FILE_NAME_LENTH];/*ÐèÒªÏÂÔØµÄÎļþÃû*/
int data_offset;/*ÎļþÊý¾ÝµÄÆ«ÒÆÁ¿*/
int data_lenth;/*±¾´Î¶ÁÈ¡Êý¾ÝµÄ³¤¶È*/
};
struct zteftp_get_rspmsg {
int result;
int data_lenth;/*±¾´Î¶ÁÈ¡Êý¾ÝµÄ³¤¶È*/
unsigned char file_content[1];/*ftpÊý¾ÝÄÚÈÝ*/
};
/* zte_ftpÄ£¿éÉÏ´«¹¦ÄÜÏûÏ¢Êý¾Ý½á¹¹*/
struct zteftp_put_reqmsg {
char file_name[MAX_FILE_NAME_LENTH];/*ÐèÒªÉÏÔØµÄÎļþÃû.°üÀ¨Â·¾¶*/
unsigned int data_lenth;/*ÿ´ÎÉÏ´«Êý¾ÝµÄ³¤¶È*/
unsigned int eof;/* ÉÏ´«Îļþ½áÊø±ê־λ.×î¸ßλΪ0,±íʾÊý¾ÝΪ¿Õ£»Îª1±íʾÓÐÊý¾Ý£¬Êý¾ÝÇø½ô¸ú¸ÃµØÖ·*/
unsigned char file_content[1];/*ftpÊý¾ÝÄÚÈÝ*/
};
struct zteftp_put_rspmsg {
int ret;
/*ÏÂÃæ²ÎÊýÐÅÏ¢ÓëÇëÇóÐÅÏ¢±£³ÖÒ»ÖÂ.´¦Àí¸ÃputÏìÓ¦ÏûϢʱ²»ÄÜÐÞ¸Ä.ͨ¹ýsocketÏòÓ¦Óò㷢ËÍÊý¾ÝÏûϢʱʹÓÃ*/
char file_name[MAX_FILE_NAME_LENTH];/*ÐèÒªÉÏÔØµÄÎļþÃû.°üÀ¨Â·¾¶.*/
unsigned int data_lenth;/*ÿ´ÎÉÏ´«Êý¾ÝµÄ³¤¶È*/
unsigned int eof;/* ÉÏ´«Îļþ½áÊø±ê־λ*/
};
/*ftp fotaÉý¼¶*/
struct zteftp_fota_reqmsg {
unsigned int channel; /* ftpÆô¶¯»ùÓÚµÄchannelÀàÐÍ.0~3*/
char destination[256];/*ftpÕ¾µãip/url : port*/
char file_name[MAX_FILE_NAME_LENTH];/*fota²î·Ö°üÎļþÃû*/
char username[256];/*µÇ¼Óû§Ãû*/
char password[256];/*µÇ¼ÃÜÂë*/
};
struct zteftp_fota_rspmsg {
int result;/*0±íʾOK£»-1±íʾERROR*/
};
#if CONFIG_EXIT_DATAMODE
struct zteftp_exit_reqmsg {
int mode;/*0±íʾ͸´«Ä£Ê½£¬-1±íʾ·Ç͸´«Ä£Ê½¡£Í¸´«Ä£Ê½Ê±£¬ÐèÒªÖ÷¶¯Éϱ¨ÏìÓ¦ÏûÏ¢£»·Ç͸´«Ä£Ê½ÆÕͨÏûÏ¢Éϱ¨*/
};
/* zte_ftpÄ£¿éÌø³öÊý¾ÝģʽÏûÏ¢Êý¾Ý½á¹¹.ÊÕµ½"+++"Ê±Ìø³öÊý¾Ýģʽ*/
struct zteftp_exit_rspmsg {
int result;/*0±íʾÍ˳öOK£»-1±íʾÍ˳öERROR*/
};
#endif
#endif