factories.h

Go to the documentation of this file.
00001 /**
00002  *  Copyright (C) 2004-2005 Alo Sarv <madcat_@users.sourceforge.net>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 #ifndef __FACTORIES_H__
00020 #define __FACTORIES_H__
00021 
00022 /**
00023  * @file factories.h
00024  * Uses macros to declare a set of factories for each and every packet we can
00025  * receive from eDonkey2000 network streams. This is an implementation header -
00026  * client code should never include this file directly - instead include
00027  * parser.h.
00028  */
00029 
00030 /* Packets received from servers via TCP */
00031 DECLARE_PACKET_FACTORY(PR_ED2K,  ServerStatus,      OP_SERVERSTATUS     );
00032 DECLARE_PACKET_FACTORY(PR_ED2K,  IdChange,          OP_IDCHANGE         );
00033 DECLARE_PACKET_FACTORY(PR_ED2K,  GetServerList,     OP_GETSERVERLIST    );
00034 DECLARE_PACKET_FACTORY(PR_ED2K,  ServerList,        OP_SERVERLIST       );
00035 DECLARE_PACKET_FACTORY(PR_ED2K,  ServerIdent,       OP_SERVERIDENT      );
00036 DECLARE_PACKET_FACTORY(PR_ED2K,  ServerMessage,     OP_SERVERMESSAGE    );
00037 DECLARE_PACKET_FACTORY(PR_ED2K,  SearchResult,      OP_SEARCHRESULT     );
00038 DECLARE_PACKET_FACTORY(PR_ED2K,  CallbackReq,       OP_CBREQUESTED      );
00039 DECLARE_PACKET_FACTORY(PR_ED2K,  FoundSources,      OP_FOUNDSOURCES     );
00040 
00041 /* Packets received from other clients via TCP */
00042 DECLARE_PACKET_FACTORY(PR_ED2K,  Hello,             OP_HELLO            );
00043 DECLARE_PACKET_FACTORY(PR_ED2K,  HelloAnswer,       OP_HELLOANSWER      );
00044 DECLARE_PACKET_FACTORY(PR_EMULE, MuleInfo,          OP_MULEINFO         );
00045 DECLARE_PACKET_FACTORY(PR_EMULE, MuleInfoAnswer,    OP_MULEINFOANSWER   );
00046 DECLARE_PACKET_FACTORY(PR_ED2K,  ReqFile,           OP_REQFILE          );
00047 DECLARE_PACKET_FACTORY(PR_ED2K,  FileName,          OP_FILENAME         );
00048 DECLARE_PACKET_FACTORY(PR_EMULE, FileDesc,          OP_FILEDESC         );
00049 DECLARE_PACKET_FACTORY(PR_ED2K,  SetReqFileId,      OP_SETREQFILEID     );
00050 DECLARE_PACKET_FACTORY(PR_ED2K,  NoFile,            OP_REQFILE_NOFILE   );
00051 DECLARE_PACKET_FACTORY(PR_ED2K,  FileStatus,        OP_REQFILE_STATUS   );
00052 DECLARE_PACKET_FACTORY(PR_ED2K,  ReqHashSet,        OP_REQHASHSET       );
00053 DECLARE_PACKET_FACTORY(PR_ED2K,  HashSet,           OP_HASHSET          );
00054 DECLARE_PACKET_FACTORY(PR_ED2K,  StartUploadReq,    OP_STARTUPLOADREQ   );
00055 DECLARE_PACKET_FACTORY(PR_ED2K,  AcceptUploadReq,   OP_ACCEPTUPLOADREQ  );
00056 DECLARE_PACKET_FACTORY(PR_ED2K,  QueueRanking,      OP_QUEUERANKING     );
00057 DECLARE_PACKET_FACTORY(PR_EMULE, MuleQueueRank,     OP_MULEQUEUERANK    );
00058 DECLARE_PACKET_FACTORY(PR_ED2K,  ReqChunks,         OP_REQCHUNKS        );
00059 DECLARE_PACKET_FACTORY(PR_ED2K,  DataChunk,         OP_SENDINGCHUNK     );
00060 DECLARE_PACKET_FACTORY(PR_EMULE, PackedChunk,       OP_PACKEDCHUNK      );
00061 DECLARE_PACKET_FACTORY(PR_ED2K,  CancelTransfer,    OP_CANCELTRANSFER   );
00062 DECLARE_PACKET_FACTORY(PR_EMULE, SourceExchReq,     OP_REQSOURCES       );
00063 DECLARE_PACKET_FACTORY(PR_EMULE, AnswerSources,     OP_ANSWERSOURCES    );
00064 DECLARE_PACKET_FACTORY(PR_ED2K,  AnswerSources2,    OP_ANSWERSOURCES    );
00065 DECLARE_PACKET_FACTORY(PR_ED2K,  Message,           OP_MESSAGE          );
00066 DECLARE_PACKET_FACTORY(PR_ED2K,  ChangeId,          OP_CHANGEID         );
00067 DECLARE_PACKET_FACTORY(PR_EMULE, SecIdentState,     OP_SECIDENTSTATE    );
00068 DECLARE_PACKET_FACTORY(PR_EMULE, PublicKey,         OP_PUBLICKEY        );
00069 DECLARE_PACKET_FACTORY(PR_EMULE, Signature,         OP_SIGNATURE        );
00070 
00071 /* Packets received via UDP socket are handled in-place and not here. */
00072 
00073 #endif