# HG changeset patch # User Nicolas Cornu # Date 1281746841 -7200 # Node ID cae0cb7eff455b4b4d3e32b12e1ccd25d1de5dac # Parent 8138678841598862976e85633e419e916ff9f733 JS5: Add a CMakeList diff -r 813867884159 -r cae0cb7eff45 CMakeLists.txt --- a/CMakeLists.txt Sat Aug 14 02:17:09 2010 +0200 +++ b/CMakeLists.txt Sat Aug 14 02:47:21 2010 +0200 @@ -40,6 +40,7 @@ add_subdirectory(jingle) add_subdirectory(jingle-filetransfer) add_subdirectory(jingle-ibb) +add_subdirectory(jingle-socks5) ## Packaging information set(CPACK_PACKAGE_NAME mcabber-jingle) diff -r 813867884159 -r cae0cb7eff45 jingle-filetransfer/filetransfer.c --- a/jingle-filetransfer/filetransfer.c Sat Aug 14 02:17:09 2010 +0200 +++ b/jingle-filetransfer/filetransfer.c Sat Aug 14 02:47:21 2010 +0200 @@ -168,8 +168,11 @@ if (!g_strcmp0(lm_message_node_get_attribute(node, "xmlns"), NS_JINGLE_APP_FT_INFO) && !g_strcmp0(node->name, "hash")) { ((JingleFT *)data)->hash = lm_message_node_get_value(node); + return TRUE; } + return FALSE; } + return FALSE; } static gboolean is_md5_hash(const gchar *hash) diff -r 813867884159 -r cae0cb7eff45 jingle-socks5/CMakeLists.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jingle-socks5/CMakeLists.txt Sat Aug 14 02:47:21 2010 +0200 @@ -0,0 +1,4 @@ +add_library(jingle-socks5 MODULE socks5.c socks5.h) +set_target_properties(jingle-socks5 PROPERTIES COMPILE_FLAGS "-Wall -O0 -g") +include_directories(${CMAKE_SOURCE_DIR}) +install(TARGETS jingle-socks5 DESTINATION lib/mcabber) diff -r 813867884159 -r cae0cb7eff45 jingle-socks5/socks5.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jingle-socks5/socks5.c Sat Aug 14 02:47:21 2010 +0200 @@ -0,0 +1,89 @@ +/* + * socks5.c + * + * Copyrigth (C) 2010 Nicolas Cornu + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ + +#include "config.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "socks5.h" + +gconstpointer jingle_socks5_check(JingleContent *cn, GError **err); +gboolean jingle_socks5_cmp(gconstpointer data1, gconstpointer data2); +void jingle_socks5_tomessage(gconstpointer data, LmMessageNode *node); +const gchar* jingle_socks5_xmlns(void); +gconstpointer jingle_socks5_new(void); +void jingle_socks5_send(session_content *sc, const gchar *to, gconstpointer data, gchar *buf, gsize size); + +static void jingle_socks5_init(void); +static void jingle_socks5_uninit(void); + +const gchar *deps[] = { "jingle", NULL }; + +static JingleTransportFuncs funcs = { + jingle_socks5_xmlns, + jingle_socks5_check, + jingle_socks5_tomessage, + jingle_socks5_cmp, + jingle_socks5_new, + jingle_socks5_send +}; + +module_info_t info_jingle_inbandbytestream = { + .branch = MCABBER_BRANCH, + .api = MCABBER_API_VERSION, + .version = PROJECT_VERSION, + .description = "Jingle In Band Bytestream (XEP-0261)\n", + .requires = deps, + .init = jingle_socks5_init, + .uninit = jingle_socks5_uninit, + .next = NULL, +}; + + +const gchar* jingle_socks5_xmlns(void) +{ + return NS_JINGLE_TRANSPORT_SOCKS5; +} + +static void jingle_socks5_init(void) +{ + jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs, + JINGLE_TRANSPORT_STREAMING, + JINGLE_TRANSPORT_HIGH); + xmpp_add_feature(NS_JINGLE_TRANSPORT_SOCKS5); +} + +static void jingle_socks5_uninit(void) +{ + xmpp_del_feature(NS_JINGLE_TRANSPORT_SOCKS5); + jingle_unregister_transport(NS_JINGLE_TRANSPORT_SOCKS5); +} diff -r 813867884159 -r cae0cb7eff45 jingle-socks5/socks5.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jingle-socks5/socks5.h Sat Aug 14 02:47:21 2010 +0200 @@ -0,0 +1,10 @@ +#ifndef __JINGLESOCKS5_H__ +#define __JINGLESOCKS5_H__ 1 + +#define NS_JINGLE_TRANSPORT_SOCKS5 "urn:xmpp:jingle:transports:s5b:1" + +typedef struct { + +} JingleSocks5; + +#endif diff -r 813867884159 -r cae0cb7eff45 socks5.c --- a/socks5.c Sat Aug 14 02:17:09 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,89 +0,0 @@ -/* - * socks5.c - * - * Copyrigth (C) 2010 Nicolas Cornu - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - -#include "config.h" - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "socks5.h" - -gconstpointer jingle_socks5_check(JingleContent *cn, GError **err); -gboolean jingle_socks5_cmp(gconstpointer data1, gconstpointer data2); -void jingle_socks5_tomessage(gconstpointer data, LmMessageNode *node); -const gchar* jingle_socks5_xmlns(void); -gconstpointer jingle_socks5_new(void); -void jingle_socks5_send(session_content *sc, const gchar *to, gconstpointer data, gchar *buf, gsize size); - -static void jingle_socks5_init(void); -static void jingle_socks5_uninit(void); - -const gchar *deps[] = { "jingle", NULL }; - -static JingleTransportFuncs funcs = { - jingle_socks5_xmlns, - jingle_socks5_check, - jingle_socks5_tomessage, - jingle_socks5_cmp, - jingle_socks5_new, - jingle_socks5_send -}; - -module_info_t info_jingle_inbandbytestream = { - .branch = MCABBER_BRANCH, - .api = MCABBER_API_VERSION, - .version = PROJECT_VERSION, - .description = "Jingle In Band Bytestream (XEP-0261)\n", - .requires = deps, - .init = jingle_socks5_init, - .uninit = jingle_socks5_uninit, - .next = NULL, -}; - - -const gchar* jingle_socks5_xmlns(void) -{ - return NS_JINGLE_TRANSPORT_SOCKS5; -} - -static void jingle_socks5_init(void) -{ - jingle_register_transport(NS_JINGLE_TRANSPORT_SOCKS5, &funcs, - JINGLE_TRANSPORT_STREAMING, - JINGLE_TRANSPORT_MEDIUM); - xmpp_add_feature(NS_JINGLE_TRANSPORT_SOCKS5); -} - -static void jingle_socks5_uninit(void) -{ - xmpp_del_feature(NS_JINGLE_TRANSPORT_SOCKS5); - jingle_unregister_transport(NS_JINGLE_TRANSPORT_SOCKS5); -} diff -r 813867884159 -r cae0cb7eff45 socks5.h --- a/socks5.h Sat Aug 14 02:17:09 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -#ifndef __JINGLESOCKS5_H__ -#define __JINGLESOCKS5_H__ 1 - -#define NS_JINGLE_TRANSPORT_SOCKS5 "urn:xmpp:jingle:transports:s5b:1" - -typedef struct { - -} JingleSocks5; - -#endif