Diff between 44d3b4bbb07e671f2d265c9ac22fafe50166e4e9 and 22d55d7c347551afb4de6d24027f44413920b2c4

Changed Files

File Additions Deletions Status
obexd/plugins/mas.c +42 -0 added
obexd/plugins/messages-dummy.c +28 -0 added
obexd/plugins/messages.h +22 -0 added
obexd/src/main.c +9 -2 modified
obexd/src/obex.h +1 -0 modified

Full Patch

diff --git a/obexd/plugins/mas.c b/obexd/plugins/mas.c
new file mode 100644
index 0000000..0eab43b
--- /dev/null
+++ b/obexd/plugins/mas.c
@@ -0,0 +1,42 @@
+/*
+ *
+ *  OBEX Server
+ *
+ *  Copyright (C) 2010-2011  Nokia Corporation
+ *
+ *
+ *  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
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "plugin.h"
+#include "log.h"
+
+#include "messages.h"
+
+static int mas_init(void)
+{
+	return 0;
+}
+
+static void mas_exit(void)
+{
+}
+
+OBEX_PLUGIN_DEFINE(mas, mas_init, mas_exit)
diff --git a/obexd/plugins/messages-dummy.c b/obexd/plugins/messages-dummy.c
new file mode 100644
index 0000000..fd9679d
--- /dev/null
+++ b/obexd/plugins/messages-dummy.c
@@ -0,0 +1,28 @@
+/*
+ *
+ *  OBEX Server
+ *
+ *  Copyright (C) 2010-2011  Nokia Corporation
+ *
+ *
+ *  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
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "messages.h"
diff --git a/obexd/plugins/messages.h b/obexd/plugins/messages.h
new file mode 100644
index 0000000..c510244
--- /dev/null
+++ b/obexd/plugins/messages.h
@@ -0,0 +1,22 @@
+/*
+ *
+ *  OBEX Server
+ *
+ *  Copyright (C) 2010-2011  Nokia Corporation
+ *
+ *
+ *  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
+ *
+ */
diff --git a/obexd/src/main.c b/obexd/src/main.c
index 1e78615..8154e3b 100644
--- a/obexd/src/main.c
+++ b/obexd/src/main.c
@@ -84,6 +84,7 @@ static gboolean option_irmc = FALSE;
 static gboolean option_pcsuite = FALSE;
 static gboolean option_symlinks = FALSE;
 static gboolean option_syncevolution = FALSE;
+static gboolean option_mas = FALSE;
 
 static gboolean parse_debug(const char *key, const char *value,
 				gpointer user_data, GError **error)
@@ -125,6 +126,8 @@ static GOptionEntry options[] = {
 				"Enable PC Suite Services server" },
 	{ "syncevolution", 'e', 0, G_OPTION_ARG_NONE, &option_syncevolution,
 				"Enable OBEX server for SyncEvolution" },
+        { "mas", 'm', 0, G_OPTION_ARG_NONE, &option_mas,
+				"Enable Message Access server" },
 	{ NULL },
 };
 
@@ -212,9 +215,10 @@ int main(int argc, char *argv[])
 	if (option_opp == FALSE && option_ftp == FALSE &&
 				option_pbap == FALSE &&
 				option_irmc == FALSE &&
-				option_syncevolution == FALSE) {
+				option_syncevolution == FALSE &&
+				option_mas == FALSE) {
 		fprintf(stderr, "No server selected (use either "
-				"--opp, --ftp, --pbap, --irmc or --syncevolution)\n");
+				"--opp, --ftp, --pbap, --irmc, --mas, or --syncevolution)\n");
 		exit(EXIT_FAILURE);
 	}
 
@@ -278,6 +282,9 @@ int main(int argc, char *argv[])
 		obex_server_init(OBEX_SYNCEVOLUTION, NULL, TRUE, FALSE,
 							FALSE, NULL);
 
+	if (option_mas == TRUE)
+		obex_server_init(OBEX_MAS, NULL, TRUE, FALSE, FALSE, NULL);
+
 	if (!root_folder_setup(option_root, option_root_setup)) {
 		error("Unable to setup root folder %s", option_root);
 		exit(EXIT_FAILURE);
diff --git a/obexd/src/obex.h b/obexd/src/obex.h
index c3f6e3d..94274c2 100644
--- a/obexd/src/obex.h
+++ b/obexd/src/obex.h
@@ -36,6 +36,7 @@
 #define OBEX_IRMC	(1 << 5)
 #define OBEX_PCSUITE	(1 << 6)
 #define OBEX_SYNCEVOLUTION	(1 << 7)
+#define OBEX_MAS	(1 << 8)
 
 #define TARGET_SIZE 16