Merge authors: poy (poy) ------------------------------------------------------------ revno: 28 [merge] committer: poy <p...@123gen.com> branch nick: DevPlugin timestamp: Thu 2013-05-16 20:22:16 +0200 message: merge modified: doc/Plugin format (dcext).txt pluginsdk/Hooks.cpp pluginsdk/Hooks.h pluginsdk/PluginDefs.h
-- lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin Your team Dcplusplus-team is subscribed to branch lp:~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin. To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcpp-plugin-sdk-cpp/DevPlugin/+edit-subscription
=== modified file 'doc/Plugin format (dcext).txt' --- doc/Plugin format (dcext).txt 2013-04-23 18:12:02 +0000 +++ doc/Plugin format (dcext).txt 2013-05-13 17:40:06 +0000 @@ -15,8 +15,13 @@ Shared extensions are fine for testing but impractical to distribute and to have users install. Therefore, a DC plugin is preferably packaged as a .dcext file. -A .dcext file is an archive. Currently, it is required to be a tar file, either uncompressed or -compressed with bzip2 or gzip. This may be expanded in the future if needed. +A .dcext file is a ZIP archive, as defined by PKWARE's APPNOTE, either uncompressed (method 0) or +compressed with DEFLATE (method 8), with the following restrictions: +- No encryption. +- No streaming / splitting / spanning. +- No manifest file. +- No character outside of the ASCII range in file names. +- Extensions / extra fields and comments are allowed but shall be ignored. That archive must contain an XML file named "info.xml" at its root, whose contents shall validate against the schemas/dcext.xsd schema. === modified file 'pluginsdk/Hooks.cpp' --- pluginsdk/Hooks.cpp 2013-01-18 21:37:14 +0000 +++ pluginsdk/Hooks.cpp 2013-05-16 18:19:42 +0000 @@ -95,6 +95,14 @@ addEvent(HOOK_NETWORK_CONN_OUT, [f](dcptr_t pObject, dcptr_t pData, bool& bBreak) { return f(reinterpret_cast<ConnectionDataPtr>(pObject), reinterpret_cast<char*>(pData), bBreak); }); } +void Hooks::Network::onUDPDataIn(function<bool (UDPDataPtr, char*, bool&)> f) { + addEvent(HOOK_NETWORK_UDP_IN, [f](dcptr_t pObject, dcptr_t pData, bool& bBreak) { + return f(reinterpret_cast<UDPDataPtr>(pObject), reinterpret_cast<char*>(pData), bBreak); }); +} +void Hooks::Network::onUDPDataOut(function<bool (UDPDataPtr, char*, bool&)> f) { + addEvent(HOOK_NETWORK_UDP_OUT, [f](dcptr_t pObject, dcptr_t pData, bool& bBreak) { + return f(reinterpret_cast<UDPDataPtr>(pObject), reinterpret_cast<char*>(pData), bBreak); }); +} void Hooks::Queue::onAdded(function<bool (QueueDataPtr, bool&)> f) { addEvent(HOOK_QUEUE_ADDED, [f](dcptr_t pObject, dcptr_t, bool& bBreak) { === modified file 'pluginsdk/Hooks.h' --- pluginsdk/Hooks.h 2013-01-18 21:37:14 +0000 +++ pluginsdk/Hooks.h 2013-05-16 18:19:42 +0000 @@ -78,6 +78,8 @@ static void onHubDataOut(function<bool (HubDataPtr, char*, bool&)> f); static void onClientDataIn(function<bool (ConnectionDataPtr, char*, bool&)> f); static void onClientDataOut(function<bool (ConnectionDataPtr, char*, bool&)> f); + static void onUDPDataIn(function<bool (UDPDataPtr, char*, bool&)> f); + static void onUDPDataOut(function<bool (UDPDataPtr, char*, bool&)> f); }; struct Queue { === modified file 'pluginsdk/PluginDefs.h' --- pluginsdk/PluginDefs.h 2013-05-13 17:18:05 +0000 +++ pluginsdk/PluginDefs.h 2013-05-16 18:19:42 +0000 @@ -100,6 +100,8 @@ #define HOOK_NETWORK_HUB_OUT "dcpp.network.onHubDataOut" /* Outgoing protocol message to hub (obj: HubData) */ #define HOOK_NETWORK_CONN_IN "dcpp.network.onClientDataIn" /* Incoming client<->client protocol message (obj: ConnectionData) */ #define HOOK_NETWORK_CONN_OUT "dcpp.network.onClientDataOut" /* Outgoing client<->client protocol message (obj: ConnectionData) */ +#define HOOK_NETWORK_UDP_IN "dcpp.network.onUDPDataIn" /* Incoming UDP data (obj: UDPData) */ +#define HOOK_NETWORK_UDP_OUT "dcpp.network.onUDPDataOut" /* Outgoing UDP data (obj: UDPData) */ #define HOOK_QUEUE_ADDED "dcpp.queue.onAdded" /* (New) item has been added to download queue (obj: QueueData) */ #define HOOK_QUEUE_MOVED "dcpp.queue.onMoved" /* Download queue item has been moved to new location (obj: QueueData) */ @@ -246,6 +248,12 @@ Bool isManaged; /* Always True (Plugins can not lookup, or track the scope of, a specific instance) */ } ConnectionData, *ConnectionDataPtr; +/* UDP */ +typedef struct tagUDPData { + const char* ip; /* The ip address (remote) for this connection */ + uint16_t port; /* The port for this connection */ +} UDPData, *UDPDataPtr; + /* Queue items and files */ typedef struct tagQueueData { const char* target; /* The *final* location for the file */
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : linuxdcpp-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp