| lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | /** | 
 | 2 |  * @file ext_ftp_func.h | 
 | 3 |  * @brief ÌṩÁËzte_ftpÍⲿÏûÏ¢ºÍÏûÏ¢½á¹¹¶¨Òå | 
 | 4 |  * | 
 | 5 |  * Copyright (C) 2017 Sanechips Technology Co., Ltd. | 
 | 6 |  * @author | 
 | 7 |  * | 
 | 8 |  * This program is free software; you can redistribute it and/or modify | 
 | 9 |  * it under the terms of the GNU General Public License version 2 as | 
 | 10 |  * published by the Free Software Foundation. | 
 | 11 |  * | 
 | 12 |  */ | 
 | 13 | #ifndef __EXT_FTP_FUNC_H__ | 
 | 14 | #define __EXT_FTP_FUNC_H__ | 
 | 15 |  | 
 | 16 | /******************************************************************************* | 
 | 17 |  *                           Include header files                              * | 
 | 18 |  ******************************************************************************/ | 
 | 19 | #include "message.h" | 
 | 20 |  | 
 | 21 | /******************************************************************************* | 
 | 22 |  *                             Macro definitions                               * | 
 | 23 |  ******************************************************************************/ | 
 | 24 | #define MAX_FILE_NAME_LENTH 64 | 
 | 25 | /******************************************************************************* | 
 | 26 |  *                             Type definitions                                * | 
 | 27 |  ******************************************************************************/ | 
 | 28 | /* zte_ftpÄ£¿é´ò¿ªÇëÇóÏûÏ¢Êý¾Ý½á¹¹*/ | 
 | 29 | struct zteftp_open_reqmsg { | 
 | 30 | 	unsigned int channel; /* ftpÆô¶¯»ùÓÚµÄchannelÀàÐÍ.0~3*/ | 
 | 31 | 	char destination[256];/*ftpÕ¾µãip/url : port*/ | 
 | 32 | 	char username[256];/*µÇ¼Óû§Ãû*/ | 
 | 33 | 	char password[256];/*µÇ¼ÃÜÂë*/ | 
 | 34 | 	unsigned int  mode;/*0±íʾÖ÷¶¯FTPģʽ£»1±íʾ±»¶¯FTPģʽ*/ | 
 | 35 | 	unsigned int  tout;/*5~180s,FTPÃüÁî»òÕßÊý¾Ý¿ÕÏг¬Ê±ÉèÖ㬵¥Î»s£»Ä¬ÈÏΪ30s*/ | 
 | 36 | 	unsigned int  ftptype;/*0±íʾ¶þ½øÖÆÄ£Ê½(ĬÈÏ);1±íʾÎı¾Ä£Ê½*/ | 
 | 37 | }; | 
 | 38 | /* zte_ftpÄ£¿é´ò¿ªÏìÓ¦ÏûÏ¢Êý¾Ý½á¹¹*/ | 
 | 39 | struct zteftp_open_rspmsg { | 
 | 40 | 	int result;/*0±íʾOK£»-1±íʾERROR*/ | 
 | 41 | 	int err;/*´íÎóÂë*/ | 
 | 42 | }; | 
 | 43 |  | 
 | 44 | /* ״̬²éѯÏìÓ¦ÏûÏ¢Êý¾Ý½á¹¹*/ | 
 | 45 | struct zteftp_query_rspmsg { | 
 | 46 | 	int  connect_status;/*1±íʾÁ¬½Ó³É¹¦£»0±íʾÁ¬½Óʧ°Ü*/ | 
 | 47 | }; | 
 | 48 |  | 
 | 49 | /* zte_ftpÄ£¿é¹Ø±ÕÏìÓ¦ÏûÏ¢Êý¾Ý½á¹¹*/ | 
 | 50 | struct zteftp_close_rspmsg { | 
 | 51 | 	int result;/*0±íʾ¹Ø±ÕOK£»-1±íʾ¹Ø±ÕERROR*/ | 
 | 52 | }; | 
 | 53 |  | 
 | 54 | /* zte_ftpÄ£¿é»ñÈ¡FTP·þÎñÆ÷¶ÔÓ¦ÎļþµÄ³¤¶ÈÇëÇóÏûÏ¢Êý¾Ý½á¹¹*/ | 
 | 55 | struct zteftp_size_reqmsg { | 
 | 56 | 	char file_name[MAX_FILE_NAME_LENTH]; | 
 | 57 | }; | 
 | 58 | struct zteftp_size_rspmsg { | 
 | 59 | 	int file_lenth; | 
 | 60 | }; | 
 | 61 |  | 
 | 62 | /* zte_ftpÄ£¿éÏÂÔØ¹¦ÄÜÏûÏ¢Êý¾Ý½á¹¹*/ | 
 | 63 | struct zteftp_get_reqmsg { | 
 | 64 | 	char file_name[MAX_FILE_NAME_LENTH];/*ÐèÒªÏÂÔØµÄÎļþÃû*/ | 
 | 65 | 	int data_offset;/*ÎļþÊý¾ÝµÄÆ«ÒÆÁ¿*/ | 
 | 66 | 	int data_lenth;/*±¾´Î¶ÁÈ¡Êý¾ÝµÄ³¤¶È*/ | 
 | 67 | }; | 
 | 68 | struct zteftp_get_rspmsg { | 
 | 69 | 	int result; | 
 | 70 | 	int data_lenth;/*±¾´Î¶ÁÈ¡Êý¾ÝµÄ³¤¶È*/ | 
 | 71 | 	unsigned char file_content[1];/*ftpÊý¾ÝÄÚÈÝ*/ | 
 | 72 | }; | 
 | 73 |  | 
 | 74 | /* zte_ftpÄ£¿éÉÏ´«¹¦ÄÜÏûÏ¢Êý¾Ý½á¹¹*/ | 
 | 75 | struct zteftp_put_reqmsg { | 
 | 76 | 	char file_name[MAX_FILE_NAME_LENTH];/*ÐèÒªÉÏÔØµÄÎļþÃû.°üÀ¨Â·¾¶*/ | 
 | 77 | 	unsigned int data_lenth;/*ÿ´ÎÉÏ´«Êý¾ÝµÄ³¤¶È*/ | 
 | 78 | 	unsigned int eof;/* ÉÏ´«Îļþ½áÊø±ê־λ.×î¸ßλΪ0,±íʾÊý¾ÝΪ¿Õ£»Îª1±íʾÓÐÊý¾Ý£¬Êý¾ÝÇø½ô¸ú¸ÃµØÖ·*/ | 
 | 79 | 	unsigned char file_content[1];/*ftpÊý¾ÝÄÚÈÝ*/ | 
 | 80 | }; | 
 | 81 | struct zteftp_put_rspmsg { | 
 | 82 | 	int ret; | 
 | 83 |  | 
 | 84 | 	/*ÏÂÃæ²ÎÊýÐÅÏ¢ÓëÇëÇóÐÅÏ¢±£³ÖÒ»ÖÂ.´¦Àí¸ÃputÏìÓ¦ÏûϢʱ²»ÄÜÐÞ¸Ä.ͨ¹ýsocketÏòÓ¦Óò㷢ËÍÊý¾ÝÏûϢʱʹÓÃ*/ | 
 | 85 | 	char file_name[MAX_FILE_NAME_LENTH];/*ÐèÒªÉÏÔØµÄÎļþÃû.°üÀ¨Â·¾¶.*/ | 
 | 86 | 	unsigned int data_lenth;/*ÿ´ÎÉÏ´«Êý¾ÝµÄ³¤¶È*/ | 
 | 87 | 	unsigned int eof;/* ÉÏ´«Îļþ½áÊø±ê־λ*/ | 
 | 88 | }; | 
 | 89 |  | 
 | 90 | /*ftp fotaÉý¼¶*/ | 
 | 91 | struct zteftp_fota_reqmsg { | 
 | 92 | 	unsigned int channel; /* ftpÆô¶¯»ùÓÚµÄchannelÀàÐÍ.0~3*/ | 
 | 93 | 	char destination[256];/*ftpÕ¾µãip/url : port*/ | 
 | 94 | 	char file_name[MAX_FILE_NAME_LENTH];/*fota²î·Ö°üÎļþÃû*/ | 
 | 95 | 	char username[256];/*µÇ¼Óû§Ãû*/ | 
 | 96 | 	char password[256];/*µÇ¼ÃÜÂë*/ | 
 | 97 | }; | 
 | 98 | struct zteftp_fota_rspmsg { | 
 | 99 | 	int result;/*0±íʾOK£»-1±íʾERROR*/ | 
 | 100 | }; | 
 | 101 |  | 
 | 102 | #if CONFIG_EXIT_DATAMODE | 
 | 103 | struct zteftp_exit_reqmsg { | 
 | 104 | 	int mode;/*0±íʾ͸´«Ä£Ê½£¬-1±íʾ·Ç͸´«Ä£Ê½¡£Í¸´«Ä£Ê½Ê±£¬ÐèÒªÖ÷¶¯Éϱ¨ÏìÓ¦ÏûÏ¢£»·Ç͸´«Ä£Ê½ÆÕͨÏûÏ¢Éϱ¨*/ | 
 | 105 | }; | 
 | 106 | /* zte_ftpÄ£¿éÌø³öÊý¾ÝģʽÏûÏ¢Êý¾Ý½á¹¹.ÊÕµ½"+++"Ê±Ìø³öÊý¾Ýģʽ*/ | 
 | 107 | struct zteftp_exit_rspmsg { | 
 | 108 | 	int result;/*0±íʾÍ˳öOK£»-1±íʾÍ˳öERROR*/ | 
 | 109 | }; | 
 | 110 | #endif | 
 | 111 |  | 
 | 112 | #endif |