diff options
author | Florian Dold <florian.dold@gmail.com> | 2013-11-05 01:10:35 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2013-11-05 01:10:35 +0000 |
commit | ad8ed315dca32a5de2af97bfda96c6199c565722 (patch) | |
tree | 91d9beffd3c3a66f4fc09701bbcda890346a68d4 /src/secretsharing | |
parent | ca2c7bdfa64a30c0013598f0718dcfe7e6d98b2a (diff) | |
download | gnunet-ad8ed315dca32a5de2af97bfda96c6199c565722.tar.gz gnunet-ad8ed315dca32a5de2af97bfda96c6199c565722.zip |
skeleton for secretsharing
Diffstat (limited to 'src/secretsharing')
-rw-r--r-- | src/secretsharing/Makefile.am | 59 | ||||
-rw-r--r-- | src/secretsharing/gnunet-service-secretsharing.c | 80 | ||||
-rw-r--r-- | src/secretsharing/secretsharing.conf.in | 19 | ||||
-rw-r--r-- | src/secretsharing/secretsharing_api.c | 32 | ||||
-rw-r--r-- | src/secretsharing/test_secretsharing.conf | 0 | ||||
-rw-r--r-- | src/secretsharing/test_secretsharing_api.c | 33 |
6 files changed, 223 insertions, 0 deletions
diff --git a/src/secretsharing/Makefile.am b/src/secretsharing/Makefile.am new file mode 100644 index 000000000..7a925dd0e --- /dev/null +++ b/src/secretsharing/Makefile.am | |||
@@ -0,0 +1,59 @@ | |||
1 | AM_CPPFLAGS = -I$(top_srcdir)/src/include | ||
2 | |||
3 | pkgcfgdir= $(pkgdatadir)/config.d/ | ||
4 | |||
5 | libexecdir= $(pkglibdir)/libexec/ | ||
6 | |||
7 | pkgcfg_DATA = \ | ||
8 | secretsharing.conf | ||
9 | |||
10 | if MINGW | ||
11 | WINFLAGS = -Wl,--no-undefined -Wl,--export-all-symbols | ||
12 | endif | ||
13 | |||
14 | if USE_COVERAGE | ||
15 | AM_CFLAGS = -fprofile-arcs -ftest-coverage | ||
16 | endif | ||
17 | |||
18 | libexec_PROGRAMS = \ | ||
19 | gnunet-service-secretsharing | ||
20 | |||
21 | lib_LTLIBRARIES = \ | ||
22 | libgnunetsecretsharing.la | ||
23 | |||
24 | gnunet_service_secretsharing_SOURCES = \ | ||
25 | gnunet-service-secretsharing.c | ||
26 | gnunet_service_secretsharing_LDADD = \ | ||
27 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
28 | $(top_builddir)/src/core/libgnunetcore.la \ | ||
29 | $(top_builddir)/src/mesh/libgnunetmesh.la \ | ||
30 | $(top_builddir)/src/set/libgnunetset.la \ | ||
31 | $(GN_LIBINTL) | ||
32 | gnunet_service_secretsharing_DEPENDENCIES = \ | ||
33 | $(top_builddir)/src/set/libgnunetset.la | ||
34 | |||
35 | libgnunetsecretsharing_la_SOURCES = \ | ||
36 | secretsharing_api.c | ||
37 | libgnunetsecretsharing_la_LIBADD = \ | ||
38 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
39 | $(LTLIBINTL) | ||
40 | libgnunetsecretsharing_la_LDFLAGS = \ | ||
41 | $(GN_LIB_LDFLAGS) | ||
42 | |||
43 | check_PROGRAMS = \ | ||
44 | test_secretsharing_api | ||
45 | |||
46 | if ENABLE_TEST_RUN | ||
47 | TESTS = $(check_PROGRAMS) | ||
48 | endif | ||
49 | |||
50 | test_secretsharing_api_SOURCES = \ | ||
51 | test_secretsharing_api.c | ||
52 | test_secretsharing_api_LDADD = \ | ||
53 | $(top_builddir)/src/util/libgnunetutil.la \ | ||
54 | $(top_builddir)/src/testing/libgnunettesting.la \ | ||
55 | $(top_builddir)/src/secretsharing/libgnunetsecretsharing.la | ||
56 | |||
57 | EXTRA_DIST = \ | ||
58 | test_secretsharing.conf | ||
59 | |||
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c new file mode 100644 index 000000000..a16f88079 --- /dev/null +++ b/src/secretsharing/gnunet-service-secretsharing.c | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2013 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file secretsharing/gnunet-service-secretsharing.c | ||
23 | * @brief secret sharing service | ||
24 | * @author Florian Dold | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_util_lib.h" | ||
28 | |||
29 | |||
30 | /** | ||
31 | * Task run during shutdown. | ||
32 | * | ||
33 | * @param cls unused | ||
34 | * @param tc unused | ||
35 | */ | ||
36 | static void | ||
37 | cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
38 | { | ||
39 | /* FIXME: do clean up here */ | ||
40 | } | ||
41 | |||
42 | |||
43 | /** | ||
44 | * Process template requests. | ||
45 | * | ||
46 | * @param cls closure | ||
47 | * @param server the initialized server | ||
48 | * @param cfg configuration to use | ||
49 | */ | ||
50 | static void | ||
51 | run (void *cls, struct GNUNET_SERVER_Handle *server, | ||
52 | const struct GNUNET_CONFIGURATION_Handle *cfg) | ||
53 | { | ||
54 | static const struct GNUNET_SERVER_MessageHandler handlers[] = { | ||
55 | /* FIXME: add handlers here! */ | ||
56 | {NULL, NULL, 0, 0} | ||
57 | }; | ||
58 | /* FIXME: do setup here */ | ||
59 | GNUNET_SERVER_add_handlers (server, handlers); | ||
60 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &cleanup_task, | ||
61 | NULL); | ||
62 | } | ||
63 | |||
64 | |||
65 | /** | ||
66 | * The main function for the template service. | ||
67 | * | ||
68 | * @param argc number of arguments from the command line | ||
69 | * @param argv command line arguments | ||
70 | * @return 0 ok, 1 on error | ||
71 | */ | ||
72 | int | ||
73 | main (int argc, char *const *argv) | ||
74 | { | ||
75 | return (GNUNET_OK == | ||
76 | GNUNET_SERVICE_run (argc, argv, "template", | ||
77 | GNUNET_SERVICE_OPTION_NONE, &run, NULL)) ? 0 : 1; | ||
78 | } | ||
79 | |||
80 | /* end of gnunet-service-template.c */ | ||
diff --git a/src/secretsharing/secretsharing.conf.in b/src/secretsharing/secretsharing.conf.in new file mode 100644 index 000000000..0834235d4 --- /dev/null +++ b/src/secretsharing/secretsharing.conf.in | |||
@@ -0,0 +1,19 @@ | |||
1 | [secretsharing] | ||
2 | AUTOSTART = NO | ||
3 | @JAVAPORT@PORT = 2114 | ||
4 | HOSTNAME = localhost | ||
5 | BINARY = gnunet-service-secretsharing | ||
6 | ACCEPT_FROM = 127.0.0.1; | ||
7 | ACCEPT_FROM6 = ::1; | ||
8 | UNIXPATH = $GNUNET_RUNTIME_DIR/gnunet-service-secretsharing.sock | ||
9 | UNIX_MATCH_UID = YES | ||
10 | UNIX_MATCH_GID = YES | ||
11 | # DISABLE_SOCKET_FORWARDING = NO | ||
12 | # USERNAME = | ||
13 | # MAXBUF = | ||
14 | # TIMEOUT = | ||
15 | # DISABLEV6 = | ||
16 | # BINDTO = | ||
17 | # REJECT_FROM = | ||
18 | # REJECT_FROM6 = | ||
19 | # PREFIX = | ||
diff --git a/src/secretsharing/secretsharing_api.c b/src/secretsharing/secretsharing_api.c new file mode 100644 index 000000000..325e07f51 --- /dev/null +++ b/src/secretsharing/secretsharing_api.c | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2012 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file secretsharing/secretsharing_api.c | ||
23 | * @brief | ||
24 | * @author Florian Dold | ||
25 | */ | ||
26 | #include "platform.h" | ||
27 | #include "gnunet_util_lib.h" | ||
28 | |||
29 | |||
30 | #define LOG(kind,...) GNUNET_log_from (kind, "secretsharing-api",__VA_ARGS__) | ||
31 | |||
32 | |||
diff --git a/src/secretsharing/test_secretsharing.conf b/src/secretsharing/test_secretsharing.conf new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/src/secretsharing/test_secretsharing.conf | |||
diff --git a/src/secretsharing/test_secretsharing_api.c b/src/secretsharing/test_secretsharing_api.c new file mode 100644 index 000000000..a6f3cb127 --- /dev/null +++ b/src/secretsharing/test_secretsharing_api.c | |||
@@ -0,0 +1,33 @@ | |||
1 | /* | ||
2 | This file is part of GNUnet. | ||
3 | (C) 2013 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | GNUnet is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | option) any later version. | ||
9 | |||
10 | GNUnet is distributed in the hope that it will be useful, but | ||
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
18 | Boston, MA 02111-1307, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file secretsharing/test_secretsharing_api.c | ||
23 | * @brief testcase for the secretsharing api | ||
24 | */ | ||
25 | #include "platform.h" | ||
26 | #include "gnunet_util_lib.h" | ||
27 | |||
28 | int | ||
29 | main (int argc, char **argv) | ||
30 | { | ||
31 | return 0; | ||
32 | } | ||
33 | |||