eccodes.h

来自「wxWidgets写的电驴」· C头文件 代码 · 共 1,407 行 · 第 1/3 页

H
1,407
字号
//// This file is part of the aMule Project.//// Copyright (c) 2004-2006 aMule Team ( admin@amule.org / http://www.amule.org )//// Any parts of this program derived from the xMule, lMule or eMule project,// or contributed by third-party developers are copyrighted by their// respective authors.//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.// // You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA///*! * \file ECCodes.h * * \brief EC types, OPCODEs, TAGNAMEs. */#ifndef	ECCODES_H#define	ECCODES_H#include <inttypes.h>		// Needed for uint* types/* * EC types */typedef uint8_t ec_opcode_t;typedef uint16_t ec_tagname_t;typedef uint32_t ec_taglen_t;/** * Current EC protocol version */#define	EC_CURRENT_PROTOCOL_VERSION	0x01f3/* * EC FLAG values */#define EC_FLAG_ZLIB		0x00000001#define EC_FLAG_UTF8_NUMBERS	0x00000002#define EC_FLAG_HAS_ID		0x00000004#define EC_FLAG_ACCEPTS		0x00000010#define EC_FLAG_UNKNOWN_MASK	0xff7f7f08/** * <b>EC opcodes</b> * * OpCodes tell the receiver what to do (with the provided data). */// If you plan to use opcodes greater than 0x00ff, please// change the size of ec_opcode_t to uint16.enum {		/*!		 * \brief Perform no operation, just like do nothing.		 *		 * General server response when the requested operation was		 * successful, and no reply needed.		 */	EC_OP_NOOP = 0x0001,	//	// Authentication	//		/*!		 * \brief Authentication request.		 *		 * \par Tags:		 *	::EC_TAG_PASSWD_HASH (required)\n		 *	::EC_TAG_CLIENT_NAME\n		 *	::EC_TAG_CLIENT_VERSION\n		 *	::EC_TAG_CLIENT_MOD\n		 *	::EC_TAG_PROTOCOL_VERSION (required)\n		 *	::EC_TAG_VERSION_ID		 */	EC_OP_AUTH_REQ,		/*!		 * \brief Authentication failed.		 *		 * \par Tags:		 *	::EC_TAG_STRING (optional) describing the reason why authentication was rejected.\n		 *	::EC_TAG_SERVER_VERSION aMule version.		 */	EC_OP_AUTH_FAIL,		/*!		 * \brief Authentication succeeded.		 *		 * \par Tags:		 *	::EC_TAG_SERVER_VERSION aMule version.		 */	EC_OP_AUTH_OK,	//	// Misc commands	//		/*!		 * \brief General error reply.		 *		 * \par Tags:		 *	::EC_TAG_STRING (0-1) An error message.		 */	EC_OP_FAILED,		/*!		 * \brief Used when need to transfer text message without any		 * particular meaning - like logging message in reply to command		 *		 * \par Tags:		 *	::EC_TAG_STRING (1+) string message		 */	EC_OP_STRINGS,		/*!		 * \brief Miscannelous data.		 *		 * \par Tags:		 *	(any tag)		 */	EC_OP_MISC_DATA,		/*!		 * \brief Request to shut down aMule.		 *		 * \par Tags:		 *	(none)		 */	EC_OP_SHUTDOWN,		/*!		 * \brief Handle ED2k link.		 *		 * \par Tags:		 *	::EC_TAG_STRING (1+) holding ED2k link.		 */	EC_OP_ED2K_LINK,	//	// Statistics	//		/*!		 * \brief Request statistics.		 *		 * Request from client, server must reply with statistics (::EC_OP_STATS).		 *		 * \par Tags:		 *	(none)		 */	EC_OP_STAT_REQ,			/*!		 * \brief Request connection state.		 *		 * Request from client, server replies with an ::EC_OP_MISC_DATA		 * packet containing an ::EC_TAG_CONNSTATE tag.		 *		 * \par Tags:		 *	(none)		 */	EC_OP_GET_CONNSTATE,		/*!		 * \brief Reply to stats request		 * 		 * Status information about files/users/limits/speeds etc		 * 		 * \par Tags:		 *	::EC_TAG_STATS_*		 */	EC_OP_STATS,		/*!		 * \brief Request for download queue.		 *		 * \par Tags:		 *	::EC_TAG_PARTFILE (*) info can be requested for selected list only		 */	EC_OP_GET_DLOAD_QUEUE,				/*!		 * \brief Request for upload queue - currect uploads		 *		 * \par Tags:		 *	::EC_TAG_PARTFILE (*) status can be requested for selected list only		 */	EC_OP_GET_ULOAD_QUEUE,	EC_OP_GET_WAIT_QUEUE,		/*!		 * \brief Request for list of shared files		 * 		 */	EC_OP_GET_SHARED_FILES,			/*!		 * \brief Set priority for shared file(s)		 * 		 * \par Tags:		 *  ::EC_TAG_KNOWNFILE (1+) file to process		 */	EC_OP_SHARED_SET_PRIO,		/*		 * \brief Perform action on file in queue.		 *		 * \par Tags:		 *	::EC_TAG_PARTFILE (1+) item (object) to perform command on		 */	EC_OP_PARTFILE_REMOVE_NO_NEEDED,	EC_OP_PARTFILE_REMOVE_FULL_QUEUE,	EC_OP_PARTFILE_REMOVE_HIGH_QUEUE,	EC_OP_PARTFILE_CLEANUP_SOURCES,	EC_OP_PARTFILE_SWAP_A4AF_THIS,	EC_OP_PARTFILE_SWAP_A4AF_THIS_AUTO,	EC_OP_PARTFILE_SWAP_A4AF_OTHERS,	EC_OP_PARTFILE_PAUSE,	EC_OP_PARTFILE_RESUME,	EC_OP_PARTFILE_STOP,	EC_OP_PARTFILE_PRIO_SET,	EC_OP_PARTFILE_DELETE,	EC_OP_PARTFILE_SET_CAT,		/*!		 * \brief Get download queue.		 *		 * \par Tags:		 *	::EC_TAG_PARTFILE (1+) info about file in download queue		 */	EC_OP_DLOAD_QUEUE,				/*!		 * \brief Get upload/waiting queue.		 *		 * \par Tags:		 *	::EC_TAG_UPDOWN_CLIENT (1+) info about client in queue		 */	EC_OP_ULOAD_QUEUE,	EC_OP_WAIT_QUEUE,		/*!		 * \brief Get shared files		 * 		 * \par Tags:		 *	::EC_TAG_KNOWNFILE (*) info about each file		 */	EC_OP_SHARED_FILES,		/*!		 * \brief Reloads the shared files list.		 */	EC_OP_SHAREDFILES_RELOAD,		/*!		 * \brief Add specified directory to the shared files list.		 */	EC_OP_SHAREDFILES_ADD_DIRECTORY,		/*!		 * \brief Rename a known file.		 *		 * \par Tags:		 *	::EC_TAG_KNOWNFILE,\n		 *	::EC_TAG_PARTFILE_NAME		 */	EC_OP_RENAME_FILE,	//	// Search	//		/*!		 * \brief Command to start new search		 */	EC_OP_SEARCH_START,			/*!		 * \brief Command to stop current search		 */	EC_OP_SEARCH_STOP,		/*!		 * \brief Search results returned to client		 */	EC_OP_SEARCH_RESULTS,		/*!		 * \brief Query (or reply) search progress (in %%)		 */	EC_OP_SEARCH_PROGRESS,			/*!		 * \brief Add 1 or more of found files to download queue		 * 		 * \par Tags:		 *  ::EC_TAG_SEARCHFILE (1+) file to download		 */	EC_OP_DOWNLOAD_SEARCH_RESULT,		//	// IPFilter	//		/*!		 * \brief Reloads IPFilter.		 */	EC_OP_IPFILTER_RELOAD,	//	// Server commands	//		/*!		 * \brief Request list of servers		 */	EC_OP_GET_SERVER_LIST,			/*!		 * \brief List of servers, reply to ::EC_OP_GET_SERVER_LIST		 *		 * \par Tags:		 *	::EC_TAG_SERVER (1+)		 */	EC_OP_SERVER_LIST,			/*!		 *  \brief Disconnect from current server		 * 		 * No tags		 */	EC_OP_SERVER_DISCONNECT,			/*!		 * \brief Connect to server		 *		 * Connect to server - when tag is present it identifies server to use,		 * otherwise it will be "any server"		 *		 * \par Tags:		 *	::EC_TAG_SERVER (0-1) identifies server to use		 */	EC_OP_SERVER_CONNECT,		/*		 * \brief Remove server from list.		 *		 * \par Tags:		 *	::EC_TAG_SERVER (1) identifies the server to be removed		 */	EC_OP_SERVER_REMOVE,		/*		 * \brief Add server from list.		 *		 * \par Tags:		 *	::EC_TAG_SERVER (1) identifies the server to be added		 */	EC_OP_SERVER_ADD,		/*		 * \brief Update server.met from given URL		 *		 * \par Tags:		 *	::EC_TAG_STRING containing the URL		 */	EC_OP_SERVER_UPDATE_FROM_URL,	//	// Logging	//		/*!		 * \brief Adds a new LogLine.		 *		 * \par Tags:		 *	::EC_TAG_LOG_TO_STATUS		 *	::EC_TAG_STRING		 */	EC_OP_ADDLOGLINE,		/*!		 * \brief Adds a new debog log line.		 *		 * \par Tags:		 *	::EC_TAG_LOG_TO_STATUS		 *	::EC_TAG_STRING		 */	EC_OP_ADDDEBUGLOGLINE,		/*!		 * \brief Retrieves the log.		 *		 * Server replies with an ::EC_OP_LOG packet.		 */	EC_OP_GET_LOG,		/*!		 * \brief Retrieves the debug log.		 *		 * Server replies with an ::EC_OP_DEBUGLOG packet.		 */	EC_OP_GET_DEBUGLOG,		/*!		 * \brief Retrieves the server info log.		 *		 * Server replies with an ::EC_OP_SERVERINFO packet.		 */	EC_OP_GET_SERVERINFO,		/*!		 * \brief The log.		 *		 * Server replies with this to an ::EC_OP_GET_LOG packet.		 *		 * \par Tags:		 *	::EC_TAG_STRING (1+)	The log lines.		 */	EC_OP_LOG,		/*!		 * \brief The debug log.		 *		 * Server replies with this to an ::EC_OP_GET_DEBUGLOG packet.		 *		 * \par Tags:		 *	::EC_TAG_STRING (1+)	The log lines.		 */	EC_OP_DEBUGLOG,		/*!		 * \brief The server info log.		 *		 * Server replies with this to an ::EC_OP_GET_SERVERINFO packet.		 *		 * \par Tags:		 *	::EC_TAG_STRING (1+)	The log lines.		 */	EC_OP_SERVERINFO,

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?